Starting the Zend Framework 2 Session Manager

One way to start the session with Zend Framework 2 (2.0.3 dev) is as below written.

1
2
3
4
// public/index.php
$manager = new \Zend\Session\SessionManager();
$manager->getConfig()->setCookieHttpOnly(true)->setName('ac-session');
$manager->start();
  1. Start the session manager
  2. Get the session config object
  3. Set httpOnly cookies for better xss security
  4. Set your session name
  5. Start the session

There are many other options which i have not tested yet, but this options are mandatory in my opinion.

Lp. Silvester

jQuery niceDate plugin

After looking on the internet for a jquery or javascript plugin that converts machine dates to readable ones like 12.12.2012 -> 2 days ago, I decided to write on my own. Since I am not a good javascript programmer feel free to correct my mistakes.

Features

  • multilanguage,
  • aware of language grammatics,
  • easy to hack,
  • available for past and future dates,
  • show original date on mouseover

Continue reading

MySQL backup to Rackspace Cloud files, quick & dirty

After having deep thought about security, bad hardware and shit I decided to make some database backup for some of my clients. They wouldn’t provide any spare backup space so i decided to use my account on rackspace cloud. The file space was cheap enough so i do not charge my client for it (even if I would i could not). I wont write about how to restore the database. In case a restore is needed, the situation will be too complex to restore with a click of button. It took about 1 hour to complete the task. The plan is to use php-cli, crontab and cloud files. Continue reading

prototype, scriptaculous Chained Select

For one of my projects i had to make some select boxes which would work in a chain. I had 500.000 inserts in mysql which should be found easily. So i implemented 5 chained select boxes.

The first part of the project was not meant to be public so i limited my work to Firefox. But after a while the public part started and i wanted to use some ready made widgets in smarty (like my address widget with 5 chained select boxes). When i tried it in IE 6 it did not worked.
Continue reading