PHPSpec Gets New Documentation Looks and Promises More Early 2012

After a quick refactoring of the documentation we are eager to deploy the new version of the documentation. This time refactored from xml into rst so that it can be plain, easy to write on the fly, PR’eable on github, and totally updated with nightly builds. We are glad to present:

You will be ripping the benefits of this new way of doing things for your new PHPSpec projects on 2012.

For the Symfony2 community we are bringing the best of PHPSpec and a new way of doing things on 2012.

Encouragements in all good.

Thanks to Behat (everzet) and Symfony2 community for helping us with the way of doing docs the right way.

Famoust Viral Christmas Post

This post is just an excuse as a coder to speak about the real meaning of Christmas. In its likeness to a Christmas tree this graphic called your attention and mine too. But there is a great God-man Jesus Christ, and only one, that came incarnated to earth to save sinners, yes from their sins. We are them. So this is an appeal to that attitude as I repent and encourage you to do the same and may God open our eyes for us to see the beautiful and divine majesty which is the person of Jesus Christ as our savior, king, and almighty God. He has shown great grace and mercy to us sinners, he has done all well, given us a righteousness not our own and making our way perfect for us. Something we could have never done it.

Learning to work on PRs

Working on a PR today I learned some tricks:

// dbu
git pull --rebase
// lsmith
git remote update
git checkout -b feature/myAssertFix_clean upstream/doctrine_dbal
git merge --no-commit --no-ff feature/myAssertFix
git commit -a -m "commit message explaining your changes"
git push origin feature/myAssertFix_clean
git branch --set-upstream feature/myAssertFix origin/feature/myAssertFix
git push origin feature/myAssertFix_clean

Some explanation of the commands above:

1. makes sure local is aware of all the remote changes
2. creates a new local repository based on the state of the upstream repository
3. moves all the code changes from your old local branch to the new one without committing them
4. commits the changes as one commit in the new local branch
5. pushes your new local branch to your repository on github

Special thanks to dbu and lsmith.

We should also remember our two friends:

git rebase -i SHA1
git merge-base branch1 branch2

Vespolina: The Sandbox Story 3

The sandbox is now integrating background controllers for ProductBundle and also in the front end i have extended ProductBundle to implement pricing and display products and their price. There is a new twig extension on MonetaryBundle which is capable of exchanging automatically the currency of the product’s price. The template is built using the MopaBootstrapBundle too so it is nice looking and clean.

What is next? Well there seems to be need for a paginator, an image manager, then perhaps a cartbundle although some other components need to be there before we move that far. There is a need for categorization too and that is being achieved by TaxonomyBundle. FulfillmentBundle is also on the cooking as I type this so it is certainly something we could be looking at on the next story.

Thanks for reading and enjoy working with vespolina!

Symfony2 on PHP5.3, Python2.7, Node.js, Java, and what not on Shared Hosting

Sometimes one has too many privileges :D
Yes so I needed to use less right on my sharedhosting. For that to work I had to install several things. My former hosting had just recently upgraded to php5.3 and only had available python2.4 because of this. I discovered one can install python2.7 latest easily on user space with some commands here. The need for python2.7 is that there is a node.js script for installation that was written on python2.7 or later and that it requires some json components, etc. That being said python2.7 was out of our way. We then moved to install node.js on user space too. We found some helpful commands here and completed our setup setting things on .bashrc on server.
Then in order to configure less we said:

// parameters.yml
parameters:
  node_path:         "/home/cordoval/bin/node"
  node_paths:        "/home/cordoval/bin/node_modules"
 
// config.yml
assetic:
    filters:
        less:
            node: %node_path%
            node_paths: [%node_paths%]

This setup was for local but the server side was similar. If you want like me a shared hosting that looks like VPS where you can do all sort of things with symfony2 (including deploying with capifony.org), well you can find more information here where I am an affiliate. Hope this is useful to you! I hunted for months for a hosting like this.

Load Behat CommonContexts from Symfony2

To load common contexts for behat on a symfony2 project we basically add to deps and also to autoload as follows:

// to deps
[BehatCommonContexts]
    git=https://github.com/Behat/CommonContexts.git
    target=/behat/CommonContexts
// to autoload.php
'Behat\CommonContext'       => __DIR__.'/../vendor/behat/CommonContexts',

Then do a `bin/vendors install` and then run your behat scenarios!

Updating Behat

I was working on redirect steps and found a command set to upgrade my behat environment.
You can check first what you currently have:

pear list -c behat

And then compare to the following:

sudo pear channel-discover pear.behat.org
pear remote-list -c behat
sudo pear channel-update pear.behat.org
sudo pear upgrade behat/behat
sudo pear upgrade behat/gherkin
sudo pear upgrade behat/mink

Sharing so you don’t have to look or spend time on this and keep to the current bleeding edge.

Vespolina: The Sanbox Story 2

So vespolina ProductBundle gained today a feature section to customize products as we can see:

I guess the next step is to implement or setup nice template and product images to store the to make it more realistic so we can be able to feel the real needs of a component like this. The step after that is the integration with different services within the app so perhaps we will need to make the component even more modular. Refactoring etc coming I supose.

Thanks!

Hours later. I went and worked on getting travis-ci on VespolinaProductBundle and now got it passing at least.

http://travis-ci.org/#!/cordoval/VespolinaProductBundle/builds/319041

Now the store is more functional by itself and things are starting to work more nicely.

Vespolina: The Sandbox Story 1

Today I was able to use EasyExtends to make use of BaseProduct class by generating a directory structure that would help me implement Product class from Vespolina ProductBundle. The task involved bringing up the mongodb properly installed, with settings on cgi as well as on cli php.ini files to understand the why of EasyExtends.

The command you say?

~ php app/console sonata:easy-extends:generate VespolinaProductBundle --dest=src

The sandbox contains all the additions here showing you the sort of directory structure that was created.

A little encouragement for an url http://store.local/app_dev.php/admin/products/ follows :

I worked also on fixing some of the tests due to the break by refactory. Now that i understand a little bit more about vespolina, I can go back and work more on the tests. Focusing currently on ProductBundle and trying to get something working asap.

Git Mnemonic and statement

Recently I read this here and caught two good concepts:

The first one was a mnemonic of how to think in terms of git rebase. Basically a cherry picking macro for moving parts of the history somewhere else into a given first_this base. So we are rebasing then_this with its new base first_this:

git rebase first_this then_this

The second thing was a sentence.

Git references make Git commits Git reachable.

:D This is of course my adaptation of the link above.

Happy coding!