Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for php8 #3

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7a26997
fix for issue #741
eelkevdbos Feb 4, 2014
a4140b8
changed composer.json to be able to take this package to packagist
eelkevdbos Feb 4, 2014
6418b78
update
eelkevdbos Feb 13, 2014
d607c4a
Merge branch 'master' of https://github.com/propelorm/Propel
eelkevdbos Jul 26, 2014
8a3067f
many to one populateRelation fix
eelkevdbos Jan 17, 2015
3c9c42f
Bugfix
DanielFortuyn Oct 30, 2017
67d4878
Merge pull request #1 from DanielFortuyn/master
eelkevdbos Oct 30, 2017
ec7a0fd
Fix create_function deprectation warning
eelkevdbos Oct 23, 2018
f369407
Merge branch 'master' of github.com:eelkevdbos/Propel
eelkevdbos Oct 23, 2018
1dc5b6d
Fix PHP 7.2 issue calling count on string
eelkevdbos Oct 24, 2018
3f7151b
Fix appending array to array object by ref
eelkevdbos Dec 16, 2018
e050c0c
Fix injection on limit
eelkevdbos Feb 9, 2019
d3096bd
Merge branch 'master' of github.com:vdbf/Propel
eelkevdbos Feb 9, 2019
2bbdad7
Disable many to one population
eelkevdbos Feb 13, 2019
dbd385d
changed composer.json to be able to take this package to packagist
eelkevdbos Feb 4, 2014
b1c3ae8
update
eelkevdbos Feb 13, 2014
28f5c52
many to one populateRelation fix
eelkevdbos Jan 17, 2015
64927e1
Fix create_function deprectation warning
eelkevdbos Oct 23, 2018
ee14237
Bugfix
DanielFortuyn Oct 30, 2017
252ae4b
Fix PHP 7.2 issue calling count on string
eelkevdbos Oct 24, 2018
59f60fc
Fix injection on limit
eelkevdbos Feb 9, 2019
5384cc7
Fix appending array to array object by ref
eelkevdbos Dec 16, 2018
54ef333
Disable many to one population
eelkevdbos Feb 13, 2019
b745b52
7.4
DanielFortuyn Jan 19, 2022
19326d4
apply array formatter fix
DanielFortuyn Jan 20, 2022
678736a
add github actions test workflow (#2)
jwong-dayspring Nov 1, 2022
d24a5c2
compatibility with php 7.4 and 8.x (#4)
jwong-dayspring Dec 20, 2022
48a8f82
update readme
jwong-dayspring Dec 20, 2022
0409694
fix for postgres12+ compatibility (#5)
jwong-dayspring Dec 21, 2022
52d0541
supress some errors
DanielFortuyn Feb 10, 2023
6ee8bb4
some merges
DanielFortuyn Feb 10, 2023
795bd09
Rename package to jooola/propel1
jooola Oct 3, 2021
3d3a2af
Fix usage of deprecated mysql_escape_string
jooola Oct 3, 2021
e247491
Fix Propel conditional data array
jooola Oct 3, 2021
e3ff98d
Fix php7.4 compatibility
jooola Oct 3, 2021
e924bff
style: format composer.json
jooola Jan 12, 2023
5e7b8c5
chore: rename package to libretime/propel1
jooola Jan 12, 2023
364b751
chore: add pre-commit config
jooola Jan 12, 2023
6d45686
style: format code using prettier
jooola Jan 12, 2023
fd168c5
wip
jooola Jun 22, 2024
d332c89
run on pull request
jooola Jun 22, 2024
339fe2b
wip
jooola Jun 22, 2024
5c77d52
wip
jooola Jun 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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)$
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ branches:

services: docker

script:
bash docker/run.sh
script: bash docker/run.sh
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
61 changes: 38 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"homepage": "http://www.willdurand.fr"
}],
"authors": [
{
"name": "William Durand",
"email": "[email protected]",
"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"
}
}
3 changes: 1 addition & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

15 changes: 7 additions & 8 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"
services:
php:
build:
Expand All @@ -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"
Empty file modified docker/reset.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion generator/lib/behavior/DelegateBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* @license MIT License
*/

require_once 'AggregateColumnRelationBehavior.php';

/**
* Keeps an aggregate column updated with related table
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* @license MIT License
*/

require_once 'AggregateColumnRelationBehavior.php';

/**
* Keeps an aggregate column updated with related table
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Computes the value of the aggregate column <?php echo $column->getName() ?>
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Updates the aggregate column <?php echo $column->getName() ?>
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Update the aggregate column in the related <?php echo $relationName ?> object
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Finds the related <?php echo $foreignTable->getPhpName() ?> objects and keep them for later
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

protected function updateRelated<?php echo $relationName ?>s($con)
{
foreach ($this-><?php echo $variableName ?>s as $<?php echo $variableName ?>) {
Expand Down
3 changes: 1 addition & 2 deletions generator/lib/behavior/archivable/ArchivableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Removes the object from the database without archiving it.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Get an archived version of the current object.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Populates the the current object based on a $archiveTablePhpName archive object.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Persists the object to the database without archiving it.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Copy the data of the objects satisfying the query into <?php echo $archiveTablePhpName ?> archive objects.
* The archived objects are then saved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Delete records matching the current query without archiving them.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Enable/disable auto-archiving on delete for the next query.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Enable/disable auto-archiving on update for the next query.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Delete records matching the current query without archiving them.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading