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

Christopher Pitt:
Building a blog - Introduction & Posts
Oct 29, 2018 @ 17:56:15

Christopher Pitt has kicked off a new series of posts to his site covering the creation of a new blog system. It's not just any blogging system, however. In this system he's developing it as an asynchronous application using preprocessing. In the introduction to the project he fills in more of the details:

I’ve been building this blog, for a few days now, and it’s been a fun experience. This is partly because it’s an asynchronous application, and partly because it uses a lot of preprocessing.

I thought it would be interesting for me to describe how it is put together, in an ad-hoc sort of series. In the series, I’ll show bits of code and links to libraries I’ve used. I’ll talk about why I’ve chosen to do things in certain ways, and what I could improve (short of deleting everything and starting over with a mature framework).

In this first part of the series, he includes a "tiny bit of code" showing a component of the system before the preprocessing has been run. He's also posted the second part of the series that continues covering the functionality for handling "posts" in more depth (including the use of flat files for content storage and functionality to output Markdown content as HTML).

tagged: tutorial series part1 part2 blog introduction asynchronous preprocessing

Link: https://assertchris.io/post/2018-10-24-building-something-new

Laravel News:
Building a Laravel Translation Package – Scaffolding
Oct 29, 2018 @ 16:27:42

The Laravel News site has continued their series of posts covering the creation of a Laravel translation package with part two of the series. In this latest article they build on part one's introduction and start to build out some of the scaffolding for the package.

In Part 1, we introduced that this series would cover the process of building and maintaining an open-source package for Laravel. Check it out for an overview of what we’ll create in this series. Next, we are going to get to work on scaffolding a new Laravel package.

The post then walks you though the basics of scaffolding a package including:

  • repository setup
  • Composer configuration creation
  • defining the package structure
  • the creation of a service provider
  • testing

Examples of the Composer configuration are included but the remainder of the points will be developed over the next several parts of the series.

tagged: laravel tutorial package translation scaffolding part2 series

Link: https://laravel-news.com/scaffolding-a-package

Matthias Noback:
Test-driving repository classes - Part 2: Storing and retrieving entities
Oct 08, 2018 @ 19:44:04

Matthias Noback has continued his series of tutorials covering various uses of the Repository design pattern. This is the second part of the series and picks up where part one left of, showing the handling of entities in the repository, performing the usual CRUD operations.

In part 1 of this short series (it's going to end with this article) we covered how you can test-drive the queries in a repository class. Returning query results is only part of the job of a repository though. The other part is to store objects (entities), retrieve them using something like a save() and a getById() method, and possibly delete them. Some people will implement these two jobs in one repository class, some like to use two or even many repositories for this. When you have a separate write and read model (CQRS), the read model repositories will have the querying functionality (e.g. find me all the active products), the write model repositories will have the store/retrieve/delete functionality.

In particular if you write your own mapping code (like I've been doing a lot recently), you need to write some extra tests to verify that the persistence-related activities of your repository function correctly.

He starts with the test cases for the functionality (following the test-drive design mentality) and talks about the expected behavior of the various entity and repository methods. He includes the code for these tests covering state changes, handling child entities, deleting entities, and working with ports/adapters.

tagged: entities repository class tutorial series part2 test

Link: https://matthiasnoback.nl/2018/10/test-driving-repository-classes-part-2-storing-and-retrieving-entities/

Symfony Blog:
SymfonyCon Lisbon here we come: schedule part 2!
Aug 27, 2018 @ 15:45:28

On the Symfony blog they've posted the second part of their announcement about the speakers that will be presenting at the SymfonyCon Lisbon conference in December.

We announced last Monday the first part of the conference schedule for SymfonyCon Lisbon 2018. We’re now very happy to announce the second part of the schedule. Discover the conference schedule! We’re extremely pleased to welcome the following speakers (in alphabetical order) and their talks at the conference.

Speakers and sessions in this announcement include:

  • Pedro Magalhães: "Changing PHP"
  • Jeremy Mikola: "Bulletproof MongoDB"
  • Michelle Sanver: "Using the Workflow component for e-commerce"
  • Miro Svrtan: "When Testing Makes No Sense"

They'll also be joined by Symfony creator and project lead Fabien Potencier with an opening keynote.

tagged: symfonyconlisbon18 symfonycon conference schedule announcement part2

Link: https://symfony.com/blog/symfonycon-lisbon-here-we-come-schedule-part-2

TutsPlus.com:
Get Started With Pusher - Using Private Channels
Aug 09, 2018 @ 16:56:46

TutsPlus.com has posted the next part of their series covering the use of "channels" with Pusher, the real-time messaging service. In the previous article they introduced Pusher and its "channels" functionality to build a simple real-time chat. In this new tutorial they show how to modify this application to use private channels.

n this series, we've been learning about Channels from Pusher, a platform that allows you to give your users the seamless real-time experience they want.

Private channels provide your applications with a secure, private medium for publishing messages. The best part is how easy it is to implement and use private channels for your apps.

Much like the previous article, they've included a screencast of the entire process right along side the text version. The tutorial walks you through setting up the server (the ChannelsController), the endpoint for client authorization and the changes to make to the client itself.

tagged: pusher private channel private tutorial series part2

Link: https://code.tutsplus.com/tutorials/get-started-with-pusher-using-private-channels--cms-31253

Pascal Landau:
Setting up PhpStorm with Xdebug for local development on Docker
Aug 08, 2018 @ 17:44:30

Following up from his previous post about setting up Docker running PHP-FPM and Nginx on Windows 10, Pascal Landau has published the second part of the series taking things a step further and introducing (and integrating) PhpStorm and Xdebug for local development debugging.

In the second part of this tutorial series on developing PHP on Docker we're taking a good hard look at PhpStorm, Xdebug and how to run and debug scripts from within PhpStorm on Docker.

[...] The setup that I am going to use is for demonstration purposes only! I do not recommend that you use it "as is" as your development setup. [...] There will be a another part of this series that will deal with all of those (and some more common) problems and aims at providing a consistent development environment for all developers in a team (regardless of the OS they are using).

He then walks through the process from setup through actual script debugging:

  • setting up the Docker containers/configuration
  • allowing the PHP container to connect over port 2375
  • running a PHP script on this container
  • building a "workspace" container for Xdebug

For each step he provides the configuration changes needed, commands and screenshots of the settings panels to ensure its easy to follow along.

tagged: docker phpfpm nginx debugging phpstorm xdebug tutorial series part2

Link: https://www.pascallandau.com/blog/setup-phpstorm-with-xdebug-on-docker/

Contentful Blog:
An extremely picky developer's take on static site generators for PHP: Part 2 - Jig
Aug 03, 2018 @ 15:50:23

On the Contentful blog they've posted the second part of their series reviewing static site generators for PHP. In this new article they look at Jigsaw, a Laravel-based tool.

In the first article of the series we took a look at Sculpin, the PHP static site generator which is currently the most starred on Github. Today we’re exploring Jigsaw, a tool which promises to bring a Laravel-based approach to the world of PHP static site generators (SSGs).

The author starts by sharing some about his (somewhat limited) experience with Laravel. From there he dives right in, showing the creation of a new Jigsaw site including configuration and how to serve it up locally. It then gets into detail about the directory structure of the site, asset handling and adding new content. The post ends by answering the "is it ready" question for their own needs (at Contentful).

tagged: static site generator review series part2 jigsaw

Link: https://www.contentful.com/blog/2018/08/01/extremely-picky-developers-take-php-static-site-generators-part-2-jigsaw/

Delicious Brains:
WordPress Deployment Part 2: Deploying WordPress Using The Command Line
Jul 03, 2018 @ 14:48:59

The Delicious Brains site has posted the second part of their "deploying WordPress using the command line" series today. In part one they talked about automated deployments and why they're important (and useful). In this latest tutorial they start in on the setup of the environment and the tools you'll need to complete the deployment.

In my last article, we looked briefly at why automated deployments are important and how to prepare a WordPress site for automated deployments.

Now that our WordPress site is ready to be deployed, in this article we’re going to look at how we can use command line (CLI) tools to deploy WordPress from our local computer to a remote server. While we’re not quite at the stage of being ready to set up automated deployments just yet, understanding how we can use CLI tools to deploy WordPress will serve as a good foundation for all of the automated deployment methods we will look at later in this series.

The article then walks through the different pieces you'll need to set up including a DigitalOcean droplet as a destination and a choice of several data transfer tools:

The post also mentions the WP-CLI tool but points out that it doesn't include functionality to actually move files, only work with local ones.

tagged: wordpress deployment part2 series commandline tutorial

Link: https://deliciousbrains.com/wordpress-deployment-workflow-command-line/

SitePoint PHP Blog:
Building an Image Gallery Blog with Symfony Flex (Parts 1 & 2)
Jun 21, 2018 @ 16:48:56

On the SitePoint PHP blog they've kicked off a series by Zoran Antolovic walking through the creation of a blog application using the latest from the Symfony project - Symfony Flex.

Our journey towards a stable, robust, high-performance web app will start with the simple but functional application — the so-called minimum viable product (MVP). We’ll populate the database with random content, do some benchmarks and improve performance incrementally. Every article in this series will be a checkpoint on our journey!

This article will cover the basics of setting up the project and organizing files for our Symfony Flex project. I’ll also show you some tips, tricks and helper scripts I’m using for speeding up the development.

So far they've posted the first two articles of the series:

  • Part one explaining some of the basics of Flex and getting the application set up (including some sample fixture data)
  • Part two showing how to populate the application with more realistic data, run some basic performance tests and create a first unit test

There's much more to come in the series including the creation of file (image) upload handling, user registration and login and the creation of image galleries from uploads.

tagged: image gallery blog tutorial symfonyflex symfony flex part1 part2

Link: https://www.sitepoint.com/building-image-gallery-blog-symfony-flex-setup/

Symfony Blog:
New in Symfony 4.1: Misc. improvements (Parts 1-4)
May 30, 2018 @ 18:18:05

On the Symfony project blog they've posted a series of articles covering some miscellaneous improvements made for the v4.1 release of the framework.

During the past months we've published almost 40 blog posts about the main new features of Symfony 4.1. In this article you'll find some of the other small but nice new features.

Here's the list of the posts and some of the things covered in each:

  • Part 1: CSRF without forms, visibility change in progress bar component, showing dotenv files in the profiler
  • Part 2: command to delete cache pool items, allowing custom functions in "allow_if" expressions, addition of "dd" debug helper
  • Part 3: add/remove LDAP attributes efficiently, keeping the query string after redirect, hasser accessors in PropertyInfo
  • Part 4: adding anonymous services in PHP DSL, support for extracting type from constructor, configurable PHP error log level

Check out each post for a brief summary of each change and example code/configuration showing how to make use of it.

tagged: symfony improvement v41 series part1 part2 part3 part4

Link: https://symfony.com/blog/new-in-symfony-4-1-misc-improvements-part-1


Trending Topics: