View phpunit
1 2 3 4 5 6 7 8 9 10
vagrant@ubuntu:~/code/Proton$ vendor/bin/phpunit
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.
 
Configuration read from /home/vagrant/code/Proton/phpunit.xml
 
Deprecated configuration setting "strict" used
 
...........
 
Time: 2.46 seconds, Memory: 7.25Mb
View index.php
1 2 3 4 5 6 7 8 9 10
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
require 'vendor/autoload.php';
$app = new Proton\Application();
$app->get('/user/{username}', function (Request $request, Response $response, $args) {
View index.php
1 2 3 4 5 6 7 8 9 10
<?php
use League\Container\Container;
use League\Route\RouteCollection;
use League\Route\Strategy\MethodArgumentStrategy;
use Symfony\Component\HttpFoundation\Request;
require 'vendor/autoload.php';
$container = new Container();
View call-this-2.js
1 2 3 4 5 6 7 8 9 10
function helper(arg1, callback, context) {
// do something…
callback.call(context, data);
}
 
obj = {
name: 'John Doe',
bar: function() {
helper('foo', function(data) {
console.log(this);
View call-this.js
1 2 3 4 5 6 7 8 9 10
function helper(arg1, callback) {
// do something…
callback(data);
}
 
obj = {
name: 'John Doe',
bar: function() {
helper('foo', function(data) {
console.log(this);
View htaccess
1 2 3 4 5 6 7
RewriteCond %{REQUEST_URI} =~ "/public.(pictures.(products|banners)|images.default\-).*/"
RewriteRule ^ - [E=cache_control:1,L]
Header unset Last-Modified env=cache_control
Header unset ETag env=cache_control
FileETag None env=cache_control
Header set cache-control "public, max-age=26426400" env=cache_control
ExpiresDefault "access plus 10 months" env=cache_control
View name-route-segments.php
1 2 3 4 5 6 7 8 9
<?php
use League\Container\Container;
use League\Route\RouteCollection;
use League\Route\Strategy\MethodArgumentStrategy;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
require 'vendor/autoload.php';
View travis.yml
1 2 3
- before_script:
- travis_retry composer self-update
- travis_retry composer install --ignore-platform-reqs --no-interaction --prefer-source
View ignore-platform-requirements.md

Composer update without PHP environment checking

Hi there, welcome for another blog post on Composer.

Since version 1.0.0-alpha9 composer has a new flag for the install and update commands. I'm talking about the --ignore-platform-reqs flag. From the changelog:

Added --ignore-platform-reqs to install/update commands to install even if you are missing a php extension or have an invalid php version.
View .gitattributes
1 2 3 4 5 6 7 8 9
/tests export-ignore
/stubs export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/changelog.md export-ignore
/readme.md export-ignore
Something went wrong with that request. Please try again.