Symfony CMFSymfony CMF Hackdays in Würzburg (12/13 Dec. 2014) (26.11.2014, 05:00 UTC)

The Mayflower Gmbh will host the next Symfony CMF Hackday in Würzburg, Germany. It will be focused on the roadmap for the 1.3 release. We are going to have nearly two days of hacking and pushing the CMF forward to the next version.

You can sign up to the event on Doodle. There will be a public workshop as an opener, too. You can get more information via the Facebook-Event. This workshop is public, but limited to 8 persons.

Both events are located at:

Mayflower GmbH
Gneisenaustraße 10/11
97074 Würzburg
Germany

Link
PHP ClassesOAuth Pin Based Authorization for Twitter, LinkedIn, Imgur and Others (25.11.2014, 10:13 UTC)
By Manuel Lemos
Some applications need to access OAuth based APIs but since they are not based on regular Web browsers, they need to need to use an alternative method to obtain the user authorization.

Pin based authorization is a method used for instance by applications based on the command line, desktop applications, embedded systems, game consoles, and certain types of mobile apps.

Read this article to learn how the pin based OAuth authorization process works and how can you implement it in your applications using the PHP OAuth API class.
Link
Derick RethansLondon in Fives: The Making Of (25.11.2014, 08:55 UTC)

London in Fives: The Making Of

A few days ago I published a video called "London in Fives" on Vimeo. In this article I am explaining how I made this, including the hardware and software that I used.

But first, let's have a look at the video itself:

London in Fives

There are 25 sections in this video, each taking 5 seconds. Because the frame rate is 25 fps, that means there are 125 frames per segment. All those numbers are powers of 5, hence the title of the film: London in Fives.

The first and last segments are merely the title and end credits, and are just a series of images. The more interesting bits are the 23 segments in between.

Hardware

All these segments are made from single frame shots from my Nikon D300 DSLR camera. It has a feature that allows a picture to be taken every 5 seconds automatically. For all segments, except for the night time shot of Covent Garden and the Ice Skating, that created the raw images.

For each segment, I usually took a few more shots than the 125 required, usually up to a 150, to have a bit of a choice of where to start and end the segment. In one case (the Regent's Park sunrise in the fog segment), I was happy that I did! Due to a hard drive failure I fortunately managed to only lose a few images, so that I still had just 125 left!

Of course it is important to keep the camera steady between all of the shots. In most of the segments I used a GorillaPod, a three legged flexible tripod where each leg can wrap around objects. In the later scenes, I used a normal stand-up tripod, a Manfrotto befree.

astro.png

The camera movements are all done in post production, except for the night time shot of Covent Garden and the Ice Skating segments. Instead of using my camera's "take a photo every x seconds" feature, I relied on hardware to take both a photo every 5 seconds, but also rotate the camera slightly on top of its tripod. The time lapsing device that I used to rotate and instruct the camera to take a photo every 5 seconds is an Astro. This is a disk like device that can rotate around one axis and instruct the camera through a cable to take a photo at specific intervals over a certain period of time. I think that for future time lapses I will not rotate more than 30° for a 125 segment shoot as otherwise it goes a bit too fast.

To make sure I had my camera perfectly horizontal on my camera, I used a spirit level that sits on top of my flash socket.

Post Processing

After taking the photos, some post-processing was necessary. There are three types of post-processing that I had to do, depending on how the photos were shot.

For the two segments created with the Astro, I really only had to rescale the photos from the camera's native resolution to 1280x720.

For one other segment (Regent's Park sunrise in the fog), the GorillaPod was sitting on a bench that didn't turn out to be stable enough and lots of instability was introduced among the different images. I used Hugin's align_image_stack tool to align them in such a way they formed a stable sequence of images. This tool is usually used to "align overlapping images for HDR creation", but it also suited my use case very well. Basically, I ran the following command:

align_image_stack -a aligned/a -v -i -C --threads 3 *jpg

I first also tried enabling GPU support for remapping, but that just ended up crashing the tool. The tool here is called with an output prefix of aligned/a and the -C auto-cropped the image sequence so that it covered an area that all images shared.

lon</body>

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

Link
Cal EvansInterview with Lorna Jane Mitchell (25.11.2014, 05:00 UTC) Link
labs @ Qandidate.comBroadway just got a new release (25.11.2014, 00:00 UTC)

Today we tagged version 0.3.0 for Broadway. In this version we have merged some nice pull requests from various contributors, thanks to everybody that submitted issues and/or pull requests!

One of the pull requests we received is from simensen. He added factories for our aggregates.

∞ labs @ Qandidate.com Permalink

Link
Horde newsHorde im Tatort (24.11.2014, 18:46 UTC)
Horde Groupware played a role in Germany's number one crime series on Sunday evening.
Link
Anthony FerraraAlternatives To MVC (24.11.2014, 18:00 UTC)
Last week, I wrote A Beginner's Guide To MVC For The Web. In it, I described some of the problems with both the MVC pattern and the conceptual "MVC" that frameworks use. But what I didn't do is describe better ways. I didn't describe any of the alternatives. So let's do that. Let's talk about some of the alternatives to MVC...

Read more »
Link
SitePoint PHPGeospatial Search with SOLR and Solarium (24.11.2014, 17:00 UTC)

In a recent series of articles I looked in detail at Apache’s SOLR and Solarium.

To recap; SOLR is a search service with a raft of features - such as faceted search and result highlighting - which runs as a web service. Solarium is a PHP library which allows you to integrate with SOLR - whether local or remote - interacting with it as if it were a native component of your application. If you’re unfamiliar with either, then my series is over here, and I’d urge you to take a look.

In this article, I’m going to look at another part of SOLR which warrants its own discussion; Geospatial search.

An Example

I’ve put together a simple example application to accompany this article. You can get it from Github, or see it in action here.

Before we delve into that, let’s look at some of the background.

Sometimes, the things you want to search for have geographical locations. Often, that provides vital context. It’s all very well me being able to search for “Italian restaurants”, but I’m hungry - a restaurant on another continent, as good as it might be, is of no help. Rather, it would be far more useful to be able to run a search which asks “show me Italian restaurants, but within 5 miles”. Or alternatively, “show me the ten closest Italian restaurants”. That’s where Geospatial search comes in.

Continue reading %Geospatial Search with SOLR and Solarium%

Link
Paul ReinheimerMongo Replicaset Issue - NAT'd server (24.11.2014, 00:19 UTC)

We just ran into an issue joining a new server to our MongoDB replica set powering Where’s it Up & ShotSherpa. We copied the data over to give it a good starting point, then added it to the replica set. We waited a while, it still hadn’t joined, looking at the tail of the log showed many connection lines, nothing telling. When I restarted MongoDB I saw:

replSet info self not present in the repl set configuration

I tried pinging the server’s hostname to ensure it was successful. No problem. I tried connecting to the server using the mongo command line on the primary server (`mongo server.example.com:27017`). No problem.


Eventually I copied the mongo hostname from the replica set configuration, and tried to use it to connect to mongo on the new secondary. No dice! As it turns out the NAT hadn’t been configured to allow that hostname to work locally. A few new entries in our /etc/hosts file later, and our server was joined successfully.

MongoDB Tip:

When MongoDB has trouble connecting, try the connection strings listed in the replica set config from all relevant hosts.

Link
Christian WeiskePCNTL with mod_php and phancap 0.2 (22.11.2014, 20:41 UTC)

SemanticScuttle with website thumbnails Last week I released version 0.2.0 of phancap, the self-hosted website screenshot service.

phancap uses cutycapt to render website screenshots on a headless server, and it works fine most of the time. The problem here is most of the time; cutycapt has a nasty bug that makes it hang on some web sites and use 100% CPU, forever. This is not something that you want to run unattended on your server.

Process control

Fortunately, PHP has the pcntl extension that allows PHP scripts to fork and control processes. My idea was to let cutycapt run for at most 30 seconds and kill it if it did not exit in that time. This way, screenshot generation would fail for some URLs, but the server would not collect hundreds of never-ending processes.

The implementation wasn't that hard and worked fine on command line: It forked a child process that hung forever and killed it after 3 seconds.

After integrating it in phancap I noticed that it did not work. I was sure I had the pcntl extension installed and enabled, and it worked fine on CLI - just not when run under mod_php.

A user note in the PHP manual finally gave a hint why it failed:

"Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment."

At least for PHP 5.3.8 which I am using, and who knows how far back, it's not a matter of "should not", it's "can not". Even though I have compiled in PCNTL with --enable-pcntl, it turns out that it only compiles in to the CLI version of PHP, not the Apache module. As a result, I spent many hours trying to track down why function_exists('pcntl_fork') was returning false even though it compiled correctly. It turns out it returns true just fine from the CLI, and only returns false for HTTP requests. The same is true of ALL of the pcntl_*() functions.

To summarize: PHP's pcntl extension does not work on Apache with mod_php.

timeout to the rescue

After some searching I found the timeout command on my linux system, which came with the GNU core utilities.

timeout lets you specify how long to wait for a process to finish, and kills it with a user-defined signal if it's still running.

phancap utilizes timeout now when running cutycapt. With that I'm confident enough to let phancap run on my public server and use it on the SemanticScuttle demo site to provide screenshots for bookmarked web sites.

<script type="text/javascript" src="http://cweiske.de/tagebuch/js/shadowbox/shadowbox.js"> <script type="text/javascript"> Shadowbox.init({ continuous: true, displayCounter: false, displayNav: true, handleOversize: "resize" });
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP