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
Brandon SavageLet’s work together! (29.6.2015, 13:00 UTC)

I currently have a few projects wrapping up and I’m available to take on new projects, both large and small in the PHP development world. With more than ten years of experience as a PHP developer, I can help you to develop your project efficiently, effectively and with the best possible outcomes. I’ve worked on […]

The post Let’s work together! appeared first on BrandonSavage.net.

Link
PHP ClassesTutorial on Creating an AJAX based Chat system in PHP (29.6.2015, 07:38 UTC)
By Ashraf Gheith
AJAX is not a new technology. Many years ago I published this class to implement an AJAX based chat system. It is still useful but AJAX also evolved a bit, so the class also has evolved too.

Read this article to learn how you can implement an AJAX based chat room in your own site using this class that could well be used for instance as the basis of a live customer support system.
Link
SitePoint PHPMobile App Development with Zend Studio (26.6.2015, 16:00 UTC)

The world has turned mobile. This is not new, and it should therefore be no surprise to anyone that the results of the 2015 DevPulse survey by Zend show that a vast majority of PHP developers are working on, or intend to work on, mobile apps.

Mobile app development poses many challenges for developers, one of which is tying in the front end of the mobile application with the back-end web service APIs.

This tutorial describes how to simultaneously create, test and modify both the front and back end of a modern mobile app using Zend Studio’s mobile development features.

The steps described in this article were performed using Zend Studio 12.5 and a Zend Server 8 AWS instance. You can, of course, use any PHP server of your choice, local or remote, to host the API project.

Step 1: Creating a Cloud Connected Mobile Project

Your first step is to create a new Cloud Connected Mobile (CCM) project in your Zend Studio workspace.
A CCM project contains both a hybrid mobile project defining the front-end of your mobile app and a project containing all the back-end APIs.

Continue reading %Mobile App Development with Zend Studio%

Link
Ilia AlshanetskyDutch PHP Conference 2015 - Deep Dive into Browser Performance (26.6.2015, 12:57 UTC)
My slides from DPC 2015 on "Deep Dive into Browser Performance" are now available for download here.
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP