Tag: 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

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in PHP, Symfony2 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

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in PHP, Small Tips Tagged with: , , , , ,

Change default date for Jackson in Spring Boot application

Dates as a concept are seamingly simple and straight forward. Though in programming world those could be rather complex starting from format, representation, time zones, machine default configuration going through different calendars and date manipulations. In this post I won’t

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in API, Java, Small Tips, Spring MVC, Swagger 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

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in PHP, Small Tips, Symfony2 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

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in PHP 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]

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in Apache, CentOS, PHP, Servers, Small Tips Tagged with: ,

HTTP cache control on a dynamic PHP page

In the general case the website caching happens on the server side where the PHP output or database objects are cached in static files or in the server RAM. That could work pretty good but we could improve that and

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in Apache, Servers, Zend Framework Tagged with: , , ,

PHP Type Checking

Here’s a quick and dirty utility method for type checking an object or an array of objects. [cc escaped=”true” lang=”php”]/** * Ensure the object (or the first item in the * array of objects) is of the specified type *

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in PHP, Small Tips Tagged with: , , ,

Generate radio grpoup with JHTML

Joomla provides very useful class called JHTML that can be used to produce different HTML elements saving us time and code. The Joomla team has provided a very useful class loader method “_()” in which we can pass string for

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in Joomla, Small Tips Tagged with: , , , ,

CakePHP – User authentication and registration

Hello guys! This is my firs post so I’ll keep it short for now. I could say I am newbie with CakePHP framework. I’ve been working with it just for a couple of weeks so far but I think it’s

It's only fair to share...Buffer this pageShare on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditPin on PinterestEmail this to someone
Posted in CakePHP, Plugins Tagged with: , , , ,