Welcome to this weeks @phpweekly news.
Back in September, Laravel News partnered with LaraJobs to run a Laravel survey, to see what types of projects people are taking on with Laravel, as well as get some feedback on what the Laravel community could be doing better. With over 1,600 submissions, and some interesting insights, the complete results are available here.
Also this week we have the next episode in the Programming With Yii2 series, looking at Routing and URL Creation.
The January edition of php[architect] magazine is out now. Titled Blueprints for Success, it contains articles to help you plan and make your application and code better.
Plus the first Free The Geek podcast of 2017 is out now, featuring a great, and in-depth, discussion with the Asciidoc project leader Dan Allen.
And finally, the two day PHP Serbia Conference has been announced for May this year, taking place in Belgrade. The Call for Papers is now open.
Have a great weekend folks,
Cheers
Katie and Ade |
We love our sponsors. Why not try them?
From our sponsors:
|
Articles
Moving the Drupal 8 Workflow Initiative Along
Nine months ago I wrote about the importance of improving Drupal's content workflow capabilities and how we set out to include a common base layer of workflow-related functionality in Drupal 8 core. Today, I'd like to provide an update on the workflow initiative's progress the past 9 months.
Scrum Roles: Product Owners and Team Members
Unlike a scrum master, whose responsibilities are focused on the development team, a product owner has a shared responsibility to the team and to the customer. The product owner is the voice of the customer, and stands in as the representative of the customer’s needs, wants, and expectations.
2016 Laravel Survey
At Larajobs we’ve been front and centre for the amazing rise in popularity in Laravel over the past few years. Each year it seems to keep growing faster than we could ever expect. Though we can all see the growth in Github stars or Google searches, we thought it’d be interesting to partner up with Laravel News to survey Laravel users, to dig out more details than you can get from those simpler metrics. Over 1,600 of you took the survey! Here we’ve published the results, along with some additional analytical analysis and a subset of the replies we received to the open ended questions.
Pragmatic Coding
Can you write me a simple script that fetches some information from an RSS feed and displays the titles? Like, just write me that script in a couple of minutes. I don't care about tests, quality, etc. Just get me the information, quickly. I'm curious how you would handle this request. A couple of years ago I was asked a similar question. Not in a professional role, but for a hobby project that has nothing to do with PHP. There was a website, a simple website, and it needed some information displayed. Nothing fancy right? I can do that. But as I sat down to code this little script, I came to the conclusion that it took me way too much effort to start thinking in a pragmatic, simplistic way.
The 10 Best Amasty Articles of 2016
One more year is gone now, and we traditionally sum it up with the collection of our best blog posts. We selected the most popular and shareable articles and hope you’ll enjoy the reading!
Goodbye PHP 5
A few days ago I merged a patch into Xdebug that removes support for PHP 5 in Xdebug's master branch on GitHub. Maintaining PHP 5 and PHP 7 support in one code base is not particularly easy, and even more complicated for something like Xdebug, with its deep interactions with PHP's internals. As PHP 5.6's active support has ended on December 31st, I also felt it no longer needed to support PHP 5 with Xdebug any more. It saves more than 5000 lines of code. |
Tutorials and Talks
Programming With Yii2: Routing and URL Creation
In this Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. In today's tutorial, I'll review routing and URL creation in Yii. When a browser request arrives at your Yii application's index.php file, it must be parsed to determine which controller and method to call. That's routing. The reverse process of linking to parts of your application is URL creation, which is best done programmatically.
WherePivot and WherePivotIn – Additional Filters or many-to-many Relationships
Recently I’ve found a small detail in Laravel documentation which I want to share with you. Apparently, it’s possible to filter pivot tables additionally, if needed. Let me show you how.
Sane Defaults Over Exceptions
Part of our work is defensive programming. A lot of web development is centered around taking input from a customer, processing it in some way and returning output. Since the source of input is out of our control we are used to writing all kinds of guards. Is this an integer (in case of a dynamically typed language), is it greater than zero, is it smaller than RANDOM_THRESHOLD, etc.
Using Phive To Manage PHPUnit
I recently came across the Phive project and have had a play with it. Phive is part of phar.io and is intended to manage development tools such as PHPUnit in preference to using Composer's dev dependencies. The main advantages of Phive are that it uses the phar file of the tool and only keeps one copy of each version rather than downloading a new copy into each project.
Drupal 8 Migrate Multilingual Content using Migrate API
As a follow-up to my previous blog post about the usage of Migrate API in Drupal 8, I would like to give an example, how to import multilingual content and translations in Drupal 8.
Containerising a Static Website with Docker, Part I
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 containerise my blog (which is the site you're visiting now) and deploy a single container to a production server.
Building Your Startup: Sending Reminders
In this two-part tutorial, I'm describing how I built the infrastructure for reminders and their delivery. Today, I'm going to guide you through monitoring when to deliver reminders and how to send the emails.
Re-Introducing Jenkins: Automated Testing with Pipelines
As our applications become more complex – with Composer dependencies, Webpack build scripts, and per-environment variables – we inevitably reach a point where testing all of these different intricacies becomes slow and laborious, especially when you’re tearing down and rebuilding the entire environment for each test. Likewise, code style might deviate over time and creating a production ready deployment archive requires a specific set of steps to be followed.
Writing Functional Tests for WP-CLI Packages
My last article was part of a short series on automating local WordPress site setup. In that series, we created a WP-CLI package that helps with installing and uninstalling WordPress development environments, and we even got it submitted to the WP-CLI Package Index. Since the command is available for anyone to use in the Package Index, it makes sense to improve on the command and make sure that it works for everyone. In this post we’re going to take a bit of a break from automating WordPress installs and start writing some functional tests to make sure that everything works as expected. While I’ll be writing the tests for the wp installer command, the same concepts should apply for any WP-CLI package.
How To Disable PHP Files in Upload Folder of WordPress With IIS
This is another security tip to harden your WordPress site running on IIS server. As we know, hackers always try to find loop holes in the website to hack it. It is better to prepare yourself for each type of attack. A smart developer always tries to minimise the chances of hacking by implementing security measures. Attack on upload folder by inserting .php files to it is one of the most used hacking technique. Hackers generally insert a PHP file to your upload folder and execute it to get useful information or delete something.
Using HTTP Client Timeouts in PHP
Timeouts are a rarely discussed topic and neglected in many applications, even though they can have a huge effect on your site during times of high load and when dependent services are slow. For micro service architectures timeouts are important to avoid cascading failures when a service is down.
How To Contribute To An Open-Source GitHub Project Using Your Own Fork
I just recently joined a new open source project, and there were a few folks on the team who weren't familiar with how to contribute to an open source project by forking your own copy, so I wrote this up for the docs of that project. I figured I'd also share it here.
Getting Rid of Static
When people start (unit-)testing their code one of the worst problems to tackle is static calls. How can we refactor static calls out of an existing application without breaking the code and while producing new features? How can we get rid of this big test impediment?
PHP Site Gamification Using a Secret Path - PHP Secret URL Path Package Blog
The main purpose of gamification is to keep our users entertained in game like activities, so that they stay around longer and come back more often, for instance to your site or your app. We can accomplish this by setting up a sequence of page visits and rewarding our users if they complete the sequence correctly using the Secret Path class. Read this article to learn how you can use the PHP Secret Path class to implement a neat game like experience for your users. |
News and Announcements
Shift Developer Platform
Announcing a platform for developers to build custom Shifts.
Midwest PHP Conference - March 17-18th 2017, Minnesota
Midwest PHP is the FUN conference. This is our fifth annual conference, and each year it gets better and better. Our goal is to share best practices, ideas, and techniques about building state-of-the-art software applications. Early Bird tickets are on sale now.
PHPKonf - May 20th 2017, Istanbul
PHPKonf is hosted by the İstanbul PHP community (İstanbul PHP) in İstanbul, Turkey from May 20th 2017, and you're invited! For the 4th year, we'll host some of the best speakers, awesome talk topics, latest technologies, and up to date news in PHP. The conference has something for every level of PHP developer with awesome keynote and 14 talks(multi-track). So come meet other PHP developers and see what others are doing, and please share your experience as well. Then relax or have some fun at the evening events with plenty of fun for everyone! Early bird tickets are on sale now, and the Call for Papers is now open.
PHP Serbia Conference - May 27-28th 2017, Belgrade
PHP Serbia Conference delivers high-value technical content about PHP and related web technologies, architecture, best practices and testing. It offers two days of amazing talks by some of the most prominent experts and professionals in the PHP world in a comfortable and professional setting. The Call for Papers is now open.
Laracon - July 25-26th 2017, New York City
Two amazing days of learning, growing, and mingling with the Laravel community - returning to the Big Apple. Other events at this years Laracon include a Science Fair, for you to show off your cool projects to the community! Early Bird tickets are on sale now. |
Podcasts
Full Stack Radio Podcast Episode 56: Wes Bos - Getting Things Done and Building Your Own Tools
In this episode, Adam talks to Wes Bos about how he seems to get so much done, why he built his own course platform, and growing an audience.
MageTalk Magento Podcast #113 - Political Cartography and 2017 Predictions
It’s the 2017 prediction show! The last recorded show of 2016 is full of “seriously inaccurate” predictions for 2017 and community shoutouts. Max Chadwick’s Page Cache Hit Rate module is named extension of the week by Kalen!
PHP Round Table Podcast Episode 58: HTTPlug, Guzzle & API's
Guzzle has become the de-facto HTTP-client library for PHP. But recently a number of open source projects have been switching to HTTPlug which boasts itself as an HTTP-client abstraction. We chat about the problems HTTPlug aims to solve, the plans for its future and the reasons behind why some library maintainers have chosen to adopt it or not.
Free The Geek Podcast: Episode 21 - Talking With Dan Allen Asciidoc Project Lead
In this episode I sit down with Asciidoc project Lead, and all round good fella - Dan Allen. If you love technical writing, technical documentation, and documenting your code, then this is an episode you’re not going to want to miss. Dan shares so much valuable insight into why Asciidoc is the premiere format for writing, regardless of the type of work you do, how the format came to life, some of the tooling available, plus so much more. If you’re just getting in to technical writing, love documenting your code, but want to spend less time doing it, or just want to find a toolchain that demands less of you, but gives you so much more, then grab your favourite beverage, put your feet up, and tune in!
The Laracasts Snippets Episode 54: Go Go Go
At all times on social media, we are surrounded by folks at the top of their game. With so much genius and success circling us like hawks, sometimes it can get you down. Even worse, around this time of year, there's so much talk about "crushing it" and "10x'ing" it.
PHP Ugly Podcast #42: Jackie Robinson Episode
Topics include the Software Developer Podcast Awards, and the renaming of Laravel Elixir for the Laravel 5.4 release.
Three Devs and a Maybe Podcast - Checking In With Lew and Hearing About Blue n' Vue
In this weeks episode we have a long overdue catch-up with Lew. We start off by discussing what he has been up to, and a certain four-legged addition to his family. From here we move on to chat about working on a product vs. working in an agency setting, picking your battles when refactoring and not being scared to make mistakes. Finally, we highlight how Edd has recently used personal Homebrew taps, using Android simulators for testing and Lew’s experience with Vue.js.
dev/hell Podcast Episode 86: Necromantic Spies and Imagined Corporate Friends
Welcome to the very first episode of 2017! We’re back after a nice break for the holidays and ready to get back to being insightful and unfiltered. In this episode we talked about the concept of “programming as craft” with Chris and Ed having a great discussion about what should follow after the phrase “programmers need to learn empathy.” Ed also released some music, and is donating all the proceeds to OSMI. Chris was sad that he did not get the opportunity to re-record the vocal tracks from some of Ed’s older material in his own signature vocal style. Chris also talked (not so briefly) about the new laptop he bought and the security measures he decided to take with it. |
Don't Mock What You Don't Own
Trying to test code that interacts with third-party APIs has always been a controversial topic. In this screencast (taken from my Test-Driven Laravel course), I walk through two possible approaches, and explain why I think it's worth the cost to integrate with external services in your adaptor tests.
php[architect] January 2017 - Blueprints for Success
We have a new issue of the magazine to ring in the new year! This issue collects articles to help you plan and make your application and code better. These may be well-known design patterns, fundamental concepts, or novel applications of a familiar tool. At some point, if you haven’t already, you’ll realise a little planning and learning how others have solved a problem can go a long way. You’ll see failure cases you may not have considered, or you’ll find an approach that is easier to maintain or scales faster.
My Favourite Books in 2016
I’ve planned to read 36 books in 2016 and managed to hit that number a few hours before the NY! The best of those 36 books are listed below.
Android Development with Java: Step By Step Guide to Build Applications (by Learn 2 Earn, published 15th December 2016)
In this guide series, you’ll become familiar with Java, the programming language used to develop Android applications. Our goal is to prepare those already familiar with one programming language, such as PHP or Objective-C, to become comfortable working with the Java programming language and dive into Android app development. In this tutorial, you’ll get a brief introduction to Java fundamentals, including object oriented programming, inheritance and more. If you’re new to Java, or just looking to brush up on the details, then this is for you!
PHP Persistence: Concepts, Techniques and Practical Solutions with Doctrine (by Michael Romer, published 20th December 2016)
Take the pain out of dealing with relational databases in an object-oriented programming world. With this short book, you can save time and money by simply coding less while accomplishing more with the Doctrine persistence framework, a leading persistence solution for PHP programmers and web developers. PHP Persistence teaches you about PHP persistence and how to use it effectively for your database-driven applications. |
Jobs
Do you have a position that you would like to fill? PHP Weekly is ideal for targeting developers and the cost is only $50/week for an advert. Please let me know if you are interested by emailing me at [email protected] |
Interesting Projects, Tools and Libraries
tinify-php
PHP client for the Tinify API, used for TinyPNG and TinyJPG. Tinify compresses your images intelligently.
php-exif
PHPExif is a library which gives you easy access to the EXIF meta-data of an image.
phpbrake
The official Airbrake PHP error notifier.
securimage
A PHP class for creating captcha images and audio with many options.
polyfill
This project backports features found in the latest PHP versions and provides compatibility layers for some extensions and functions. It is intended to be used when portability across PHP versions and extensions is desired.
macaw
Macaw is a simple, open source PHP router. It's super small (~150 LOC), fast, and has some great annotated source code. This class allows you to just throw it into your project and start using it immediately.
gush
Rapid workflow for project maintainers and contributors.
assegai
Assegai is a full-featured MVC framework for PHP.
brush
Brush is a complete object-oriented PHP wrapper for the Pastebin API.
stream
Basic readable and writable stream interfaces that support piping.
redcatphp
Rapid Application Development relying on the best-practices with ready-to-use conventions and flexible configuration design scalable and high-performance web application.
nosh-core
NOSH ChartingSystem is an electronic health record system designed with doctors in mind.
upload
Framework agnostic upload handler library.
witycms
wityCMS is a simple Content Management System Model-View-Controller oriented in PHP. |
Please help us by clicking to our sponsor:
From our sponsors:
|
So, how did you like this issue?
|
Protect your PHP code with SourceGuardian 10. Free trial.
|
|