Paul M. JonesTelegraph: A Lambda-Style PSR-7 Middleware Dispatcher (31.5.2016, 14:37 UTC)

On reflecting over the discussions surrounding the proposed PSR for HTTP middleware (on which I am coordinator), I realized there’s no reason there should *not* be a “request-only” PSR-7 middleware dispatcher.

So, here is Telegraph to fill that void.

Built over this past weekend, Telegraph is essentially a copy of Relay, which is a “request+response” middleware dispatcher. (There are a couple of minor differences.)

I also took the time to port the existing Relay middleware over to Telegraph. You can find the Telegraph middleware here.

I was asked over the weekend, “Is this a sign that the HTTP middleware proposal is moving from request+response to request-only?” (/me shrugs) I just figure if there’s such a need for something like that, perhaps it should be made available.

Oh, and I was able to quality-check and release it using Producer.

Enjoy!

Link
PHP ClassesPHP ORM Pros and Cons (31.5.2016, 07:39 UTC)
By Victor Bolshov
Object-Relational Mapping (aka ORM), as you may know, is an approach to manipulate information in relational databases as if they are objects.

There are many packages that implement different approaches to ORM, each as its own advantages and disadvantages.

Read this article to learn about what things are recommended or not when implementing an efficient ORM package in PHP.
Link
Voices of the ElePHPantInterview with Joe “Little Joe” Ferguson (31.5.2016, 04:01 UTC) Link
PHP ClassesNotable PHP package: Move Me GIF (30.5.2016, 20:04 UTC)
By Manuel Lemos
Animated GIF images became popular because they allow to display videos on social network sites that only support image formats.

Assembling an animated GIF is just composing a sequence of still pictures. However, this class goes further to assembling pictures as animated GIFs by allowing to render sequences of images overlaid on top of custom background images.

It also provides optimization methods to generate smaller GIFs files by clipping regions of the images and skipping frames.

Read this article to learn more details about how this notable PHP package works.
Link
SitePoint PHPSourcehunt: Conferences, Oauth2 in Slim, Static Analyzers, Etc. (30.5.2016, 17:00 UTC)

Hello there, hunters! Before getting into this month's links you should star and / or contribute to, I'd like to briefly give a shoutout to two conferences I attended and participated in this month: OSCAL and PhpKonf. Skip this section if you're just interested in this month's link list.

Sourcehunt logo

Conference Season

In Europe, May is usually chock full of conferences, and this one was no exception. While I do like to go as an audience member, too, (and so should you) the two instances I was at had me over as a speaker, and that was exceptionally fun.

OSCAL

Like last year, OSCAL was organized by the team at Open Labs, including our very own Elio Qoshi, and took place at Metropolitan University of Tirana. A free conference dedicated exclusively to open data and open source, OSCAL can be considered south Europe's answer to FOSDEM. Much smaller in scope but in no way lacking dedication, this year's edition featured more tracks than ever, covering everything from data and media codes, to animal adoption via open source and bitcoin, even coding workshops.

All people

Aside from being superbly organized, OSCAL is far too humble about something one doesn't see often - if ever - at such generally tech-oriented events. Not only are most of the volunteer staff female, but the percentage of women in the audience is just jawdropping. I had wondered why that was since last time I was there (it's a regular occurrence, not a phenomenon). Could be the fact that women have been an important part of Albania's culture since the olden days (every painting in the history museum has a woman in a position of importance, or at least alongside a man)...

Paintings

... or it could be the fact that it's a less PC environment and people just shrug off what they don't like, so there's no tension around social interactions, or a number of other things. I certainly hope the organizers will collect some post-conference data around this and let us know - in any case, I wasn't the only one surprised by this.

Continue reading %Sourcehunt: Conferences, Oauth2 in Slim, Static Analyzers, Etc.%

Link
PHP ClassesPHP Articles Report May 2016 Edition (30.5.2016, 06:09 UTC)
By Manuel Lemos
This is the May edition of the podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment on the latest outstanding PHP Articles published recently.

They commented on articles about using a plugin to insert charts and graphs on WordPress posts, how to prepare to technical interview for jobs, 10 aspects on which BitBucket is better than GitHub, converting HTML to PDF using an API, using Microsoft Visual Studio as your PHP IDE with PHP Tools extension, and the main changed and new functions in PHP 7.

Listen to the podcast, or watch the hangout video to learn more about these PHP articles.
Link
Sarfraz AhmedFast MySQL Backup and Restore (29.5.2016, 13:57 UTC)

Backing up and restoring MySQL database is generally trivial task however when database is huge, it is really a pain to do so because of amount of time it takes to perform backup/restore operation with conventional tools like PHPMyAdmin or similar.

If you have SSH access to server, we can leverage built-in MySQL commands mysqldump and mysql respectively to backup and restore big database really fast.

To Backup Database:

mysqldump -uDB_USER_HERE -pDB_PASSWORD_HERE DATABASE_NAME_HERE > backup.sql

To Restore Database:

mysql -uDB_USER_HERE -pDB_PASSWORD_HERE DATABASE_NAME_HERE < backup.sql


Note: If you don't have SSH access, you can use tools like MySQLDumper which does fairly good job but not as fast as mysqldump and mysql commands of course.

Link
Evert PotBlogging for 10 years! (28.5.2016, 20:27 UTC)

10 years ago today I first started this blog. I guess at this point it might be the longest running ‘thing’ I’ve ever done. Back then I had never been on an airplane, but since then I’ve blogged from every continent except Antartica.

Although blogging isn’t nearly as cool as it used to be, and twitter has largely replaced RSS, I’m happy to say it’s still going strong and it’s still fun!

I had some of my most read posts this year, but sadly I noticed that there’s a very obvious correlation between popularity and writing somewhat low-effort opinion pieces. My most popular post was pretty much about how I hate LinkedIn, which got around 23000 page views. Articles like that completely drown out the ones I actually care about, but on the upside, that particular post actually got me 4 new customers for my freelance work.

Technology wise I’ve gone from a custom solution, to Habari, eventually landing on Github Pages + Disqus. Disqus has become more and more social media and less ‘comment box’ and they added some dark patterns, so if you have a different recommendation I’d love to hear it! Especially if I can import from Disqus. But I love Github pages (except when they upgrade jekyll and throw non-descript errors). The static markdown approach to blogging makes so much sense, but I miss scheduling posts in the future.

Since this year this blog is also running on HTTPS via the HTTP/2 protocol. You gotta practise what you preach after all! This is provided via Cloudflare, which is a nice service and free if your needs are simple.

Anyway, one thing I have to say is… I’m extremely happy that I’ve started this all this time ago. Twitter is nice, but my blog archive gives me an awesome archive on what things interested me over the years. The blog has opened many doors, including jobs and gigs and sometimes just getting the benefit of the doubt.

It’s by far been my most useful career development tool.

Note: This post was written and was supposed to be posted on the 25th, the actual birthday of this blog, but in an ironic twist of faith, github pages decided not to publish it with a cryptic error.

Link
SitePoint PHPPhinx – the Migration Library You Never Knew You Needed (27.5.2016, 16:00 UTC)

You're building an application, and you need to share the database's structure with your team. After all, you want everyone to be up and running as soon as possible. What do you do? SQL dumps of table structures? You could... but that's so very primitive - and can be time consuming to import, too! More often than not, database migrations are the answer.

In this tutorial, we'll go through a framework-agnostic package for building and executing database migrations called Phinx.

Phinx logo

Bootstrapping

First, let's install Phinx into the project with Composer:

composer require robmorgan/phinx

The Phinx binary will be installed into the vendor/bin folder, as per Composer's default values. It can then be executed by running:

php vendor/bin/phinx

Phinx needs a phinx.yml file from which to read the database configuration before it can do anything meaningful. To generate it, we run:

php vendor/bin/phinx init

Configurations

The generate file will look something like this:

paths:
    migrations: %%PHINX_CONFIG_DIR%%/db/migrations
    seeds: %%PHINX_CONFIG_DIR%%/db/seeds

environments:
    default_migration_table: phinxlog
    default_database: development
    production:
        adapter: mysql
        host: localhost
        name: production_db
        user: root
        pass: ''
        port: 3306
        charset: utf8

    development:
        adapter: mysql
        host: localhost
        name: development_db
        user: root
        pass: ''
        port: 3306
        charset: utf8

    testing:
        adapter: mysql
        host: localhost
        name: testing_db
        user: root
        pass: ''
        port: 3306
        charset: utf8

Phinx supports an arbitrary number of "databases", though these should be considered version of one database rather than several different ones. Sometimes, the need may arise to use a completely different database, however.

Such is the case, for example, with nofw, which in a previous version still uses Gatekeeper - a secure but clumsily developed user authorization package. Gatekeeper demands its own phinx.yml file (with a custom migration path) and does not provide an option to change which one is used, while at the same time requiring its own user database. That throws a wrench into the whole "let's use Phinx in a project already using Gatekeeper" idea.

For cases like these, Phinx offers the -c option which tells the launcher which phinx.yml file to use. Note that Phinx supports json and php file formats, too, but we'll focus on the default yml one here and create a separate file for our example database.

Continue reading %Phinx – the Migration Library You Never Knew You Needed%

Link
PHP: Hypertext PreprocessorPHP 5.5.36 is available (26.5.2016, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.5.36. This is a security release. Several security bugs were fixed in this release. All PHP 5.5 users are encouraged to upgrade to this version. For source downloads of PHP 5.5.36 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP