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

Tomas Votruba:
How to change PHP code with Abstract Syntax Tree
Feb 27, 2018 @ 18:11:13

Tomas Votruba has a post to his site that (sort of) continues his look at the parsing of PHP code into an AST and the use of the nikic/php-parser library. In this new post however, he covers several of the things that can be changed in PHP code using the library.

Today we can do amazing things with PHP. Thanks to AST and nikic/php-parser we can create very narrow artificial intelligence, which can work for us.

Let's create first its synapse!

He starts with a clarification about the difference between "php-ast" (an extension) and "PHP AST" (the actual abstract syntax tree). It then gets into some of the functionality that the php-parser library provides for modifying the PHP code being parsed. This includes changing method names, renaming properties, splitting classes and even potentially upgrading an application to a newer version. As an example he shows how to change the name of a method and write the result out to a file (all code is included).

tagged: phpast ast phpparser library change name tutorial

Link: https://www.tomasvotruba.cz/blog/2017/11/06/how-to-change-php-code-with-abstract-syntax-tree/

Alan Storm:
Laravel 5 Autoloader
Feb 24, 2015 @ 17: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

Greg Beaver's Blog:
Holy Release Party, Batman
Mar 06, 2007 @ 15:11:00

Greg Beaver points out the numerous releases that were made in the PEAR community today - including an update to the PEAR website itself.

OK, today's release party wins. I've just uploaded the 8th package for release, and it's a very significant day of releases.

The three updates made today are:

tagged: release pear website patch track parsergenerator phpparser docblockparser release pear website patch track parsergenerator phpparser docblockparser

Link:

Greg Beaver's Blog:
Holy Release Party, Batman
Mar 06, 2007 @ 15:11:00

Greg Beaver points out the numerous releases that were made in the PEAR community today - including an update to the PEAR website itself.

OK, today's release party wins. I've just uploaded the 8th package for release, and it's a very significant day of releases.

The three updates made today are:

tagged: release pear website patch track parsergenerator phpparser docblockparser release pear website patch track parsergenerator phpparser docblockparser

Link:


Trending Topics: