PHP ClassesMySQL Extension, Going, Going, almost Gone (2.7.2015, 08:06 UTC)
By Dave Smith
When the warnings change from "the extension may go away" to "the extension will go away", things just became serious. For some of us, the race is on to keep our projects from collapsing.

Read this article to learn about a method to analyze your PHP code and find functions and extensions that are being deprecated, as well a quick and easy solution to deal with the removal of the MySQL extension in PHP 7 or even sooner in your current hosting provider.
Link
Chuck BurgessCorrupted .git/config Files and Jenkins (1.7.2015, 21:27 UTC)
Link
SitePoint PHPCrawling and Searching Entire Domains with Diffbot (1.7.2015, 16:00 UTC)

In this tutorial, I’ll show you how to build a custom SitePoint search engine that far outdoes anything WordPress could ever put out. We’ll be using Diffbot as a service to extract structured data from SitePoint automatically, and this matching API client to do both the searching and crawling.

Diffbot logo

I’ll also be using my trusty Homestead Improved environment for a clean project, so I can experiment in a VM that’s dedicated to this project and this project alone.

What’s what?

To make a SitePoint search engine, we need to do the following:

  1. Build a Crawljob which will index and process the entire SitePoint.com domain and keep itself up to date with newly published content.
  2. Build a GUI for submitting search queries to the saved set produced by this crawljob. Searching is done via the Search API. We’ll do this in a followup post.

A Diffbot Crawljob does the following:

  1. It spiders a URL pattern for URLs. This does not mean processing - it means looking for links to process on all the pages it can find, starting from the domain you originally passed in as seed. For the difference between crawling and processing, see here.
  2. It processes the pages found on the spidered URLs with the designated API engine - for example, using Product API, it processes all products it found on Amazon.com and saves them into a structured database of items on offer.

Continue reading %Crawling and Searching Entire Domains with Diffbot%

Link
PHP ClassesOnline Boot Camp for Modernizing PHP Legacy Applications (1.7.2015, 04:01 UTC)
By Paul M. Jones
Over the years the recommended practices to develop PHP applications have evolved but applications developed in the past were not maintained and suffer with several problems for being what are usually called legacy applications.

Read this article to learn how you can participate in an online course to learn the best practices to modernize your legacy PHP applications.
Link
Nomad PHPProtected: NEPHP Logos (30.6.2015, 20:47 UTC)

There is no excerpt because this is a protected post.

The post Protected: NEPHP Logos appeared first on Nomad PHP.

Link
Paul M. JonesModernizing Serialized PHP Objects with class_alias() (30.6.2015, 14:14 UTC)

Several weeks ago, a correspondent presented a legacy situation that I’ve never had to deal with. He was working his way through Modernizing Legacy Applications in PHP, and realized the codebase was storing serialized PHP objects in a database. He couldn’t refactor the class names without seriously breaking the application.

I was carefully moving my classes to a PSR-0/4 structure when I found this. The application saves the output of serialize($shoppingCart) in a BLOB column, and unserializes it later to recreate the ShoppingCart object. The serialized object string looks like this:

O:12:"ShoppingCart":17:{s:13:"\00Basket\00items";a:25:{...}; ...}

See how the class name is embedded in the serialized string? If I rename the ShopppingCart class to PSR-0/4 namespace, then the old class won’t be found when the application tries to unserialize() the serialized representation. How can I begin refactoring this without breaking the whole application?

Before I was able to reply, my correspondent ended up changing the serialization strategy to use JSON, which was a rather large change. It ended up well, but it turns out there is a less intrusive solution: class_alias().

If you’re in a serialized situation, and you need to change a class name, you can use a class_alias() to point the old class name to the new one. (Call class_alias() early in execution, probably before you register your autoloader.) You can then rename and move the class according to PSR-0/4 rules, and PHP will handle the rest for you.

For example, if you renamed ShoppingCart to Domain\Orders\Cart, you might do this:

class_alias('ShoppingCart', 'Domain\Orders\Cart');

Now when you call unserialize($shoppingCart) to create an object, PHP will create it as an instance of Domain\Orders\Cart instead of ShoppingCart. Re-serialized representations of the recreated object will retain the new class name, not the old one: O:18:"Domain\Orders\Cart":....

As soon as there are no more serialized representations using the old class name, you can remove the class_alias() call entirely.


Afterword

Are you stuck with a legacy codebase? Are you having a hard time getting started on modernizing it? If so, I have put together an online weekend “boot camp” where we go through the entire modernization process, from basic prerequisities at the beginning to setting up a DI container at the end. After that end-to-end study of the steps involved, you should be able to jump-start your own modernizing project much more easily.

The 8-hour camp will combine lecture and “live” coding with examples. In particular, there will be plenty of opportunity for you to get answers specific to your own modernizing situation, and to chat with other attendees.

The two-day camp will be on Sat 11 July and Sun 12 July. Each day will run from 12 noon to 4pm (US Central Daylight), with time for breaks built in. That makes it 10am-2pm for Pacific time zone attendees, and 1-5pm for Eastern, which should be convenient for almost everyone.

With your ticket to attend the boot camp, you get:

  • Two days of online boot camp, four hours each
  • A review of the entire modernization process from beginning to end
  • A bonus recording of the camp
  • For $399

This might be the only time I lead this kind of boot camp, so get your ticket while there are still seats available!

Link
Cal EvansInterview with Sammy K. Powers (30.6.2015, 05:00 UTC) Link
PHP ClassesReview: Modernizing Legacy Applications In PHP (30.6.2015, 03:58 UTC)
Modernizing Legacy Applications In PHP
Title
Reviewer
Samuel Adeshina
Category
PHP books
Publisher
Leanpub
Author
Paul M. Jones
Summary
After going through this book, I discovered that it is not just apps that were built ‘over a decade ago’ that deserves to be called legacy applications.

Many of the apps we write today also have some of the bad features which makes them worthy to be termed a ‘legacy application’. I felt guilty, because I use a lot of these bad features in my day to day PHP development process, even when I claim I am developing object oriented applications and I believe I am not alone.

I strongly recommend this material to the PHP professionals out there, there are a lot of things we ‘claim’ and ‘think’ we are doing right, just read this book and see for yourself.

Code maintenance engineers from other spheres or areas of software development would also find this book very intrinsic, as it provides references and links to external materials that would help you learn and know more.

This book is a very bright light, that shows us a lot of places and instances where we get it all wrong when it comes to developing with PHP, and also provides how to make them right. Software Maintenance Engineers would find this book very useful, because it laid out a step by step, and chapter by chapter introduction into code maintenance and optimization.
Link
Davey ShafikFarewell Engine Yard! (29.6.2015, 17:49 UTC)

After almost 4 years at Engine Yard, my last day will be July 3rd.

It is a sad thing, but it also means I am moving on to hopefully bigger, exciting, more challenging, and better things.

On Saturday I gave my last conference talk as a Yardee, and I think it was fitting that it was about “What’s new in PHP 7″, as my first talk for Engine Yard was at PHPUK 2012 and it was about “What’s new in PHP 5.4″.

I have had an amazing time working for Engine Yard, learned a lot from lots of smart people, been able to travel the world and meet even more fabulous people. I have been allowed to shape my job around the life I want to lead: to be a good person, to teach and help people, and to spread the joy of the things I love to as many people as possible.

I will be moving on to Akamai Technologies on July 6th as a Developer Evangelist.

I will be working on some thing bigger than I can conceive and I’m excited at the prospect of helping people — particularly in the PHP community — to achieve amazing things using these tools and more.

But I wouldn’t be here if not for all I’ve been enabled to do the last four years:

Thank you Engine Yard ❤️

P.S.
Y’all should go check out Deis and Deis.com/Deis PRO, they’re pretty awesome!

Link
SitePoint PHPPHP Channel’s 2015 2nd Trimester Update (29.6.2015, 16:00 UTC)
> img.left {float: left; margin: 10px 20px 0 0} ul.contributor_social {list-style: none; margin: 0} ul.contributor_social li {float: left; margin: 3px 3px 7px 3px}

Another three months have passed, and our author roster has expanded again.

Silhouettes of formally dressed people, blurred, walking towards camera

We’ve got six more authors joining us this trimester and they are, in order:

Narayan Prusty, India

Narayan is a very active blogger at Qnimate who actually wrote for SitePoint extensively before - on the WordPress channel. It was only recently that he decided to dive into PHP related topics as well, debuting with a piece on sending emails with PhpMailer - one of the oldest and most reliable email sending packages in the PHP ecosystem.


Continue reading %PHP Channel’s 2015 2nd Trimester Update%

Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP