Skip to content

Commit 15a46f9

Browse files
committed
Merge remote-tracking branch 'origin/dev' into sensiolabs-insight-deletionaction-fixes
Had to completely remove the composer.lock file and run composer update
2 parents 9b467bb + 96a5e19 commit 15a46f9

20 files changed

+537
-355
lines changed

.travis.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,11 @@ before_install:
77
- sudo apt-get update
88

99
before_script:
10-
- cd Symfony
11-
- cp app/config/parameters.yml.dist app/config/parameters.yml
12-
- composer install
13-
- sudo apt-get install -y unzip
14-
- sudo mkdir /opt/codebender
15-
- wget https://github.com/codebendercc/arduino-core-files/archive/master.zip
16-
- unzip master.zip
17-
- sudo cp -r arduino-core-files-master /opt/codebender/codebender-arduino-core-files
18-
- rm master.zip
19-
- wget https://github.com/codebendercc/external_cores/archive/master.zip
20-
- unzip master.zip
21-
- sudo cp -r external_cores-master /opt/codebender/external-core-files
22-
10+
- scripts/install.sh
11+
- cd /opt/codebender/compiler/Symfony
2312
script:
2413
- mkdir -p build/logs
25-
- phpunit -c app/ --coverage-clover build/logs/clover.xml
14+
- ../scripts/run_tests.sh
2615

2716
after_script:
2817
- php composer.phar update satooshi/php-coveralls --dev

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,52 @@
11
This repository is part of the [codebender.cc](http://www.codebender.cc) maker and artist web platform.
22

3-
[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler) [![Coverage Status](https://img.shields.io/coveralls/codebendercc/compiler.svg)](https://coveralls.io/r/codebendercc/compiler?branch=master)
3+
[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler)
4+
[![Coverage Status](https://coveralls.io/repos/codebendercc/compiler/badge.svg?branch=master)](https://coveralls.io/r/codebendercc/compiler?branch=master)
45

56
## And what's that?
67

7-
codebender comes to fill the need for reliable and easy to use tools for makers.
8-
A need that from our own experience could not be totally fulfilled by any of the existing solutions. Things like installing libraries, updating the software or installing the IDE can be quite a painful process.
8+
codebender fills the need for reliable, easy to use tools for makers, a need that couldn't be completely fulfilled by any existing solution according to our experience.
99

10-
In addition to the above, the limited features provided (e.g. insufficient highlighting, indentation and autocompletion) got us starting building codebender, a completely web-based IDE, that requires virtually no installation and offers a great code editor. It also stores your sketches on the cloud.
10+
Things like installing libraries or the IDE and updating software sometimes were (and still are) quite a painful process. But in addition to the above, the limited features provided (e.g. insufficient highlighting, indentation and autocompletion) got us to start codebender, a completely web-based IDE that requires virtually no installation and offers a great code editor. Plus it stores your sketches on the cloud. Yeah!
1111

12-
That way, you can still access your sketches safely even if your laptop is stolen or your hard drive fails! codebender also takes care of compilation, giving you extremely descriptive warnings on terrible code. On top of that, when you are done, you can upload your code to your Arduino straight from the browser.
12+
With your code on the cloud, you can access your sketches safely even if your laptop is stolen or your hard drive fails! codebender also compiles your code giving you extremely descriptive error descriptions on terrible code. There's even more, you can upload your code to your Arduino straight from the browser.
1313

1414
## How does the compiler come into the picture?
1515

16-
The compiler repository includes all the necessary files needed to run the compiler as a service. It receives the code as input and outputs the errors in the code, or the compiled output if the compilation was successful. We provide a really easy to use interface to allow us to send the code to the compiler easily.
16+
The compiler repository includes all the necessary files needed to run the compiler as a service. It receives the code as input and outputs the compiled output if the compilation was successful or the errors present in the code. We provide an easy interface to send the code to the compiler.
1717

1818
Here's a list of open source projects we use
1919
* Clang
2020
* gcc-avr
2121
* avr binutils (avrsize)
2222

23-
For development, we've used it on a variety of Linux and Mac OS X machines.
23+
For development we've run it on a variety of Linux and Mac OS X machines.
2424

25-
For production, we are using Ubuntu Server 12.04, and we know it works perfectly with that, so we suggest using that as well.
25+
For production we are using Ubuntu Server 12.04. We know the compiler works perfectly on it, so we suggest you using it as well.
26+
27+
## How to install
28+
29+
Check out the code in any directory you wish
30+
31+
`git clone https://github.com/codebendercc/compiler.git`
32+
33+
Then cd in the created directory (if you run the command as is above, it would be named `compiler`) and run
34+
35+
`scripts/install.sh`
36+
37+
(don't cd into scripts directory and run install.sh from there, it won't work)
38+
39+
If you now visit `http://localhost/status` you'll see a JSON response telling you everything's ok:
40+
`{"success":true,"status":"OK"}`
41+
42+
## What's next?
43+
44+
Visit the [wiki](https://github.com/codebendercc/compiler/wiki) for more information.
45+
46+
## How can someone contribute?
47+
48+
Contribution is always welcome whether it is by creating an issue for a bug or suggestion you can't fix yourself or a pull request for something you can.
49+
50+
If you write new code or edit old code please don't forget to add/update relative unit tests that come with it. It is always a good idea to run tests localy to make sure nothing breaks before you create a pull request.
51+
52+
We expect new code to be [PSR-2](http://www.php-fig.org/psr/psr-2/) but we know we carry legacy code with different coding styles. You're welcome to fix that.

Symfony/app/SymfonyRequirements.php

Lines changed: 50 additions & 31 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', '>='),
@@ -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 =

0 commit comments

Comments
 (0)