PHP Coalface

Here's the main RSS feed from phpdeveloper.org:

PHPDeveloper.org
Web-Techno.net: The DRY principle misunderstood on 23 February 2018

On the Web-Techno.net site there's a new tutorial posted that talks about the DRY principle in development (Don't Repeat Yourself) and why .

I know what you are thinking: "Again a boring article on DRY? Don't we have enough already?". You might be right. However I see too many developers (junior or senior) applying DRY like they are doing some witch hunting. Totally randomly or everywhere they can. So apparently we never have enough DRY principle articles on Internet.

A little reminder for those in the back who don't follow: the DRY principle means "Don't Repeat Yourself" and was first introduced in the . The principle itself was known and applied before this book came to life. However the Pragmatic Programmer defined it precisely and put a name on it.

He starts by defining the original intent of the principle: not repeating knowledge (not necessarily repeating code). He gives an example of a e-commerce site and the logic around "shipments". If there's logic around these shipments happening in multiple places in the application, that can lead to maintenance issues down the line. He suggests creating a single instance of the knowledge about shipment handling rather than just reducing code duplication. He gives an example of a product instance and code duplication happening in some of the data validation. After showing a possible solution for this particular issue he gets into some issues that come from over-DRYing your code including useless abstractions and premature optimization.

php[architect]: Education Station: Shifting and Masking with a Side of Crypto on 23 February 2018

The php[architect] site has posted an article published in their issue by Edward Barnard as a part of his "Education Station" column. The article covers bit shifting and .

The basics can be tricky. This month we take a careful walk-through of a few lines of cryptographic code in PHP. This leads us through the difference between ones’ complement and two’s complement representation. We achieve weirdness by combining logical AND with integer addition.

He starts with a bit of a history lesson going back to mainframes and keypunching followed by a look at the logical and bitwise operators. He then takes some of these basics and applies them to the world of cryptography and provides some example code and a constant-time encoding algorithm. This leads to a discussion about ones' compliment, signed zero, two's compliment and "packing".

CloudWays Blog: Create A Laravel Vue Single Page App In Under An Hour on 23 February 2018

The CloudWays blog has a new tutorial posted that walks you through the process of getting in less than an hour. The instructions for the server portion cover the use of CloudWays' service but they could be applied to any number of other hosting providers.

Laravel has become the most popular choice for developing PHP projects. One important reason for this popularity is the built in support for Vue.js, a very fast growing JavaScript library for developing impressive front-ends.

This combination results is fast, secure and very impressive applications that need minimum time to go from ideation to final code review. The support for Vue.js means that Laravel developers could use Vue components easily within their apps without wasting time in writing integrations for the components. To demonstrate the support, I decided to create a single page application in Laravel with a Vue.js powered frontend.

They start off with a list of prerequisites (software to have installed) and then move on to setting up the database and creating a "tasks" migration. The tutorial then covers building out the authentication handling (via artisan) and the creation of the "task" model and controller. With all of that in place it starts in on the backend functionality to read, create, update and delete the tasks. Next it moves to the frontend showing how to create the Vue.js components required and integrating the Javascript into the view to link it to the backend for managing the tasks.

Christopher Jones: Installing XAMPP for PHP and Oracle Database on 23 February 2018

On the Oracle and PHP blog today Christopher Jones has posted a tutorial showing you how to . Oracle support requires the installation of the .

This post shows how to install XAMPP on Windows to run PHP applications that connect to a remote Oracle Database.

XAMPP is an open source package that contains Apache, PHP and many PHP 'extensions'. One of these extension is PHP OCI8 which connects to Oracle Database.

The post walks you through each of the steps required to get the combination up and running:

  • Downloading and installing XAMPP
  • Ensuring thread safety is enabled
  • Editing the php.ini to enable the OCI8 module
  • Installing the Oracle Instant Client

The post also includes some example code you can use to ensure the connection is up and working, selecting information from the default database.

Site News: Popular Posts for This Week (02.23.2018) on 23 February 2018

Popular posts from PHPDeveloper.org for the past week:

Also from phpdeveloper.org, here are some Security links:

No channel data


Comments

It's quiet in here...Add your comment