Posted by & filed under Webdev.

GraphQLGraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Links

Offical site http://graphql.org/
Server libraries http://graphql.org/code/
Что же такое этот GraphQL? https://habrahabr.ru/post/326986/
Сравнение REST и GraphQL https://habrahabr.ru/post/335158/

Posted by & filed under Webdev.

PHP-PM is a process manager, supercharger and load balancer for PHP applications.

It’s based on ReactPHP and works best with applications that use request-response frameworks like Symfony’s HTTPKernel. The approach of this is to kill the expensive bootstrap of PHP (declaring symbols, loading/parsing files) and the bootstrap of feature-rich frameworks. See Performance section for a quick hint. PHP-PM basically spawns several PHP instances as worker bootstraping your application (eg. the whole Symfony Kernel) and hold it in the memory to be prepared for every incoming request: This is why PHP-PM makes your application so fast.

More information can be found in the article: Bring High Performance Into Your PHP App (with ReactPHP)

Features

  • Performance boost up to 15x (compared to PHP-FPM, Symfony applications).
  • Integrated load balancer.
  • Hot-Code reload (when PHP files change).
  • Static file serving for easy development procedures.

Github

Posted by & filed under Webdev.

Learn

Python

Posted by & filed under Webdev.

Laradock is a Docker PHP development environment. It facilitate running PHP Apps on Docker.

Laradock is configured to run Laravel Apps by default, and it can be modifyed to run all kinds of PHP Apps (Symfony, Codeigniter, WordPress, Drupal…).

Use Docker first and learn about it later.

Github

Posted by & filed under Study.

This is my multi-month study plan for going from web developer (self-taught, no CS degree) to Google software engineer.

This long list has been extracted and expanded from Google’s coaching notes, so these are the things you need to know. There are extra items I added at the bottom that may come up in the interview or be helpful in solving a problem. Many items are from Steve Yegge’s “Get that job at Google” and are reflected sometimes word-for-word in Google’s coaching notes.

Full article on Github

Posted by & filed under Webdev.

A search for “dependency injection container” on packagist currently provides over 95 pages of results. It is safe to say that this particular “wheel” has been invented.

However, no chef ever learned to cook using only ready meals. Likewise, no developer ever learned programming using only “ready code”.

In this article, we are going to learn how to make a simple dependency injection container package. All of the code written in this article, plus PHPDoc annotations and unit tests with 100% coverage is available at this GitHub repository. It is also listed on Packagist.
Read more »

Posted by & filed under Webdev.

Modern PHP testing for everyone.

codeception

Codeception PHP Testing Framework is designed to work just out of the box. This means its installation requires minimal steps and no external dependencies preinstalled (except PHP, of course). Only one configuration step should be taken and you are ready to test your web application from an eye of actual user.

Project Home Yii2 extension
Acceptance Test

<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('create wiki page');
$I->amOnPage('/');
$I->click('Pages');
$I->click('New');
$I->see('New Page');
$I->fillField('title', 'Hobbit');
$I->fillField('body', 'By Peter Jackson');
$I->click('Save');
$I->see('page created'); // notice generated
$I->see('Hobbit','h1'); // head of page of is our title
$I->seeInCurrentUrl('pages/hobbit'); 
$I->seeInDatabase('pages', array('title' => 'Hobbit'));
?>

API Test

<?php
$I = new ApiTester($scenario);
$I->wantTo('create a new user by API');
$I->amHttpAuthenticated('davert','123456');
$I->haveHttpHeader('Content-Type','application/x-www-form-urlencoded');
$I->sendPOST('/users', array('name' => 'davert' ));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(array('result' => 'ok'));
?>

Unit Test

<?php
use \Codeception\Util\Stub;
class UserTest extends \Codeception\TestCase\Test
{
    public function testUserSave() {
        $user = Stub::make('User');
        $user->setName('davert');
        $this->assertEquals('davert', $user->getName());
        $user->save();
        $this->tester->seeInDatabase('users', array('name' => 'davert'));
    }
}
?>