diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..deb9817cf --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Test + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + php: + - "7.4" + - "8.0" + - "8.1" + composer: + - "" + - "--prefer-lowest" + + env: + DB: mysql + DB_USER: root + + steps: + - uses: actions/checkout@v4 + + - name: Use PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: sqlite3, zip + coverage: xdebug + tools: composer + + - run: composer validate + + - run: composer update ${COMPOSER_FLAGS} --prefer-source + + - name: Start MySQL + run: | + sudo systemctl start mysql + mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -proot mysql + + - name: Disable MySQL strict mode + run: | + echo "SET GLOBAL sql_mode = ''" | mysql -u root -proot mysql + + - name: setup database + run: | + sh -c "if [ '$DB' = 'mysql' ]; then mysql -u root -proot mysql -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'; fi" + sh -c "if [ '$DB' = 'mysql' ]; then mysql -u root -proot mysql -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'; fi" + ./test/reset_tests.sh + + - name: Run Tests + run: vendor/bin/phpunit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..9a86bb6d2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + exclude: generator/bin/propel-gen.bat$ + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: destroyed-symlinks + + - id: check-json + - id: check-yaml + - id: check-xml + exclude: test/testsuite/runtime/parser/fixtures/test_data.xml$ + + - id: check-vcs-permalinks + - id: check-merge-conflict + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 + hooks: + - id: prettier + files: \.(md|yml|yaml|json)$ diff --git a/.travis.yml b/.travis.yml index 99db8cd1c..a3eefa226 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,4 @@ branches: services: docker -script: - bash docker/run.sh +script: bash docker/run.sh diff --git a/CHANGELOG b/CHANGELOG index 28d3547e1..6a2b098ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,7 @@ SQL injection fix: Coerce offset and limit values to integers fix support for php 5.3 -Applying fix for migrate connection error +Applying fix for migrate connection error Honour value of 'disable_updated_at timestampable behaviour parameter Fixed diff generator when several identical columns were renamed Support column descriptions in reverse task diff --git a/README.md b/README.md index ad74a8082..617380585 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,27 @@ # Propel # -Propel is an open-source Object-Relational Mapping (ORM) for PHP5. +Propel is an open-source Object-Relational Mapping (ORM) for PHP. -[![Build Status](https://secure.travis-ci.org/propelorm/Propel.png?branch=master)](http://travis-ci.org/propelorm/Propel) -[![Total Downloads](https://poser.pugx.org/propel/propel1/downloads.png)](https://packagist.org/packages/propel/propel1) -[![Latest Stable Version](https://poser.pugx.org/propel/propel1/v/stable.png)](https://packagist.org/packages/propel/propel1) +This fork is maintained by [Dayspring Partners](https://www.dayspringpartners.com/) and provides compatiblity with PHP 7.4 and 8.x. -## A quick tour of the features ## +![Build Status](https://github.com/dayspring-tech/Propel/actions/workflows/test.yml/badge.svg) +[![Total Downloads](https://poser.pugx.org/dayspring-tech/propel1/downloads.png)](https://packagist.org/packages/dayspring-tech/propel1) +[![Latest Stable Version](https://poser.pugx.org/dayspring-tech/propel1/v/stable.png)](https://packagist.org/packages/dayspring-tech/propel1) + +## A quick tour of the features Propel has some nice features you should know about: - - It's a fast and easy way to manage your database; - - It provides command line tools for generating code (well documented with an IDE-friendly syntax); - - It's very flexible: you can simply extend Propel; - - It uses PDO (PHP Data Objects) so it allows you to use the RDBMS of your choice (MySQL, SQLite, PostgreSQL, Oracle and MSSQL are supported); - - Propel is an open-source project which is [well documented](http://propelorm.org/Propel/documentation/). +- It's a fast and easy way to manage your database; +- It provides command line tools for generating code (well documented with an IDE-friendly syntax); +- It's very flexible: you can simply extend Propel; +- It uses PDO (PHP Data Objects) so it allows you to use the RDBMS of your choice (MySQL, SQLite, PostgreSQL, Oracle and MSSQL are supported); +- Propel is an open-source project which is [well documented](http://propelorm.org/Propel/documentation/). -## Installation ## +## Installation Read the [Propel documentation](http://propelorm.org/Propel/). - -## License ## +## License Propel is an open-source project released under the MIT license. See the `LICENSE` file for more information. diff --git a/composer.json b/composer.json index a0ee41e26..1d90345da 100644 --- a/composer.json +++ b/composer.json @@ -1,43 +1,58 @@ { - "name": "propel/propel1", + "name": "libretime/propel1", "description": "Propel is an open-source Object-Relational Mapping (ORM) for PHP5.", - "keywords": ["orm", "active record", "mapping", "database", "persistence"], + "keywords": [ + "orm", + "active record", + "mapping", + "database", + "persistence" + ], "homepage": "http://www.propelorm.org/", "license": "MIT", - "authors": [{ - "name": "William Durand", - "email": "william.durand1@gmail.com", - "homepage": "http://www.willdurand.fr" - }], + "authors": [ + { + "name": "William Durand", + "email": "william.durand1@gmail.com", + "homepage": "http://www.willdurand.fr" + } + ], "autoload": { - "classmap": ["runtime/lib", "generator/lib"] + "classmap": [ + "runtime/lib", + "generator/lib" + ] }, - "include-path": ["runtime/lib", "generator/lib"], + "include-path": [ + "runtime/lib", + "generator/lib" + ], "require": { - "php": "^7.1", - "phing/phing": "~2.4" - + "php": "^7.4 | ^8.0", + "phing/phing": "^2.17", + "ext-pdo": "*" }, "require-dev": { - "pear-pear.php.net/pear_packagefilemanager2": "@stable", "phpunit/phpunit": "^9.0.0", "phpcompatibility/php-compatibility": "^9.3", - "squizlabs/php_codesniffer": "^3.5" + "squizlabs/php_codesniffer": "^3.5", + "ext-simplexml": "*", + "ext-dom": "*" }, "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-main": "1.7-dev" } }, - "repositories": [ - { - "type": "pear", - "url": "https://pear.php.net" - } + "replace": { + "propel/propel1": "^1.8" + }, + "bin": [ + "generator/bin/propel-gen", + "generator/bin/propel-gen.bat" ], - "bin": ["generator/bin/propel-gen", "generator/bin/propel-gen.bat"], "scripts": { - "post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility", - "post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility" + "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility", + "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index 3330a01c5..aeecbd5b8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM thecodingmachine/php:7.4-v3-cli +FROM thecodingmachine/php:8.0-v4-cli USER root RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales @@ -8,4 +8,3 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ USER docker ENV LANG en_US.UTF-8 - diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 95efc4eeb..f99e74421 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: php: build: @@ -9,18 +9,17 @@ services: volumes: - ../:/usr/src/app environment: - - PHP_EXTENSIONS=intl pdo_sqlite sqlite3 + - PHP_EXTENSIONS=intl pdo_sqlite sqlite3 xdebug - STARTUP_COMMAND_1=composer install - STARTUP_COMMAND_2=bash test/reset_tests.sh + - PHP_IDE_CONFIG="serverName=propel" + - XDEBUG_MODE=debug + - XDEBUG_SESSION=1 db: image: percona command: > - mysqld - --sql-mode="NO_ENGINE_SUBSTITUTION" - --character-set-server="utf8" - --collation-server="utf8_unicode_ci" - --default-authentication-plugin=mysql_native_password + mysqld --sql-mode="NO_ENGINE_SUBSTITUTION" --character-set-server="utf8" --collation-server="utf8_unicode_ci" --default-authentication-plugin=mysql_native_password restart: always environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" diff --git a/docker/reset.sh b/docker/reset.sh old mode 100644 new mode 100755 diff --git a/generator/lib/behavior/DelegateBehavior.php b/generator/lib/behavior/DelegateBehavior.php index 4f9af83cd..e5f5a5bc3 100644 --- a/generator/lib/behavior/DelegateBehavior.php +++ b/generator/lib/behavior/DelegateBehavior.php @@ -111,7 +111,7 @@ public function objectCall($builder) $relationName = $builder->getFKPhpNameAffix($fk); } $script .= " -if (is_callable(array('$ARFQCN', \$name))) { +if (method_exists('$ARFQCN', \$name)) { if (!\$delegate = \$this->get$relationName()) { \$delegate = new $ARClassName(); \$this->set$relationName(\$delegate); diff --git a/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php b/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php index f2b9eb802..75d2cca75 100644 --- a/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php +++ b/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php @@ -8,8 +8,6 @@ * @license MIT License */ -require_once 'AggregateColumnRelationBehavior.php'; - /** * Keeps an aggregate column updated with related table * diff --git a/generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php b/generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php index cf27b38f1..41e7706f2 100644 --- a/generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php +++ b/generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php @@ -8,8 +8,6 @@ * @license MIT License */ -require_once 'AggregateColumnRelationBehavior.php'; - /** * Keeps an aggregate column updated with related table * diff --git a/generator/lib/behavior/aggregate_column/templates/objectCompute.php b/generator/lib/behavior/aggregate_column/templates/objectCompute.php index 32db0fdc7..37d440694 100644 --- a/generator/lib/behavior/aggregate_column/templates/objectCompute.php +++ b/generator/lib/behavior/aggregate_column/templates/objectCompute.php @@ -1,4 +1,3 @@ - /** * Computes the value of the aggregate column getName() ?> * diff --git a/generator/lib/behavior/aggregate_column/templates/objectUpdate.php b/generator/lib/behavior/aggregate_column/templates/objectUpdate.php index 147d5ca47..9527162b0 100644 --- a/generator/lib/behavior/aggregate_column/templates/objectUpdate.php +++ b/generator/lib/behavior/aggregate_column/templates/objectUpdate.php @@ -1,4 +1,3 @@ - /** * Updates the aggregate column getName() ?> * diff --git a/generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php b/generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php index 3e4399e87..5a282e825 100644 --- a/generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php +++ b/generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php @@ -1,4 +1,3 @@ - /** * Update the aggregate column in the related object * diff --git a/generator/lib/behavior/aggregate_column/templates/queryFindRelated.php b/generator/lib/behavior/aggregate_column/templates/queryFindRelated.php index f2761bfe6..876f4c0bd 100644 --- a/generator/lib/behavior/aggregate_column/templates/queryFindRelated.php +++ b/generator/lib/behavior/aggregate_column/templates/queryFindRelated.php @@ -1,4 +1,3 @@ - /** * Finds the related getPhpName() ?> objects and keep them for later * diff --git a/generator/lib/behavior/aggregate_column/templates/queryUpdateRelated.php b/generator/lib/behavior/aggregate_column/templates/queryUpdateRelated.php index 01404112f..de80fa61a 100644 --- a/generator/lib/behavior/aggregate_column/templates/queryUpdateRelated.php +++ b/generator/lib/behavior/aggregate_column/templates/queryUpdateRelated.php @@ -1,4 +1,3 @@ - protected function updateRelateds($con) { foreach ($this->s as $) { diff --git a/generator/lib/behavior/archivable/ArchivableBehavior.php b/generator/lib/behavior/archivable/ArchivableBehavior.php index 91225d2fb..b39fb354c 100644 --- a/generator/lib/behavior/archivable/ArchivableBehavior.php +++ b/generator/lib/behavior/archivable/ArchivableBehavior.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ArchivableBehaviorObjectBuilderModifier.php'; -require_once dirname(__FILE__) . '/ArchivableBehaviorQueryBuilderModifier.php'; + /** * Keeps tracks of an ActiveRecord object, even after deletion diff --git a/generator/lib/behavior/archivable/templates/objectDeleteWithoutArchive.php b/generator/lib/behavior/archivable/templates/objectDeleteWithoutArchive.php index b3d3658cd..8853e5e20 100644 --- a/generator/lib/behavior/archivable/templates/objectDeleteWithoutArchive.php +++ b/generator/lib/behavior/archivable/templates/objectDeleteWithoutArchive.php @@ -1,4 +1,3 @@ - /** * Removes the object from the database without archiving it. * diff --git a/generator/lib/behavior/archivable/templates/objectGetArchive.php b/generator/lib/behavior/archivable/templates/objectGetArchive.php index 308e07974..4a2b65874 100644 --- a/generator/lib/behavior/archivable/templates/objectGetArchive.php +++ b/generator/lib/behavior/archivable/templates/objectGetArchive.php @@ -1,4 +1,3 @@ - /** * Get an archived version of the current object. * diff --git a/generator/lib/behavior/archivable/templates/objectPopulateFromArchive.php b/generator/lib/behavior/archivable/templates/objectPopulateFromArchive.php index c16c0f229..045b62661 100644 --- a/generator/lib/behavior/archivable/templates/objectPopulateFromArchive.php +++ b/generator/lib/behavior/archivable/templates/objectPopulateFromArchive.php @@ -1,4 +1,3 @@ - /** * Populates the the current object based on a $archiveTablePhpName archive object. * diff --git a/generator/lib/behavior/archivable/templates/objectRestoreFromArchive.php b/generator/lib/behavior/archivable/templates/objectRestoreFromArchive.php index 3b3e72930..31b232305 100644 --- a/generator/lib/behavior/archivable/templates/objectRestoreFromArchive.php +++ b/generator/lib/behavior/archivable/templates/objectRestoreFromArchive.php @@ -1,4 +1,3 @@ - /** * Revert the the current object to the state it had when it was last archived. * The object must be saved afterwards if the changes must persist. diff --git a/generator/lib/behavior/archivable/templates/objectSaveWithoutArchive.php b/generator/lib/behavior/archivable/templates/objectSaveWithoutArchive.php index 1868b35ca..db321cae8 100644 --- a/generator/lib/behavior/archivable/templates/objectSaveWithoutArchive.php +++ b/generator/lib/behavior/archivable/templates/objectSaveWithoutArchive.php @@ -1,4 +1,3 @@ - /** * Persists the object to the database without archiving it. * diff --git a/generator/lib/behavior/archivable/templates/queryArchive.php b/generator/lib/behavior/archivable/templates/queryArchive.php index 05d5a028b..f0babd887 100644 --- a/generator/lib/behavior/archivable/templates/queryArchive.php +++ b/generator/lib/behavior/archivable/templates/queryArchive.php @@ -1,4 +1,3 @@ - /** * Copy the data of the objects satisfying the query into archive objects. * The archived objects are then saved. diff --git a/generator/lib/behavior/archivable/templates/queryDeleteWithoutArchive.php b/generator/lib/behavior/archivable/templates/queryDeleteWithoutArchive.php index 1f30eac50..edd936bda 100644 --- a/generator/lib/behavior/archivable/templates/queryDeleteWithoutArchive.php +++ b/generator/lib/behavior/archivable/templates/queryDeleteWithoutArchive.php @@ -1,4 +1,3 @@ - /** * Delete records matching the current query without archiving them. * diff --git a/generator/lib/behavior/archivable/templates/querySetArchiveOnDelete.php b/generator/lib/behavior/archivable/templates/querySetArchiveOnDelete.php index f4fb08ebd..f1740687e 100644 --- a/generator/lib/behavior/archivable/templates/querySetArchiveOnDelete.php +++ b/generator/lib/behavior/archivable/templates/querySetArchiveOnDelete.php @@ -1,4 +1,3 @@ - /** * Enable/disable auto-archiving on delete for the next query. * diff --git a/generator/lib/behavior/archivable/templates/querySetArchiveOnUpdate.php b/generator/lib/behavior/archivable/templates/querySetArchiveOnUpdate.php index 7b9fd9c12..f095b93e6 100644 --- a/generator/lib/behavior/archivable/templates/querySetArchiveOnUpdate.php +++ b/generator/lib/behavior/archivable/templates/querySetArchiveOnUpdate.php @@ -1,4 +1,3 @@ - /** * Enable/disable auto-archiving on update for the next query. * diff --git a/generator/lib/behavior/archivable/templates/queryUpdateWithoutArchive.php b/generator/lib/behavior/archivable/templates/queryUpdateWithoutArchive.php index 129390006..891b0483c 100644 --- a/generator/lib/behavior/archivable/templates/queryUpdateWithoutArchive.php +++ b/generator/lib/behavior/archivable/templates/queryUpdateWithoutArchive.php @@ -1,4 +1,3 @@ - /** * Delete records matching the current query without archiving them. * diff --git a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php index 28ecda907..0b634ec13 100644 --- a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php +++ b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'ConcreteInheritanceParentBehavior.php'; /** * Makes a model inherit another one. The model with this behavior gets a copy diff --git a/generator/lib/behavior/i18n/I18nBehavior.php b/generator/lib/behavior/i18n/I18nBehavior.php index 21adb0a6d..8d005babd 100644 --- a/generator/lib/behavior/i18n/I18nBehavior.php +++ b/generator/lib/behavior/i18n/I18nBehavior.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/I18nBehaviorObjectBuilderModifier.php'; -require_once dirname(__FILE__) . '/I18nBehaviorQueryBuilderModifier.php'; -require_once dirname(__FILE__) . '/I18nBehaviorPeerBuilderModifier.php'; + + /** * Allows translation of text columns through transparent one-to-many relationship diff --git a/generator/lib/behavior/i18n/templates/objectAttributes.php b/generator/lib/behavior/i18n/templates/objectAttributes.php index 59bfcee7f..00a6ca0a1 100644 --- a/generator/lib/behavior/i18n/templates/objectAttributes.php +++ b/generator/lib/behavior/i18n/templates/objectAttributes.php @@ -1,4 +1,3 @@ - /** * Current locale * @var string diff --git a/generator/lib/behavior/i18n/templates/objectGetCurrentTranslation.php b/generator/lib/behavior/i18n/templates/objectGetCurrentTranslation.php index df56fa53f..d4215b6da 100644 --- a/generator/lib/behavior/i18n/templates/objectGetCurrentTranslation.php +++ b/generator/lib/behavior/i18n/templates/objectGetCurrentTranslation.php @@ -1,4 +1,3 @@ - /** * Returns the current translation * diff --git a/generator/lib/behavior/i18n/templates/objectGetLocale.php b/generator/lib/behavior/i18n/templates/objectGetLocale.php index 9a6aa0ccf..808a3c1cd 100644 --- a/generator/lib/behavior/i18n/templates/objectGetLocale.php +++ b/generator/lib/behavior/i18n/templates/objectGetLocale.php @@ -1,4 +1,3 @@ - /** * Gets the locale for translations * diff --git a/generator/lib/behavior/i18n/templates/objectGetLocaleAlias.php b/generator/lib/behavior/i18n/templates/objectGetLocaleAlias.php index 915c6f817..a1ae02cbe 100644 --- a/generator/lib/behavior/i18n/templates/objectGetLocaleAlias.php +++ b/generator/lib/behavior/i18n/templates/objectGetLocaleAlias.php @@ -1,4 +1,3 @@ - /** * Gets the locale for translations. * Alias for getLocale(), for BC purpose. diff --git a/generator/lib/behavior/i18n/templates/objectGetTranslation.php b/generator/lib/behavior/i18n/templates/objectGetTranslation.php index f26d116a8..82bf1f625 100644 --- a/generator/lib/behavior/i18n/templates/objectGetTranslation.php +++ b/generator/lib/behavior/i18n/templates/objectGetTranslation.php @@ -1,4 +1,3 @@ - /** * Returns the current translation for a given locale * diff --git a/generator/lib/behavior/i18n/templates/objectPostDelete.php b/generator/lib/behavior/i18n/templates/objectPostDelete.php index 959653119..343ad026e 100644 --- a/generator/lib/behavior/i18n/templates/objectPostDelete.php +++ b/generator/lib/behavior/i18n/templates/objectPostDelete.php @@ -1,4 +1,3 @@ - // emulate delete cascade ::create() ->filterBy($this) diff --git a/generator/lib/behavior/i18n/templates/objectRemoveTranslation.php b/generator/lib/behavior/i18n/templates/objectRemoveTranslation.php index 455b8d41e..21a4e7fc5 100644 --- a/generator/lib/behavior/i18n/templates/objectRemoveTranslation.php +++ b/generator/lib/behavior/i18n/templates/objectRemoveTranslation.php @@ -1,4 +1,3 @@ - /** * Remove the translation for a given locale * diff --git a/generator/lib/behavior/i18n/templates/objectSetLocale.php b/generator/lib/behavior/i18n/templates/objectSetLocale.php index 5678f0629..be99740dd 100644 --- a/generator/lib/behavior/i18n/templates/objectSetLocale.php +++ b/generator/lib/behavior/i18n/templates/objectSetLocale.php @@ -1,4 +1,3 @@ - /** * Sets the locale for translations * diff --git a/generator/lib/behavior/i18n/templates/objectSetLocaleAlias.php b/generator/lib/behavior/i18n/templates/objectSetLocaleAlias.php index 6bba031d3..29830105f 100644 --- a/generator/lib/behavior/i18n/templates/objectSetLocaleAlias.php +++ b/generator/lib/behavior/i18n/templates/objectSetLocaleAlias.php @@ -1,4 +1,3 @@ - /** * Sets the locale for translations. * Alias for setLocale(), for BC purpose. diff --git a/generator/lib/behavior/i18n/templates/objectSetTranslation.php b/generator/lib/behavior/i18n/templates/objectSetTranslation.php index 6d90a08cb..73266f1b0 100644 --- a/generator/lib/behavior/i18n/templates/objectSetTranslation.php +++ b/generator/lib/behavior/i18n/templates/objectSetTranslation.php @@ -1,4 +1,3 @@ - /** * Sets the translation for a given locale * diff --git a/generator/lib/behavior/i18n/templates/objectTranslatedColumnGetter.php b/generator/lib/behavior/i18n/templates/objectTranslatedColumnGetter.php index 019f32f20..9296aeab3 100644 --- a/generator/lib/behavior/i18n/templates/objectTranslatedColumnGetter.php +++ b/generator/lib/behavior/i18n/templates/objectTranslatedColumnGetter.php @@ -1,4 +1,3 @@ - diff --git a/generator/lib/behavior/i18n/templates/objectTranslatedColumnSetter.php b/generator/lib/behavior/i18n/templates/objectTranslatedColumnSetter.php index 5acd2a14e..ff5ee478b 100644 --- a/generator/lib/behavior/i18n/templates/objectTranslatedColumnSetter.php +++ b/generator/lib/behavior/i18n/templates/objectTranslatedColumnSetter.php @@ -1,4 +1,3 @@ - $this->getCurrentTranslation()->set(); diff --git a/generator/lib/behavior/i18n/templates/queryJoinI18n.php b/generator/lib/behavior/i18n/templates/queryJoinI18n.php index 9008c024f..1d33c5d9f 100644 --- a/generator/lib/behavior/i18n/templates/queryJoinI18n.php +++ b/generator/lib/behavior/i18n/templates/queryJoinI18n.php @@ -1,4 +1,3 @@ - /** * Adds a JOIN clause to the query using the i18n relation * diff --git a/generator/lib/behavior/i18n/templates/queryJoinWithI18n.php b/generator/lib/behavior/i18n/templates/queryJoinWithI18n.php index b67040bea..f10edd173 100644 --- a/generator/lib/behavior/i18n/templates/queryJoinWithI18n.php +++ b/generator/lib/behavior/i18n/templates/queryJoinWithI18n.php @@ -1,4 +1,3 @@ - /** * Adds a JOIN clause to the query and hydrates the related I18n object. * Shortcut for $c->joinI18n($locale)->with() diff --git a/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php b/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php index 80ce2bcad..caa6ebca4 100644 --- a/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php +++ b/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php @@ -1,4 +1,3 @@ - /** * Use the I18n relation query object * diff --git a/generator/lib/behavior/nestedset/NestedSetBehavior.php b/generator/lib/behavior/nestedset/NestedSetBehavior.php index a3dfde11d..26fb9b4eb 100644 --- a/generator/lib/behavior/nestedset/NestedSetBehavior.php +++ b/generator/lib/behavior/nestedset/NestedSetBehavior.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/NestedSetBehaviorObjectBuilderModifier.php'; -require_once dirname(__FILE__) . '/NestedSetBehaviorQueryBuilderModifier.php'; -require_once dirname(__FILE__) . '/NestedSetBehaviorPeerBuilderModifier.php'; + + /** * Behavior to adds nested set tree structure columns and abilities diff --git a/generator/lib/behavior/sortable/SortableBehavior.php b/generator/lib/behavior/sortable/SortableBehavior.php index 2bec8453d..847eec9ea 100644 --- a/generator/lib/behavior/sortable/SortableBehavior.php +++ b/generator/lib/behavior/sortable/SortableBehavior.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/SortableBehaviorObjectBuilderModifier.php'; -require_once dirname(__FILE__) . '/SortableBehaviorQueryBuilderModifier.php'; -require_once dirname(__FILE__) . '/SortableBehaviorPeerBuilderModifier.php'; -require_once dirname(__FILE__) . '/SortableRelationBehavior.php'; + + + /** * Gives a model class the ability to be ordered diff --git a/generator/lib/behavior/versionable/VersionableBehavior.php b/generator/lib/behavior/versionable/VersionableBehavior.php index 7751e941d..0b50aa792 100644 --- a/generator/lib/behavior/versionable/VersionableBehavior.php +++ b/generator/lib/behavior/versionable/VersionableBehavior.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/VersionableBehaviorObjectBuilderModifier.php'; -require_once dirname(__FILE__) . '/VersionableBehaviorQueryBuilderModifier.php'; -require_once dirname(__FILE__) . '/VersionableBehaviorPeerBuilderModifier.php'; + + /** * Keeps tracks of all the modifications in an ActiveRecord object diff --git a/generator/lib/builder/om/ExtensionQueryBuilder.php b/generator/lib/builder/om/ExtensionQueryBuilder.php index da103aa94..c7f4bd01d 100644 --- a/generator/lib/builder/om/ExtensionQueryBuilder.php +++ b/generator/lib/builder/om/ExtensionQueryBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Generates the empty PHP5 stub class for object query diff --git a/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php b/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php index 0c9432c4c..0823d2a87 100644 --- a/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php +++ b/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Generates the empty PHP5 stub query class for use with single table inheritance. diff --git a/generator/lib/builder/om/OMBuilder.php b/generator/lib/builder/om/OMBuilder.php index a27187b9e..f2344c55f 100644 --- a/generator/lib/builder/om/OMBuilder.php +++ b/generator/lib/builder/om/OMBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../DataModelBuilder.php'; /** * Baseclass for OM-building classes. diff --git a/generator/lib/builder/om/ObjectBuilder.php b/generator/lib/builder/om/ObjectBuilder.php index ab5cc81e1..cd9c5ff8a 100644 --- a/generator/lib/builder/om/ObjectBuilder.php +++ b/generator/lib/builder/om/ObjectBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Base class for Peer-building classes. diff --git a/generator/lib/builder/om/PHP5ExtensionNodeBuilder.php b/generator/lib/builder/om/PHP5ExtensionNodeBuilder.php index 58f6ab4ed..3e241bf66 100644 --- a/generator/lib/builder/om/PHP5ExtensionNodeBuilder.php +++ b/generator/lib/builder/om/PHP5ExtensionNodeBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates the empty PHP5 stub node object class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5ExtensionNodePeerBuilder.php b/generator/lib/builder/om/PHP5ExtensionNodePeerBuilder.php index da8cd17a6..d3e4142e4 100644 --- a/generator/lib/builder/om/PHP5ExtensionNodePeerBuilder.php +++ b/generator/lib/builder/om/PHP5ExtensionNodePeerBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PeerBuilder.php'; /** * Generates the empty PHP5 stub node peer class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5ExtensionObjectBuilder.php b/generator/lib/builder/om/PHP5ExtensionObjectBuilder.php index 9161c1a8d..5c74f8b60 100644 --- a/generator/lib/builder/om/PHP5ExtensionObjectBuilder.php +++ b/generator/lib/builder/om/PHP5ExtensionObjectBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates the empty PHP5 stub object class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5ExtensionPeerBuilder.php b/generator/lib/builder/om/PHP5ExtensionPeerBuilder.php index 3a72e12e0..daa85c71b 100644 --- a/generator/lib/builder/om/PHP5ExtensionPeerBuilder.php +++ b/generator/lib/builder/om/PHP5ExtensionPeerBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PeerBuilder.php'; /** * Generates the empty PHP5 stub peer class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5InterfaceBuilder.php b/generator/lib/builder/om/PHP5InterfaceBuilder.php index 0850b1732..2788fb561 100644 --- a/generator/lib/builder/om/PHP5InterfaceBuilder.php +++ b/generator/lib/builder/om/PHP5InterfaceBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates the empty PHP5 stub interface for user object model (OM). diff --git a/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php b/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php index c861d6d3f..d648ee124 100644 --- a/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php +++ b/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates the empty PHP5 stub object class for use with inheritance in the user object model (OM). diff --git a/generator/lib/builder/om/PHP5NestedSetBuilder.php b/generator/lib/builder/om/PHP5NestedSetBuilder.php index 4c2e92c50..3b8ed4bee 100644 --- a/generator/lib/builder/om/PHP5NestedSetBuilder.php +++ b/generator/lib/builder/om/PHP5NestedSetBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates a PHP5 tree node Object class for user object model (OM) using Nested Set way. diff --git a/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php b/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php index ca6f3d20b..2a05e160f 100644 --- a/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php +++ b/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PeerBuilder.php'; /** * Generates a PHP5 tree nested set Peer class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5NodeBuilder.php b/generator/lib/builder/om/PHP5NodeBuilder.php index 9d9f8cc7b..691979db1 100644 --- a/generator/lib/builder/om/PHP5NodeBuilder.php +++ b/generator/lib/builder/om/PHP5NodeBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates a PHP5 tree node Object class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5NodePeerBuilder.php b/generator/lib/builder/om/PHP5NodePeerBuilder.php index b3ab83c81..133e3e1ba 100644 --- a/generator/lib/builder/om/PHP5NodePeerBuilder.php +++ b/generator/lib/builder/om/PHP5NodePeerBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PeerBuilder.php'; /** * Generates a PHP5 tree node Peer class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5ObjectBuilder.php b/generator/lib/builder/om/PHP5ObjectBuilder.php index da9fd1625..76c5d317f 100644 --- a/generator/lib/builder/om/PHP5ObjectBuilder.php +++ b/generator/lib/builder/om/PHP5ObjectBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ObjectBuilder.php'; /** * Generates a PHP5 base Object class for user object model (OM). @@ -3287,7 +3286,7 @@ public function isPrimaryKeyNull() } $script .= " - return " . join(' && ', $tests) . ";"; + return " . implode(' && ', $tests) . ";"; } $script .= " } diff --git a/generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php b/generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php index 176273ffc..c2549122d 100644 --- a/generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php +++ b/generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PHP5ObjectBuilder.php'; /** * Generates a PHP5 base Object class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5PeerBuilder.php b/generator/lib/builder/om/PHP5PeerBuilder.php index 4a2effaac..063d8def0 100644 --- a/generator/lib/builder/om/PHP5PeerBuilder.php +++ b/generator/lib/builder/om/PHP5PeerBuilder.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PeerBuilder.php'; -require_once dirname(__FILE__) . '/ClassTools.php'; + /** * Generates a PHP5 base Peer class for user object model (OM). diff --git a/generator/lib/builder/om/PHP5TableMapBuilder.php b/generator/lib/builder/om/PHP5TableMapBuilder.php index ed5a02c26..711554acb 100644 --- a/generator/lib/builder/om/PHP5TableMapBuilder.php +++ b/generator/lib/builder/om/PHP5TableMapBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Generates the PHP5 table map class for user object model (OM). diff --git a/generator/lib/builder/om/PeerBuilder.php b/generator/lib/builder/om/PeerBuilder.php index d58b644b2..95c6e7d89 100644 --- a/generator/lib/builder/om/PeerBuilder.php +++ b/generator/lib/builder/om/PeerBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Base class for Peer-building classes. diff --git a/generator/lib/builder/om/QueryBuilder.php b/generator/lib/builder/om/QueryBuilder.php index c561a85a5..f01d3a623 100644 --- a/generator/lib/builder/om/QueryBuilder.php +++ b/generator/lib/builder/om/QueryBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; /** * Generates a PHP5 base Query class for user object model (OM). diff --git a/generator/lib/builder/om/QueryInheritanceBuilder.php b/generator/lib/builder/om/QueryInheritanceBuilder.php index b2f2a9029..f28392fdf 100644 --- a/generator/lib/builder/om/QueryInheritanceBuilder.php +++ b/generator/lib/builder/om/QueryInheritanceBuilder.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/OMBuilder.php'; -require_once dirname(__FILE__) . '/ClassTools.php'; + /** * Generates the empty PHP5 stub query class for use with single table inheritance. diff --git a/generator/lib/builder/sql/DataSQLBuilder.php b/generator/lib/builder/sql/DataSQLBuilder.php index 16426ed26..fb8b754ca 100644 --- a/generator/lib/builder/sql/DataSQLBuilder.php +++ b/generator/lib/builder/sql/DataSQLBuilder.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once 'builder/DataModelBuilder.php'; -require_once 'model/PropelTypes.php'; + /** * Baseclass for SQL data dump SQL building classes. diff --git a/generator/lib/builder/sql/mssql/MssqlDataSQLBuilder.php b/generator/lib/builder/sql/mssql/MssqlDataSQLBuilder.php index d839fdac6..4245a43ea 100644 --- a/generator/lib/builder/sql/mssql/MssqlDataSQLBuilder.php +++ b/generator/lib/builder/sql/mssql/MssqlDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * MS SQL Server class for building data dump SQL. diff --git a/generator/lib/builder/sql/mysql/MysqlDataSQLBuilder.php b/generator/lib/builder/sql/mysql/MysqlDataSQLBuilder.php index 5938b6e64..e3b1642f8 100644 --- a/generator/lib/builder/sql/mysql/MysqlDataSQLBuilder.php +++ b/generator/lib/builder/sql/mysql/MysqlDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * MySQL class for building data dump SQL. diff --git a/generator/lib/builder/sql/oracle/OracleDataSQLBuilder.php b/generator/lib/builder/sql/oracle/OracleDataSQLBuilder.php index bf7a35dae..5d03463a8 100644 --- a/generator/lib/builder/sql/oracle/OracleDataSQLBuilder.php +++ b/generator/lib/builder/sql/oracle/OracleDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * Oracle class for building data dump SQL. diff --git a/generator/lib/builder/sql/pgsql/PgsqlDataSQLBuilder.php b/generator/lib/builder/sql/pgsql/PgsqlDataSQLBuilder.php index ee986d62c..192efb03b 100644 --- a/generator/lib/builder/sql/pgsql/PgsqlDataSQLBuilder.php +++ b/generator/lib/builder/sql/pgsql/PgsqlDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * PostgreSQL class for building data dump SQL. diff --git a/generator/lib/builder/sql/sqlite/SqliteDataSQLBuilder.php b/generator/lib/builder/sql/sqlite/SqliteDataSQLBuilder.php index 498856ffc..ff295f24f 100644 --- a/generator/lib/builder/sql/sqlite/SqliteDataSQLBuilder.php +++ b/generator/lib/builder/sql/sqlite/SqliteDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * SQLite class for building data dump SQL. diff --git a/generator/lib/builder/sql/sqlsrv/SqlsrvDataSQLBuilder.php b/generator/lib/builder/sql/sqlsrv/SqlsrvDataSQLBuilder.php index 84e4688d7..2fd8c4616 100644 --- a/generator/lib/builder/sql/sqlsrv/SqlsrvDataSQLBuilder.php +++ b/generator/lib/builder/sql/sqlsrv/SqlsrvDataSQLBuilder.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'builder/sql/DataSQLBuilder.php'; /** * MS SQL Server using pdo_sqlsrv driver class for building data dump SQL. diff --git a/generator/lib/builder/util/DefaultEnglishPluralizer.php b/generator/lib/builder/util/DefaultEnglishPluralizer.php index 8d53b7794..53c8bfbbe 100644 --- a/generator/lib/builder/util/DefaultEnglishPluralizer.php +++ b/generator/lib/builder/util/DefaultEnglishPluralizer.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/Pluralizer.php'; /** * The default English pluralizer class. diff --git a/generator/lib/builder/util/StandardEnglishPluralizer.php b/generator/lib/builder/util/StandardEnglishPluralizer.php index 13f8374ff..be4903895 100644 --- a/generator/lib/builder/util/StandardEnglishPluralizer.php +++ b/generator/lib/builder/util/StandardEnglishPluralizer.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/Pluralizer.php'; /** * Standard replacement English pluralizer class. Based on the links below diff --git a/generator/lib/builder/util/XmlToAppData.php b/generator/lib/builder/util/XmlToAppData.php index 76b608a31..d4a254ed4 100644 --- a/generator/lib/builder/util/XmlToAppData.php +++ b/generator/lib/builder/util/XmlToAppData.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../../model/AppData.php'; -require_once dirname(__FILE__) . '/../../exception/SchemaException.php'; + /** * A class that is used to parse an input xml schema file and creates an AppData @@ -405,7 +404,7 @@ protected function isAlreadyParsed($filePath) } /** - * See: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Filesystem/Filesystem.php#L379 + * See: https://github.com/symfony/symfony/blob/0baa58d4e4bb006c4ae68f75833b586bd3cb6e6f/src/Symfony/Component/Filesystem/Filesystem.php#L446-L462 */ protected function isAbsolutePath($file) { diff --git a/generator/lib/builder/util/XmlToDataSQL.php b/generator/lib/builder/util/XmlToDataSQL.php index 1f563cf20..e9750e8d5 100644 --- a/generator/lib/builder/util/XmlToDataSQL.php +++ b/generator/lib/builder/util/XmlToDataSQL.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'phing/parser/AbstractHandler.php'; /** * A Class that is used to parse an data dump XML file and create SQL using a DataSQLBuilder class. diff --git a/generator/lib/config/GeneratorConfig.php b/generator/lib/config/GeneratorConfig.php index dd468842a..dd2166620 100644 --- a/generator/lib/config/GeneratorConfig.php +++ b/generator/lib/config/GeneratorConfig.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/GeneratorConfigInterface.php'; // Phing dependencies -require_once 'phing/Phing.php'; + /** * A class that holds build properties and provide a class loading mechanism for the generator. diff --git a/generator/lib/config/QuickGeneratorConfig.php b/generator/lib/config/QuickGeneratorConfig.php index 4bc8efef3..549fba4ec 100644 --- a/generator/lib/config/QuickGeneratorConfig.php +++ b/generator/lib/config/QuickGeneratorConfig.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/GeneratorConfig.php'; -require_once dirname(__FILE__) . '/GeneratorConfigInterface.php'; -require_once dirname(__FILE__) . '/../platform/PropelPlatformInterface.php'; -require_once dirname(__FILE__) . '/../platform/SqlitePlatform.php'; + + + /** * @package propel.generator.config @@ -90,7 +89,7 @@ protected function parsePseudoIniFile($filepath) public function getConfiguredBuilder(Table $table, $type) { $class = $this->builders[$type]; - require_once dirname(__FILE__) . '/../builder/om/' . $class . '.php'; + $builder = new $class($table); $builder->setGeneratorConfig($this); @@ -104,7 +103,7 @@ public function getConfiguredBuilder(Table $table, $type) */ public function getConfiguredPluralizer() { - require_once dirname(__FILE__) . '/../builder/util/DefaultEnglishPluralizer.php'; + return new DefaultEnglishPluralizer(); } diff --git a/generator/lib/exception/EngineException.php b/generator/lib/exception/EngineException.php index c98775d40..a6e6113d2 100644 --- a/generator/lib/exception/EngineException.php +++ b/generator/lib/exception/EngineException.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'phing/BuildException.php'; /** * The base class of all exceptions thrown by the engine. diff --git a/generator/lib/model/AppData.php b/generator/lib/model/AppData.php index 1ff393898..427aed1cd 100644 --- a/generator/lib/model/AppData.php +++ b/generator/lib/model/AppData.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../exception/EngineException.php'; -require_once dirname(__FILE__) . '/Database.php'; + /** * A class for holding application data structures. diff --git a/generator/lib/model/Behavior.php b/generator/lib/model/Behavior.php index fb32a8e7c..706ebcfcb 100644 --- a/generator/lib/model/Behavior.php +++ b/generator/lib/model/Behavior.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/Index.php'; -require_once dirname(__FILE__) . '/../builder/util/PropelTemplate.php'; + /** * Information about behaviors of a table. diff --git a/generator/lib/model/Column.php b/generator/lib/model/Column.php index cbc159d79..6b30af05f 100644 --- a/generator/lib/model/Column.php +++ b/generator/lib/model/Column.php @@ -8,13 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; -require_once dirname(__FILE__) . '/../exception/EngineException.php'; -require_once dirname(__FILE__) . '/PropelTypes.php'; -require_once dirname(__FILE__) . '/Inheritance.php'; -require_once dirname(__FILE__) . '/Domain.php'; -require_once dirname(__FILE__) . '/ColumnDefaultValue.php'; - /** * A Class for holding data about a column used in an Application. * diff --git a/generator/lib/model/Database.php b/generator/lib/model/Database.php index 747670f02..b1bd8a7f6 100644 --- a/generator/lib/model/Database.php +++ b/generator/lib/model/Database.php @@ -8,11 +8,10 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ScopedElement.php'; -require_once dirname(__FILE__) . '/IDMethod.php'; -require_once dirname(__FILE__) . '/NameGenerator.php'; -require_once dirname(__FILE__) . '/Table.php'; -require_once dirname(__FILE__) . '/Behavior.php'; + + + + /** * A class for holding application data structures. diff --git a/generator/lib/model/Domain.php b/generator/lib/model/Domain.php index 7d8353bcd..acf23e832 100644 --- a/generator/lib/model/Domain.php +++ b/generator/lib/model/Domain.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; /** * A class for holding data about a domain used in the schema. diff --git a/generator/lib/model/ForeignKey.php b/generator/lib/model/ForeignKey.php index aaf5daa00..949a06f98 100644 --- a/generator/lib/model/ForeignKey.php +++ b/generator/lib/model/ForeignKey.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; /** * A Class for information about foreign keys of a table. diff --git a/generator/lib/model/IdMethodParameter.php b/generator/lib/model/IdMethodParameter.php index 2dc82e076..7c6b9c3cc 100644 --- a/generator/lib/model/IdMethodParameter.php +++ b/generator/lib/model/IdMethodParameter.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; /** * Information related to an ID method. diff --git a/generator/lib/model/Index.php b/generator/lib/model/Index.php index c6de078dc..06529ebe6 100644 --- a/generator/lib/model/Index.php +++ b/generator/lib/model/Index.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; -require_once dirname(__FILE__) . '/../exception/EngineException.php'; + /** * Information about indices of a table. diff --git a/generator/lib/model/Inheritance.php b/generator/lib/model/Inheritance.php index 5ef1976ce..441185cc3 100644 --- a/generator/lib/model/Inheritance.php +++ b/generator/lib/model/Inheritance.php @@ -8,7 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; +//require_once dirname(__FILE__) . '/XMLElement.php'; /** * A Class for information regarding possible objects representing a table diff --git a/generator/lib/model/NameFactory.php b/generator/lib/model/NameFactory.php index 356305036..077899fef 100644 --- a/generator/lib/model/NameFactory.php +++ b/generator/lib/model/NameFactory.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../exception/EngineException.php'; -require_once dirname(__FILE__) . '/NameGenerator.php'; -require_once dirname(__FILE__) . '/PhpNameGenerator.php'; -require_once dirname(__FILE__) . '/ConstraintNameGenerator.php'; + + + /** * A name generation factory. diff --git a/generator/lib/model/PhpNameGenerator.php b/generator/lib/model/PhpNameGenerator.php index 09b592527..46b009f36 100644 --- a/generator/lib/model/PhpNameGenerator.php +++ b/generator/lib/model/PhpNameGenerator.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/NameGenerator.php'; /** * A NameGenerator implementation for PHP-esque names. diff --git a/generator/lib/model/Rule.php b/generator/lib/model/Rule.php index 1b5f22c5c..71bca19f7 100644 --- a/generator/lib/model/Rule.php +++ b/generator/lib/model/Rule.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; /** * Data about a validation rule used in an application. diff --git a/generator/lib/model/ScopedElement.php b/generator/lib/model/ScopedElement.php index bca8cb542..8534d6ef9 100644 --- a/generator/lib/model/ScopedElement.php +++ b/generator/lib/model/ScopedElement.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; /** * Data about an element with a name and optional namespace/schema/package attributes diff --git a/generator/lib/model/Table.php b/generator/lib/model/Table.php index bf47a2b17..578d0ac9c 100644 --- a/generator/lib/model/Table.php +++ b/generator/lib/model/Table.php @@ -8,16 +8,15 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/ScopedElement.php'; -require_once dirname(__FILE__) . '/../exception/EngineException.php'; -require_once dirname(__FILE__) . '/IDMethod.php'; -require_once dirname(__FILE__) . '/NameFactory.php'; -require_once dirname(__FILE__) . '/Column.php'; -require_once dirname(__FILE__) . '/Unique.php'; -require_once dirname(__FILE__) . '/ForeignKey.php'; -require_once dirname(__FILE__) . '/IdMethodParameter.php'; -require_once dirname(__FILE__) . '/Validator.php'; -require_once dirname(__FILE__) . '/Behavior.php'; + + + + + + + + + /** * Data about a table used in an application. diff --git a/generator/lib/model/Unique.php b/generator/lib/model/Unique.php index 5766585d9..1ca201d24 100644 --- a/generator/lib/model/Unique.php +++ b/generator/lib/model/Unique.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/Index.php'; /** * Information about unique columns of a table. This class assumes diff --git a/generator/lib/model/Validator.php b/generator/lib/model/Validator.php index b6b7b395c..c4d3d9532 100644 --- a/generator/lib/model/Validator.php +++ b/generator/lib/model/Validator.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; -require_once dirname(__FILE__) . '/../exception/EngineException.php'; -require_once dirname(__FILE__) . '/PropelTypes.php'; -require_once dirname(__FILE__) . '/Rule.php'; + + + /** * Validator. diff --git a/generator/lib/model/VendorInfo.php b/generator/lib/model/VendorInfo.php index 0e0f86aeb..9a5680b4b 100644 --- a/generator/lib/model/VendorInfo.php +++ b/generator/lib/model/VendorInfo.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/XMLElement.php'; -require_once dirname(__FILE__) . '/../exception/EngineException.php'; + /** * Object to hold vendor-specific info. diff --git a/generator/lib/model/XMLElement.php b/generator/lib/model/XMLElement.php index b5a455bb4..1d6825c37 100644 --- a/generator/lib/model/XMLElement.php +++ b/generator/lib/model/XMLElement.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/VendorInfo.php'; /** * An abstract class for elements represented by XML tags (e.g. Column, Table). diff --git a/generator/lib/model/diff/PropelColumnComparator.php b/generator/lib/model/diff/PropelColumnComparator.php index 80e1e686f..c3b796ef5 100644 --- a/generator/lib/model/diff/PropelColumnComparator.php +++ b/generator/lib/model/diff/PropelColumnComparator.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Column.php'; -require_once dirname(__FILE__) . '/PropelColumnDiff.php'; + /** * Service class for comparing Column objects. diff --git a/generator/lib/model/diff/PropelColumnDiff.php b/generator/lib/model/diff/PropelColumnDiff.php index b5ae65a6d..fc6e5357c 100644 --- a/generator/lib/model/diff/PropelColumnDiff.php +++ b/generator/lib/model/diff/PropelColumnDiff.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Column.php'; /** * Value object for storing Column object diffs. diff --git a/generator/lib/model/diff/PropelDatabaseComparator.php b/generator/lib/model/diff/PropelDatabaseComparator.php index caef2c853..9013f672e 100644 --- a/generator/lib/model/diff/PropelDatabaseComparator.php +++ b/generator/lib/model/diff/PropelDatabaseComparator.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Database.php'; -require_once dirname(__FILE__) . '/PropelDatabaseDiff.php'; -require_once dirname(__FILE__) . '/PropelTableComparator.php'; + + /** * Service class for comparing Database objects diff --git a/generator/lib/model/diff/PropelDatabaseDiff.php b/generator/lib/model/diff/PropelDatabaseDiff.php index df531b47f..d102e8226 100644 --- a/generator/lib/model/diff/PropelDatabaseDiff.php +++ b/generator/lib/model/diff/PropelDatabaseDiff.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Database.php'; -require_once dirname(__FILE__) . '/PropelTableDiff.php'; + /** * Value object for storing Database object diffs diff --git a/generator/lib/model/diff/PropelForeignKeyComparator.php b/generator/lib/model/diff/PropelForeignKeyComparator.php index 46174f00f..1816b3b1b 100644 --- a/generator/lib/model/diff/PropelForeignKeyComparator.php +++ b/generator/lib/model/diff/PropelForeignKeyComparator.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../ForeignKey.php'; /** * Service class for comparing ForeignKey objects diff --git a/generator/lib/model/diff/PropelIndexComparator.php b/generator/lib/model/diff/PropelIndexComparator.php index 17c2b4eb7..beda5ad1d 100644 --- a/generator/lib/model/diff/PropelIndexComparator.php +++ b/generator/lib/model/diff/PropelIndexComparator.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Index.php'; /** * Service class for comparing Index objects diff --git a/generator/lib/model/diff/PropelTableComparator.php b/generator/lib/model/diff/PropelTableComparator.php index 38a323d7e..d75a64869 100644 --- a/generator/lib/model/diff/PropelTableComparator.php +++ b/generator/lib/model/diff/PropelTableComparator.php @@ -8,12 +8,11 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Table.php'; -require_once dirname(__FILE__) . '/PropelTableDiff.php'; -require_once dirname(__FILE__) . '/PropelColumnComparator.php'; -require_once dirname(__FILE__) . '/PropelColumnDiff.php'; -require_once dirname(__FILE__) . '/PropelIndexComparator.php'; -require_once dirname(__FILE__) . '/PropelForeignKeyComparator.php'; + + + + + /** * Service class for comparing Table objects diff --git a/generator/lib/model/diff/PropelTableDiff.php b/generator/lib/model/diff/PropelTableDiff.php index 6972ccb6c..22a579c91 100644 --- a/generator/lib/model/diff/PropelTableDiff.php +++ b/generator/lib/model/diff/PropelTableDiff.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../Table.php'; -require_once dirname(__FILE__) . '/PropelColumnDiff.php'; + /** * Value object for storing Table object diffs diff --git a/generator/lib/platform/DefaultPlatform.php b/generator/lib/platform/DefaultPlatform.php index 1891e5b91..d37c0a5a4 100644 --- a/generator/lib/platform/DefaultPlatform.php +++ b/generator/lib/platform/DefaultPlatform.php @@ -8,11 +8,10 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/PropelPlatformInterface.php'; -require_once dirname(__FILE__) . '/../model/Column.php'; -require_once dirname(__FILE__) . '/../model/Table.php'; -require_once dirname(__FILE__) . '/../model/Domain.php'; -require_once dirname(__FILE__) . '/../model/PropelTypes.php'; + + + + /** * Default implementation for the Platform interface. diff --git a/generator/lib/platform/MssqlPlatform.php b/generator/lib/platform/MssqlPlatform.php index fdbb17af3..124f63c93 100644 --- a/generator/lib/platform/MssqlPlatform.php +++ b/generator/lib/platform/MssqlPlatform.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/DefaultPlatform.php'; -require_once dirname(__FILE__) . '/../model/Domain.php'; + /** * MS SQL PropelPlatformInterface implementation. diff --git a/generator/lib/platform/MysqlPlatform.php b/generator/lib/platform/MysqlPlatform.php index 6853221e3..166f9b6d3 100644 --- a/generator/lib/platform/MysqlPlatform.php +++ b/generator/lib/platform/MysqlPlatform.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/DefaultPlatform.php'; /** * MySql PropelPlatformInterface implementation. @@ -732,9 +731,8 @@ public function hasSize($sqlType) */ public function disconnectedEscapeText($text) { - // mysql_escape_string doesn't work in PHP >= 5.4 - if (version_compare(PHP_VERSION, '5.4', '<') && function_exists('mysql_escape_string')) { - return mysql_escape_string($text); + if (function_exists('mysql_real_escape_string')) { + return mysql_real_escape_string($text); } else { return addslashes($text); } diff --git a/generator/lib/platform/OraclePlatform.php b/generator/lib/platform/OraclePlatform.php index 44ae559ca..320b5f644 100644 --- a/generator/lib/platform/OraclePlatform.php +++ b/generator/lib/platform/OraclePlatform.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/DefaultPlatform.php'; /** * Oracle PropelPlatformInterface implementation. diff --git a/generator/lib/platform/PgsqlPlatform.php b/generator/lib/platform/PgsqlPlatform.php index d7b94c23e..0e2dac41a 100644 --- a/generator/lib/platform/PgsqlPlatform.php +++ b/generator/lib/platform/PgsqlPlatform.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/DefaultPlatform.php'; /** * Postgresql PropelPlatformInterface implementation. diff --git a/generator/lib/platform/SqlitePlatform.php b/generator/lib/platform/SqlitePlatform.php index 5e6709f00..e58708617 100644 --- a/generator/lib/platform/SqlitePlatform.php +++ b/generator/lib/platform/SqlitePlatform.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/DefaultPlatform.php'; /** * SQLite PropelPlatformInterface implementation. diff --git a/generator/lib/platform/SqlsrvPlatform.php b/generator/lib/platform/SqlsrvPlatform.php index 867075b04..ec4ebd788 100644 --- a/generator/lib/platform/SqlsrvPlatform.php +++ b/generator/lib/platform/SqlsrvPlatform.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/MssqlPlatform.php'; /** * MS SQL Server using pdo_sqlsrv implementation. diff --git a/generator/lib/reverse/BaseSchemaParser.php b/generator/lib/reverse/BaseSchemaParser.php index e35bd36d5..a12a64e52 100644 --- a/generator/lib/reverse/BaseSchemaParser.php +++ b/generator/lib/reverse/BaseSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/SchemaParser.php'; /** * Base class for reverse engineering a database schema. diff --git a/generator/lib/reverse/mssql/MssqlSchemaParser.php b/generator/lib/reverse/mssql/MssqlSchemaParser.php index c76d0e0a3..f9e697526 100644 --- a/generator/lib/reverse/mssql/MssqlSchemaParser.php +++ b/generator/lib/reverse/mssql/MssqlSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../BaseSchemaParser.php'; /** * Microsoft SQL Server database schema parser. diff --git a/generator/lib/reverse/mysql/MysqlSchemaParser.php b/generator/lib/reverse/mysql/MysqlSchemaParser.php index 7dfbc14bb..e95709079 100644 --- a/generator/lib/reverse/mysql/MysqlSchemaParser.php +++ b/generator/lib/reverse/mysql/MysqlSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../BaseSchemaParser.php'; /** * Mysql database schema parser. diff --git a/generator/lib/reverse/oracle/OracleSchemaParser.php b/generator/lib/reverse/oracle/OracleSchemaParser.php index c7c073623..addccc832 100644 --- a/generator/lib/reverse/oracle/OracleSchemaParser.php +++ b/generator/lib/reverse/oracle/OracleSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../BaseSchemaParser.php'; /** * Oracle database schema parser. diff --git a/generator/lib/reverse/pgsql/PgsqlSchemaParser.php b/generator/lib/reverse/pgsql/PgsqlSchemaParser.php index 091284edb..ff5519d37 100644 --- a/generator/lib/reverse/pgsql/PgsqlSchemaParser.php +++ b/generator/lib/reverse/pgsql/PgsqlSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../BaseSchemaParser.php'; /** * Postgresql database schema parser. @@ -175,7 +174,7 @@ protected function addColumns(Table $table, $oid, $version) att.atttypmod, att.atthasdef, att.attnotnull, - def.adsrc, + pg_get_expr(def.adbin, def.adrelid) as adsrc, CASE WHEN att.attndims > 0 THEN 1 ELSE 0 END AS isarray, CASE WHEN ty.typname = 'bpchar' diff --git a/generator/lib/reverse/sqlite/SqliteSchemaParser.php b/generator/lib/reverse/sqlite/SqliteSchemaParser.php index d90bd4097..a05f8151d 100644 --- a/generator/lib/reverse/sqlite/SqliteSchemaParser.php +++ b/generator/lib/reverse/sqlite/SqliteSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../BaseSchemaParser.php'; /** * SQLite database schema parser. diff --git a/generator/lib/reverse/sqlsrv/SqlsrvSchemaParser.php b/generator/lib/reverse/sqlsrv/SqlsrvSchemaParser.php index b79c127bb..712d33150 100644 --- a/generator/lib/reverse/sqlsrv/SqlsrvSchemaParser.php +++ b/generator/lib/reverse/sqlsrv/SqlsrvSchemaParser.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'reverse/mssql/MssqlSchemaParser.php'; /** * Microsoft SQL Server database schema parser. diff --git a/generator/lib/task/AbstractPropelDataModelTask.php b/generator/lib/task/AbstractPropelDataModelTask.php index b1c1fa564..01fb61f72 100644 --- a/generator/lib/task/AbstractPropelDataModelTask.php +++ b/generator/lib/task/AbstractPropelDataModelTask.php @@ -9,7 +9,7 @@ */ //include_once 'phing/tasks/ext/CapsuleTask.php'; -require_once 'task/AbstractPropelTask.php'; + include_once 'config/GeneratorConfig.php'; include_once 'model/AppData.php'; include_once 'model/Database.php'; @@ -516,7 +516,7 @@ protected function loadDataModels() foreach ($this->dataModels as $dataModel) { $validator = new PropelSchemaValidator($dataModel); if (!$validator->validate()) { - throw new EngineException(sprintf("The database schema contains errors:\n - %s", join("\n - ", $validator->getErrors()))); + throw new EngineException(sprintf("The database schema contains errors:\n - %s", implode("\n - ", $validator->getErrors()))); } } } diff --git a/generator/lib/task/AbstractPropelTask.php b/generator/lib/task/AbstractPropelTask.php index 4343e21ef..b6df8b79c 100644 --- a/generator/lib/task/AbstractPropelTask.php +++ b/generator/lib/task/AbstractPropelTask.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'phing/Task.php'; require_once __DIR__ . '/../../stubs/functions.php'; abstract class AbstractPropelTask extends Task diff --git a/generator/lib/task/BasePropelMigrationTask.php b/generator/lib/task/BasePropelMigrationTask.php index dba36a282..742b1e8fc 100644 --- a/generator/lib/task/BasePropelMigrationTask.php +++ b/generator/lib/task/BasePropelMigrationTask.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'task/AbstractPropelTask.php'; /** * This Task lists the migrations yet to be executed diff --git a/generator/lib/task/PropelConvertConfTask.php b/generator/lib/task/PropelConvertConfTask.php index 2db5e2712..e210e8f55 100644 --- a/generator/lib/task/PropelConvertConfTask.php +++ b/generator/lib/task/PropelConvertConfTask.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once 'task/AbstractPropelTask.php'; -require_once 'task/AbstractPropelDataModelTask.php'; -require_once 'builder/om/OMBuilder.php'; -require_once 'builder/om/ClassTools.php'; + + + /** * This Task converts the XML runtime configuration file into a PHP array for faster performance. diff --git a/generator/lib/task/PropelDataSQLTask.php b/generator/lib/task/PropelDataSQLTask.php index 5c645c7db..8fba3b59a 100644 --- a/generator/lib/task/PropelDataSQLTask.php +++ b/generator/lib/task/PropelDataSQLTask.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once 'model/AppData.php'; -require_once 'model/Database.php'; -require_once 'builder/util/XmlToAppData.php'; -require_once 'builder/util/XmlToDataSQL.php'; + + + /** * Task that transforms XML datadump files into files containing SQL INSERT statements. diff --git a/generator/lib/task/PropelGraphvizTask.php b/generator/lib/task/PropelGraphvizTask.php index 6493d728e..b9c62e9a1 100644 --- a/generator/lib/task/PropelGraphvizTask.php +++ b/generator/lib/task/PropelGraphvizTask.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once 'task/AbstractPropelDataModelTask.php'; -require_once 'model/AppData.php'; -require_once 'util/PropelDotGenerator.php'; + + /** * A task to generate Graphviz dot files from Propel datamodel. diff --git a/generator/lib/task/PropelMigrationDownTask.php b/generator/lib/task/PropelMigrationDownTask.php index ff2b37581..539ae704f 100644 --- a/generator/lib/task/PropelMigrationDownTask.php +++ b/generator/lib/task/PropelMigrationDownTask.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/BasePropelMigrationTask.php'; -require_once dirname(__FILE__) . '/../util/PropelMigrationManager.php'; + /** * This Task executes the next migration down diff --git a/generator/lib/task/PropelMigrationStatusTask.php b/generator/lib/task/PropelMigrationStatusTask.php index 7c3a1319b..21939ef81 100644 --- a/generator/lib/task/PropelMigrationStatusTask.php +++ b/generator/lib/task/PropelMigrationStatusTask.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/BasePropelMigrationTask.php'; -require_once dirname(__FILE__) . '/../util/PropelMigrationManager.php'; + /** * This Task lists the migrations yet to be executed diff --git a/generator/lib/task/PropelMigrationTask.php b/generator/lib/task/PropelMigrationTask.php index 8f8347114..e059f1bf3 100644 --- a/generator/lib/task/PropelMigrationTask.php +++ b/generator/lib/task/PropelMigrationTask.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/BasePropelMigrationTask.php'; -require_once dirname(__FILE__) . '/../util/PropelMigrationManager.php'; + /** * This Task executes the next migrations up diff --git a/generator/lib/task/PropelMigrationUpTask.php b/generator/lib/task/PropelMigrationUpTask.php index 5a0e13ff7..ab814a566 100644 --- a/generator/lib/task/PropelMigrationUpTask.php +++ b/generator/lib/task/PropelMigrationUpTask.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/BasePropelMigrationTask.php'; -require_once dirname(__FILE__) . '/../util/PropelMigrationManager.php'; + /** * This Task executes the next migration up diff --git a/generator/lib/task/PropelOMTask.php b/generator/lib/task/PropelOMTask.php index f9c850e49..67bcefda0 100644 --- a/generator/lib/task/PropelOMTask.php +++ b/generator/lib/task/PropelOMTask.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once 'task/AbstractPropelDataModelTask.php'; -require_once 'builder/om/ClassTools.php'; -require_once 'builder/om/OMBuilder.php'; + + /** * This Task creates the OM classes based on the XML schema file. diff --git a/generator/lib/task/PropelSQLDiffTask.php b/generator/lib/task/PropelSQLDiffTask.php index dfb2991c2..407c08e73 100644 --- a/generator/lib/task/PropelSQLDiffTask.php +++ b/generator/lib/task/PropelSQLDiffTask.php @@ -8,11 +8,10 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/AbstractPropelDataModelTask.php'; -require_once dirname(__FILE__) . '/../builder/om/ClassTools.php'; -require_once dirname(__FILE__) . '/../builder/om/OMBuilder.php'; -require_once dirname(__FILE__) . '/../model/diff/PropelDatabaseComparator.php'; -require_once dirname(__FILE__) . '/../util/PropelMigrationManager.php'; + + + + /** * This Task creates the OM classes based on the XML schema file. diff --git a/generator/lib/task/PropelSQLExec.php b/generator/lib/task/PropelSQLExec.php index 158e5b0ce..36dfb40b2 100644 --- a/generator/lib/task/PropelSQLExec.php +++ b/generator/lib/task/PropelSQLExec.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once 'task/AbstractPropelTask.php'; -require_once dirname(__FILE__) . '/../util/PropelSQLParser.php'; + /** * Executes all SQL files referenced in the sqldbmap file against their mapped databases. diff --git a/generator/lib/task/PropelSQLTask.php b/generator/lib/task/PropelSQLTask.php index 010e7b4a4..b4f8f39f4 100644 --- a/generator/lib/task/PropelSQLTask.php +++ b/generator/lib/task/PropelSQLTask.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'model/AppData.php'; /** * The task for building SQL DDL based on the XML datamodel. diff --git a/generator/lib/task/PropelSchemaReverseTask.php b/generator/lib/task/PropelSchemaReverseTask.php index c67eea7f1..7bad58875 100644 --- a/generator/lib/task/PropelSchemaReverseTask.php +++ b/generator/lib/task/PropelSchemaReverseTask.php @@ -8,9 +8,8 @@ * @license MIT License */ -require_once 'phing/tasks/ext/pdo/PDOTask.php'; -require_once 'config/GeneratorConfig.php'; -require_once 'model/PropelTypes.php'; + + /** * This class generates an XML schema of an existing database from diff --git a/generator/lib/task/PropelSqlBuildTask.php b/generator/lib/task/PropelSqlBuildTask.php index d66dc091b..00a9bc356 100644 --- a/generator/lib/task/PropelSqlBuildTask.php +++ b/generator/lib/task/PropelSqlBuildTask.php @@ -8,7 +8,6 @@ * @license MIT License */ -require_once 'util/PropelSqlManager.php'; /** * The new task for building SQL DDL based on the XML datamodel. diff --git a/generator/lib/util/PropelMigrationManager.php b/generator/lib/util/PropelMigrationManager.php index 7b58f7575..96674c6d7 100644 --- a/generator/lib/util/PropelMigrationManager.php +++ b/generator/lib/util/PropelMigrationManager.php @@ -8,10 +8,9 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../model/Table.php'; -require_once dirname(__FILE__) . '/../model/Column.php'; -require_once dirname(__FILE__) . '/PropelSQLParser.php'; -require_once dirname(__FILE__) . '/../../../runtime/lib/Propel.php'; + + + /** * Service class for preparing and executing migrations diff --git a/generator/lib/util/PropelQuickBuilder.php b/generator/lib/util/PropelQuickBuilder.php index 1043a226b..84412cb30 100644 --- a/generator/lib/util/PropelQuickBuilder.php +++ b/generator/lib/util/PropelQuickBuilder.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../builder/util/XmlToAppData.php'; -require_once dirname(__FILE__) . '/PropelSQLParser.php'; + class PropelQuickBuilder { @@ -45,7 +44,7 @@ public function setPlatform($platform) public function getPlatform() { if (null === $this->platform) { - require_once dirname(__FILE__) . '/../platform/SqlitePlatform.php'; + $this->platform = new SqlitePlatform(); } @@ -70,7 +69,7 @@ public function setConfig(GeneratorConfigInterface $config) public function getConfig() { if (null === $this->config) { - require_once dirname(__FILE__) . '/../config/QuickGeneratorConfig.php'; + $this->config = new QuickGeneratorConfig($this->getPlatform()); } diff --git a/generator/lib/util/PropelSqlManager.php b/generator/lib/util/PropelSqlManager.php index 5820683e4..c597c1086 100644 --- a/generator/lib/util/PropelSqlManager.php +++ b/generator/lib/util/PropelSqlManager.php @@ -8,8 +8,7 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/../config/GeneratorConfigInterface.php'; -require_once dirname(__FILE__) . '/../util/PropelSQLParser.php'; + /** * Service class for managing SQL. diff --git a/generator/pear/pear-propel-gen b/generator/pear/pear-propel-gen old mode 100644 new mode 100755 index 253ef2920..108d1e2cf --- a/generator/pear/pear-propel-gen +++ b/generator/pear/pear-propel-gen @@ -20,5 +20,3 @@ if [ $# = 1 ] ; then else $PHING_COMMAND -f @DATA-DIR@/propel_generator/pear-build.xml -Dproject.dir=$* fi - - diff --git a/generator/pear/pear-propel-gen.bat b/generator/pear/pear-propel-gen.bat index 17c704d9f..9db34baa0 100644 --- a/generator/pear/pear-propel-gen.bat +++ b/generator/pear/pear-propel-gen.bat @@ -27,4 +27,4 @@ if %nbArgs% leq 1 ( GOTO :EOF :PAUSE_END -PAUSE \ No newline at end of file +PAUSE diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2dcb3b3df..e733fdf27 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,27 +1,14 @@ - - - - - - ./test/testsuite/ - - - - - - ./runtime/lib/ - ./generator/lib/ - - + + + + ./runtime/lib/ + ./generator/lib/ + + + + + ./test/testsuite/ + + diff --git a/runtime/lib/Propel.php b/runtime/lib/Propel.php index 424714a7e..f71d39938 100644 --- a/runtime/lib/Propel.php +++ b/runtime/lib/Propel.php @@ -731,7 +731,12 @@ private static function processDriverOptions($source, &$write_to) } $key = constant($key); - $value = $optiondata['value']; + if (is_array($optiondata && isset($optiondata['value']))) { + $value = $optiondata['value']; + } else { + $value = $optiondata; + } + if (is_string($value) && strpos($value, '::') !== false) { if (!defined($value)) { throw new PropelException("Invalid PDO option/attribute value specified: " . $value); diff --git a/runtime/lib/adapter/DBPostgres.php b/runtime/lib/adapter/DBPostgres.php index bbf899ac1..31d87f8c4 100644 --- a/runtime/lib/adapter/DBPostgres.php +++ b/runtime/lib/adapter/DBPostgres.php @@ -146,6 +146,9 @@ public function getTimeFormatter() */ public function applyLimit(&$sql, $offset, $limit) { + $limit = (int) $limit; + $offset = (int) $offset; + if ($limit > 0) { $sql .= " LIMIT " . $limit; } diff --git a/runtime/lib/collection/PropelOnDemandCollection.php b/runtime/lib/collection/PropelOnDemandCollection.php index dc8a993c5..b1bd8c073 100644 --- a/runtime/lib/collection/PropelOnDemandCollection.php +++ b/runtime/lib/collection/PropelOnDemandCollection.php @@ -148,7 +148,7 @@ public function prepend($value) throw new PropelException('The On Demand Collection is read only'); } - public function asort() + public function asort(int $flags = SORT_REGULAR): bool { throw new PropelException('The On Demand Collection is read only'); } @@ -168,7 +168,7 @@ public function getFlags() throw new PropelException('The On Demand Collection does not allow access by offset'); } - public function ksort() + public function ksort(int $flags = SORT_REGULAR) { throw new PropelException('The On Demand Collection is read only'); } diff --git a/runtime/lib/config/PropelConfigurationIterator.php b/runtime/lib/config/PropelConfigurationIterator.php index 1c74e4fdd..0c95d020d 100644 --- a/runtime/lib/config/PropelConfigurationIterator.php +++ b/runtime/lib/config/PropelConfigurationIterator.php @@ -12,7 +12,7 @@ * PropelConfigurationIterator is used internally by PropelConfiguration to * build a flat array from nesting configuration arrays. * - * @author Veikko Mäkinen + * @author Veikko M�kinen * @version $Revision$ * @package propel.runtime.config */ @@ -72,6 +72,7 @@ public function getNodeType() * @see http://www.php.net/RecursiveIteratorIterator * @return mixed */ + #[\ReturnTypeWillChange] public function current() { $current = parent::current(); @@ -90,6 +91,7 @@ public function current() * * @see http://www.php.net/RecursiveIteratorIterator */ + #[\ReturnTypeWillChange] public function endChildren() { if ($this->namespaceStack) { diff --git a/runtime/lib/connection/DebugPDOStatement.php b/runtime/lib/connection/DebugPDOStatement.php index 9e8e557be..390ddea77 100644 --- a/runtime/lib/connection/DebugPDOStatement.php +++ b/runtime/lib/connection/DebugPDOStatement.php @@ -81,6 +81,11 @@ public function getExecutedQueryString(array $values = array()) $boundValue = trim($boundValue, "'"); $boundValue = $this->pdo->quote($boundValue); } + + if (is_resource($boundValue)) { + $boundValue = '[BLOB]'; + } + $sql = str_replace($pos, $boundValue, $sql); } } @@ -101,7 +106,7 @@ public function execute($input_parameters = null) $debug = $this->pdo->getDebugSnapshot(); $return = parent::execute($input_parameters); - $sql = $this->getExecutedQueryString($input_parameters?$input_parameters:array()); + $sql = $this->getExecutedQueryString($input_parameters ? $input_parameters : []); $this->pdo->log($sql, null, __METHOD__, $debug); $this->pdo->setLastExecutedQuery($sql); $this->pdo->incrementQueryCount(); diff --git a/runtime/lib/connection/PropelPDO.php b/runtime/lib/connection/PropelPDO.php index 7d30a08f1..5236e0107 100644 --- a/runtime/lib/connection/PropelPDO.php +++ b/runtime/lib/connection/PropelPDO.php @@ -448,18 +448,16 @@ public function exec($sql) * * @return PDOStatement */ - public function query() + public function query(string $statement, ?int $fetchMode = null, ...$fetchModeArgs) { + $debug = null; + if ($this->useDebug) { $debug = $this->getDebugSnapshot(); } $args = func_get_args(); - if (version_compare(PHP_VERSION, '5.3', '<')) { - $return = call_user_func_array(array($this, 'parent::query'), $args); - } else { - $return = call_user_func_array('parent::query', $args); - } + $return = parent::query(...$args); if ($this->useDebug) { $sql = $args[0]; diff --git a/runtime/lib/formatter/PropelArrayFormatter.php b/runtime/lib/formatter/PropelArrayFormatter.php index 87ba24cf9..0688df84b 100644 --- a/runtime/lib/formatter/PropelArrayFormatter.php +++ b/runtime/lib/formatter/PropelArrayFormatter.php @@ -49,6 +49,13 @@ public function format(PDOStatement $stmt) $data[] = &$object; } } + + if ($class = $this->collectionName) { + $collection = new $class($data); + $collection->setModel($this->class); + $collection->setFormatter($this); + } + $this->currentObjects = array(); $this->alreadyHydratedObjects = array(); $stmt->closeCursor(); diff --git a/runtime/lib/parser/yaml/sfYamlInline.php b/runtime/lib/parser/yaml/sfYamlInline.php index 331802a00..8aa665b90 100644 --- a/runtime/lib/parser/yaml/sfYamlInline.php +++ b/runtime/lib/parser/yaml/sfYamlInline.php @@ -8,7 +8,7 @@ * file that was distributed with this source code. */ -require_once dirname(__FILE__).'/sfYaml.php'; +require_once dirname(__FILE__) . '/sfYaml.php'; /** * sfYamlInline implements a YAML parser/dumper for the YAML inline syntax. @@ -79,7 +79,7 @@ public static function dump($value) case is_resource($value): throw new InvalidArgumentException('Unable to dump PHP resources in a YAML file.'); case is_object($value): - return '!!php/object:'.serialize($value); + return '!!php/object:' . serialize($value); case is_array($value): return self::dumpArray($value); case null === $value: @@ -122,9 +122,8 @@ protected static function dumpArray($value) { // array $keys = array_keys($value); - - if (count($value) > 0 && array_values($value) === $value) - { + + if (count($value) > 0 && array_values($value) === $value) { $output = array(); foreach ($value as $val) { $output[] = self::dump($val); @@ -168,7 +167,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter if (false !== $strpos = strpos($output, ' #')) { $output = rtrim(substr($output, 0, $strpos)); } - } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + } elseif (preg_match('/^(.+?)(' . implode('|', $delimiters) . ')/', substr($scalar, $i), $match)) { $output = $match[1]; $i += strlen($output); } else { @@ -191,7 +190,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter */ protected static function parseQuotedScalar($scalar, &$i) { - if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + if (!preg_match('/' . self::REGEX_QUOTED_STRING . '/Au', substr($scalar, $i), $match)) { throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); } @@ -247,7 +246,7 @@ protected static function parseSequence($sequence, &$i = 0) if (!$isQuoted && false !== strpos($value, ': ')) { // embedded mapping? try { - $value = self::parseMapping('{'.$value.'}'); + $value = self::parseMapping('{' . $value . '}'); } catch (InvalidArgumentException $e) { // no, it's not } @@ -366,7 +365,7 @@ protected static function evaluateScalar($scalar) case in_array(strtolower($scalar), $falseValues): return false; case is_numeric($scalar): - return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar); + return '0x' == $scalar[0] . $scalar[1] ? hexdec($scalar) : floatval($scalar); case 0 == strcasecmp($scalar, '.inf'): case 0 == strcasecmp($scalar, '.NaN'): return -log(0); diff --git a/runtime/lib/parser/yaml/sfYamlParser.php b/runtime/lib/parser/yaml/sfYamlParser.php index 634b5ca37..b3f67576f 100644 --- a/runtime/lib/parser/yaml/sfYamlParser.php +++ b/runtime/lib/parser/yaml/sfYamlParser.php @@ -325,7 +325,7 @@ protected function parseValue($value) if (preg_match('/^(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?$/', $value, $matches)) { $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; - return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers))); + return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int)$modifiers)); } else { return sfYamlInline::load($value); } diff --git a/runtime/lib/query/Criteria.php b/runtime/lib/query/Criteria.php index 3c45ddf55..5ff6cad95 100644 --- a/runtime/lib/query/Criteria.php +++ b/runtime/lib/query/Criteria.php @@ -1239,6 +1239,7 @@ public function isSingleRecord() */ public function setLimit($limit) { + // TODO: do we enforce int here? 32bit issue if we do $this->limit = (int) $limit; return $this; diff --git a/runtime/lib/query/ModelCriteria.php b/runtime/lib/query/ModelCriteria.php index 5ea69007b..ef13c85dd 100644 --- a/runtime/lib/query/ModelCriteria.php +++ b/runtime/lib/query/ModelCriteria.php @@ -529,14 +529,14 @@ public function select($columnArray) throw new PropelException('You must ask for at least one column'); } - if ($columnArray == '*') { + if (!is_array($columnArray) && $columnArray == '*') { $columnArray = array(); foreach (call_user_func(array($this->modelPeerName, 'getFieldNames'), BasePeer::TYPE_PHPNAME) as $column) { $columnArray[] = $this->modelName . '.' . $column; } } - $this->select = $columnArray; + $this->select = (array) $columnArray; return $this; } diff --git a/test/etc/lob/tin_drum.txt b/test/etc/lob/tin_drum.txt index 09dacac0f..c2738d513 100644 --- a/test/etc/lob/tin_drum.txt +++ b/test/etc/lob/tin_drum.txt @@ -73,4 +73,4 @@ Suddenly Koljaiczek found himself short, wide, and coverless in the rain, and he My grandmother found four more hot potatoes under the ashes. She gave Koljaiczek three of them and took one for herself; before biting into it she asked if he was from the brickworks, though she knew perfectly well that Koljaiczek came from somewhere else and had no connection with bricks. Without waiting for an answer, she lifted the lighter basket to his back, took the heavier one for herself, and still had a hand free for her rake and hoe. Then with her basket, her potatoes, her rake, and her hoe, she set off, like a sail billowing in the breeze, in the direction of Bissau Quarry. -That wasn't the same as Bissau itself. It lay more in the direction of Ramkau. Passing to the right of the brickworks, they headed for the black forest with Goldkrug in it and Brenntau behind it. But in a hollow, before you come to the forest, lay Bissau Quarry. Thither Joseph Koljaiczek, unable to tear himself away from her skirts, followed my grandmother. \ No newline at end of file +That wasn't the same as Bissau itself. It lay more in the direction of Ramkau. Passing to the right of the brickworks, they headed for the black forest with Goldkrug in it and Brenntau behind it. But in a hollow, before you come to the forest, lay Bissau Quarry. Thither Joseph Koljaiczek, unable to tear himself away from her skirts, followed my grandmother. diff --git a/test/etc/xsl/phpunit-noframes.xsl b/test/etc/xsl/phpunit-noframes.xsl index 76fa46029..e9a14060c 100644 --- a/test/etc/xsl/phpunit-noframes.xsl +++ b/test/etc/xsl/phpunit-noframes.xsl @@ -442,4 +442,3 @@ - diff --git a/test/etc/xsl/str.replace.function.xsl b/test/etc/xsl/str.replace.function.xsl index 96433a4ad..6b2d53059 100644 --- a/test/etc/xsl/str.replace.function.xsl +++ b/test/etc/xsl/str.replace.function.xsl @@ -102,4 +102,4 @@ - \ No newline at end of file + diff --git a/test/fixtures/bookstore-packaged/build.properties b/test/fixtures/bookstore-packaged/build.properties index 0c2b9e579..5328989c1 100644 --- a/test/fixtures/bookstore-packaged/build.properties +++ b/test/fixtures/bookstore-packaged/build.properties @@ -16,4 +16,4 @@ propel.database.url = sqlite:/var/tmp/test.db # propel.database.createUrl = (doesn't apply for SQLite, since db is auto-created) propel.targetPackage = bookstore-packaged -propel.packageObjectModel = true \ No newline at end of file +propel.packageObjectModel = true diff --git a/test/fixtures/bookstore/build.properties b/test/fixtures/bookstore/build.properties index 6305b4fe8..f4b96a815 100644 --- a/test/fixtures/bookstore/build.properties +++ b/test/fixtures/bookstore/build.properties @@ -19,7 +19,7 @@ propel.schema.autoPrefix = true # For MySQL or Oracle, you also need to specify username & password propel.database.user = root -#propel.database.password = [db password] +propel.database.password = root # Note that if you do not wish to specify the database (e.g. if you # are using multiple databases) you can use the @DB@ token which diff --git a/test/fixtures/bookstore/runtime-conf.xml b/test/fixtures/bookstore/runtime-conf.xml index 1e59f3fde..e3c3d601e 100644 --- a/test/fixtures/bookstore/runtime-conf.xml +++ b/test/fixtures/bookstore/runtime-conf.xml @@ -21,7 +21,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root @@ -56,7 +56,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root @@ -78,7 +78,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root diff --git a/test/fixtures/namespaced/build.properties b/test/fixtures/namespaced/build.properties index 8f220f1d4..c4670681d 100644 --- a/test/fixtures/namespaced/build.properties +++ b/test/fixtures/namespaced/build.properties @@ -18,7 +18,7 @@ propel.disableIdentifierQuoting=true # For MySQL or Oracle, you also need to specify username & password propel.database.user = root -#propel.database.password = [db password] +propel.database.password = root # Note that if you do not wish to specify the database (e.g. if you # are using multiple databases) you can use the @DB@ token which diff --git a/test/fixtures/namespaced/runtime-conf.xml b/test/fixtures/namespaced/runtime-conf.xml index 037b84527..66d2d2080 100644 --- a/test/fixtures/namespaced/runtime-conf.xml +++ b/test/fixtures/namespaced/runtime-conf.xml @@ -21,7 +21,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root diff --git a/test/fixtures/nestedset/runtime-conf.xml b/test/fixtures/nestedset/runtime-conf.xml index 5ec3bbce1..802c76043 100644 --- a/test/fixtures/nestedset/runtime-conf.xml +++ b/test/fixtures/nestedset/runtime-conf.xml @@ -45,7 +45,7 @@ sqlite sqlite:/var/tmp/nestedset.db - + root diff --git a/test/fixtures/reverse/mysql/build.properties b/test/fixtures/reverse/mysql/build.properties index 99ec001cf..2f26ce3c4 100644 --- a/test/fixtures/reverse/mysql/build.properties +++ b/test/fixtures/reverse/mysql/build.properties @@ -17,7 +17,7 @@ propel.database.url = mysql:host=db;dbname=reverse_bookstore # For MySQL or Oracle, you also need to specify username & password propel.database.user = root -#propel.database.password = [db password] +propel.database.password = root propel.mysql.tableType = InnoDB diff --git a/test/fixtures/reverse/mysql/runtime-conf.xml b/test/fixtures/reverse/mysql/runtime-conf.xml index d50175fff..e98996d1f 100644 --- a/test/fixtures/reverse/mysql/runtime-conf.xml +++ b/test/fixtures/reverse/mysql/runtime-conf.xml @@ -19,7 +19,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root diff --git a/test/fixtures/reverse/pgsql/runtime-conf.xml b/test/fixtures/reverse/pgsql/runtime-conf.xml index d060ce54a..aee1ab4c4 100644 --- a/test/fixtures/reverse/pgsql/runtime-conf.xml +++ b/test/fixtures/reverse/pgsql/runtime-conf.xml @@ -18,7 +18,7 @@ diff --git a/test/fixtures/schemas/build.properties b/test/fixtures/schemas/build.properties index b089f65c1..8a1467a99 100644 --- a/test/fixtures/schemas/build.properties +++ b/test/fixtures/schemas/build.properties @@ -14,6 +14,7 @@ propel.project = bookstore propel.database = mysql propel.database.url = mysql:host=db;dbname=test propel.database.user = root +propel.database.password = root propel.mysql.tableType = InnoDB propel.disableIdentifierQuoting = true propel.schema.autoPrefix = true diff --git a/test/fixtures/schemas/runtime-conf.xml b/test/fixtures/schemas/runtime-conf.xml index e31bc59ee..faf6f87dd 100644 --- a/test/fixtures/schemas/runtime-conf.xml +++ b/test/fixtures/schemas/runtime-conf.xml @@ -19,7 +19,7 @@ For MySQL and Oracle you must specify username + password separate from DSN: --> root - + root diff --git a/test/fixtures/treetest/build.properties b/test/fixtures/treetest/build.properties index 1d97a2d15..bd16d72c0 100644 --- a/test/fixtures/treetest/build.properties +++ b/test/fixtures/treetest/build.properties @@ -21,6 +21,3 @@ propel.database.url = sqlite:/var/tmp/treetest.db #propel.database = codebase #propel.database.url = odbc://localhost/Driver=CodeBaseOdbcStand;DBQ=test;?adapter=CodeBase - - - diff --git a/test/fixtures/treetest/runtime-conf.xml b/test/fixtures/treetest/runtime-conf.xml index 0996495e0..274bd1c1c 100644 --- a/test/fixtures/treetest/runtime-conf.xml +++ b/test/fixtures/treetest/runtime-conf.xml @@ -45,7 +45,7 @@ sqlite sqlite:/var/tmp/treetest.db - + root diff --git a/test/testsuite/generator/behavior/concrete_inheritance/ConcreteInheritanceExcludedParentBehaviorTest.php b/test/testsuite/generator/behavior/concrete_inheritance/ConcreteInheritanceExcludedParentBehaviorTest.php index 6a6be079c..cc2a7992a 100644 --- a/test/testsuite/generator/behavior/concrete_inheritance/ConcreteInheritanceExcludedParentBehaviorTest.php +++ b/test/testsuite/generator/behavior/concrete_inheritance/ConcreteInheritanceExcludedParentBehaviorTest.php @@ -26,14 +26,14 @@ public function testHasChildObjectAddChildMethod() $article = new ConcreteTag(); // to autoload the BaseConcreteArticle class $r = new ReflectionClass('BaseConcreteTag'); $p =$r->getMethod('addChild')->getParameters(); - $this->assertEquals('ConcreteCategory', $p[0]->getClass()->getName(), 'concrete_inheritance does not generate addChild method child object class'); + $this->assertEquals('ConcreteCategory', $p[0]->getType()->getName(), 'concrete_inheritance does not generate addChild method child object class'); } public function testHasChildPeerIsValidMethod() { $r = new ReflectionClass('BaseConcreteTagPeer'); $p =$r->getMethod('isValid')->getParameters(); - $this->assertEquals('ConcreteCategory', $p[0]->getClass()->getName(), 'concrete_inheritance does not generate isValid method child peer class'); + $this->assertEquals('ConcreteCategory', $p[0]->getType()->getName(), 'concrete_inheritance does not generate isValid method child peer class'); } } diff --git a/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php b/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php index 234dd139a..c150714d0 100644 --- a/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php +++ b/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php @@ -1013,10 +1013,10 @@ public function testVersionColumnNameCaseInsensitivity() // there should be two versions of this getter in the source. one for the main // class and one for the version class - $this->assertEquals(2, sizeof($getterMatches[0])); + $this->assertEquals(2, count($getterMatches[0])); // there should be two versions of the filter. one for the main query class // and one for the version query class - $this->assertEquals(2, sizeof($filterMatches[0])); + $this->assertEquals(2, count($filterMatches[0])); } } diff --git a/test/testsuite/misc/BookstoreTest.php b/test/testsuite/misc/BookstoreTest.php index 88cabd072..f48679c43 100644 --- a/test/testsuite/misc/BookstoreTest.php +++ b/test/testsuite/misc/BookstoreTest.php @@ -203,7 +203,7 @@ public function testScenario() $qs_lookup = BookPeer::retrieveByPk($qs_id); $this->assertNotNull($qs_lookup, 'just-created book can be found by pk'); - $new_title = "Quicksilver (".crc32(uniqid(rand())).")"; + $new_title = "Quicksilver (".crc32(uniqid(random_int(0, getrandmax()))).")"; // Attempting to update found object $qs_lookup->setTitle($new_title); $qs_lookup->save(); @@ -626,7 +626,7 @@ public function testScenarioUsingQuery() $qs_lookup = BookQuery::create()->findPk($qs_id); $this->assertNotNull($qs_lookup, 'just-created book can be found by pk'); - $new_title = "Quicksilver (".crc32(uniqid(rand())).")"; + $new_title = "Quicksilver (".crc32(uniqid(random_int(0, getrandmax()))).")"; // Attempting to update found object $qs_lookup->setTitle($new_title); $qs_lookup->save(); diff --git a/test/testsuite/runtime/query/ExplainPlanTest.php b/test/testsuite/runtime/query/ExplainPlanTest.php index fb03893a9..344300027 100644 --- a/test/testsuite/runtime/query/ExplainPlanTest.php +++ b/test/testsuite/runtime/query/ExplainPlanTest.php @@ -34,7 +34,7 @@ public function testExplainPlanFromObject() $explain = $c->explain($this->con); if ($db instanceof DBMySQL) { - $this->assertEquals(sizeof($explain), 2, 'Explain plan return two lines'); + $this->assertEquals(count($explain), 2, 'Explain plan return two lines'); // explain can change sometime, test can't be strict $this->assertArrayHasKey('select_type',$explain[0], 'Line 1, select_type key exist'); @@ -47,7 +47,7 @@ public function testExplainPlanFromObject() $this->assertArrayHasKey('type',$explain[1], 'Line 2, type key exist'); $this->assertArrayHasKey('possible_keys',$explain[1], 'Line 2, possible_keys key exist'); } elseif ($db instanceof DBOracle) { - $this->assertTrue(sizeof($explain) > 2, 'Explain plan return more than 2 lines'); + $this->assertTrue(count($explain) > 2, 'Explain plan return more than 2 lines'); } else { $this->markTestSkipped('Cannot test explain plan on adapter ' . get_class($db)); } @@ -65,7 +65,7 @@ public function testExplainPlanFromString() $explain = $stmt->fetchAll(PDO::FETCH_ASSOC); if ($db instanceof DBMySQL) { - $this->assertEquals(sizeof($explain), 2, 'Explain plan return two lines'); + $this->assertEquals(count($explain), 2, 'Explain plan return two lines'); // explain can change sometime, test can't be strict $this->assertArrayHasKey('select_type',$explain[0], 'Line 1, select_type key exist'); @@ -78,7 +78,7 @@ public function testExplainPlanFromString() $this->assertArrayHasKey('type',$explain[1], 'Line 2, type key exist'); $this->assertArrayHasKey('possible_keys',$explain[1], 'Line 2, possible_keys key exist'); } elseif ($db instanceof DBOracle) { - $this->assertTrue(sizeof($explain) > 2, 'Explain plan return more than 2 lines'); + $this->assertTrue(count($explain) > 2, 'Explain plan return more than 2 lines'); } else { $this->markTestSkipped('Cannot test explain plan on adapter ' . get_class($db)); } diff --git a/test/testsuite/runtime/query/ModelCriteriaTest.php b/test/testsuite/runtime/query/ModelCriteriaTest.php index ff7043b0c..bcfa7988c 100644 --- a/test/testsuite/runtime/query/ModelCriteriaTest.php +++ b/test/testsuite/runtime/query/ModelCriteriaTest.php @@ -92,13 +92,13 @@ public static function conditionsForTestReplaceNames() /** * @dataProvider conditionsForTestReplaceNames */ - public function testReplaceNames($origClause, $columnPhpName = false, $modifiedClause) + public function testReplaceNames($origClause, $columnPhpName, $modifiedClause) { $c = new TestableModelCriteria('bookstore', 'Book'); - $this->doTestReplaceNames($c, BookPeer::getTableMap(), $origClause, $columnPhpName = false, $modifiedClause); + $this->doTestReplaceNames($c, BookPeer::getTableMap(), $origClause, $modifiedClause, $columnPhpName = false); } - public function doTestReplaceNames($c, $tableMap, $origClause, $columnPhpName = false, $modifiedClause) + public function doTestReplaceNames($c, $tableMap, $origClause, $modifiedClause, $columnPhpName = false) { $c->replaceNames($origClause); $columns = $c->replacedColumns; diff --git a/test/testsuite/runtime/query/ModelCriteriaWithNamespaceTest.php b/test/testsuite/runtime/query/ModelCriteriaWithNamespaceTest.php index 4ad74f5eb..fd1b93162 100644 --- a/test/testsuite/runtime/query/ModelCriteriaWithNamespaceTest.php +++ b/test/testsuite/runtime/query/ModelCriteriaWithNamespaceTest.php @@ -37,13 +37,13 @@ public static function conditionsForTestReplaceNamesWithNamespaces() /** * @dataProvider conditionsForTestReplaceNamesWithNamespaces */ - public function testReplaceNamesWithNamespaces($origClause, $columnPhpName = false, $modifiedClause) + public function testReplaceNamesWithNamespaces($origClause, $columnPhpName, $modifiedClause) { $c = new TestableModelCriteriaWithNamespace('bookstore_namespaced', 'Foo\\Bar\\NamespacedBook'); - $this->doTestReplaceNames($c, Foo\Bar\NamespacedBookPeer::getTableMap(), $origClause, $columnPhpName = false, $modifiedClause); + $this->doTestReplaceNames($c, Foo\Bar\NamespacedBookPeer::getTableMap(), $origClause, $modifiedClause, $columnPhpName = false); } - public function doTestReplaceNames($c, $tableMap, $origClause, $columnPhpName = false, $modifiedClause) + public function doTestReplaceNames($c, $tableMap, $origClause, $modifiedClause, $columnPhpName = false) { $c->replaceNames($origClause); $columns = $c->replacedColumns; diff --git a/test/testsuite/runtime/query/ModelCriteriaWithSchemaTest.php b/test/testsuite/runtime/query/ModelCriteriaWithSchemaTest.php index 0bbe50110..7be449c29 100644 --- a/test/testsuite/runtime/query/ModelCriteriaWithSchemaTest.php +++ b/test/testsuite/runtime/query/ModelCriteriaWithSchemaTest.php @@ -44,13 +44,13 @@ public static function conditionsForTestReplaceNamesWithSchemas() /** * @dataProvider conditionsForTestReplaceNamesWithSchemas */ - public function testReplaceNamesWithSchemas($origClause, $columnPhpName = false, $modifiedClause) + public function testReplaceNamesWithSchemas($origClause, $columnPhpName, $modifiedClause) { $c = new TestableModelCriteriaWithSchema('bookstore-schemas', 'ContestBookstoreContest'); - $this->doTestReplaceNames($c, ContestBookstoreContestPeer::getTableMap(), $origClause, $columnPhpName = false, $modifiedClause); + $this->doTestReplaceNames($c, ContestBookstoreContestPeer::getTableMap(), $origClause, $modifiedClause, $columnPhpName = false); } - public function doTestReplaceNames($c, $tableMap, $origClause, $columnPhpName = false, $modifiedClause) + public function doTestReplaceNames($c, $tableMap, $origClause, $modifiedClause, $columnPhpName = false) { $c->replaceNames($origClause); $columns = $c->replacedColumns; diff --git a/test/tools/helpers/bookstore/BookstoreEmptyTestBase.php b/test/tools/helpers/bookstore/BookstoreEmptyTestBase.php index 70fcf7356..272bd6f2e 100644 --- a/test/tools/helpers/bookstore/BookstoreEmptyTestBase.php +++ b/test/tools/helpers/bookstore/BookstoreEmptyTestBase.php @@ -1,4 +1,3 @@ -