PHP Directory


  • How to Build Your Own Dependency Injection Container

  • Three Months Of Patreon

  • PHP 7.0 (and 5.6) on Ubuntu

    PHP 7 is released but for those of us who don't usually compile our own PHP, it can be a long wait for our preferred distro to release the packages we want. For Ubuntu, I'm using a PPA which allows … Continue reading

    PHP 7.0 (and 5.6) on Ubuntu was originally published on LornaJane by Lorna. Lorna is a web development consultant, tech lead, author, trainer, and open source maintainer, and she is occasionally available for freelance work.

  • PHP Tutorial to Increase Speed and Reduce Costs of AWS S3 using Caching

    By Joseluis Laso
    Amazon S3 service is one of the most popular cloud storage services that you can use for many purposes like storing backups of important data or serve important files to many users.

    Read this article to learn how to easily use Amazon AWS S3 API from PHP to store your files using caching to access the files faster and reducing the service costs.
  • Building an Spress Svbtle Theme – Responsive Static Blogs!

    You may have heard of Sculpin - a static site generator for PHP. Static blogs are, as you may know, blogs which you dynamically write in your app or on your local machine, and then export as a pure html version for hosting on static-only servers, for speed, reliability, and offline-first friendliness.

    While easy to use and fast to set up, Sculpin’s development has stagnated a bit and the documentation leaves much to be desired. Spress is, in a way, its spritual successor. Much better documentation, much more flexible configuration, much easier to extend, and just as easy to use with almost the same API and commands.

    Spress header image

    In this tutorial, we’ll be building an Spress setup for generating a static blog with a custom theme.


    This tutorial will assume you have a working PHP environment like Homestead Improved. For convenience, the following few lines will get you started immediately:

    git clone hi_spress
    cd hi_spress
    vagrant up; vagrant ssh

    After we’re in the VM, we can install Spress with:

    sudo mv spress.phar /usr/local/bin/spress
    sudo chmod +x /usr/local/bin/spress

    Spress is now available system-wide (or VM-wide if you’re using a VM), which can be verified by running spress:

    Screenshot of Spress output

    To create a sample site, we can use the instructions from the docs:

    cd ~/Code
    spress site:new myblog spresso
    cd myblog
    spress site:build --server

    The site should now be accessible via http://localhost:4000 or if you’re in a VM like Homestead Improved, you should first forward port 4000 in Homestead.yaml, run vagrant provision outside of the VM, and then access the site via

    Screenshot of working demo app

    Continue reading %Building an Spress Svbtle Theme – Responsive Static Blogs!%

  • First Symfony CMF 1.3 Release Candidate Available

    The release of Symfony CMF 1.3 is coming closer with the availability of release candidates for all packages. Stable releases can be expected in the coming weeks.

    After the 1.2 release, the activity of the Symfony CMF project has dropped, resulting in no new release in 2015. With this new release, the CMF is back in the running with full Symfony 2.8 and PHP 7 support.

    Important new Features

    Included in this release are the following packages:

    • Version 1.0 of SlugifierApi;
    • Version 1.1 of RoutingAutoBundle and RoutingAuto;
    • Version 1.2 of SearchBundle, SeoBundle and TreeBrowserBundle;
    • Version 1.3 of BlockBundle, CoreBundle, ContentBundle, MediaBundle, SimpleCmsBundle, Testing;
    • Version 1.4 of RoutingBundle and Routing;
    • Version 2.0 of MenuBundle;

    The most important features included in these new versions are:

    • PHP 7 support for all CMF packages;
    • The Routing and Testing components support Symfony 3;
    • The CmfMenuBundle added KnpMenu 2 support and dropped support for KnpMenu 1;
    • The CmfSeoBundle added support for generating sitemaps and an exception controller for better error pages;
    • The CmfMediaBundle added a cmf_media_file form type to upload simple files;
    • Improved admin experience for most Sonata Admin classes, including integration of the SonataTranslationBundle for multi-language documents;
    • A symfony-cmf/slugifier-api package was introduced, containing a generic sluggifier interface to be used when a sluggifier is needed;
    • Integration of CKeditor in the CmfSimpleCmsBundle and CmfContentBundle, providing the admin with better tooling to edit page contents.

    You can read about all new features master version of the documentation.

    Please update your project and to test the release candidates. This will help making the 1.3 release more stable.

    The Future

    Symfony CMF 1.3 will be the last release in the 1.x series. After this release, work will start on Symfony CMF 2.0. This version targets Symfony 2.8 and 3.0+. In 1.3, most deprecated features already trigger deprecation notices. However, this does not mean the upgrade to 2.0 will not contain more breaking changes. We do our best to reduce the breaking changes as much as possible.

    For 2.0, we will also try to reduce the number of bundles included in the CMF so that we can focus on the important parts. A first thing we already deprecated is the BlogBundle that never saw a stable release.

  • Quick Tip: Sync a Fork with the Original via GitHub’s Web UI

    I often find myself having to update my fork of someone else’s repo to include the changes made to the original since the fork. In fact, we use this approach often in SitePoint’s Peer Review System as well.

    Purely by accident, I’ve recently discovered a way to quickly and easily sync a fork with the original repo through the Github web UI, so no need to go commando (use the command line).

    Continue reading %Quick Tip: Sync a Fork with the Original via GitHub’s Web UI%

  • Interview with Mathew Beane

    The post Interview with Mathew Beane appeared first on Voices of the ElePHPant.

  • Clean Code Architecture and Test Driven Development in PHP

    The Clean Code Architecture was introduced by Robert C. Martin on the 8light blog. The idea was to create an architecture which is independent of any external agency. Your business logic should not be coupled to a framework, a database, or to the web itself. With the independence, you have several advantages. For example, you have the ability to defer technical decisions to a later point during development (e.g. choosing a framework and choosing a database engine/provider). You can also easily switch the implementations or compare different implementations, but the biggest advantage is that your tests will run fast.

    Just think about it. Do you really have to run through a router, load a database abstract layer or some ORM magic, or execute some other code just to assert one or more results?

    I started to learn and practice this architecture because of my old favorite framework Kohana. At some point, the core developer stopped maintaining the code, which also meant that my projects would not get any further updates or security fixes. This meant that I had to either move to another framework and rewrite the entire project or trust the community development version.

    Clean Code Architecture

    I could have chosen to go with another framework. Maybe it would have been better to go with Symfony 1 or Zend 1, but by now that framework would have also changed.

    Frameworks will continue to change and evolve. With composer, it is easy to install and replace packages, but it is also easy to abandon a package (composer even has the option to mark a package as abandoned), so it is easy to make “the wrong choice”.

    In this tutorial, I will show you how we can implement the Clean Code Architecture in PHP, in order to be in control of our own logic, without being dependent on external providers, but while still using them. We will create a simple guestbook application.

    Continue reading %Clean Code Architecture and Test Driven Development in PHP%

  • Bastian Hofmann – Talking about ResearchGate, Berlin & PHPBenelux

    Bastian Hofmann My friend Bastian Hofmann was flying to Brussels to speak at the PHPBenelux Conference that I organize. I

    The post Bastian Hofmann – Talking about ResearchGate, Berlin & PHPBenelux appeared first on Thijs Feryn's blog.

:: Our Favorites

Featured Sites Using PHP

>Atlanta Real Estate