My personal php.nanorc syntax highlighting settings for future reference.
I finally got around to an idea I had about 3 years ago when I remembered my Dad’s old medicine chest. Inside there is a classic vial of “Otto’s Cure: The German Remedy”. How fun would a Snake Oil generator be? It turns out, lots of fun, once you load it up with all the historical/hysterical benefits of Snake Oil (and some extra items too).
After collecting a lot of images of actual panaceas, I went digging over at FontSquirrel for some suitable webfonts, and started coding away. At first I thought about using svg for the graphical components. I was quickly dissuaded when I found that browsers still lack support for text wrapping. So, I went back to using background layers which works pretty well, except for in the randomly generated black boxes, where the text is often the wrong color.
It still needs some work. I have some ingredient lists and other ideas percolating. Eventually I plan on making it customizable. Some of the background images are a tad large as well, causing the initial downloads to be slow. Once they are cached on your browser things go faster.
Try it out, and if you have suggestions, let me know in the comments!
I was running into some date validation problems between jQuery datepicker and ZF1. My client wanted one date picker to use a “January 01, 2000” format, and the others a “01/02/2000” format. Seems simple enough.
I decided to look in to HyperDex again and found someone beat me to making a php extension. Emboldened to get it up and running for a pet project, I wanted to see if I could build Hyperdex itself from source on my newest Ubuntu 12.10 VM before tackling the php extension.
$ sudo apt-get install git autoconf automake autoconf-archive \ libtool python-dev python-pyparsing cython libpopt-dev \ libcityhash-dev g++ libgoogle-glog-dev libleveldb-dev \ bison gperf flex python-sphinx
The rest is mostly the same until the end since we don’t need the python bindings.
git clone git://git.hyperdex.org/po6.git git clone git://git.hyperdex.org/e.git git clone git://git.hyperdex.org/busybee.git git clone git://git.hyperdex.org/replicant.git git clone git://git.hyperdex.org/HyperDex.git cd po6 && autoreconf -i; ./configure; make && sudo make install cd ../e && autoreconf -i; ./configure; make && sudo make install cd ../busybee && autoreconf -i; ./configure; make && sudo make install cd ../replicant && autoreconf -i; ./configure; make && sudo make install cd ../HyperDex && autoreconf -i; ./configure; make && sudo make install
When it came time to test HyperDex out, it showed me no love.
$ hyperdex daemon --help hyperdex daemon: error while loading shared libraries: libe.so.0: cannot open shared object file: No such file or directory
Looking back through the build spam I see that I need to add /usr/local/lib to my LD_LIBRARY_PATH. Since I want this in my path on boot, lets add it to our ld.so
$ sudo nano /etc/ld.so.conf.d/e.conf
#export needed for 'e' library for HyperDex execution /usr/local/lib
Save it then reload the ldconfig:
Now, HyperDex starts up swimmingly:
$ hyperdex daemon --help
Next step: building php-hyperdex!
I whipped up a simple ZF1 resource plugin for AngularJs called AngularZF1 and dropped it onto github. We have started using Angular at work and I thought, why not mimic how the ZendX_JQuery plugin works. Right now it doesn’t add much beyond just adding the script tag to your <head>. Enjoy, all you who are still on ZF1!
I have been using Zend Framework 1.x at work for some time now. I appreciate the large number of components, many of which my system uses on a daily basis. Yes, it is a large library, but we have a very large application that probably does too many things.
ZF2 is coming out soon and it seems quite different from 1.x. I downloaded the betas and skeleton app, and looked at the well written tutorials, but I am still having a difficult time wrapping my mind around it. So I have decided to see if the grass is greener elsewhere. There are plenty of PHP frameworks out there to choose from, but I have one particular requirement: Oracle support. I work in a somewhat regulated space and the big vendors are preferred over the Open Source databases. And not just any Oracle support, we need to use the oci8 driver.
Most of the new frameworks prefer to use PDO for their database abstraction layer. This is fine for most people who are using MySQL or PostgreSQL. This is not great for us Oracle users. Although there is a pdo_oci extension, it is very buggy. We have to use the oci8 driver instead. And no, I cannot just switch to MySQL.
So, which of the frameworks support oci8? *feel free to correct me in your comments
|Symfony2||Doctrine||Y||According to the Doctrine 2.0x docs oci8 is supported.|
|Lithium||Internal||N||MySQL, SQLite3, CouchDB, MongoDB|
|Aura||Wrappers around PDO||N||MySQL, PostgreSQL, SQLite3, SQLServer|
|DooPHP||Wrappers around PDO||N|
|Yii||Internal||?||Found a note from 2009 saying it worked|
|Slim||–||No DB support in framework|
When I was researching frameworks 3 years ago I looked at Doctrine as a DBAL and even contributed a few patches to the project, but eventually got frustrated enough to bail on it and go with ZF’s vanilla approach. Should I try out Doctrine again or use something like Slim and keeping all my existing ZF1 database code?
About once every other week I try and spend some time at work thinking ahead. With PHP 5.4 on the horizon I began to wonder how our current Zend Framework application would fare if the SysAdmins decided to jump straight from PHP 5.2 to PHP 5.4. Would the site work at all? One way to find out. Lets install PHP 5.4RC8 and Apache 2.4.
I started by creating a fresh Ubuntu 11.10 VM. In complete disclosure, I removed some of the unneeded packages like LibreOffice first. I then cloned it so I would always have a base to work off of in the future.
Back at php|tek11 Rob Allen gave a talk on optimizing Zend Framework. During the tutorial he pointed out how you could cache your application config files so that they are not loaded and parsed at every request. This got me thinking about something that had been bugging me for a long time. What is the best format for your config file?
Back before ZF 1.0 there was a fair bit of confusion on how to do everything “right”, especially setting up a “modular” build. One of the first good examples out there was made by Dasprid, and he used an xml based application config. We are talking back in early 2007 when it was the wild west for ZF. Since then, I only see people using ini files.
Well, here it finally is, the official synthetic Zend_Config benchmark shootout.
After some frustration I learned from a forum post that the default password time limit for Oracle 11g is 120 days. Once you get close to that you will go into a grace period, where PHP’s oci connection dies on you with no explanation. You will notice a message like this in you apache log:
- [notice] child pid NNNN exit signal Bus error (10) in the apache log.
Step 1: Change your password, or rather lets just keep it as it is…
- ALTER USER myname IDENTIFIED BY mypassword
Step 2: Make us not have to do this again:
- ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Hope this helps someone.