Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthias Noback:
Creating virtual pages with Sculpin
Dec 14, 2016 @ 15:28:58

Matthias Noback has continued his series looking at using Sculpin to create static pages for "in-project documentation" with this second post focusing more on the creation of "virtual pages". These pages allow the insertion of dynamic content into pages pulled from other sources (in this case, from the source of the project).

Previously we looked at how to use the static site generator Sculpin to generate in-project documentation. When Sculpin builds the HTML files and assets it looks at what files are in the source/ directory and processes them based on certain rules (e.g. "parse Markdown files", "format HTML files with Twig", etc.). The purpose for my "living documentation" project is to also dynamically generate documentation based on PHP and configuration files from the main project.

[...] The Sculpin documentation mentions several ways to generate dynamic content for a static site, as opposed to the standard way of adding static Markdown or HTML files. [...] So, I dug into the source code of Sculpin to find out what would be a reasonable extension point. It turned out that the best way to approach this was to create a custom data source (which is currently not documented).

He then walks you through the creation of a custom data source with "dataSourceId" and "refresh" methods the tool uses to pull in the dynamic data. He shows how to set up the script to be called at any time and have the same effect (Sculpin does this when the "server" is running) and defining the service in your Sculpin configuration.

tagged: sculpin static site generator virtual page dynamic content tutorial

Link: http://php-and-symfony.matthiasnoback.nl/2016/12/creating-virtual-pages-with-sculpin/

Symfony Blog:
Virtual Symfony Hack Day - March 12th!
Mar 08, 2016 @ 19:41:08

On the Symfony blog they've officially announce their latest virtual Symfony Hack Day coming in March (on the 12th). This event is a concentrated effort from the project and developers to come together and solve issues over several hours.

Symfony has always been a project driven by a huge and active community. [...] Because Symfony has a predictable release schedule, we know that feature freeze for Symfony 3.1 will be at the end of this month (March). That makes the next few weeks of development really important!

That's why we've decided to organize an online hack day, and I would love if you'd join us. If you're an experienced contributor, great! If you're new, even better! This hack day will focus on teaching you how to contribute.

The event will be happening March 12th from 3pm to 8pm CET / 9am to 2pm EST and will focus around the #symfony-dev channel on the Freenode IRC network. They'll be focusing on how to get started contributing to the framework including a mini-workshop showing how to triage issues to creating a pull request.

tagged: symfony framework hackday march virtual symfonydev freenode irc beginner contribute howto

Link: http://symfony.com/blog/virtual-symfony-hack-day-march-12th

Dutch Web Alliance:
Docker & PHP: beyond virtual machines
Nov 13, 2014 @ 19:09:21

On the Dutch Web Alliance site there's a recent post from Michael Rook introducing you to using Docker with PHP. Docker is a configurable system allowing you to script the creation and setup of an environment, piecing software and components together in an easy, reproducible way.

Docker is currently one of the hottest technologies around, because it solves a very specific problem: the ability to easily package and deploy a (self contained) application, without the overhead of traditional virtualization solutions. In this post you’ll learn how to build, run and host Docker containers, integrate with other containers, and see how Vagrant interacts with Docker.

The post walks you through the steps you'll need to get an instance up and running with PHP setup and configured:

  • Installing Docker
  • Creating and starting a container
  • Dependencies: linking containers
  • Using Docker & Vagrant

In the end, you'll have a virtual instance and environment with PHP installed. All commands and configuration/code needed is included in the post.

tagged: virtual machine docker tutorial introduction vagrant

Link: https://dutchweballiance.nl/techblog/docker-and-php-beyond-virtual-machines/

Peter Petermann:
Composer & Virtual Packages
Sep 30, 2014 @ 18:27:36

Peter Petermann has an interesting post he's added to his site describing a lesser known feature of the Composer package manager: virtual package support.

A few days ago i stumbled over a “virtual package” on packagist – and found it to be a feature that i was actually missing in composer. Turns out, composer can do it, its just not so well documented. So what is this about? Virtual packages allow you to have a more loose dependency. Rather than depending on a specific package, you depend on a virtual one, which can be fulfilled by all packages that provide the virtual one.

He includes a few examples to help illustrate the point of using virtual packages. The first describes an application that wants to use the PSR-4 logger structure but depends on "log-implementation" (a virtual package) rather than the "psr/log" package. The key is in using the "provide" keyword in the Composer configuration. His other two examples expand on this a bit, one showing the use of the "provide" keyword to define the relationship and the other of an actual application making use of this package.

tagged: composer virtual package provide library tutorial psr log

Link: http://devedge.wordpress.com/2014/09/27/composer-and-virtual-packages/

SitePoint PHP Blog:
Build Virtual Machines Easily With PuPHPet
Dec 19, 2013 @ 17:42:32

On the SitePoint PHP blog today Matthew Setter introduces you to a tool that can help make the setup and configuration of your Vagrant/Puppet development environments a lot easier - PuPHPet.

I can't speak for you, but one of my pet peeves about software development is environments. Whether it's creating and maintaining them for different projects with different needs; ensuring environment parity across a development team, (especially when they're remote); or between environments such as development, testing, and production. Across all of these, it can be a laborious task, especially when done manually. [...] In pursuit of ending this pain and making the entire process as efficient as possible, I set about the task of learning Vagrant & Puppet. [...] However, like most people in the modern world, I'm impatient. Like you, I have a lot going on, plus I was not seeking to become a guru. I felt there must be a way to come up to speed quickly but without becoming an aficionado.

This "better way" cam in the form of PuPHPet, a GUI tool (web-based) that lets you specify the options you want included in the configuration and generates the needed configuration files for you. This tool (created by Juan Treminio) makes it a lot simpler to get up and running quickly. Matthew walks you through a sample configuration and, with screenshots, and show you how to specify options for things like the web server, server software to install and PHP extensions to include.

tagged: puphpet virtual machine vm puppet vagrant development environment

Link: http://www.sitepoint.com/build-virtual-machines-easily-puphpet/

7PHP.com:
Win Free Tickets To Nomad PHP EU - "Dispelling the Myths About Auth*"
Oct 15, 2013 @ 16:08:37

The 7PHP.com site has announced a giveaway of free tickets to this month's Nomad PHP virtual user group meeting, the European chapter. The topic for this month's EU meeting is authorization and authentication (disclaimer: I am the speaker).

Here I am again for another NomadPHP Ticket(s) give-away. Two tickets will be given away – to the 1st & 2nd draw winner! If you did not know, NomadPHP is virtual PHP User Group mainly for people who do not have the chance to avail of a local PHP user group. But it is open to ANYONE around the world. I also remind you that NomadPHP is an initiative brought forward by the icon of The PHP Community, namely ‘His Awesomeness’ Mr Cal Evans.

To enter the contest to win the tickets, you just make a comment on the post and he'll select the winners before the event. The meeting is Thursday, October 17th at 8pm CEST.

tagged: nomadphp europe authentication authorization myth virtual usergroup

Link: http://7php.com/nomadphp-tickets-17oct2013/

Nomad PHP:
November 2013 - Ed Finkler, "More Code, More Problems"
Aug 30, 2013 @ 15:38:38

The Nomad PHP (virtual) user group has announced their speaker for the November 2013 meeting - Ed Finkler talking about the problems that come with having "more code" in your applications.

In this talk I’ll extend the concepts to other languages we work with in web development, establishing these core principles: Learn languages, not frameworks, build small things, less code is better than more, and create and use simple, readable code We’ll cover how following these principles makes you a better developer, and makes the job of maintaining and verifying your code much easier.

The meeting is on November 14th and you'll have to sign up if you'd like to attend. There's a $10 USD cost for a ticket and you can purchase them right up until the event.

tagged: edfinkler nomadphp november virtual user group

Link: http://nomadphp.com/2013/08/29/november-2013/

Community News:
Day Camp 4 Developers - Programming PHP Securely
Aug 12, 2013 @ 14:37:13

Recently, the Day Camp 4 Developers announced their latest "PHP Master Series" event (Volume 2). This time there's a focus on security with four speakers (disclaimer: myself included) talking about various aspects of PHP and general security:

Having your program hacked sucks. The sad truth is though, if you put a program out there, someone will try to find a way to hack it. Especially if there is a prize on the other side.

For PHP Master Series v2, we have gathered together 4 experts on the topic of "Programming PHP Securely" to share their knowledge with you. That knowledge will help you write programs that are more difficult to hack. Programs that will keep your data, and your customers data, safer.

Each of the found speakers - Fred Alger, Mike Stowe, Anthony Ferrara and myself - are going to cover:

  • 2FA: The Rise of Two-Factor Authentication
  • The OWASP Top 10 and You
  • Prison Theory of Web Development Security
  • Password Storage (And Hacking) in PHP

You can find out more about the event (or get your tickets) from the Day Camp 4 Developers website.

tagged: programming dc4d daycamp4developers security virtual conference

Link: http://daycamp4developers.com

JavaWorld.com:
Facebook invents a PHP virtual machine
Aug 08, 2013 @ 15:20:54

On JavaWorld.com there's a new article posted about an update Facebook has made to their HipHop virtual machine (HHVM) version that is supposed to execute PHP nine times faster than its normal rate.

Social networking giant Facebook has taken another step at making the PHP Web programming language run more quickly. The company has developed a PHP Virtual Machine that it says can execute the language as much as nine times as quickly as running PHP natively on large systems.

An engineering manager for Facebook pointed out the goal of the update - "to make PHp run really, really quickly." The HHVM compiles down the PHP code into C and executes it directly, removing the need for the PHP interpreter.

HHVM is the next step for Facebook. Under development for about three years, HHVM actually works on the same principle as the JVM (Java Virtual Machine). HHVM has a JIT (just-in-time) compiler that converts the human readable source code into machine-readable byte code when it is needed. (The previous HipHop, renamed HPHPc, has now been retired within Facebook.)

You can find out more about the HipHop virtual machine over on Facebook.

tagged: facebook virtual machine hiphop vm execution compile

Link: http://www.javaworld.com/javaworld/jw-07-2013/130726-facebook-invents-php-virtual-machine.html

Allan MacGregor:
An Introduction to HHVM
Jul 26, 2013 @ 15:24:52

Allan MacGregor has posted a (high level) introduction to the HipHop Virtual Machine (HHVM) that was created by Facebook to address some of their PHP-related needs inside their platform. It sacrifices some things in the name of speed and less resource consumption.

In early 2008 Facebook began working on HipHop(now HPHP), a PHP execution engine; its original motivation was to convert Facebook massive PHP code base into C++ in order to save resources and increase the application performance. [...] At it’s peak, HipHop PHP code showed up to 6x times better performance than its ZEND counterpart. However, there where several drawbacks to this first iteration of HipHop. [...] At the same time Facebook started the development of the modern version of HipHop, known as HHVM (HipHop Virtual Machine), HHVM improves the strengths of HPHPc and corrects many of the critical problems.

He talks some about Facebook's efforts to open source the platform and what the HipHop VM does to make your PHP code execute that much faster. It's all about bytecode, machine code and a JIT (just in time) compiler where the bytecode is parsed during execution instead of before.

Currently HHVM supports PHP 5.4 almost on its entirety, however there are still numerous bugs that prevent some applications from running, for that reason Facebook has set as goal to have the top 20 open source PHP applications running on HHVM. The first popular application to achieve this was Wordpress.
tagged: introduction hhvm hiphop virtual machine facebook bytecode jit compiler

Link: http://coderoncode.com/2013/07/24/introduction-hhvm.html


Trending Topics: