Saturday, August 22, 2015

Cheap ExtJS 4.x SASS watcher (ready to be wrapped with gulp/grund or any other build tool)

ExtJS 4.x does't has reliable SASS watcher out of the box. Recommended approach of "compass watch" introduced in ExtJS 4.x doesn't works anymore in ExtJS 4.2 as it doesn't understand the structure of themes, leaving "sencha ant sass" as only option to build SASS, which is so slooooow and takes around 30-40 seconds to rebuild the whole theme.

Wednesday, September 10, 2014

URL params parsing on pure JavaScript

ES3 compatible URL params parsing on pure JavaScript:

* Detects hash params and builds an array of values
* We have the following URL: ""
* this function will extract the part: "param1=value1&param2=value2" and build an array:
* param1 = value1
* param2 = value2
* inspired by:
* @returns {Array}
function getHashVars()  {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('#') + 1).split('&');
    for(var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars[hash[0]] = hash[1];
    return vars; 

Saturday, July 26, 2014

Selenium WebDriver + Xvfb + PHP PHPUnit

Selenium WebDriver is one of the best and most mature tools for functional testing of WEB applications, supports wide range of browsers and bindings for all major language platforms.

Here is brief overview of possible selenium setup, which by the way has a lot of possibilities for improvement but can be good for quick and easy start.

Tuesday, September 10, 2013

Add sidepars in Wordpress theme

The shortest post ever.
The file names for the right and left sidebars should be
sidebar-right.php and sidebar-left.php respectively.

Wednesday, October 10, 2012

PHP Copy and Paste detection tool installation

In order to install it you will need to:

1. Upgrade to latest PHPUnit 3.7
2. Install (see instructions inside)
3. Install (see instructions inside)

Then you can run it like:

$ phpcpd /path/to/project/directory

You will see the copy&paste report:

Found 3 exact clones with 53 duplicated lines in 5 files:

  - /usr/local/src/phpunit/PHPUnit/Framework/Constraint/Or.php:136-157

  - /usr/local/src/phpunit/PHPUnit/Framework/Constraint/Or.php:136-157

  - /usr/local/src/phpunit/PHPUnit/Framework/Comparator/Scalar.php:121-132

0.19% duplicated lines out of 27640 total lines of code.

Thursday, September 6, 2012

Zend Framework 2.0 stable release

Finally after all these years I'm glad to announce the Zend Framework 2.0 stable release. It is still not ideal but as we have stable release now - we can start polishing it and try and use it for our needs.
Congratulations to everyone!

Sunday, June 10, 2012

Easy start with Jenkins for PHP developer

Lets look into the quick and minimal Jenkins setup for middle sized fast growing PHP project.
In order to easy follow this article you should at least:
  • have PEAR installed on server
  • use phpUnit for unit tests
  • build your app with Phing

Wednesday, May 16, 2012

Drupal produces warnings with file_check_directory() on low bootstrap levels

I've found interesting issue with file_check_directory() in Drupal. It generates errors like:

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../public_html/includes/ on line 245

Friday, April 6, 2012

Convert OpenSSH keys to Putty on Linux with puttygen

If you need a Putty ppk key on Linux when you don't have Windows installation, for example when using Windows application that requires ppk-key under Wine. You can use "puttygen" CLI tool in that case.

On Ubuntu:

# apt-get install putty-tools

$ cd ~/.ssh/
$ puttygen id_dsa -o id_dsa.ppk

Make sure you've replaced the "id_dsa" with your private key filename.


Thursday, February 9, 2012

Xdebug PHP scipts profiling examples

Look at this presentation to become familiar with PHP profiling:
And also look into this article for more details:

Edit PHP.ini and add the line:
xdebug.profiler_enable = 1
Restart the Apache and you will find the profiling dumps in /tmp/ .

PHP debug process internals with xdebug

Xdebug debugger allows you to interactively walk through script execution and inspect the call traces and variable values in each appropriate scope.

Why install xdebug?

Even without actual integration with your IDE you are able to get benefit from xdebug on your development machine:

Wednesday, December 21, 2011

PHP debug & profiling for dummies

Sometimes very basic debug can be done by dumping the values of variables. The other method is about writing debug values into log files. Such approaches are hard to be successfully used on large sophisticated projects like Drupal or Magento. In such case the best solution is to use the debugger and debug your code via step by step code execution, back traces, breakpoints, variables scope inspection and producing execution flows / profiling dumps.

Here is the short compilation of materials about debug and profiling in PHP where everyone can find links to the interesting materials on the WEB and also my personal experience.

Monday, October 31, 2011

Zend Mail 2.0 to be delivered for upcoming ZF2 beta2

The work under new Zend Mail 2.0 component has been started recently. Matthew Weier O'Phinney created the architectural outline of proposed object relations and interactions. That document can be found under following Wiki page: "RFC - Mail Refactoring"

Mail goals that should be addressed in new Zend Mail component are:
  • handing of mass messaging
  • better separation between message handing and transport
  • improved MIME-types encoding and Unicode support
  • more intuitive handing of attachments and custom message headers
Feel free to provide your comments under the appropriate Wiki page according the proposed architecture.

Revised version of Zend Mail 2.0 is planed to be delivered for upcoming Zend Framework 2 beta2 release.

Saturday, October 29, 2011

Simplest solution to enable PHP mail() function under Ubuntu

If PHP mail() function doesn't works on your development desktop and your Apache error log shows something like "sh: /usr/sbin/sendmail: not found" - then you obviously need to install "sendmail" in order to fix that :)

Just run the following command in Ubuntu:

# apt-get install sendmail

To configure Sendmail for your needs use (see appropriate configuration scripts in output):

# sendmailconfig 

Writing this post for people who asking me quite frequently: "Why PHP mail() function doesn't works after I've successfully installed LAMP development environment on my Ubuntu desktop?"

Monday, August 15, 2011

Preparing Ubuntu Linux desktop for web development

There are a lot of articles on the Internet about configuring Ubuntu desktop for web developer. I'm using Ubuntu for 3 years already as my working desktop station for web development and want to share my own list of software each web developer should have. So here is just another guide to prepare Ubuntu powered desktop for web development.

Wednesday, May 25, 2011

Bug-Hunt Days May 2011 Anouncement!

A new Bug-Hunt days are coming. On 26th, 27th and 28th - join the team of best PHP developers in magnificent quest of resolving Zend Framework bugs and issues.

For each first-time bug hunter it is recommended to view "The list of all Zend Framework open issues" and joining the IRC channel on Freenode.

You can read the detailed information about participating in Zend Farmework bug-hunt days and if you will close a lot of bugs you will win a valuable prizes.

Happy hunting!

Wednesday, May 11, 2011

Zend Framework 2 MVC brainstorm

During next 4 weeks everyone can contribute ideas according ZF2 MVC requirements and architecture on the Zend Framework MVC requirements brainstorm page. As it was stated by Matthew Weier O'Phinney, the main idea is to finally come up with a concrete list of deliverables for the ZF2 MVC.

Feel free to give your comments and join discussion on mailing lists, IRC and Wiki.

Sunday, April 17, 2011

Zend Framework core developers update

We had couple ZF code developers changes during last 1-2 months that worth to be mentioned.

Alexander Veremiev is not in the official Zend Framework development core team any more, but will still support the development as community member.

Anyway we have a new core developer introduced by Matthew Weier O'Phinney last month. Enrico Zimuel worked for Zend for several years as a consultant for companies that use PHP solutions.

You can find more information about Enrico on his personal blog:

Welcome on board!!

Thursday, March 24, 2011

Bug-Hunt Days March 2011 started!

Ralph Schindler announced Zend Framework Monthly Bug-hunt Days for 24-25-26 March. See detailed announcement in the news section on Zend Developers Network website.

Such event is organised every month to reduce the amount of open issues we have in ZF issue tracker.

Everyone can participate in the event and even win the priceless presents like Zend Framework T-shirt!

Why its important to participate in bug hunt days? well... you can:
  • communicate with the best PHP developers in the world;
  • improve the code base  you use everyday in your work;
  • learn Zend Framework internals and increase your QA skills;
  • and finally you will do a great work for all the people from Zend Framework community and that will give you a positive influence on your karma!

So make sure you have a signed CLA, join IRC channel and search for the Zend Framework issue you want to resolve.