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

Alejandro Celaya:
Reusing factories in Zend ServiceManager
Jul 25, 2017 @ 10:03:33

Alejandro Celaya has a new post to his site showing the Zend Framework users out there how you can reuse factories in Zend/ServiceManager. Factories are heavily utilized by the component to create the objects the service returns. Factories tend to be single-use, however, but Alejandro has shown a way around that.

I like zend-servicemanager because it is explicit, and you are always in control of what's done, without loosing flexibility in the process. Since this container expects you to define factories for every service, you usually end up writing, testing and maintaining a lot of factories that doesn't add value to the application.

That's why it is so important to properly reuse factories when possible, not only because you will have to maintain less classes, but because the ServiceManager will instantiate less objects at runtime when it can reuse a factory.

He then talks about ways you can set up shared factories in your application including the use of an abstract factory class or a concrete factory to return other dependencies required. He also shows how to use the ConfigAbstractFactory that allows for the injection of dependencies based on a configuration (similar to the "wiring" in other dependency injection containers). Finally he shows the use of the ReflectionBasedAbstractFactory that handles the injection in about the same way but instead of basing it on a configuration it uses PHP's own reflection to try to determine the class and autoload it into the current system.

tagged: factory zend servicemanager zendframework configuration reflection abstract tutorial

Link: https://blog.alejandrocelaya.com/2017/07/21/reusing-factories-in-zend-servicemanager/

Zend Developer Zone:
June 2017 PHP Community (coffee) Cup of Service winner
Jun 22, 2017 @ 12:29:42

The Zend Developer Zone has announce their "Coffee Cup of Service" winner for the month of June 2017: Sara Golemon.

It is time for the June 2017 PHP Community (coffee) Cup of Service award. This month it goes to someone who has been giving to PHP for more than 15 years, Ms. Sara Golemon.

Sara is a regular speaker at PHP conferences worldwide, an active core contributor, [and] one of the release managers of PHP 7.2.

Please join us here at Rogue Wave in saying thank you to Sara for her more than fifteen years of service to PHP and the PHP community.

This is the second winner of the "Coffee Cup of Service" winner with the first being Michelangelo van Dam himself who the award was inspired by.

tagged: coffeecupofservice winner saragolemon zend roguewave community

Link: https://devzone.zend.com/category/community/

Nikita Popov:
PHP 7 Virtual Machine
Apr 17, 2017 @ 17:42:47

Nikita Popov has a new post to his site sharing a look behind the curtain of how the PHP 7 virtual machine works, the latest version in the Zend Virtual Machine that powers the language.

This article aims to provide an overview of the Zend Virtual Machine, as it is found in PHP 7. This is not a comprehensive description, but I try to cover most of the important parts, as well as some of the finer details.

This description targets PHP version 7.2 (currently in development), but nearly everything also applies to PHP 7.0/7.1. However, the differences to the PHP 5.x series VM are significant and I will generally not bother to draw parallels.

Most of this post will consider things at the level of instruction listings and only a few sections at the end deal with the actual C level implementation of the VM.

He then goes through many different points and piece of functionality in the VM and how they work including:

  • variable types
  • the stack frame layout
  • fetch modes
  • exception handling
  • finally handling
  • generators

There's lots of information here and it's definitely interesting to see what happens inside the language to create the fast and functional PHP 7 applications we have now.

tagged: virtualmachine php7 zend detail behindthescenes example

Link: http://nikic.github.io/2017/04/14/PHP-7-Virtual-machine.html

Community News:
ZendCon 2017 Call for Papers Opens
Mar 03, 2017 @ 13:35:12

Zend has officially announced the opening of the Call for Papers for their 2017 event happening in Las Vegas, Nevada on October 23rd through 26th at the Hard Rock Hotel and Casino.

We’re pleased to announce the ZendCon 2017 Conference, the most anticipated event of the year combining the best of PHP and open source. ZendCon is where community and enterprise developers from around the world gather to share and learn the latest hot trends and technologies in today's professional PHP and open source development.

[We are] now accepting talks on any topic or technology related to PHP, the enterprise web stack, frameworks, security, API design & management, IBM i, DevOps, people & processes, and much more.

The CFP is open until April 14th (11:59pm UTC) and, if your submissions are accepted, you will be provided with a speaker package that includes a conference pass, airfare and hotel nights depending on the type of session you're presenting. You can find out more about the conference and the CFP on the Call for Papers site. Get those submissions in early and often - the deadline will come up sooner than your expect!

tagged: zendcon17 zend conference callforpapers cfp open announcement

Link: http://cfp.zendcon.com

Zend Blog:
Top 10 PHP articles of 2016
Dec 30, 2016 @ 11:43:17

On the Zend blog they've posted a retrospective of 2016 and some of their most popular articles published over the last year.

The audience has spoken. From Zend Framework 3 release to Zend Server with PHP 7, from IBM i to AWS, the top ten articles on the blog from 2016 cover a wide range of topics to help you deliver PHP applications rapidly, reliably, securely, both on-premise and in the cloud.

Articles that made the list include:

Check out the original post for the full list. Predictably, most are related to Zend's own offerings but its good to see some other topics mixed in there as well.

tagged: top10 articles list 2016 retrospective zend

Link: http://blog.zend.com/2016/12/29/top-10-articles-of-2016/#.WGZ-8KIrJZ0

PHP Roundtable Podcast:
057: All things Zend
Dec 23, 2016 @ 11:50:54

The PHP Roundtable podcast, hosted by Sammy Powers, has posted their latest roundtable discussion talking about all things Zend. In this episode Sammy is joined by Adam Culp, Cal Evans (both from Zend) and Gary Hockin (of JetBrains).

There's a lot more going on at Zend other than Zend Framework. We chat about the Zend ecosystem, from Apigility to Zend Certification and what Zend's role is in PHP internals.

You can catch this latest episode in a few different ways either using the in-page audio or video player or you can watch the video directly over on YouTube. If you enjoy the episode, be sure to subscribe to their feed and follow them on Twitter for updates on when new shows will be recorded and released.

tagged: phproundtable sammypowers zend podcast video calevans adamculp garyhockin

Link: https://www.phproundtable.com/episode/all-things-zend-framework-apigility-certification

Zend Framework Blog:
Zend Framework 1 End-of-Life Announcement
Jul 01, 2016 @ 10:52:25

On the Zend Framework blog they've posted the announcement about the end of life for Zend Framework v1, the first version of the popular framework.

With the release of Zend Framework 3, it's time to halt development on Zend Framework 1. As such, we hereby announce that Zend Framework 1 reaches its End of Life (EOL) three months from today, on 28 September 2016.

Between now and then, we will only provide security fixes, if any security reports are made in that time frame. Past that point, we will offer custom bug and security fixes for Zend Framework 1 on-demand only to Enterprise users of Zend Server. [...] Additionally, as of today, access to our legacy subversion server is disabled.

You can still get the latest from the package archive, use Composer for updates. There are also services from Zend that can help you update your application as well as two trainings that can help you learn what you need for the upgrade.

tagged: zendframework zendframework1 endoflife announcement project zend

Link: https://framework.zend.com/blog/2016-06-28-zf1-eol.html

Alejandro Celaya:
Improving ZendServiceManager workflow with annotations
Apr 11, 2016 @ 10:19:57

In a post to his site Alejandro Celaya shows you how to make life easier when using the ZendServiceManager with the help of annotations and a package he's developed to make it all work together.

Everyone who regularly visits my blog knows that I'm a complete fan of the ZendServiceManager component. It is always my choice to deal with dependency injection in any kind of project, more now that v3 has been released, which is faster and has a better public API.

The workflow while working with the ServiceManager is usually the same. You create a factory or abstract factory that creates a service and then you register that service into the ServiceManager itself. Of course you have to optimize your code, and you should try to reuse the same factories whenever possible, and try not to abuse of abstract factories and initializers.

He points out the main problem with using services like this in a larger application, namely that you can end up with a large amount of them, making them difficult to manage (and find problems with). He proposed solution uses this library to minimize the amount of code needed buy injecting dependencies into the service based on "inject" annotations. He includes an example of this functionality in action and includes a few things to keep in mind using the package (like the slower parsing of the annotations some limitations it currently has).

tagged: zend servicemanager component services workflow annotations inject tutorial library package

Link: http://blog.alejandrocelaya.com/2016/04/09/improving-zend-service-manager-workflow-with-annotations/

Cloudways Blog:
The Speed Of The New PHP 7 Engine Truly Sets The Stage Going Forward, Says Adam Culp
Feb 24, 2016 @ 09:13:07

The Cloudways blog has posted an interview they've done with Adam Culp a senior consultant with Zend and organizer of both the Sunshine PHP conference and ZendCon.

Adam Culp is a very experienced PHP developer currently associated with Zend Technologies. He has been a trainer and speaker at various PHP events. He was the organizer of SunshinePHP 2016. He is also the member of Zend Certification advisory board and contributor to Zend framework. He is an expert developer of LAMP, Windows, IIS, MYSQL, CSS, AJAX, Javascript, and HTML. Without waiting anymore, let’s explore his life experiences and ideas.

In the interview Adam answers questions about:

  • His past and how he got in to software development
  • How he feels being a part of the Zend certification advisory board
  • Questions about the Sunshine PHP Conference and SoFloPHP user group
  • Why he prefers open source software
  • What trends he sees coming and where he sees current software standing in the big picture

You can read Adam's answers to these and other questions in the full interview.

tagged: sunshinephp zend adamculp interview cloudways developer php7

Link: http://www.cloudways.com/blog/interview-adam-culp/

Geert Eltink:
Zend-Expressive Console CLI Commands
Feb 12, 2016 @ 11:21:15

In a new post to his site Geert Eltink shares how he added console command support to Zend Expressive, a PSR-7 framework from Zend that recently hit it's v1.0 mark.

zend-expressive does not come out of the box with a console for handling cli commands. However it's easy to add this and make full use of the container and its dependencies.

He uses the Symfony console component to handle most of the "heavy lifting" with the command line interaction, pulled in via Composer. He shows the process for getting the component installed and how to create the "bootstrap" file needed to build an instance of the Application class. He follows this with a simple "greeting" command including the configuration to add a few arguments and output the simple "Hello" message. He then creates the functionality to wire it in to the Zend Expressive application and gives an example of it in use.

tagged: zend expressive framework console command commandline cli tutorial symfony component

Link: https://xtreamwayz.com/blog/2016-02-07-zend-expressive-console-cli-commands