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

AWS Developer Blog:
Automating the Deployment of Encrypted Web Services with the AWS SDK for PHP (Pa
Feb 17, 2017 @ 12:25:48

The Amazon Web Services blog has posted the second part of their series covering the automated deployment of encrypted web services with the AWS SDK. In this new tutorial (part two, part one is here) they continue with the deployment of services: AWS Elastic Beanstalk, Amazon Route 53 and Amazon CloudFront.

In the first post of this series, we focused on how to use Amazon Route 53 for domain registration and use Amazon Certificate Manager (ACM) to create SSL certificates. With our newly registered domain available for use, we can proceed to deploy and configure the services we need to host the www.dev-null.link website across an encrypted connection. Once complete, the infrastructure configuration will reflect the diagrams [included in the post].

The tutorial then walks you through each of the services you need to deploy and shares the code (using the AWS PHP SDK) to show how to automate the process. There's also a few screenshots included of various page results and admin UIs to help you be sure you're in the right place.

tagged: aws amazon deployment encrypted webservice sdk tutorial series part2

Link: https://aws.amazon.com/blogs/developer/automating-the-deployment-of-encrypted-web-services-with-the-aws-sdk-for-php-part-2/

Delicious Brains Blog:
Scaling Laravel Using AWS Elastic Beanstalk Part 3: Setting up Elastic Beanst
Feb 07, 2017 @ 10:29:41

The Delicious Brains blog has posted the third part of their series covering the scaling of Laravel with AWS Beanstalk. In this latest article the walk through the setup of the Elastic Beanstalk application.

In my last article we set up the supporting services we would require for our Laravel app once we deploy it to the Elastic Beanstalk architecture. We created a VPC to keep our infrastructure secure, we created a MySQL database in RDS, and we set up ElastiCache for our Redis cache. So now that our Laravel app is decoupled and our supporting services are in place, it’s finally time to deploy our app to Elastic Beanstalk.

They start by talking about the Elastic Beanstalk environments and helping you get the application set up via the command line tool. Next up is the creation of the ebextensions directory and the matching YAML configurations for the EB settings. They provide an example of the contents` and explain what some of the configuration sets up. Finally they use the command line tool to issue the "create" command and build out the environment based on the configuration. The post wraps up with a bit about some configuration tweaks that could be made and optionally enabling HTTPS.

tagged: tutorial elastic beanstalk tutorial series part3 setup environment commandline

Link: https://deliciousbrains.com/scaling-laravel-using-aws-elastic-beanstalk-part-3-setting-elastic-beanstalk/

Building Your Startup: Advanced Scheduling Commands
Jan 30, 2017 @ 10:56:17

The TutsPlus.com site has updated their "Building Your Startup" series with their latest tutorial showing you how to build advanced scheduling commands allowing for things like repeating meetings, updating the meeting details and rescheduling.

I also began to realize that the ability to adjust meetings easily after they've been scheduled could make or break the Meeting Planner brand. [...] In today's tutorial, I'll cover expanding the navigation bar using Bootstrap and the basics of building some of the advanced scheduling features within Meeting Planner. Next week, I'll review building the more complex feature for participants to request change(s) and for others to accept or decline them.

He starts with the frontend, updating the navigation bar to include links to other functionality for meeting changes, repeating and showing planning activities for the meeting. He uses Bootstrap's single-button dropdowns for this and includes the code to add them to the UI with a bit of code in the view. He then gets into the main functionality of these changes showing the code to:

  • make changes to a current meeting
  • reschedule a meeting
  • repeat a meeting
  • resend invitations

The next part in the series will take a look into social engineering and UX needs for the application along with some other smaller changes.

tagged: startup tutorial series advanced scheduling commands change update meeting

Link: https://code.tutsplus.com/tutorials/building-your-startup-advanced-scheduling-commands--cms-27075

Building Your Startup: Automatic Time-Zone Detection
Jan 25, 2017 @ 12:43:43

The TutsPlus.com site continues their "Building Your Startup" series of tutorials with the latest in the series covering automatic timezone detection based on the user's local time.

For the alpha release of Meeting Planner, I provided people the opportunity to change their time zone in user settings. However, for anyone outside of the western United States, they may have been wondering why their calendar appointments were at the wrong times. You have to know to look for the settings page.

As I approach the beta, I realized I needed to fix this as soon as possible. So I began to reflect on how best to resolve this. In today's episode, I'm going to walk you through my approach to automatic time-zone detection and how I integrated it into the user experience.

The tutorial starts off with a look at the current state of timezone detection, linking to two options that do mostly the same thing. Eventually, however, he decided on the jsTimezoneDetect library as it fit best with the needs of the application. He covers some of the thoughts that went into designing the user experience and the code required to integrate the Javascript library with his Yii2-based application. He ends the tutorial with a few additional considerations worth keeping in mind including timezone representation in ical exports and virtual meetings.

tagged: timezone detection tutorial startup series yii2 automatic

Link: https://code.tutsplus.com/tutorials/building-your-startup-automatic-timezone-detection--cms-27041

Building Your Startup: Preparing for Text Messaging
Jan 23, 2017 @ 09:44:52

The TutsPlus.com site has posted the latest in their (lengthy) series of tutorials showing how to use PHP to "build your startup". In this new tutorial they show how to integrate SMS functionality into the application. This is the first part covering this topic and mostly covers the setup and testing of the connection to send the necessary SMS messages.

In today's episode, I'm going to walk you through the first half of my SMS configuration for the Meeting Planner application. Basically, I'll cover choosing an SMS provider, setting up the account, building the initial application infrastructure, and trial texting.

In the next episode, I'll build specific texting scenarios into the Meeting Planner application and walk you through those decisions and the coding that followed.

He starts off talking about one of the main choices you'll have to make early on: which SMS provider you want to use to send your messages. While they list several, for the sake of the tutorial they move ahead with Twilio. He show you how to set up an account with the Twilio service and where to get the credentials to connect your application to their API. After talking a bit about things like SMS pricing and handling incoming messages he starts on the integration with Yii2 via this package. Once installed and configured he creates a simple class to send a message via Twilio and tries it out with a "First test" message.

tagged: startup build tutorial series yii2 framework twilio sms notification

Link: https://code.tutsplus.com/tutorials/building-your-startup-preparing-for-text-messaging--cms-26912

Using Namespaces and Autoloading in WordPress Plugins, Part 4
Jan 19, 2017 @ 10:24:36

The TutsPlus.com site has posted the fourth part of their series covering the use of namespacing and autoloading in WordPress plugins. In this latest tutorial they take everything they've shared (and made) previously and put it all together into a cohesive whole plugin.

At this point, we've laid the foundation for our plugin, written the plugin, and defined and explored namespaces and autoloaders. All that's left is to apply what we've learned.

So in this tutorial, we're going to put all of the pieces together. Specifically, we're going to revisit the source code of our plugin, namespace all relevant classes, and write an autoloader so that we can remove all of our include statements.

He starts off talking about namespacing and how it relates to directory structure and the code you'll need for each of the plugin files for put them in the correct namespace. With just these in place, however, errors are thrown. This requires the setup of a custom autoloader and PHP's own spl_autoload_register handling. He includes the code for the autoloader, taking in the class name and splitting it up to locate the correct directory, making it easier to replace the loading of all plugin scripts.

tagged: namespacing tutorial series part4 wordpress plugin autoloading namespace

Link: https://code.tutsplus.com/tutorials/using-namespaces-and-autoloading-in-wordpress-plugins-4--cms-27342

Mattias Noback:
Containerizing a static website with Docker, part III
Jan 09, 2017 @ 11:48:46

Matthias Noback has posted the third part of his "containerizing a static website with Docker" service, continuing on from his previous two posts to look at deploying the environment he's created.

In the previous posts we looked at creating a build container, and after that we created a blog container, serving our generated static website.

It's quite surprising to me how simple the current setup is — admittedly, it's a simple application too. It takes about 50 lines of configuration to get everything up and running.

The idea of the blog container, which has nginx as its main process, is to deploy it to a production server whenever we feel like it, in just "one click". There should be no need to configure a server to host our website, and it should not be necessary to build the application on the server too. This is in fact the promise, and the true power of Docker.

He then gets into the two remaining steps in the process resulting in the deployment of the simple application: pushing to Docker Hub and deploying out to a DigitalOcean server. He includes all of the commands and configuration you'll need to get the process set up and work with the remote machine.

tagged: docker series container part3 deploy dockerhub digitalocean

Link: https://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker-part-iii/

Matthias Noback:
Containerizing a static website with Docker (Part 1 & 2)
Jan 06, 2017 @ 09:07:39

Matthias Noback has started a series to his site showing you how to use Docker along with a static site, like one generated with Sculpin to create a complete environment. So far he's posted part one and part two.

Recently a former colleague of mine, Lucas van Lierop, showed me his new website, which he created using Spress. Lucas took two bold moves: he started freelancing, and he open-sourced his website code. This to me was very inspiring. I've been getting up to speed with Docker recently and am planning to do a lot more with it over the coming months, and being able to take a look at the source code of up-to-date projects that use Docker is certainly invaluable.

Taking lots of inspiration from Lucas's codebase, and after several hours of fiddling with configuration files, I can now guide you through the steps it took to containerize my blog (which is the site you're visiting now) and deploy a single container to a production server.

In part one he talks about how his blog is currently set up - based on a "large set of Markdown files" - and using Sculpin to generate the resulting site. He walks through the configuration of the Sculpin installation and how to configure and build the initial container, the "build" container.

In part two he continues the process but creates a "blog" container this time. This container runs the web server itself (nginx) configured as required by the Sculpin formatting.

tagged: container docker static website tutorial series part1 part2

Link: http://php-and-symfony.matthiasnoback.nl/categories/Docker/

Programming With Yii2: Using the Debugger
Jan 03, 2017 @ 11:52:29

The TutsPlus.com site continues their "Programming with Yii2" series of tutorials with the latest edition in the series, a look at using the Yii2 debugger to help track down issues in your code.

In today's tutorial, I'll show you how to install the Yii2 Debugger, and we'll explore its capabilities in detail. It's a powerful programming assistant which is often underutilized.

As you code and test your application, the debugger can show you your application path, queries and query variables, performance characteristics, server and framework settings, and much more.

The article starts off by showing you how to install the "yiisoft/yii2-debug" library (via Composer) and enable it in the "debug" section of your configuration. With it correctly installed you'll then be able to access it at the bottom of your pages. The debug console provides plenty of helpful information related to:

  • the route matched
  • a log of actions and events
  • load time
  • memory used
  • database queries performed

...among others. The tutorial walks you through these and other pieces of information the tool provides with screenshots of example output for each.

tagged: programming yii2 debugger tutorial series toolbar screenshot detail

Link: https://code.tutsplus.com/tutorials/programming-with-yii2-using-the-debugger--cms-26910

Building Your Startup: Ajax for Meeting Times and Places
Jan 02, 2017 @ 13:10:42

The TutsPlus.com site has posted the next in their "Building Your Startup" series of tutorials covering the use of Yii2 to create a calendaring application. In this new part of the series they continue migrating some functionality over to use an Ajax-powered system, reducing the need for page reloads.

Last week, I delved deeper into Ajax to transform the meeting scheduling experience into a fully ajaxified model and eliminated the need for page refreshes. I got about halfway, focusing mostly on the straightforward elements.

In today's tutorial, I'll guide you through the more complex content panels that required a lot more troubleshooting, research, debugging, brainstorming, and recoding. [...] I'm also going to show you how I used Google's Chrome browser developer console to help me identify the broken areas—which can be especially difficult when working with Ajax between PHP and JavaScript. It's like light at the end of the tunnel of darkness.

The tutorial then walks through the updates needed to move over various pieces of functionality to the Ajax-driven model:

  • adding meeting participants
  • adding dates and times
  • adding meeting places

There's also a few screenshots included of the Chrome developer console and what some of the example request/responses look like, helping you debug your own development work.

tagged: startup ajax meeting time place series refactor feature tutorial

Link: https://code.tutsplus.com/tutorials/building-your-startup-ajax-for-meeting-times-and-places--cms-27327