Wednesday, September 9, 2026

How to Contribute to ZF2

Just found a very interesting link on Twitter from Matthew Weier O'Phinney about on how to contribute to Zend Framework. He describes all the bureaucratic procedures in order to start contributing.

There were no clear easy to understand single piece of document that contains step-by-step description in the human language about all the details that should be done by contributor. We have such document right now. Thanks to Matthew's great article on his blog named "How to Contribute to ZF2" that describes all the details.

Here is the general steps:

1. Create account on Issue Tracker (http://framework.zend.com/issues)
2. Sign Contributors License Agreement and send it to Zend (http://framework.zend.com/cla)
3. Join the developers community at GitHub (http://github.com/zendframework/zf2)
Enjoy!

To start your development you should clone the repository, create a separate branch for your hotfix or feature. After everything will be coded and you will be ready to contribute your code you should do two things: cover your code with tests and issue a pull request and some of dev-team members will review and accept you changes. It's very essential to cover your code with test, because it will help to keep ZF more stable and less affected with unpredictable or recurring bugs.

Right now development team works under new MVC implementation and the contributors from community can take their tasks from the following areas:

  • Contact component maintainers and ask for the tasks that needs to be done for each component.
  • If component, you are interested in, doesn't have maintainer then you can offer to take over maintenance.
  • Run individual tests for different components and help to fix test fails.
  • Look at new proposed documentation standard and start you work to update documentation to new format.
Have a great fun while contributing to Zend Framework!

BUG: Zend_Date changes automatically the timezone after setting the unix timestamp to -100000000

Wanted to outline a very interesting bug found in Zend_Date component. After settings  the timestamp to -100000000 it changes the timezone.

ini_set('date.timezone', 'UTC');

$date = new Zend_Date();
$date->setTimezone('Europe/Berlin');
$date->set(-100000000);
 
So you will receive:
Zend_Date Object
(
[_locale:private] => de
[_fractional:private] => 0
[_precision:private] => 3
[_unixTimestamp:private] => -100000000
[_timezone:private] => Etc/GMT+10
[_offset:private] => 36000
[_syncronised:private] => 0
[_dst:protected] => 1
)
 
If you will set the timestamp to -99999999 it works as expected.
So the workaround is to set the timezone after you will set your timestamp.

Check out details  on Zend_Date changes automatically the timezone after setting the unix timestamp.

See Zend Framework 2 documentation proposal

See Zend Framework 2 documentation proposal submitted by Matthew Weier O'Phinney, that describes the drawbacks of old documentation system and provides some interesting thoughts on resolving mentioned issues.

The main point is to standardise the typical documentation section for each component like: Overivew, Quick Start, Configuration Options, Available Methods, Examples. This will indicate for components documentation authors which information should be presented in documentation and will make navigation and finding of required information more easier.

Feel free to participate in discussion.

Zend ACL access denied error handler

jQuery HTML Templates usage

PHPeople. PHP community super-heroes overview.

I think PHP community lacks of its own celebrities, that are examples of experts in PHP development for others. Especially those are very valuable to developers that starting their career or searching for good opportunities and success stories within PHP ecosystem. Anyway we have a lot of interesting people but the problem is that they are not widely known. So I decided to write this post about PHPeople, guys I'm following  in my RSS reader, Twitter, etc...



Andrei Zmievski
Wil Sinclair

Full page caching using Zend_Cache

Thursday, January 25, 2024

Welcome to GitLab, @wrongusername

Sometimes, you have a personal and work account on GitLab, and your system could just log you in with the wrong one. Here is how to handle such situations.

1. Navigate to your cloned repository directory.

2. Add your private key to SSH: ssh-add ~/.ssh/id_ed1234_gitlab

3. Check whether you see the correct user now: ssh -T git@gitlab.com


Bonus:

GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed1234_gitlab" git clone git@github.com:xxx/yyyy.git

Tuesday, September 4, 2018

Setup Google Play Developer API for APKs publishing from continuous integration server

Sometimes you need to publish a whole bunch of apps, which makes you think about automation through Google Play Publishing API. The access to API can be setup only by the account owner, and you may end up with the following screen.


Here is the detailed step by step instruction on how to setup the Developer API access fo your boss, IT support, offshore client, you name it - the person that actually owns the account.

(all screenshots are clickable)

Wednesday, November 9, 2016

Jenkins fails Maven/Java builds when running API tests using HTTPS

Recently discovered the problem with Jenkins, when projects builds were failing due to REST API tests (RestAssured) fails for an unknown reason.

We've recently switched our infrastructure to HTTPS and that change was obviously the root cause as the tests on HTTP were passing successfully.

On local developer's machines, the QA servers or even on Jenkins machine tests were passing when running from bash.

Also tried to run them from the "jenkins" user, on Jenkins machine, from the build's workspace -
in the exact same way Jenkins runs during a build, and all tests were passing successfully on both HTTP and HTTPS.

HTTPS tests were failing only when started from Jenkins UI "Build Now" button. We were not able to reproduce these fails any other environment except this Jenkins instance.


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: "http://www.domain.com/path/page.html#param1=value1&param2=value2"
* this function will extract the part: "param1=value1&param2=value2" and build an array:
* param1 = value1
* param2 = value2
*
* inspired by: http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html
*
* @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.push(hash[0]); 
        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 https://github.com/theseer/fDOMDocument (see instructions inside)
3. Install https://github.com/sebastianbergmann/phpcpd (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/And.php:143-164

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

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

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

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/module.inc 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.

Profit!

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.