Larry GarfieldVisiting other islands this fall (8.10.2015, 19:49 UTC)

In case you hadn't heard yet, Drupal 8 RC 1 is out. And there has been much rejoicing! I'm going to save my own lengthy celebration-and-thank-you post for the 8.0.0 release, so for now I will just point everyone at Campbell Vertesi's post and say "what he said!".

But it's also a good time to consider the impact that Drupal 8 has had on the PHP community. The "off the island" movement has grown large, and people outside of Drupal are echoing the same message. In fact, not one but two conferences this fall are actively trying to build bridges between PHP sub-communities: ZendCon and php[world].

read more

Rob AllenThe beginner's guide to rebasing your PR (8.10.2015, 10:05 UTC)

You've successfully created a PR and it's in the queue to be merged. A maintainer looks at the code and asks you to rebase your PR so that they can merge it.

Say what?

The maintainer means that there have been other code changes on the project since you branched which means that your branch cannot be merged without conflicts and they would like to you to sort this out.

These are the steps you should take.


Read the summary.

1. Update your target branch from upstream

I assume you already have an upstream repository as described in The beginner's guide to contributing to a GitHub project. The target branch you want to update can be found at the top of the PR on the GitHub site.

For example:

Pr title

The target branch in this example is develop, though I see master a lot too.

$ git checkout develop
$ git pull upstream develop && git push origin develop

2. Rebase your branch

The next step is to change to your branch which is the other branch listed in the PR details (feature/validator-result-interface in this example) and then perform a rebase:

$ git checkout feature/validator-result-interface
$ git rebase develop

This will rewind all your commits on this branch and then replay them against the tip of the branch you are rebasing against.

As you have been asked to do this, you'll get conflicts. Don't panic!

$ git status will show you which files are in conflict. For each one, follow this process:

  1. Open in editor and search for "<<<<<<" (that's 6 <) to find the conflict
  2. Inspect and fix so that you end up with the correct text. Remove the lines starting with <<<<<<, ====== and >>>>>>.
  3. Press find-next in your editor to find the next conflict in the file.
  4. Once all conflicts in the file have been fixed, exit your editor
  5. Add this file to the staging index: git add {filename}
  6. Continue until git status shows that all conflicting files have been added to the index

Once all conflicting files are fixed you can continue the rebase:

$ git rebase --continue

3. Push your newly rebased branch to origin

Finally, all you need to do is push your branch back to origin. Note that this will require a force push and you've probably been told to never do such a thing. This is the one exception to that rule because the maintainer asked you to do it.

So go ahead:

$ git push -f origin

It's a good idea to leave a comment on the PR that you've done the rebase and the PR is ready for re-review.

All done

To summarise the steps required:

  1. $ git checkout {target branch}
  2. $ git pull upstream {target branch} && git push origin {target branch}
  3. $ git checkout {victim branch}
  4. $ git rebase {target branch}
  5. Fix conficts and continue rebasing
  6. $ git push -f origin

That's it. Being asked to rebase your PR isn't scary or (usually) difficult as long as you pay attention to what you're doing. However, if you're not fully comfortable with git, then I recommend buying the Git Workbook and working through all the exercises.

SitePoint PHPCan PuliPHP Re-Revolutionize PHP Package Development? (7.10.2015, 16:00 UTC)

Puli is a new toolkit built on top of Composer that helps to manage and exchange resources like configuration files, images, CSS files, translation catalogs, and others. These are, you’ll agree, often difficult to maintain and share across projects.

Puli logo

Puli provides a framework-agnostic solution to this problem, keeping track of every resource location and avoiding the problems of using absolute or relative paths inside different systems.

How it works

  • You map resources via CLI.
  • A puli.json file keeps track of them.
  • You use a ResourceRepository instance to handle resources.

The Puli project also provides libraries for other functionalities like URL generation, or Twig support.

Puli components

Continue reading %Can PuliPHP Re-Revolutionize PHP Package Development?%

labs @ Qandidate.comAsynchronous Event Processing with Broadway using RabbitMQ (7.10.2015, 14:05 UTC)

Broadway allows the processing of events by passing them to an event bus. You can have a Projector subscribe to this event bus in order to update your read models, or you can have a Processor subscribe to the event bus in order to for example send an email. In Broadway this all happens synchronously: dispatching of the command, persisting the new events and processing the events (the projectors and processors) all happen on a single request, on a single thread. In this blog post we will explain to you how you can improve your user experience by running the processors asynchronously using RabbitMQ (or any other message queue).

∞ labs @ Permalink

Official Blog of the PEAR Group/PEAR PresidentPEAR 1.10.0 with PHP7 support is out (7.10.2015, 11:12 UTC)

After a year of development, PEAR version 1.10.0 has been released.

It works on PHP7 and is E_DEPRECATED and E_STRICT compatible.

Apart from those big changes, a number of annoying bugs have been fixed and some features implemented – have a look at the release notes and the roadmap.

Thanks to Ferenc Kovacs, Hannes Magnusson, Remi Collet and Ken Guest for their patches.


Upgrade your existing PEAR installation as follows:

$ pear clear-cache
$ pear upgrade pear-1.10.0

Fresh installation

See the PEAR installation documentation.

PHP ClassesCreate Microsoft Word DOCX files from HTML in PHP Part 2: More Complex Documents (7.10.2015, 03:37 UTC)
By Ashraf Gheith
In the first part of this article it was presented the class VsWord as a means to create Microsoft Word DOCX articles from HTML.

Read this article to learn how to compose more complex documents either using HTML or calls to the class that can insert document elements programmatically.
SitePoint PHPFunctional Prog, Distributed DBs, JSON-Patch and More! (6.10.2015, 14:59 UTC)

This article is a review of the WebCampZG conference. All images are taken from WebCampZg’s official and Facebook page.

This weekend, Chris Ward (the mobile channel editor at SitePoint) and me attended Webcamp ZG, the annual international web-oriented conference in Zagreb, Croatia.

Webcamp ZG logo

The conference is a two day event, each day spearheaded by a keynote type of talk before diving into the bulk of the content. The schedules of both days contained plenty of breaks with food, drinks and snacks scattered throughout, providing for both energy and excellent socialization and networking contexts.

The two main tracks were sponsored by two companies: Intercom and Reversing Labs, and while each had a sponsored talk slot, neither disappointed. The two tracks were also identified by their sponsors’ logo, so visitors could easily redirect themselves into the appropriate hall.

Continue reading %Functional Prog, Distributed DBs, JSON-Patch and More!%

Bernhard SchussekOctober 9: Puli Coding Night (6.10.2015, 08:50 UTC)

This Friday, October 9th 2015 at 17:00 GMT (19:00 CEST) we will do a Puli Coding Night! This is the perfect opportunity for you to play with the project, ask questions, discover a new perspective of PHP package development and to start contributing.

If you are in Vienna (Austria) on that night, join us in our office! There will be beer and music. Please let me know in advance if you'd like to come around.

If you are in a different place, get your own drinks and join us on Puli's Gitter Channel.

Looking forward to seeing you! :)

Cal EvansInterview with Eric Mann (6.10.2015, 04:00 UTC) Link
Bernhard SchussekPuli 1.0-Beta8 Released (5.10.2015, 15:30 UTC)

Today marks the release of Puli 1.0-beta8. This version features the following changes:

  • Support for discovering PHP classes in Puli packages.
  • Support for loading bindings that match dynamic expressions.
  • Full Windows support.
  • Support for migrating puli.json automatically.
  • Fixed various bugs in the path-mapping repository.

Continue reading to learn more about these changes.

Class Discovery

Puli's Discovery component was extended to discover not just resources, but also PHP classes in your Puli packages. A classic example where this feature is needed is a plugin system. As example, consider a batman/core package that provides an Application class and a Plugin interface for hooking plugins into that application. The Application class is used like this:

use Batman\Core\Application;

// load Composer's autoloader
require_once __DIR__.'/vendor/autoload.php';

// create the application
$app = new Application([
    new BlogPlugin(),
    new CommentsPlugin(),
    // ...

Whenever you install a new plugin, you need to add the corresponding Plugin class to the application. With this Puli release, you can automate that.

Implementing the Plugin Infrastructure

In the batman/core package, add a binding type for the Plugin interface to puli.json:

$ puli type --define Batman\\Core\\Plugin

Change the Application class to load the plugins from Puli's Discovery:

namespace Batman\Core;

use Puli\Discovery\Api\Discovery;

class Application
    public function __construct(Discovery $discovery)
        foreach ($discovery->findBindings(Plugin::class) as $binding) {
            $pluginClass = $binding->getClassName();

            $this->registerPlugin(new $pluginClass());

Any plugin can now bind its plugin class to the binding type Batman\Core\Plugin defined in the batman/core package.

Registering a Plugin

As example, let's register the BlogPlugin class in the puli.json file of the batman/blog package:

$ puli bind Batman\\Blog\\BlogPlugin Batman\\Core\\Plugin

Using the Application

Users of your packages now instantiate the application like this:

use Batman\Core\Application;

// load Composer's autoloader
require_once __DIR__.'/vendor/autoload.php';

// load Puli's Discovery service
$factoryClass = PULI_FACTORY_CLASS;
$factory = new $factoryClass();
$repo = $factory->createRepository();
$discovery = $factory->createDiscovery($repo);

// create the application
$app = new Application($discovery);

Any installed plugin will be recognized and loaded automatically.

Use Expressions to Load Bindings

The Discovery component now uses the Webmozart Expression library to load bindings that match specific criteria. For example, let's load all bindings for the thor/message-catalog binding type that have the parameter domain set to admin:

use Webmozart\Expression\Expr;

$expr = Expr::method('getParameterValue', 'domain', Expr::same('admin'));
$bindings = $discovery->findBindings('thor/message-catalog', $expr);

Another example: Let's load all classes bound to the Plugin binding type that are located in the Webmozart\ namespace:

use Webmozart\Expression\Expr;

$expr = Expr::method('getClassName', Expr::startsWith('Webmozart\\'));
$bindings = $discovery->findBindings(Plugin::class, $expr);

Windows Compatibility

All Puli repositories are now continuously tested on Windows thanks to AppVeyor. This change helped us to spot and fix various Windows issues. As of today, all Puli repositories build successfully on Windows.

JSON Migrations

In the past, you had to manually adapt your puli.json files when upgrading to a new beta release where the structure of that file had changed. As of this release, there is a puli u

Truncated by Planet PHP, read more at the original (another 1812 bytes)

LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP