Category: PHP

Symfony security annotation on controller class and inherited action method

This is a quick code example on how to extend the Symfony security extension in your bundle so you could have rules on the controller’s class as annotation and also inherit those and merge with the action method annotations. It’s

Tagged with: , , ,

Get All Files in Directory and All Child Directories

I was playing with PHP the other day and was trying to fetch and rename 1000s of files I have stored locally on my machine. Seemingly PHP isn’t the best language to that operation Python or even BASH could do

Tagged with: , , , , ,

Load configurations from custom bundle in Symfony2

When I build apps or add new functionality to Symfony2 I build it into a separate bundle, thus trying to keep the structure modular which is generally a good practice as everyone knows. Keeping all parts of the bundle together

Tagged with: , , ,

Running out of memory on Laravel 4 update

Laravel is great framework and I quite enjoy how it’s structured and how it works. In version 4 it was migrated from bundles to using Composer for dependency injection which is great and fits well in my daily routine on

Tagged with: , , , , ,

Magento :: Export all customers and emails from orders

Magento export Every now and then I am asked by different clients if I can export specific customer data, most often people need emails of their customers to use for newsletters or other types of marketing campaigns. There are two

Tagged with: , , , ,

Custom error handler for Laravel 4

I build API service for a mobile application and I faced a problem with the error reporting with Laravel. Laravel is awesome framework and is great for RESTful application or building API that’s why it’s my first choice. But I

Tagged with: , , , ,

Consistent dates in PHP?

It’s really interesting how small changes in core PHP functionality could break whole website and take hours to find the cause of the bug. I am building website which takes some use of dates, stored in MySQL database as Date

Tagged with: , , ,

Install PHP mcrypt on UNIX server

In this quick tip I’ll show you how to install the PHP extensionmcrypt. This is needed for Magento to run properly otherwise you’ll get an error like: [cc type=”text” escaped=”true”]Fatal error: Call to undefined function mcrypt_create_iv() in lib/Varien/Crypt/Mcrypt.php on line 64[/cc]

Tagged with: ,

How to Move Magento to a New Server or Domain

Magento is one of the fastest growing eCommerce platforms on the internet and with its recent acquisition by eBay it promises to stay on the lead and keep growing with even faster pace than before.  It’s been choice for a

Tagged with: , ,

How to read STDIN with PHP script from terminal

In console environment PHP could be very useful especially running long tasks or for CRON jobs. You can execute your script like: [cc lang=”text”]php scriptName.php[/cc] You can also pass some parameters like: [cc lang=”text”]php scriptName.php param1 param2[/cc] Those can be

Top