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

Dayle Rees:
PHP: The Composer Lock File
Aug 24, 2015 @ 09:17:10

Dayle Rees has a post to his site help to demystify the composer.lock file for the Composer users out there - what it's for, how it works and why you may or may not want to have it in version control.

Everywhere that I go, conference, the supermarket, the dentist, building sites, people always ask me about the Composer lock file. It's a mystery that seems to cause confusion all across the globe. Well, boys and girls, I'm here today to de-mystify the lock file once and for all.

He starts with a new project and some simple dependencies (three of them), two with specific versions defined and one with a wildcard. Once a composer install is run, the packages are downloaded and the composer.lock file is created. He talks about the contents of the lock file and how they relate to the version of the library Composer has installed, the exact version to be precise. He then gets to the question many wonder about the lock file - should I commit it to my version control system? He suggests that, if you need exact versions installed, then yes. This helps keep versions the same across the board of a team and ensures other people working with the library are using compatible library versions. He ends the post talking about how to use the lock file (install vs update) and what changes could be made in one versus the other.

tagged: composer lock file composerlock indepth update install tutorial

Link: http://daylerees.com/the-composer-lock-file/

Coding Geek:
How does a relational database work
Aug 19, 2015 @ 09:49:41

You may have been using relational databases in your PHP applications for a long time (PHP loves MySQL after all) but you might not have ever dug deep enough to understand how those databases work internally. In this detailed tutorial from Coding Geek they dive way in and cover everything from the basics out to complex sorting, management components and query handling.

When it comes to relational databases, I can’t help thinking that something is missing. They’re used everywhere. [...] you can google by yourself “how does a relational database work” to see how few results there are. [...] Are relational databases too old and too boring to be explained outside of university courses, research papers and books?

As a developer, I HATE using something I don’t understand. And, if databases have been used for 40 years, there must be a reason. [...] Over the years, I’ve spent hundreds of hours to really understand these weird black boxes I use every day. Relational Databases are very interesting because they’re based on useful and reusable concepts. If understanding a database interests you but you’ve never had the time or the will to dig into this wide subject, you should like this article.

He covers a wide range of topics during the post:

  • O(1)) vs O(n2) (or how data sets are handled based on size)
  • Array, Tree and Hash table
  • Global overview (structure of the database system and its pieces)
  • Query manager
  • Statistics (and optimizing storage of the data)
  • Data manager
  • Deadlock
  • Logging

Each of these topics comes with a lot of explanation, examples of how the internals are functioning as well as diagrams to help make a bit more sense. If you've ever really wanted to know how that database you use functions, this is definitely the article to check out.

tagged: relational database indepth concepts lowlevel highlevel query optimization transaction buffer

Link: http://coding-geek.com/how-databases-work/

Community News:
"Are Conference Talks Getting Too Soft?" (Adam Culp & Cal Evans)
Mar 03, 2015 @ 11:57:42

There's an interesting set of posts from PHP community members Adam Culp and Cal Evans each on a similar subject centering around conferences and the presentations made at them. They both wonder if talks are getting too "soft" and not focusing as much on the technology and getting in-depth as they should be. From Cal:

PHP conferences are changing very slowly, and not in a way that I like. I blame myself. As a frequent speaker I am getting lazy. I get caught up in the excitement of the CfP, I write up 5-10 abstracts and shotgun them into the CfP system hoping that something hits the mark. I’ve not actually written these talks. In most cases, I’m pretty sure I can get 45 minutes on the topic, but I don’t know for sure because I’ve not bothered to write it yet. Adam Culp talks about this very thing in his post “Are Conference Talks Getting Too Soft?“.

Adam points out that, while introductory talks and overviews are acceptable level coverage for someone new to the speaking scene (or development), the trend seems to be that everyone is providing less "meat" in their talks.

It is hard to teach a great amount in a 1 hour talk, but if there is not some immediately usable content an attendee will have a tough time proving to their short sighted boss that it was worth their time.

Both Adam and Cal set out a challenge, both to themselves and other speakers in the community. They encourage you to spend more time with your subjects, get in-depth into the topics, present on what you're excited about and maybe even try them out locally first.

tagged: conference talk soft indepth opinion topic adamculp calevans

Link: http://www.geekyboy.com/archives/1076

Alan Storm:
Laravel 5 Autoloader
Feb 24, 2015 @ 11:51:15

Alan Storm has a new post to his site that takes an in-depth look at Laravel's autoloader and how things have changed with the release of Laravel 5.

Last time we finished up our look at Laravel 4.2’s autoloader implementation. Like a lot of features in Laravel, (or any framework), once you pull out the microscope sharp edges begin to jut out everywhere. However, unlike many other framework teams, the Laravel core team is willing to make shifts in their platform and application architecture. If you’re familiar with the internals of Laravel 4, looking at the internals of Laravel 3 may be a little disorienting. Similarly, the recent release of Laravel 5 presents some new wrinkles at the system level.

In the post he compares some of the differences based off of things found in a previous look at Laravel 4.2's autoloading system. He lists out the autoloaders initialized during the autoloader phase, four of them, including the use of the PhpParser library and Composer-only autoloading. He also includes a section at the end about some other smaller autoloading changes in the Composer configuration in both the "autoload" and "autoload-dev" sections.

tagged: laravel autoloader laravel4 laravel5 indepth composer phpparser swift

Link: http://alanstorm.com/laravel_5_autoloader

Sherif Ramadan:
A Closer Look Into PHP Arrays: What You Don’t See
Oct 29, 2012 @ 11:43:33

In a new post Sherif Ramadan takes an in-depth look at PHP arrays and what happens behind the scenes when they're put to use.

PHP is one unique language where the array data type has been highly generalized to suit a very broad set of use cases. [...] I’m going to share with you some of the underlying details of how the PHP array data type works, why it works the way that it does, how it’s different from other languages, and what behaviors the PHP array has that you may not be fully aware of.

He starts with a section looking at what arrays actually are in PHP (and how they compare to the lower level C arrays). He gives a C-based array example and shows how it's stored in memory. He points out how PHP arrays are different from other languages and shows the C code that works behind the scenes to create the array (actually a hashtable). He gets into a detailed explanation of the iteration of arrays including some basic benchmarks of some of the various methods and gets more in-depth with foreach (including subarrays and arrays containing references).

tagged: array language c hashtable indepth variable