Archive

Archive for the ‘PHP-Programming’ Category

Zend_Date in Magento Core

December 7th, 2010 No comments

Today we figure out an Bug in Zend Framework Zend_Date Component which Magento use.

If you omit the Dateformat in Constructor of Zend_Date the class try to find the right Locale.

In the case that the Day is lower than 12 it assume that the Day is the month.

See this Example:

 <?php
  $date = new Zend_Date("2010-12-06 08:20:15");
  echo $date->toString('yyyy-MM-dd HH:mm:ss'); //Results in 2010-06-12 08:20:15

If the Day is greater than 12 Zend_Date determine the Date String correct.

So be aware if you use Zend_Date in Revision 17696 2009-08-20 you should set the Date Format in Constructor:

 <?php
  $date = new Zend_Date("2010-12-06 08:20:15", "yyyy-MM-dd HH:mm:ss");
  echo $date->toString('yyyy-MM-dd HH:mm:ss'); //Results in 2010-12-06 08:20:15
Categories: PHP-Programming Tags:

Magento Cache with Memcache Servers.

December 6th, 2010 No comments

Today we had a problem with one of our Servers which had a memchached Server running. Because an Kernel failure hangs the whole Server.  Due this downtime magento produces many of Error Reports with the Message that Magento cant fetch any Data from this server.

Although we had configure three of such memchached server was our Shop offlline due we fix that Problem.

So it´s a misbelief to think that the other Server catch these Errors.
I think its a bug in Magento Core Caching System. Developers should catch such Errors and work with other configured Servers again.

Categories: PHP-Programming Tags:

Popups testen mit Selenium

November 16th, 2009 No comments

Damit man mit Selenium den Inhalt von Popups testen kann, muss man das geöffnete Fenster erst auswählen:

Folgender Code brachte mir immer einen Timeout:

<?php
public function testLink()
    {
        $this->_sel->open("/");
        $this->_sel->click("Fehler melden");
 
        for ($second = 0; ; $second++) {
            if ($second >= 5) $this->fail("timeout");
            try {
                if ($this->_sel->isElementPresent("submit")) break;
            } catch (Exception $e) {
 
            }
 
            sleep(1);
        }
    }
?>

Damit die Abfrage funkioniert muss der Code folgendermaßen ergänzt werden:

<?php
  //.... 
  $this->_sel->click("Fehler melden");
 
  $this->_sel->waitForPopUp("NameDesFensters", 3000);
  $this->_sel->selectWindow("NameDesFensters");
  for ($second = 0; ; $second++) {
  //....
?>
Categories: PHP-Programming Tags: , ,