Zend_Date with dates before 1901

Zend_Date

Zend_Date is the Zend Framework module for manipulation of dates. It gives several advantages. Everybody how has dealed with dates knows that built in PHP date function cannot manage dates before 1901. With that kind of problems Zend_Date is pretty fine.

How to do that

If you have only

Zend_Date::set($timestamp);

is not enough. The timestamp is an int representation and the framework cannot get the timezone from that and trows an error.

The simple way to solve the problem

Replace the line above with these: Continue reading

Posted in micro tutorial, PHP, zend framework | Tagged , , , , | Leave a comment

Flex 3: compare two dates

Theory of Operation

You’re using Flex 3 and want to compare two dates. The format of the dates is string something like “2009 May 05″. The question is …

What’s the best way to compare them

Well if you’ve the dates as strings and you can easily conver them to something like unix timestamps. If they are a Date object you can try lik so: Continue reading

Posted in flex 3, web development | Tagged , , , | 11 Comments

Switch from Zend_Loader to Zend_Loader_Autoloader

Zend_Loader

Zend_Loader was the usual kind of autoloading in Zend Framework before version 1.8. Than simply you say:

require_once “Zend/Loader.php”;
Zend_Loader::registerAutoload();

That made all your application to autoload files from the library folder where usualy the Zend Framework stays. That has several things to be changed. Continue reading

Posted in zend framework | Tagged , , | 18 Comments

php.ini for two web servers

Two Apaches one php.ini

Yes in our case this was the fact. There were two web servers, Apache 2 in our case, and one PHP. The php.ini file was in /etc/ as usual. Everything seemed to be perfect. But however some directives in php.ini does not worked for one of the server.

Why the second server does not read php.ini?

Well actually when you load the php.ini for the first server it loads correctly with everthing declared in it. However when you start the second server, of course on a different port than the first one, you get all the php.ini values as if they are default.

Why?

That’s some feature of PHP we didn’t know. I still don’t have an explanation about it. But of cource there’s a …

Workaround

You can put everything for the second server in the .htaccess file, so this will act as second php.ini for the second web server

Posted in web development | Tagged , , , , | Leave a comment

Flex 3 HSlider thumb gap issue

Introduction to the problem

When the HSlider is set up with two or more thumbs there’s a gap between them always. The problem is that you may want to put them on one single value of the slider, but it’s not possible.

First: hide your thumbs

The quick solution is to make custom skin for the thumbs, setup the height and width of the thumb to be 1px and make a transparent background image for skinning them. That of course does not solve the problem. There’s still gap of 1 value between the thumbs, and still you cannot select one single value with both of them. Continue reading

Posted in flex 3, micro tutorial | Tagged , , , , , , | 1 Comment