Archive for the 'PHP' Category

Zend_Auth and more than one record matches the supplied identity

Sunday, December 13th, 2009

The Zend_Auth Db adapter will fail if you have more than one record returned, which makes sense. However, when I have coded something like this in the past, I would check how many records were returned with a matching username and password. Zend_Auth looks at how many records are returned for the username field regardless […]

Setting up a new Site with Zend Framework Application/Tool

Wednesday, December 2nd, 2009

It’s been awhile since I had to set up a new site with Zend Framework, and I took the chance to play around with Zend_Tool_Project. Following the QuickStart guide, I had a site up and running in no time. But it did take me a little while to figure out how to get my modules […]

Zend_Service_Technorati and Connection Errors

Tuesday, November 3rd, 2009

I had a site that uses Technorati’s API via Zend Framework- i.e. Zend_Service_Technorati. I noticed I am getting TCP connection errors via an exception (Message: Unable to Connect to tcp://api.technorati.com:80. Error #111: Connection refused), and upon going to Technorati’s site to look at the API, I found out the new API is under works […]

PHPUnit and Mock Object Exactly Method

Sunday, November 1st, 2009

<?php$mapper->expects($this->exactly(‘2′))->method(‘delete’);
$mapper->expects($this->exactly(2))->method(‘delete’);
?>

The two above lines of code don’t behave the same. When passing in 2 as a string instead of a number, PHPUnit declares it a failure:

Em_Model_Collection_MapperTest::testDeleteCollectionWithJoinTable
Expectation failed for method name is equal to when invoked 2 time(s).
Method was expected to be called 2 times, actually called 2 times.

symlink with FTP

Monday, September 28th, 2009

Apparently you can’t use FTP for symlinks? It’s been so long since I have mucked around with FTP, that I didn’t realize you could not create symlinks. I have an old site I still maintain and had to move it to a new hosting provider and the new provider did not give SSH access (well […]