Stefan KoopmanschapStop Fighting (23.7.2014, 21:15 UTC)

I posted this on Facebook about an hour ago, but this is not limited to Facebook. It should not be. So I’m reposting it here.

Today was a day like any other, except that it wasn’t. It was an official day of mourning in The Netherlands. This morning as I woke up, it was still a day like any other. When I got into my car to drive to work was the first time I noticed a difference: Other music, special requests. As I got to work, nothing was different and actually work was no different. A full day of work, a meeting that lasted until just after 4 o’clock so I completely missed the minute of silence. A day like no other day. Since I went home a bit early on monday and I wanted to finish a couple of tasks that I had left, I stayed a bit longer. That “bit” became quite a bit longer as I ran into a colleague and talked a bit.

I started my way back home in the car. Turned on the radio. Again, the radio felt “odd” yet also comforting because of the special programme. Aside from some tweets and pictures, I had not seen anything of the return of the first victims, I’d not followed it yet. While on the highway, I heard the report of the motorcade of hearses travelling from the airport to the army base where they will try to identify the bodies. Bit by bit, the music, the reports, the tweets, it kicked in.

As I neared the exit of the highway that I need to take to go home, I heard where the motorcade was. A quick calculation later I realized that if I’d stay on the highway, I could reach the route they’d be taking easily. I wasn’t sure. Should I? Isn’t that just sensationalism. I decided it wasn’t. I just wanted to pay my respect, especially since I wasn’t able to join the minute of silence.

I am so glad I did decide to go on. It was a surreal experience. First of all, as I turned onto the highway the motorcade was going to use a bit later, there were thousands and thousands of people standing on the side of the road. Even in the opposite direction, cars were stopping on the side of the road. So many people. Police was trying to ensure safety of people, but they weren’t enforcing the law. Obviously it’s usually not allowed to stop by the side of the road like this. Much respect to the police for the way they handled everything, giving only focus to safety and nothing else.

The motorcade came. That was odd. Strange. Impressive. Fourty hearses, one after the other, several of the drivers with tears in their eyes. I could do nothing but stand there and watch. Silent. Tears in my eyes.

I usually have very little faith in humanity. We’re destroying our world, we’re destroying eachother. What happened is proof of that. But what I felt today, while standing there, the enormous amount of people all there to pay respect, to welcome the dead bodies home, the love, respect and sadness mixed together, shared with everyone there. What a crazy experience. It restored a bit of my faith in humanity. It is possible to have this, unfortunately it will never last long.

I had tears in my eyes for the whole trip home. And as I write this, the tears are again forming. Never, ever in my life will I forget this. But never ever in my life do I ever want to see this many hearses drive by. Ever. Can we please, please all stop fighting eachother?

Link
Zeev SuraskiPHPNG binaries for Debian/Ubuntu (23.7.2014, 19:51 UTC)
Want to take PHPNG for a spin but don't the time or inclination to build it?

You're in luck!  That is, at least if you're running Ubuntu 14.04 or Debian testing/unstable for now.

We published builds of the latest PHPNG-enabled codebase (as of July 18th) in packages that are compatible and can replace the Debian/Ubuntu versions of PHP.

To install:

# wget http://repos.zend.com/zend.key -O- 2> /dev/null | apt-key add -
# echo "deb http://repos.zend.com/zend-server/early-access/phpng/trusty zend" > /etc/apt/sources.list.d/phpng.list
# apt-get update
# apt-get install php5

All the package names are the same ones as Debian's / Ubuntu's (e.g. php5-cli, libapache2-mod-php5, php5-fpm).

We'll be updating these packages periodically - e.g. when new extensions are ported or other major changes happen.

Note:  This version presently identifies itself as PHP 5.7.0.  Don't get too attached to this version number - as PHPNG will definitely not come out under this version if we ever it.  If accepted, PHPNG will become the basis of the the next major version of PHP.


We're going to look into providing .rpm versions as well as Windows & Mac binaries in the next few weeks. 
Thanks to Lior Kaplan (@KaplanZend) for making this happen.

Enjoy!

Zeev

Link
Christian WeiskeEnable .phar handling in your web server (23.7.2014, 19:10 UTC)

PHP allows us to pack up whole applications in a single .phar file, but no web server software today lets PHP handle .phar files, giving you a download dialog or displaying the text contents of the file.

mod_php on Apache

Debian

Open /etc/apache2/mods-enabled/php5.conf and change the line

into

Corresponding bug report and patch: #639268

Fedora

Edit /etc/httpd/conf.d/php.conf and add the line

AddHandler php5-script .phar

Corresponding bug report: #1117140

Mac OS X

Open /etc/apache2/others/php5.conf and add the line

AddType application/x-httpd-php .phar

below the similar line ending with .php.

PHP-FPM

nginx

Use the following configuration to make PHP-FPM handle .php and .phar files:

location ~ \.(php|phar)(/.*)?$ {
    fastcgi_split_path_info ^(.+\.(?:php|phar))(/.+)$;
    set $path_info $fastcgi_path_info;
    fastcgi_param PATH_INFO $path_info;
    ...
}

Be aware of PHP bug #67587. You will get an endless redirection loop for all requests with a non-empty PATH_INFO (file.phar/foo). The fix is already committed and will released with PHP 5.6.0, 5.5.15 and 5.4.31.

Link
Bruno ŠkvorcBest Practices REST API from Scratch – Implementation (23.7.2014, 16:00 UTC)

We ended the first part of this tutorial with all the basic layers of our API in place. We have our server setup, authentication system, JSON input/output, error management and a couple of dummy routes. But, most importantly, we wrote the README file that defines resources and actions. Now it’s time to deal with these resources.

Creating and updating contacts

We have no data right now, so we can start with contact creation. Current REST best practices suggest that create and update operations should return a resource representation. Since the core of this article is the API, the code that deals with the database is very basic and could be done better. In a real world application you probably would use a more robust ORM/Model and validation library.

Continue reading %Best Practices REST API from Scratch – Implementation%

Link
Christian WeiskeExternal auth patches for ownCloud 7 (23.7.2014, 05:42 UTC)

I have an ownCloud installation on my server for several reasons:

  • ownCloud has desktop client applications that sync files automatically onto the server and back between multiple clients (like dropbox).
  • It provides a caldav server for calendar sharing.
  • You may share files with single or groups of people.
  • Web gallery for uploaded image files.

External user authentication

The ownCloud apps repository contains user_external which allows one to authenticate against a FTP, IMAP or SMB server. Since I run my own mail server, authentication against IMAP is my preferred choice to keep my passwords list short.

Unfortunately, users authenticated via IMAP could not login with the desktop client, and could also not get files shared - issues #301 and #302.

A patch

Since this was an unbearable situation, I wrote a patch that creates the users in the database during login. I got an immediate rejection

Determined to solve the problem once for all, I followed the hints and rewrote a large part of the external authentication plugin.

While Thomas Müller, one of the main developers, tested my patch he stumbled across another issue: A blank page without any error notice. Another patch was needed.

One and a half months later, both patches got merged in git master. With ownCloud 7 you'll be able to enjoy them, too.

Link
Cal EvansInterview with Evan Coury (22.7.2014, 21:50 UTC) Link
Christian WeiskeRecent PEAR package releases (22.7.2014, 21:12 UTC)

I wasn't idle since the release of PEAR 1.9.5 but did a bit of work on my PEAR packages.

Net_WebFinger version 0.4.0 now supports the final WebFinger RFC 7033. On pfefferle's request I made both Net_WebFinger and its dependency XML_XRD available on packagist and thus installable via composer: pear/net_webfinger and pear/xml_xrd

Some minutes ago I released version 0.4.0 of the OpenID package. It fixes 6 bugs and adds a new feature.

Link
Bruno ŠkvorcGetting to Know Zend Server 7 (22.7.2014, 16:21 UTC)

Zend Technologies is the company which funds the development of the Zend Engine (the engine PHP is based on), as well as Zend Framework and some other projects like Apigility. They also build proprietary software of high professional caliber, designed for high intensity PHP work in large companies - software like Zend Studio and Zend Server - though both are excellent tools for solo devs as well. In this post, we’ll be taking a look at the latter.

What is Zend Server?

Zend Server is, essentially, a locally-run web application which helps you run, deploy, debug and production-prepare other applications you write. It’s more than a developer helper, though - you can install it on your production servers and have it take care of hosting, clustering, file distribution and more.

It automatically installs Zend Framework (both version 1 and 2 for some reason) and Symfony 2, and supports GUI-based management of other libraries and projects for total ease of use. All operating systems and platforms are supported, and you can install it alongside Apache or Nginx - your choice. You can have it pull in PHP version 5.4 or 5.5, and it will do the rest on its own once you run the installation script.

The latest version of ZS, version 7, comes in several licenses and flavors, so give those a read if you’d like to know about the differences.

The concept of Zend Server might be a bit too abstract to grasp right now if you’ve never encountered it before, so let’s just walk through it instead.

Continue reading %Getting to Know Zend Server 7%

Link
thePHP.ccHHVM: The New PHP? (22.7.2014, 07:00 UTC)
Link
Bruno ŠkvorcBest Practices REST API from Scratch – Introduction (21.7.2014, 16:00 UTC)

The current internet ecosystem has literally been invaded by APIs, and for good reasons. By using third party APIs in your products or services, you have access to a ton of useful features — such as authentication or storage services — that can benefit both you and your users. By exposing your own API, your application becomes “part of the mix” and will be used in ways you’ve never thought before… if you do it the right way, obviously.

In this two part series I’ll show you how to create a RESTful API layer for your PHP applications, using a collection of real world best practices.

The full source code of this project will be available at the end of part 2.

A pleasant UI for developers

First of all, an API is a user interface for developers, so it must be friendly, simple, easy to use and of course pleasant; or else it will end up being another piece of digital junk out there.

Documentation, even in the form of a simple but well written README file, is a good place to start. The minimal information we need is a summary of the service’s scope and the list of methods and access points.

A good summary can be:

Our application is a simple contact list service that manages contacts with linked notes. It has two object types, contacts and notes. Each contact has basic attributes such as first name, last name, and email address. Also, each contact can have a number of markdown-formatted notes linked to it.

Then, it’s a good idea to make a list of all the resources and actions that we are going to implement. This can be seen as the equivalent of wireframing for visual applications. Following the key principles of REST, each resource is represented by a URL, where the action is the HTTP method used to access it.

For example GET /api/contacts/12 retrieves the contact with id of 12, while PUT /api/contacts/12 will update that same contact.

The full list of methods is displayed below:

URL                           HTTP Method  Operation
/api/contacts                 GET          Returns an array of contacts
/api/contacts/:id             GET          Returns the contact with id of :id
/api/contacts                 POST         Adds a new contact and return it with an id attribute added
/api/contacts/:id             PUT          Updates the contact with id of :id
/api/contacts/:id             PATCH        Partially updates the contact with id of :id
/api/contacts/:id             DELETE       Deletes the contact with id of :id

/api/contacts/:id/star        PUT     

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

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