Running console commands using Process component in Symfony 2

Hi All,

Today I am going to talk about process component in Symfony 2. Process component is a useful library which can be used to run console commands as it is. The main driving factor to discuss this topic is, recently I had an issue in running multiple console commands in Symfony 2. I tried using doRun method in Application. It worked for commands like doctrine:mapping:import and doctrine:generate:entities but not for doctrine:generate:form.  Even it worked for doctrine:generate:entities, I didn’t managed to generate a single entity in a bundle. I had to generate all entities for the whole bundle. In other words “php app/console doctrine:generate:entities ACMETestBundle:Person –no-backup” did not worked. So I had a really difficult time with this until someone suggested me about the process component when I posted this question in StackOverflow.. To be honest, I didn’t had the opportunity to explore process component thoroughly before that. But I found that process component is a really cool library which we can use to run console commands in Symfony 2. I thought it might be useful for someone who is trying to run console command using the application. If you have struggled running console commands using Application’s, run or doRun methods, this post is especially for you.

Continue reading

Share

How to install ApiGen in NetBeans 8.0 using PEAR

Hi All,

Today I am going to show you how to correctly install ApiGen in NetBeans 8 IDE using PEAR. Well, ApiGen is a handy, powerful and customizable code documenting tool which will help you to generate code documentation for your source code. So let’s begin installing ApiGen in to NetBeans.

  • First, you need have PHP installed in your machine and environmental variables set for the installed PHP. (If you need any help in installing PHP or setting environmental variable, just drop me a comment below, I will help 🙂 )
  • Open up your command prompt in Administration mode (right click and run as administrator)  and type this command to enable PEAR auto discovery mode. Auto discovery mode will help you to automate dependency installation. Because ApiGen requires tools such as Texy, Nette and so on. The good thing is when the auto discovery mode is on, it will install all these dependent tools automatically for you.
    pear config-set auto_discover 1

    apigen Continue reading

Share