News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Community News:
Apigility 1.0.0beta1 Released!
March 25, 2014 @ 10:41:03

Zend has officially announced the release of the 1.0.0beta1 of Apigility, their API creation platform making it simpler for developers to get started making APIs, even around existing code.

We are pleased to announce the immediate availability of Apigility 1.0.0beta1! [...] This is our first beta release of Apigility, marking its initial API stability, and providing a solid preview of what to expect for the first stable release. [...] Apigility provides tools for describing and documenting your APIs, both RESTful and RPC. You can indicate the URL that provides a service, what HTTP methods are allowed, what representations (e.g., JSON, HTML, XML) can be provided, how many items to present per page of a collection, and more.

The release goes on to talk about some of the other features of Apigility including the standard of JSON responses, custom validation for incoming data and an implementation of the Swagger UI bundled for documentation of your service. There's also a list of things (with code examples on some) about what's changed in this beta release since 0.9.1. There's also a brief look at the end of the roadmap ahead, with an emphasis on a full, stable release soon.

0 comments voice your opinion now!
apigility api zendframework beta release

Link: http://framework.zend.com/blog/apigility-1-0-0beta1-released.html

Michelangelo van Dam:
Bootstrapping ZF1 application in Apigilty
March 11, 2014 @ 10:42:27

Michelangelo van Dam has a new post sharing a method he's come up with for boostrapping Zend Framework v1 components inside of an Apigility-based application.

Apigility is a Zend Framework 2 tool that provides a REST API management interface, which is very useful if you want to build an API. Apigility can directly connect with your database and offer a full REST API for your application, but in most cases you already have an application build with Zend Framework 1.x (ZF1). Let's assume you have incorporated a lot of business logic in this application so it would be a waste not to use it building a rich REST API.

He uses the gitmodules functionality to bring his entire ZF1 application into the Apigility app's structure (or, alternatively, Subversion). He shows how to use Composer to install the actual Zend Framework v1 copy and how to pull in other third-party libraries. He includes the code you'll need to use to create a "ZF2APP_PATH" constant to get to the application path of Zend Framework v2 instance. He then gets into the main part - the actual autoloading and bootstrapping of the ZF1 classes/services. He gives a brief introduction to working with Apigility to make a new service and shows the update to the resource class.

0 comments voice your opinion now!
bootstrap application apigility zendframework2 zendframework

Link: http://www.dragonbe.com/2014/03/bootstrapping-zf1-application-in.html

Mastering Zend Framework:
Gary Hockin's Maximising Zend Framework 2 Performance Talk (Review)
February 28, 2014 @ 10:33:30

From the Master Zend Framework blog there's a new post reviewing a talk from this year's PHPUK (2014) from Gary Hockin, "Maximising Zend Framework 2 Performance".

Whether you're new to Zend Framework 2, or an old hand (can someone really say they're an old hand after such a short period of time?) the talk covered a range of tools, tips, and techniques for increasing application performance. This wasn't an academic run through; it was a talk based on practical, hands-on, experience from Gary's time as a core ZF2 contributor, and his work at Roave, Yamgo and AdSpruce.

The post talks some about the tools Gary used to benchmark his improvements and some common metrics to be aware of in your own results. Xdebug and Xhprof were also recommended for more introspection into what the application is doing and where the bottlenecks lie.

0 comments voice your opinion now!
phpuk14 zendframework performance tools talk session

Link: http://www.masterzendframework.com/reviews/maximising-zend-framework-2-performance-phpuk14

VG Tech:
Swagger Docs in ZF2 with Examples - Part 1 Setup and Annotations
February 25, 2014 @ 10:33:48

The VG Tech blog has posted the first part of a series they're doing about Zend Framework 2 and Swagger, the auto-generating documentation project for APIs. In this first part of the series, they go through some setup and show the use of annotations to define the Swagger output.

So everyone is building APIs now - parsing and outputting JSON is not that hard. Some people even build truly RESTful APIs, or something not to far from that. Before, when building APIs was about SOAP with XML schemas and WSDL specifications, people spent so much time building their APIs that they had the time to think. Now, building an API is so easy and fast that the documentation is often suffering. [...] Swagger is a popular project providing auto generated API docs based on a service specification. This spec is based on annotation comments in the controllers and models, giving the developer a fairly easy, and close to the code way of keeping the API docs up to date.

He walks you through the process to clone and setup the Zend Framework 2 project first, then pull in the "outeredge/swagger-module" with Composer. This package provides the tools to generate Swagger output from annotations in the PHP code. He also shows you how to set up the Swagger UI project (wordnik/swagger-ui). Finally, he gets into the code examples, showing how to annotate models and use partials.

0 comments voice your opinion now!
swagger api zendframework setup annotation tutorial series part1

Link: http://tech.vg.no/2014/02/24/swagger-docs-in-zf2-with-examples-part-1-setup-and-annotations/

Suresh Ariya:
Integrate Zend Framework into CakePHP application
February 13, 2014 @ 13:04:22

Suresh Ariya has a new post today showing you how to integrate Zend Framework (v1) with CakePHP so you can use any Zend Framework class/component you might need via autoloading.

Today, we are going to see how we can integrate Zend Framework version (1.12) into CakePHP Application. In order to achieve this, i created an autoloader script which will load the Zend Framework class at the time of accessing the class (creating object). I used spl_autoload_register() function which will register a function as the __autoload() function.

He creates a basic "ZFLoader" class that handles the registration of the autoloader and the parsing of the class name to resolve the path to the file. Another basic loader script is included in the post with some setup and configuration the Zend Framework will need to operate. Finally, he shows how to get the CakePHP application to pull in the Zend Framework loader in the controller and make use of the Zend_Feed component.

0 comments voice your opinion now!
integration zendframework cakephp application tutorial

Link: http://sureshdotariya.blogspot.in/2014/02/integrate-zend-framework-into-cakephp.html

MaltBlue.com:
Do We Use Magic Methods or Not?
December 13, 2013 @ 10:39:20

In the latest post to his MaltBlue.com site Matthew Setter takes a look at magic methods. He tries to answer a few basic questions about them - are they worth using and can you truly test effectively when they're in use.

As a freelance Zend Framework developer, I'm always looking to improve the quality of the applications I produce. So over the last 6 - 12 months, I've been learning as much as possible about testing. During this time, I've found the way I code's dramatically changing (and improving). [...] In a recent development session, I attempted to test some of my ZendDb based classes, specifically the code which used the magic methods for dynamically building where clauses. [...] I can't speak for what it's like using PHPUnit's mock objects, as I always use Mockery instead. But after attempting to do so in Mockery, I hit a stumbling block when trying to test the chained call.

His example is a call to "lessThanOrEqualTo" to create his where clause that makes use of the "__get" magic method to get and return "Where" object. After some research (and conversations on IRC) he started wondering if the magic methods were worth the trouble they may cause during testing. He references this post and lists several of the comments made about their use, most of them not in favor.

0 comments voice your opinion now!
magic method zendframework sql builder query unittest testing

Link: http://www.maltblue.com/php/php-magic-methods-or-not

Zend:
Apigility Progress report zf-mvc-auth, packagist, and PHP's built-in web server
November 01, 2013 @ 15:52:11

In a new post to the Apigility forums today Matthew Weier O'Phinney has announced the release of an authentication/authorization component for the recently announced project from Zend. Apigility is a Zend Framework-based tool for easily constructing and managing an API.

We've been working hard on Apigility since ZendCon, and have released some more code into the wild. zf-mvc-auth exists to provide both authentication and authorization for your APIs; in fact, it's a bit of a general-purpose library for ZF2 MVC apps! Right now, we support HTTP basic and digest authentication out of the box, and will be working next on OAuth support. Authorization is done by default via ZendPermissionsAcl, as we discovered a problem with using RBAC: RBAC is deny-by-default, which does not work when you want an open-by-default schema. You may opt-in to deny-by-default, as well as mark individual services as requiring permission by default. Finally, you have the option of denying/allowing per HTTP method of a service as well.

You can find out more details about this functionality in this quick screencast. The zf-apgility module depends on this new zf-mvc-auth module, so it will be included and available by default in your APIs. In that same post Matthew also talks about the listing of the Apigility packages on Packagist service and a note for those wanting to use the built-in HTTP server to run the tool (a PHP version dependency).

0 comments voice your opinion now!
apigility progress zendframework mvc authentication authorization packagist http server

Link: https://groups.google.com/a/zend.com/forum/#!topic/apigility-users/_mOPkxxmGYI

Reddit.com:
Evolving code
November 01, 2013 @ 13:28:06

On Reddit.com today timoh has posted a "brief look back" at PHP's evolution to be "enterprise ready" and looks towards the future with some speculations as to what the coming years will bring to the language and its community.

I'm trying to evoke some disqussion about how we have come to the current point of life we have now going on in the PHP field, as an architectural decisions, design and best practices we use to build PHP based software today. [...] Of course PHP language itself has put some walls to design the software the way one would have liked, but still there are alot that could have been done better even "back in the days". At least "better" in a sense what it means today.

He points out that in recent years there's been a push in the community as a whole for things like SOLID/DRY principles, decoupled code and testing. He speculates about the future of things like the Symfony and Zend Frameworks (and the radical changes they both made from their version one to version two). Have your own thoughts about the evolution of PHP and where it might be headed? Share them here!

0 comments voice your opinion now!
evolution code community principles symfony zendframework

Link: http://www.reddit.com/r/PHP/comments/1pofu1/evolving_code/

Kevin Schroeder:
The cost of logging
July 24, 2013 @ 11:34:09

Kevin Schroeder has a new post to his site looking at the cost of logging in web applications. It's not so much about the theory behind what to log and when to log as it is the actual performance hit various kinds of logging take on your app.

So, I was having a discussion with a person I respect about logging and they noted that often logging poses a prohibitive cost from a performance perspective. This seemed a little odd to me and so I decided to run a quick series of benchmarks on my own system.

His tests ran through the types of logging available to PHP developers (like "debug", "notice" or "info") and wrote out the same message to a file ten thousand times each. He just did a simple microtime-based benchmark and graphed out the overall time it took. The differences between the tops of the bars is the time it took for that specific level of logging. He dropped it down to a more realistic level and notes that it only took "1/1000ths of a second per request."

0 comments voice your opinion now!
cost logging benchmark overhead zendframework

Link: http://www.eschrade.com/page/the-cost-of-logging

Lingohub.com:
Internationalization How To for the 5 most popular PHP frameworks
July 24, 2013 @ 10:15:31

On the Lingohub site there's a new post showing how internationalization (i18n) is handled in 5 major PHP frameworks - CodeIgniter, CakePHP, Zend Framework Symfony and Yii.

As discussed in the previous articles on PHP internationalization, PHP provides native support for string translation using gettext and PHP arrays. These can be used in any PHP project. Additionally, some popular PHP frameworks offer their own way of string translation. In this article, I want to provide a brief summary of the internationalization process with five of the most popular PHP frameworks currently out there. In this How-To you will read about using CodeIgniter, CakePHP, Zend, Yii and Symphony.

There's only a bit of sample code here, so it's not a complete tutorial for all of them. Mostly its links to more information about how each framework does things - modules used, formats and configurations.

0 comments voice your opinion now!
framework i18n internationalization howto codeigniter zendframework symfony cakephp

Link: http://blog.lingohub.com/2013/07/internationalization-how-to-5-most-popular-php-frameworks


Community Events











Don't see your event here?
Let us know!


component podcast introduction symfony2 example language composer unittest framework application package opinion code install facebook security overview hack release hhvm

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework