Skip to content

Commit

Permalink
Merge pull request #4 from amboss-mededu/merge-upstream
Browse files Browse the repository at this point in the history
Merge changes from upstream branch
  • Loading branch information
obukhov authored Jun 18, 2021
2 parents 9e5fa52 + 4aa2b00 commit 8d9bb43
Show file tree
Hide file tree
Showing 25 changed files with 143 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
branch = 5.x
[submodule "lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine"]
path = lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine
url = https://github.com/LExpress/doctrine1.git
url = https://github.com/FriendsOfSymfony1/doctrine1.git
30 changes: 14 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
os: linux
dist: xenial
language: php

php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- nightly

# run build against nightly but allow them to fail
matrix:
jobs:
fast_finish: true
allow_failures:
- php: nightly
include:
- php: 5.3
dist: precise
sudo: required
- php: 5.4
dist: precise
sudo: required

# faster builds on new travis setup not using sudo
sudo: false
- php: 5.5
dist: trusty
- php: 5.6
dist: trusty

services:
- memcached

# cache vendor dirs
cache:
directories:
- lib/vendor/swiftmailer
- $HOME/.composer/cache

install:
- composer self-update
before_install:
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- sh -c 'if [ $(php -r "echo PHP_RELEASE_VERSION;") -le 98 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'

before_script:
install:
# by default, --remote is not used on travis
- git submodule update --remote --force
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- sh -c 'if [ $(php -r "echo PHP_RELEASE_VERSION;") -le 98 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- composer install
- composer install --prefer-dist --no-progress --no-suggest -o

script:
- php data/bin/check_configuration.php
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
CHANGELOG
=========

08/06/2020: Version 1.5.13
--------------------------

* Fix for `Warning: ini_set(): A session is active...` #229
* Php 7.4 Incompatibility Fixes #228
* Remove notice appeared on php 7.4 #230
* Rename package to `friendsofsymfony1/symfony1` #231

03/04/2020: Version 1.5.12
--------------------------

* Move project from @LExpress to @FriendsOfSymfony1
* Some doc & readme update
* Fixes for PHP 7.3 & 7.4 (thanks @W0rma for the code and @alquerci for the review) #224
* Backport fix for cve-2019-18888 by @adrienperonnet #218

17/03/2018: Version 1.5.11
--------------------------

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[![Build Status](https://secure.travis-ci.org/LExpress/symfony1.png?branch=master)](http://travis-ci.org/LExpress/symfony1)
[![Build Status](https://secure.travis-ci.org/FriendsOfSymfony1/symfony1.png?branch=master)](http://travis-ci.org/FriendsOfSymfony1/symfony1)

About this version
------------------

This is a community driven fork of symfony 1, as official support has been [interrupted in November 2012](http://symfony.com/blog/symfony-1-4-end-of-maintenance-what-does-it-mean).

**Do not use it for new projects: this version is great to improve existing symfony1 applications, but [Symfony4](http://symfony.com/) is the way to go today.**
**Do not use it for new projects: this version is great to improve existing symfony1 applications, but [Symfony5](http://symfony.com/) is the way to go today.**

All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github.com/LExpress/symfony1/blob/master/WHATS_NEW.md) file, this include:
All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github.com/FriendsOfSymfony1/symfony1/blob/master/WHATS_NEW.md) file, this include:

- [DIC](https://github.com/LExpress/symfony1/wiki/ServiceContainer)
- [DIC](https://github.com/FriendsOfSymfony1/symfony1/wiki/ServiceContainer)
- Composer support
- PHP 7.2 support
- performance boost
Expand All @@ -29,7 +29,7 @@ The end result of these advantages means there is no need to reinvent the wheel
Symfony was written entirely in PHP 5.
It has been thoroughly tested in various real-world projects, and is actually in use for high-demand e-business websites.
It is compatible with most of the available databases engines, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server.
It runs on *nix and Windows platforms.
It runs on *nix and Windows platforms*.

Requirements
------------
Expand All @@ -43,15 +43,15 @@ See http://symfony.com/legacy/doc/getting-started/1_4/en/03-Symfony-Installation

Option 1: Using [Composer](http://getcomposer.org/doc/00-intro.md) as dependency management:

composer require lexpress/symfony1 "1.5.*"
composer require friendsofsymfony1/symfony1 "1.5.*"
composer install

Note: On windows, if your project is a few directories down from the drive root, composer can throw an error relating to ZipArchive::extractTo(), this can be because pathnames are too long. There currently appears to be no proper solution but a workaround is to move your project to the drive root, run the commands from there, where they will run happily, and then move your project back.

Option 2: Using Git submodules:

git init # your project
git submodule add https://github.com/LExpress/symfony1.git lib/vendor/symfony
git submodule add https://github.com/FriendsOfSymfony1/symfony1.git lib/vendor/symfony
git submodule update --init --recursive

Documentation
Expand Down
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "lexpress/symfony1",
"name": "friendsofsymfony1/symfony1",
"description": "Fork of symfony 1.4 with dic, form enhancements, latest swiftmailer and better performance",
"type": "library",
"license": "MIT",
"require": {
"swiftmailer/swiftmailer": "~5.2"
"php" : ">=5.3.0",
"swiftmailer/swiftmailer": "~5.2 || ^6.0"
},
"require-dev": {
"psr/log": "*"
},
"type": "library",
"autoload": {
"files": ["autoload.php"]
},
"suggest": {
"lexpress/doctrine1": "Doctrine plugin",
"friendsofsymfony1/doctrine1": "Doctrine plugin",
"propel/sf-propel-o-r-m-plugin": "Propel plugin",
"psr/log": "Psr logger"
},
Expand All @@ -22,5 +23,8 @@
"dev-master": "1.5-dev"
}
},
"replace": {
"lexpress/symfony1": "^1.5"
},
"bin": ["data/bin/symfony"]
}
2 changes: 1 addition & 1 deletion lib/autoload/sfCoreAutoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* The current symfony version.
*/
define('SYMFONY_VERSION', '1.5.12-dev');
define('SYMFONY_VERSION', '1.5.14-dev');

/**
* sfCoreAutoload class.
Expand Down
4 changes: 4 additions & 0 deletions lib/config/sfFactoryConfigHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public function execute($configFiles)
unset($parameters['database']);
}

if (isset($config['user']['param']['timeout'])) {
$defaultParameters[] = sprintf("'gc_maxlifetime' => %d,", $config['user']['param']['timeout']);
}

$instances[] = sprintf(" \$class = sfConfig::get('sf_factory_storage', '%s');\n \$this->factories['storage'] = new \$class(array_merge(array(\n%s\n), sfConfig::get('sf_factory_storage_parameters', %s)));", $class, implode("\n", $defaultParameters), var_export($parameters, true));
break;

Expand Down
12 changes: 6 additions & 6 deletions lib/controller/sfWebController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ abstract class sfWebController extends sfController
/**
* Generates an URL from an array of parameters.
*
* @param mixed $parameters An associative array of URL parameters or an internal URI as a string.
* @param boolean $absolute Whether to generate an absolute URL
* @param string|array $parameters An associative array of URL parameters or an internal URI as a string.
* @param boolean $absolute Whether to generate an absolute URL
*
* @return string A URL to a symfony resource
*/
Expand Down Expand Up @@ -168,10 +168,10 @@ public function convertUrlStringToParameters($url)
/**
* Redirects the request to another URL.
*
* @param string $url An associative array of URL parameters or an internal URI as a string
* @param int $delay A delay in seconds before redirecting. This is only needed on
* browsers that do not support HTTP headers
* @param int $statusCode The status code
* @param string|array $url An associative array of URL parameters or an internal URI as a string
* @param int $delay A delay in seconds before redirecting. This is only needed on
* browsers that do not support HTTP headers
* @param int $statusCode The status code
*
* @throws InvalidArgumentException If the url argument is null or an empty string
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/form/sfForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ class sfForm implements ArrayAccess, Iterator, Countable
*/
public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
{
$this->setDefaults($defaults);
$this->options = $options;
$this->localCSRFSecret = $CSRFSecret;

$this->validatorSchema = new sfValidatorSchema();
$this->widgetSchema = new sfWidgetFormSchema();
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

$this->setDefaults($defaults);
$this->setup();
$this->configure();

Expand Down
2 changes: 1 addition & 1 deletion lib/helper/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ function _encodeText($text)

for ($i = 0; $i < strlen($text); $i++)
{
$char = $text{$i};
$char = $text[$i];
$r = mt_rand(0, 100);

# roughly 10% raw, 45% hex, 45% dec
Expand Down
20 changes: 10 additions & 10 deletions lib/i18n/sfDateFormat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
for ($i = 0, $max = count($tokens); $i < $max; $i++)
{
$pattern = $tokens[$i];
if ($pattern{0} == "'" && $pattern{strlen($pattern) - 1} == "'")
if ($pattern[0] == "'" && $pattern[strlen($pattern) - 1] == "'")
{
$tokens[$i] = str_replace('``````', '\'', preg_replace('/(^\')|(\'$)/', '', $pattern));
}
Expand Down Expand Up @@ -266,9 +266,9 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
*/
protected function getFunctionName($token)
{
if (isset($this->tokens[$token{0}]))
if (isset($this->tokens[$token[0]]))
{
return $this->tokens[$token{0}];
return $this->tokens[$token[0]];
}
}

Expand Down Expand Up @@ -397,30 +397,30 @@ protected function getTokens($pattern)

for ($i = 0, $max = strlen($pattern); $i < $max; $i++)
{
if ($char == null || $pattern{$i} == $char || $text)
if ($char == null || $pattern[$i] == $char || $text)
{
$token .= $pattern{$i};
$token .= $pattern[$i];
}
else
{
$tokens[] = str_replace("''", "'", $token);
$token = $pattern{$i};
$token = $pattern[$i];
}

if ($pattern{$i} == "'" && $text == false)
if ($pattern[$i] == "'" && $text == false)
{
$text = true;
}
else if ($text && $pattern{$i} == "'" && $char == "'")
else if ($text && $pattern[$i] == "'" && $char == "'")
{
$text = true;
}
else if ($text && $char != "'" && $pattern{$i} == "'")
else if ($text && $char != "'" && $pattern[$i] == "'")
{
$text = false;
}

$char = $pattern{$i};
$char = $pattern[$i];

}
$tokens[] = $token;
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/sfNumberFormat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function formatInteger($string)
// now for the integer groupings
for ($i = 0; $i < $len; $i++)
{
$char = $string{$len - $i - 1};
$char = $string[$len - $i - 1];

if ($multiGroup && $count == 0)
{
Expand Down
6 changes: 3 additions & 3 deletions lib/i18n/sfNumberFormatInfo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected function parsePattern($pattern)
// to find the groupsize 1.
for ($i = strlen($pattern) - 1; $i >= 0; $i--)
{
if ($pattern{$i} == $digit || $pattern{$i} == $hash)
if ($pattern[$i] == $digit || $pattern[$i] == $hash)
{
$groupSize1 = $i - $groupPos1;
break;
Expand All @@ -335,11 +335,11 @@ protected function parsePattern($pattern)
{
for ($i = strlen($pattern) - 1; $i >= 0; $i--)
{
if ($pattern{$i} == $dot)
if ($pattern[$i] == $dot)
{
break;
}
if ($pattern{$i} == $digit)
if ($pattern[$i] == $digit)
{
$decimalPoints = $i - $decimalPos;
break;
Expand Down
10 changes: 6 additions & 4 deletions lib/mailer/sfMailer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ public function setDeliveryAddress($address)
*/
public function compose($from = null, $to = null, $subject = null, $body = null)
{
return Swift_Message::newInstance()
$msg = new Swift_Message();

return $msg
->setFrom($from)
->setTo($to)
->setSubject($subject)
Expand Down Expand Up @@ -277,12 +279,12 @@ public function sendNextImmediately()
/**
* Sends the given message.
*
* @param Swift_Transport $transport A transport instance
* @param string[] &$failedRecipients An array of failures by-reference
* @param Swift_Mime_Message|Swift_Mime_SimpleMessage $message The message to send.
* @param string[] &$failedRecipients An array of failures by-reference
*
* @return int|false The number of sent emails
*/
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
public function send($message, &$failedRecipients = null)
{
if ($this->force)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/mailer/sfNoMailer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function sendNextImmediately()
return null;
}

public function send(Swift_Mime_Message $message, &$failedRecipients = null)
public function send($message, &$failedRecipients = null)
{
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/request/sfRequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function setMethod($method)
*
* @param string $name The name of the request parameter
*
* @return Boolean true if the request parameter exists, false otherwise
* @return bool true if the request parameter exists, false otherwise
*/
public function offsetExists($name)
{
Expand Down Expand Up @@ -308,7 +308,7 @@ public function setParameter($name, $value)
/**
* Returns the content of the current request.
*
* @return string|Boolean The content or false if none is available
* @return string|false The content or false if none is available
*/
public function getContent()
{
Expand Down
Loading

0 comments on commit 8d9bb43

Please sign in to comment.