PHP in MN (and other ramblings)
Wednesday, November 3, 2010
Friday, April 16, 2010
Sending Email from CLI task in Symfony 1.2
I kept getting the following error when trying to send an email in a task in Symfony 1.2:
The "default" context does not exist.
Found the solution here:
http://groups.google.com/group/symfony-users/browse_thread/thread/1463d4bf4176d23d
The "default" context does not exist.
Found the solution here:
http://groups.google.com/group/symfony-users/browse_thread/thread/1463d4bf4176d23d
Thursday, April 8, 2010
Symfony Configuration Constants
Located here in the Symfony book.
sf_root_dir # myproject/
sf_apps_dir # apps/
sf_app_dir # frontend/
sf_app_config_dir # config/
sf_app_i18n_dir # i18n/
sf_app_lib_dir # lib/
sf_app_module_dir # modules/
sf_app_template_dir # templates/
sf_cache_dir # cache/
sf_app_base_cache_dir # frontend/
sf_app_cache_dir # prod/
sf_template_cache_dir # templates/
sf_i18n_cache_dir # i18n/
sf_config_cache_dir # config/
sf_test_cache_dir # test/
sf_module_cache_dir # modules/
sf_config_dir # config/
sf_data_dir # data/
sf_doc_dir # doc/
sf_lib_dir # lib/
sf_log_dir # log/
sf_test_dir # test/
sf_plugins_dir # plugins/
sf_web_dir # web/
sf_upload_dir # uploads/
Monday, September 28, 2009
PHP Tidy on MAMP
Needed to install Tidy with MAMP. Some googling found a few solutions, none seemed to work. One caveat is that I am running on Snow Leopard and needed to back out PHP 5.3 to 5.2.
I use the Zend Studio IDE for development. My solution was the following:
- Goto the zend studio included tidy.so, mine was found at /Applications/Zend/Zend Studio - 7.0.0/plugins/org.zend.php.debug.debugger.macosx_5.2.26.v20090514/resources/php5/ext/tidy.so
- I copied the tidy.so to /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20050922/tidy.so
- Open up the php.ini with MAMP, /Applications/MAMP/conf/php5/php.ini
- Add ''extension=tidy.so" to your php.ini file
- Restart Apache
- Tidy should now be available
I use the Zend Studio IDE for development. My solution was the following:
- Goto the zend studio included tidy.so, mine was found at /Applications/Zend/Zend Studio - 7.0.0/plugins/org.zend.php.debug.debugger.macosx_5.2.26.v20090514/resources/php5/ext/tidy.so
- I copied the tidy.so to /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20050922/tidy.so
- Open up the php.ini with MAMP, /Applications/MAMP/conf/php5/php.ini
- Add ''extension=tidy.so" to your php.ini file
- Restart Apache
- Tidy should now be available
Monday, September 21, 2009
Google Embedded Maps
I needed to remove the embedded google map address bubble for a client.
Found the solution here. In short set the param "iwloc=", keeping the parameter, removing the value.
Hoping more links to the article will make the solution easier to find.
Found the solution here. In short set the param "iwloc=", keeping the parameter, removing the value.
Hoping more links to the article will make the solution easier to find.
Tuesday, September 15, 2009
Snow Leopard and Symfony
Last week I performed the upgrade to Snow Leopard. As a Mac newbie (recent convert from Ubuntu), I'm working through the upgrade in Snow Leopard to PHP 5.3. Due to our web hosting environment at this time we can't make the jump to PHP 5.3.
After the upgrade of Snow Leopard, on the command line I started to receive the message:
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
This morning I needed to work through generating a couple of tasks for our application. Trying to fire up a task generated the following error:
Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] No such file or directory]
My solution was I needed to downgrade my local install to PHP 5.2. I'm all for running the latest and greatest PHP, but now is not the time. I work on a Macbook with MAMP installed. Understanding I am approaching this from an Ubuntu perspective and there might be a better way to accomplish the following. Remember attempt at your own risk....
Now running Symfony command line commands I'm using the php executable that ships with MAMP. I hope this helps.
After the upgrade of Snow Leopard, on the command line I started to receive the message:
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
This morning I needed to work through generating a couple of tasks for our application. Trying to fire up a task generated the following error:
Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] No such file or directory]
My solution was I needed to downgrade my local install to PHP 5.2. I'm all for running the latest and greatest PHP, but now is not the time. I work on a Macbook with MAMP installed. Understanding I am approaching this from an Ubuntu perspective and there might be a better way to accomplish the following. Remember attempt at your own risk....
- The php executable is location at /usr/bin
- I copied the php executable to make sure I could jump back to PHP 5.3, I ran "sudo mv php php5.3", renaming php to php5.3 in the directory.
- Then I want to create a symlink to the MAMP php version "sudo ln -s /Applications/MAMP/bin/php5/bin/php php", creating a symlink php which points to the MAMP installed version.
Now running Symfony command line commands I'm using the php executable that ships with MAMP. I hope this helps.
Monday, June 23, 2008
Audible on Ubuntu
As an avid listener to the Twit network podcasts, each show typically is sponsored by Audible. As an Ubuntu user Audible has been a no-go. Audible software is available for Windows and Apple.
In looking for solutions for Ubuntu you will typically find a couple of solutions and/or opinions (some of the comments in this post highlights the following solutions):
Still I wanted to see what I was missing with Audible. I found this post which describes using Wine with Audible and Firefox to create a workable solution.
The added comment to the post makes this a great solution. Based on the comment I created an Audible.sh file containing:
#!/bin/bash
env WINEPREFIX="/home/ja/.wine" wine "Z:\home\ja\Audible\Audible\BIN\AudibleDownloadHelper.exe" $*
Make the above file executable (right click, permissions, check the make this executable then close).
Now log into your Audible account, go through the process of selecting a book, check out, then goto your library. By clicking the download link, Firefox provides the 'Save As' dialog. Select the above shell program in the 'Open With' options. This then fires the download manager and downloads the file. When complete the player launches and your good to go.
The above solution will allow Linux users to try the Audible service.
In looking for solutions for Ubuntu you will typically find a couple of solutions and/or opinions (some of the comments in this post highlights the following solutions):
- Since the files are DRM'd the most common response it the DRM is a show stopper for many Linux users. Many Linux users disregard Audible as easily as Audible diregards requests for a Linux client.
- Use a virtual machine or dual boot in Windows and burn CD's
Still I wanted to see what I was missing with Audible. I found this post which describes using Wine with Audible and Firefox to create a workable solution.
The added comment to the post makes this a great solution. Based on the comment I created an Audible.sh file containing:
#!/bin/bash
env WINEPREFIX="/home/ja/.wine" wine "Z:\home\ja\Audible\Audible\BIN\AudibleDownloadHelper.exe" $*
Make the above file executable (right click, permissions, check the make this executable then close).
Now log into your Audible account, go through the process of selecting a book, check out, then goto your library. By clicking the download link, Firefox provides the 'Save As' dialog. Select the above shell program in the 'Open With' options. This then fires the download manager and downloads the file. When complete the player launches and your good to go.
The above solution will allow Linux users to try the Audible service.
Subscribe to:
Posts (Atom)