SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts in Uncategorized

I recently joined Amazon’s S3 simple file storage service to use for my server backups.
I’m very happy with it.

To get the backups running on a Debain Server I had to do the following:

  1. Install Duplicity – apt-get install duplicity
  2. generate a GPG key (gpg –gen-key)
  3. create a little backup script – following these steps.
  4. set up a cron job for automatic backups

Great site that explains how to do it: https://help.ubuntu.com/community/DuplicityBackupHowto

Got this nice bug coming right out of the Zend frameworks 1.9 AMF Routines.

“Unable to parse null body data flex.messaging.io.ArrayCollection mapped class  is not defined”
in file: library/Zend/Amf/Request.php:174

Was trying to send an object that has an Arraycollection as one of its parameters to the gateway.
Found this Bug Report http://framework.zend.com/issues/browse/ZF-6601
It is supposed to be fixed in 1.8.2 ?! Why is it happening in 1.9 then?

Instead of modifying the zend framework I decided to convert the object I wanted to send into an object without arraycollections.
But definitely not a proper solution. Hopefully that bug will be fixed soon. Otherwise maybe AMFPHP is a better choice then Zend AMF.

After fixing the problem with php 5.3 and the openid library I ran into the next problem.

Trying to to use the provided example that comes with the openid php library,
with google openid url -  https://www.google.com/accounts/o8/id

And getting:

Fatal error: current_url must be a string; see NEWS file for upgrading notes. in /var/www/clients/php-openid-1.2.3/Auth/OpenID/Consumer.php

Wow – must be my lucky day today. Getting really really tired of the openid stuff. Especially cause I can’t find any decent documentation.

I figured out that I needed to add the url of the finish_auth.php to the complete function call in the finish_auth.php script itself.

//get full url of current script
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER[PHP_SELF];
//pass url into complete handler
$response = $consumer->complete($thispage);  //modified function call in finish_auth.php

And I had to get rid of the $_GET parameter that was passed into the complete function in the example.
This seems to solve the problem. Getting a nice response:
You have successfully verified https://www.google.com/accounts…as your identity.
Except for a few warnings and notices of course :-)

I used this url as my google identity url:

https://www.google.com/accounts/o8/id?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=http%3A%2F%2Fwww.example.com%2Fcheckauth&openid.realm=http%3A%2F%2Fwww.example.com%2F&openid.assoc_handle=ABSmpf6DNMw&openid.mode=checkid_setup

taken from this tutorial: http://code.google.com/apis/accounts/docs/OpenID.html

but had to replace

https://www.google.com/accounts/o8/ud

with
https://www.google.com/accounts/o8/id

download modified finish_auth.php

If a PHP script has an error but the displayed page stays blank and does not show anything,
add these two lines to the top of your script to display all PHP errors for the current script.

error_reporting(E_ALL);
ini_set("display_errors", 1);

I recently downloaded the latest Openid library for PHP and got the follwoing deprecated errors when trying to run the example in my webbrowser:

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 298

It seems to be only an issue with PHP 5.3 and I found a great fix at Miguel Santirso Blog.
He has gone through quite some trouble to fix all the compatibility issues with PHP 5.3 and and was so kind to provide his fixed version for download.

Mate Templates

No comments

Some Mate notes:

  • When using AsyncMethodInvoker, use the currentEvent  property instead of event to get the right property
Get Adobe Flash player