Skip to content

Commit 80a119d

Browse files
committed
Merge pull request #8 from codebendercc/php_5.5.9-ubuntu_trusty
PHP 5.5.9, Ubuntu 14.04, Symfony 2.3.33, PHPUnit 4.8.13, install scripts
2 parents 89bfbd1 + 82e703e commit 80a119d

15 files changed

+1264
-741
lines changed

.travis.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
language: php
22
php:
3-
# - 5.5
4-
# - 5.4
5-
- 5.3
6-
7-
#before_install:
8-
# - sudo apt-get update
3+
- 5.5.9
94

105
env:
116
global:
127
# eratosthenes library management system url (encrypted)
138
- secure: "ZYn4o229W7hq1uzj/Tii9h/a3iJlr9Li4TBaTNFXm6JY2H49lA57L1DIFUaTleTUx2Ibs2+kUrV3NFQ9Mo/ThO67gV5Q1XEMjxgFzAKt4AuWJ5TNbHxs3GBTjYc+129QCKSd0WdzrRDqEC2nZ9GjI+j7lS39DrjAMGg4wEp9b0U="
149
# codebender compiler url (encrypted)
15-
- secure: "XRsqGDqdu5uhdj2lF4SZ6qv6Y0PdcRPcvE13XvVGnIYRZaITelP3eJNSvLPO+Q5k4mBmKCz8t+ws/OVRRwSAXYaKe0Z8ZXgEcNyo1nEwGekC35mTuG1FFfB/pbuBp5/OWjw6bgz2tEHhKuFIbHytpT9zJQYy+D07rzOYeUsZjOY="
10+
- secure: "hzL7akuLe+HCsi6G7Z1UliNR8ekzGlWv1cS/iweeXnxjISYU5ALrvpeOHNcfiC/xTZJsJXq+KYwZpVa/Ps7AVwfLgnUkQGD8OA7AmXbqgIv/xao24u4NNd+xAEB9LSr/eWexQhRJniE+JHgZ53yrAefJBIwmeD0YhvU1IdrzMdE="
1611

1712
before_script:
18-
- sudo chmod +x scripts/install.sh
19-
- scripts/install.sh
13+
- sudo chmod +x scripts/travis_install.sh
14+
- scripts/travis_install.sh
2015
- cd /opt/codebender/builder/Symfony
2116
- sudo chmod -R 777 app/cache app/logs
22-
- echo 'error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
17+
- echo 'error_reporting = E_ALL' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
2318
- cd /opt/codebender/builder
24-
- sudo chmod +x scripts/apache_install.sh
25-
- scripts/apache_install.sh
19+
- sudo chmod +x scripts/travis_apache_install.sh
20+
- scripts/travis_apache_install.sh
2621
- cd /opt/codebender/builder/Symfony
2722

2823
script:
@@ -37,6 +32,3 @@ after_script:
3732

3833
notifications:
3934
irc: "chat.freenode.net#codebender.cc"
40-
# email:
41-
# recipients:
42-

Symfony/app/SymfonyRequirements.php

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getTestMessage()
7777
}
7878

7979
/**
80-
* Returns the help text for resolving the problem
80+
* Returns the help text for resolving the problem.
8181
*
8282
* @return string The help text
8383
*/
@@ -119,14 +119,14 @@ class PhpIniRequirement extends Requirement
119119
*
120120
* @param string $cfgName The configuration name used for ini_get()
121121
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
122-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
123-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
124-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
125-
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
126-
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
127-
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
128-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
129-
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
122+
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
123+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
124+
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
125+
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
126+
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
127+
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
128+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
129+
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
130130
*/
131131
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
132132
{
@@ -221,13 +221,13 @@ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText
221221
*
222222
* @param string $cfgName The configuration name used for ini_get()
223223
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
224-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
226-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
227-
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
228-
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
229-
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
230-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
224+
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
225+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
226+
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
227+
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
228+
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
229+
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
230+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
231231
*/
232232
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
233233
{
@@ -239,13 +239,13 @@ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence =
239239
*
240240
* @param string $cfgName The configuration name used for ini_get()
241241
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
242-
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243-
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
244-
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
245-
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
246-
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
247-
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
248-
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
242+
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
243+
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
244+
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
245+
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
246+
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
247+
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
248+
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
249249
*/
250250
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
251251
{
@@ -530,11 +530,22 @@ function_exists('simplexml_import_dom'),
530530

531531
/* optional recommendations follow */
532532

533-
$this->addRecommendation(
534-
file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
535-
'Requirements file should be up-to-date',
536-
'Your requirements file is outdated. Run composer install and re-check your configuration.'
537-
);
533+
if (file_exists(__DIR__.'/../vendor/composer')) {
534+
require_once __DIR__.'/../vendor/autoload.php';
535+
536+
try {
537+
$r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
538+
539+
$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
540+
} catch (\ReflectionException $e) {
541+
$contents = '';
542+
}
543+
$this->addRecommendation(
544+
file_get_contents(__FILE__) === $contents,
545+
'Requirements file should be up-to-date',
546+
'Your requirements file is outdated. Run composer install and re-check your configuration.'
547+
);
548+
}
538549

539550
$this->addRecommendation(
540551
version_compare($installedPhpVersion, '5.3.4', '>='),
@@ -578,8 +589,8 @@ function_exists('simplexml_import_dom'),
578589

579590
$this->addRecommendation(
580591
class_exists('DomDocument'),
581-
'PHP-XML module should be installed',
582-
'Install and enable the <strong>PHP-XML</strong> module.'
592+
'PHP-DOM and PHP-XML modules should be installed',
593+
'Install and enable the <strong>PHP-DOM</strong> and the <strong>PHP-XML</strong> modules.'
583594
);
584595

585596
$this->addRecommendation(
@@ -614,15 +625,15 @@ class_exists('Locale'),
614625
'Install and enable the <strong>intl</strong> extension (used for validators).'
615626
);
616627

617-
if (class_exists('Collator')) {
628+
if (extension_loaded('intl')) {
629+
// in some WAMP server installations, new Collator() returns null
618630
$this->addRecommendation(
619631
null !== new Collator('fr_FR'),
620632
'intl extension should be correctly configured',
621633
'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
622634
);
623-
}
624635

625-
if (class_exists('Locale')) {
636+
// check for compatible ICU versions (only done when you have the intl extension)
626637
if (defined('INTL_ICU_VERSION')) {
627638
$version = INTL_ICU_VERSION;
628639
} else {
@@ -641,6 +652,14 @@ class_exists('Locale'),
641652
'intl ICU version should be at least 4+',
642653
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
643654
);
655+
656+
$this->addPhpIniRecommendation(
657+
'intl.error_level',
658+
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
659+
true,
660+
'intl.error_level should be 0 in php.ini',
661+
'Set "<strong>intl.error_level</strong>" to "<strong>0</strong>" in php.ini<a href="#phpini">*</a> to inhibit the messages when an error occurs in ICU functions.'
662+
);
644663
}
645664

646665
$accelerator =

Symfony/composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
"incenteev/composer-parameter-handler": "~2.0"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "3.7.*",
24+
"phpunit/phpunit": "4.8.*",
2525
"satooshi/php-coveralls": "dev-master",
2626
"sebastian/phpcpd": "*",
27-
"phpmd/phpmd" : "2.0.*"
27+
"phpmd/phpmd" : "2.0.*",
28+
"phpunit/php-token-stream": "~1.3",
29+
"phpunit/php-code-coverage": "~2.1",
30+
"phpunit/phpunit-mock-objects": "~2.3"
2831
},
2932
"scripts": {
3033
"post-install-cmd": [

0 commit comments

Comments
 (0)