Skip to main content

Posts

Zend_Gdata and OAuth

I successfully retrieved token key / secret after applying Google Hybrid Protocol (OpenID + OAuth). Then I'm looking into Zend documentation here: http://framework.zend.com/manual/en/zend.gdata.html ... and into Calendar API example here: http://code.google.com/googleapps/marketplace/tutorial_php.html#Integrate-OAuth They mention about AuthSub method supported by Zend_Gdata library (especially in Zend_Gdata_HttpClient class form what I can see). But I cannot figure out how to use my key/secret tokens retrieved by Hybrid method in order to access calendar feeds. Example mentioned above uses AuthSub authentication, while Google recommends to switch to OAuth if possible and where possible, instead of using AuthSub. Any ideas? Thanks.

Case-inconsistency of PHP file paths on Mac / MAMP?

I'm developing a PHP program on MAMP, and just realized the following screwy behavior: echo "<br/>PATH = ".dirname(__FILE__); include 'include.php'; include.php: <?php echo "<br/>PATH = ".dirname(__FILE__); ?> Result: PATH = /users/me/stuff/mamp_server/my_site (All lower case) PATH = /Users/me/Stuff/mamp_server/my_site (Mixed case) What is causing this inconsistent behavior, and how can I protect against it? (Note that I can't just convert everything to lowercase, because the application is destined for a Linux server, where file paths are case sensitive. ) Update: This problem exists for __FILE__ and __DIR__ . It looks like this might be a real problem with no work around... going to file a bug report unless I hear otherwise. Bug report: https://bugs.php.net/bug.php?id=60017 Update: And another note: If you're doing an absolute path include(...) on Mac, it requires the mixed case version.

Why does an infinitely recursive function in PHP cause a segfault?

A hypothetical question for you all to chew on... I recently answered another question on SO where a PHP script was segfaulting, and it reminded me of something I have always wondered, so let's see if anyone can shed any light on it. Consider the following: <?php function segfault ($i = 1) { echo "$i\n"; segfault($i + 1); } segfault(); ?> Obviously, this (useless) function loops infinitely. And eventually, will run out of memory because each call to the function executes before the previous one has finished. Sort of like a fork bomb without the forking. But... eventually, on POSIX platforms, the script will die with SIGSEGV (it also dies on Windows, but more gracefully - so far as my extremely limited low-level debugging skills can tell). The number of loops varies depending on the system configuration (memory allocated to PHP, 32bit/64bit, etc etc) and the OS but my real question is - why does it happen with a segfault? Is this simply how

Is en_UK an illegal locale?

So far I had always used 'en_UK' for British English. Today I got an error when using it with Zend Framework because the locale is not included in the long list of recognized locales. Here's just a short extract of that list: 'ee_GH' => true, 'ee_TG' => true, 'ee' => true, 'el_CY' => true, 'el_GR' => true, 'el' => true, 'en_AS' => true, 'en_AU' => true, 'en_BE' => true, 'en_BW' => true, 'en_BZ' => true, 'en_CA' => true, 'en_GB' => true, 'en_GU' => true, 'en_HK' => true, 'en_IE' => true, 'en_IN' => true, 'en_JM' => true, 'en_MH' => true, 'en_MP' => true, 'en_MT' => true, 'en_NA' => true, 'en_NZ' => true, 'en_PH' => true, 'en_PK' => true, 'en_SG' => true, 'en_TT' => true, &#