Get Ready for Symfony2 Hacking Day @ SymfonyCon Series: Part I

In preparation for the hacking day I am doing a blog series. First because we are dealing with issues we need to get our environment ready. I assume you have git installed, hub installed also since it is amazing to do quick PRs and the basic stuff, like composer system wide installed and your latest version of php5.5 installed among other things. Make sure you fork symfony/symfony also on your github account and upload your public ssh key.

Create two folders at least:

mkdir symfony-standard
cd symfony-standard
git clone git://github.com/symfony/symfony-standard.git .
composer install --prefer-source
cd vendor/symfony/symfony
composer install --prefer-source
git remote add cordoval git@github.com:cordoval/symfony.git
git checkout master
git remote update
git pull -u origin master
git checkout -b my-first-contribution-to-symfony-community
git push -u cordoval my-first-contribution-to-symfony-community
cd ../../../../
cp -rf symfony-standard symfony-standard2

So far we have two SE’s with symfony under vendors.

Even though we have travis let’s get our local phpunit right:

composer global require 'phpunit/phpunit=3.7.*'
...
pico ~/.zshrc
...
export PATH="$HOME/.composer/vendor/bin:$PATH"
...
which phpunit
phpunit --version
PHPUnit 3.7.28 by Sebastian Bergmann.
...
brew install parallel
touch ~/.parallel/local
pico ~/.parallel/local
...
source ~/.bash_profile

Parallel is a tool that will run tests faster than in the serial way.
After this you have all configured to run phpunit in parallel:

ls -d src/Symfony/*/* | parallel -J local --gnu --keep-order 'echo "Running {} tests"; phpunit --exclude-group tty,benchmark {};'

If some apc related tests are failing and you are on php5.5 then you need to clean your apc.ini configuration, commenting everything but the new apcu extension:

[apcu]
extension="/usr/local/Cellar/php55-apcu/4.0.2/apcu.so"
;apc.enabled=1
;apc.shm_size=64M
;apc.ttl=7200
;apc.mmap_file_mask=/tmp/apc.XXXXXX
;apc.enable_cli=1

If you have weird errors or tests are slow please be sure to comment the lines of your xdebug extension as above for apc but for xdebug.ini.

Notice if you run it serial it should also work, but why waiting for it to finish?

A trick to run only your tests is to add an annotation on the upper part of the class like:

/**
 * @group cordoval
 */

And then run only it by doing:

phpunit --group=cordoval

Ok so now you have vendor/symfony/symfony repo ready synced with master ready to contribute on the bleeding edge.
If you need to do work on another branch then you can easily just check it out and branch off of it. You have two directories so you can run tests on one and or do parallel work trying things so not just parallel tests.
By all mean try to avoid your specific ways of setting things. This flow here works and works well and it is what you are expected to have to contribute. You can go your own way as long as you know what you are doing, but it is best not to cause any delay on that day when we can avoid it.

So far so good, we want everybody to be ready for the hacking day in Warsaw.

Symfony2 FOSS: How to Have More Badges Than Stof /o/

We all know our community member @stof, he rocks. However contributing to the Symfony ecosystem is not that hard.

Check this out mom! And I will have 24 badges, 1 more than @stof has very soon when my PR to swiftmailer is merged 🙂
And when @fabpot fixes a problem with registering contributions for doctrine repo then I will have 25. Exciting? Yeah!
Of course it does not mean that my contributions are more than the ones @stof has, but it does mean that you are active in the community, willing to help, and have true passion for what you do. In reality badges are not that important, however within the community they should at least represent a token that you are active. Whether is badges for conferences or for contributions it means you are there for the community, you benefit from it and you help as well.

Screenshot 2013-11-26 05.48.44

If you are liking this blog please support me on my way to Warsaw on the awards vote cordoval for blogger http://awards.symfony.com/community. I need all support to get to Warsaw!
Thanks!

Encouragements in all good!

undeservedly still going and with passion!

your friend,

@cordoval

Tuesday’s Cordoval Free Symfony2 Support Over IRC – Symfony2 Awards Series for Blogger

This week I have decided to hang out in IRC like the old times, trying to help some folks on IRC on #symfony.
If you read this blog please tell your friends and fellows to subscribe to it and most importantly vote for cordoval
for blogger at http://awards.symfony.com/community.

Then jump on IRC #symfony for good chat and camaraderie!

Screenshot 2013-11-19 12.10.38
Hacktime!

Symfony on Google App Engine Troubleshooting Series: Part I

Warning: Only for apps that are seriously about scaling. Stop reading if you think you can plug any ugly Symfony code without changing your mindset :P.

I have taken a peek at GAE and its APIs and how restrictive they have made the sandboxing environment for PHP that they made it interesting. I think they have the right to do things like that since they want apps to scale only. I mean don’t take me wrong but after reading their documentation, things like disabled functions, ready-only file system, maximum times of execution, quotas, limitations and ignoring functions, changing the default behavior of PHP sensitive defaults, etc, it seems PHP is not like we used to know it. Some people have called it castrated PHP :P. The other downside is that some services that are currently existing in java or other runtimes do not yet appear available in PHP so we are forced to not use bigdata or other valuable services and are forced to pay for their SQL implementation which probably uses MySQL.

If your code is PHP like the helloworld then there is no problems and you end up testing it in the local SDK sandboxed environment and deploying it like a pro with their slow and pythonic cli uploader tools:

~ ./deploy                                    Luiss-MacBook-Pro-2 [12:40:44]
12:40 PM Application: devfest-cordoval; version: 1
12:40 PM Host: appengine.google.com
12:40 PM
Starting update of app: devfest-cordoval, version: 1
12:40 PM Getting current resource limits.
Your browser has been opened to visit:
 
    https://accounts.google.com/o/oauth2/auth...
 
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
 
  --noauth_local_webserver
 
Authentication successful.
12:41 PM Scanning files on local disk.
12:41 PM Cloning 1 static file.
12:41 PM Cloning 4 application files.
12:41 PM Uploading 2 files and blobs.
12:41 PM Uploaded 2 files and blobs
12:41 PM Compilation starting.
12:41 PM Compilation completed.
12:41 PM Starting deployment.
12:41 PM Checking if deployment succeeded.
12:41 PM Deployment successful.
12:41 PM Checking if updated app version is serving.
12:41 PM Completed update of app: devfest-cordoval, version: 1

Many frameworks even laravel or silex had been successfully deployed in GAE without problems. Yeah I am not even speaking of wordpress support which I think is totally flawed since some of the plugins assume write filesystem and probably will break things when plugged. I also don’t mention drupal :P, although friends with drupalers, I am sorry I can’t do it. Laravel needs an ugly patch and Silex, well Silex is easy just because probably does not cache or uses the filesystem for optimizations in templates, annotations, or doctrine generation, like Symfony does. Or in any case these generations are not absolute path dependent and are done offline.

In addition to this, it handicaps us who use fabric or capifony, or those who like to run assets on production or do some setups. Bye bye composer on the server by the way. I believe, unless I am wrong, that all files have to be committed since day one, even vendors. And I am not talking about git commits, I am talking about their pythonic deploying tool basically scanning our whole directory for migrating changes on upload.

All in all we are identifying the roadblocks for all of this, namely overloading some forbidden functions via an easy composer component and also PR’eing for FrameworkBundle to support caching directly on Memcache so to break absolute path dependencies on templates and other cache files.

Here is the PR https://github.com/symfony/symfony/pull/9442

Also if I did not mention enough, be careful in plugging too many composer dependencies as you may hit the quota of number of files! Oh and the dev environment is failing uglily with a php bug on their SDK on some schema parsing problem. In `production` `dev` if that exists! thanks for forcing us to do this Google! it is working at least:

Screenshot 2013-11-11 10.32.10

More news soon!

Please support me via buying the Symfony2 Ecommerce book http://pilotci.com

Lord willing, I am attending Warsaw SymfonyCon and also SunshinePHP and really ask you to help me raise funds to continue getting involved in the community.

Encouragements in all good!