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)

PHP ClassesStarting Long Server PHP Scripts and Monitor their Status Part 3: Running Multiple Parallel Tasks (5.10.2015, 07:34 UTC)
By Joseluis Laso
In the previous parts of this article it was presented a solution to run a task on the server that could take a long time to complete and still be able to monitor its progress. However it was limited to running one task at a time.

Read this article to learn how to run multiple long tasks on the server in parallel taking the most of the available server resources. You can also watch a video of the example solution in action.
Hasin HayderCreating a slack bot using PHP to monitor your envato sales (4.10.2015, 20:07 UTC)
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP