Author Archive

Store Symfony Sessions in Database with Doctrine

By marc • May 4th, 2008

Here is how you can store your sessions in a central database with Doctrine in symfony. If you are trying to do this with Propel, the check out my follow up post: Store Symfony Sessions in Database with Propel
Step1 - Create your sessions table

 

CREATE TABLE IF NOT EXISTS `sessions` (

`sess_id` varchar(64) NOT NULL,

`sess_data` text NOT […]



Set a Static Ip Address in Ubuntu from Command Line

By marc • May 1st, 2008

A common task that you will need to do on a Ubuntu/Debian server is set a static IP address. By default the ip address is set through DHCP, so you will need to change that.
First edit the /etc/network/interfaces file:

 

sudo nano /etc/network/interfaces

Change your file so that it looks similar to the following, but replacing the specific […]



How to Use Symfony and Cron

By marc • Apr 30th, 2008

At some point you may need to have your symfony do some sort of process through the command line and trigger it through a cron job. I’ll will walk you through the steps in order to get it working properly.



Return MySQL Results from an “IN” Query in the Correct Order

By marc • Apr 29th, 2008

The scenario:
You have a list of ids in a particular order that you want to search for in a MySQL table. Perhaps the ids were returned in this order from a search index or something else. Whatever the case is, now you want to get the results in the same order as the ids that […]



Check if Linux Process is Still Alive from PHP

By marc • Apr 28th, 2008

At some point you may need to figure out if a system process is still running from within a PHP application. The secret is by running a system command from PHP that returns the information for a specific process id (PID).
The normal shell command would be something like this:

 

$ ps 4946

Which would return something like […]



Custom File Logging in Symfony for Cron Jobs or More

By marc • Apr 28th, 2008

Have you ever needed to log your own information to a specific log file in symfony? Sure, the built in logging is very useful, but sometimes you just need to log some specific information to a file of your choice and don’t need a full stack trace. Today I needed to be able to do […]



Custom Tasks in Symfony (1.0)

By marc • Apr 25th, 2008

As users of symfony know, there are many useful command line tasks that are essential to developing your symfony projects (symfony cc, symfony propel-build-model, etc). Luckily symfony is set up so that you can easily create your own tasks to do specific things that you may need. The only problem that some people may have […]



Using Multiple Databases in Symfony with Propel

By marc • Apr 22nd, 2008

There comes a time in your symfony development career when you will need to connect to multiple databases from within one application. At first it may not be obvious how to configure symfony correctly to handle a couple different databases or database servers.



Useful MySQL Command Line Commands

By marc • Apr 18th, 2008

From time to time I need to perform some MySQL tasks that are only possible from the command line. Considering that I don’t have to use them everyday, I tend to forget the exact syntax for them. So then I am forced to take the time to search through google to find examples for the […]



Yahoo Site Explorer, Google Site Explorer, and MSN Webmaster Center

By marc • Apr 17th, 2008

Today my SEO/SEM buddy turned me on to some of the webmaster tools being offered by Google, Yahoo, and MSN. He suggested that setting this site up in them and submitting the sitemaps may expedite the time it takes for my site to start getting crawled/indexed. As far as I can tell, all three of […]