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

Derick Rethans:
Xdebug 2.3: Improvements to Tracing
Mar 31, 2015 @ 11:15:33

Derick Rethans has posted a new article in his series highlighting some of the changes in the latest release of Xdebug (v2.3). In this new post he talks about some of the improvements in the trace file functionality.

Trace files are a way to document every function call, and if you enable it, variable assignment and function's return values — including when these functions were called, and how much memory PHP was using at the moment of function entry (and exit). Xdebug 2.3 adds a new type of parameter rendering for stack traces and function traces through the xdebug.collect_params setting.

This new setting allows much more information to be reported back in the trace results, adding on a serialized version of the value of variables. He also shows the output results (human-readable) that shows the memory usage and time index for the execution. He also shows the new handling to include return values in the trace output using the "xdebug.trace_format" handling.

tagged: tracing improvement xdebug release series part5 output

Link: http://derickrethans.nl/xdebug-2.3-tracing-improvements.html

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 5 of 8)
Sep 10, 2014 @ 13:40:49

Matthew Weier O'Phinney has posted the latest in his "deployment with Zend Server" tips today, part five of eight. In this latest post he talks about setting the status of a job.

This is the fifth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed how to secure your Job Queue job scripts. Today, I'm sharing some best practices around writing job scripts, particularly around how to indicate execution status.

When he talks about the "status" of a job he's referencing the return code that's provided back to the executing script sharing the pass/fail status of its execution. He shows how to use the ZendJobQueue object and the setCurrentJobStatus to return a constant, either "FAILED" or "OK". He shows how to use it in an isolated example, outputting the results back as a plain text message that can be found in the "Output" tab of the job.

tagged: zendserver deployment tips series part5 return status failed ok

Link: https://mwop.net/blog/2014-09-09-zend-server-deployment-part-5.html

NetTuts.com:
Refactoring Legacy Code: Part 5 - Game's Testable Methods
May 27, 2014 @ 09:29:33

NetTuts.com continues on with their next part of their refactoring series today in this new post focusing on (unit) testing more of the application. This includes both the code for the tests and the before/after of the refactored code.

Old code. Ugly code. Complicated code. Spaghetti code. Gibberish nonsense. In two words, Legacy Code. This is a series that will help you work and deal with it. In our previous tutorial, we tested our Runner functions. In this lesson, it is time to continue where we left off by testing our Game class. [...] It is much better to start testing it by its short, testable methods. This is what we'll do in this lesson: find and test those methods.

They start with creating a new "Game" object and finding the first testable method in the class. The tutorial works through this and other related methods to build up a set of "Game" tests and eventually doing some refactoring on the tests themselves. With one method down and tested, they move on to finding and creating the tests for the next few testable methods, looking for something "controllable" that makes for easy testing.

tagged: refactor legacy code series part5 unittest game method

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-5-games-testable-methods--cms-21213

Pádraic Brady's Blog:
Complex Views with the Zend Framework - Pt 5: The Two-Step View Pattern
May 24, 2007 @ 08:43:00

Pádraic Brady is back today with the latest installment (part 5!) of his look at complex views in the Zend Framework. This time, her focuses on something called the Two-Step Pattern - a pattern similar to the Layouts pattern.

Part 5 of our series takes a small time-out from approaching a Composite View solution to reusable Views to take a peek at a simpler approach useful for simpler types of web applications. As we've discussed previously Composite Views allow the nesting of reusable View elements, effectively building a View based on a hierarchy of Views. But often there are simpler solutions to simpler problems. One such solution is the Two-Step View pattern, sometimes called Layouts if implemented in a specific way (as we do below!).

He gives the example of a simple website that needs a header and footer on every page. Rather than having to duplicate the header/footer calls across all of the pages, the Layout (Step-Two) pattern defines a single template that contains the header and footer but also uses a "main" area where the content is dynamically inserted.

He includes a full code example to help illustrate the point - a class, Zps_View, that is fed the path to the layouts and the layout files to use before rendering.

tagged: part5 complexviews zendframework twostep designpattern layout part5 complexviews zendframework twostep designpattern layout

Link:

Pádraic Brady's Blog:
Complex Views with the Zend Framework - Pt 5: The Two-Step View Pattern
May 24, 2007 @ 08:43:00

Pádraic Brady is back today with the latest installment (part 5!) of his look at complex views in the Zend Framework. This time, her focuses on something called the Two-Step Pattern - a pattern similar to the Layouts pattern.

Part 5 of our series takes a small time-out from approaching a Composite View solution to reusable Views to take a peek at a simpler approach useful for simpler types of web applications. As we've discussed previously Composite Views allow the nesting of reusable View elements, effectively building a View based on a hierarchy of Views. But often there are simpler solutions to simpler problems. One such solution is the Two-Step View pattern, sometimes called Layouts if implemented in a specific way (as we do below!).

He gives the example of a simple website that needs a header and footer on every page. Rather than having to duplicate the header/footer calls across all of the pages, the Layout (Step-Two) pattern defines a single template that contains the header and footer but also uses a "main" area where the content is dynamically inserted.

He includes a full code example to help illustrate the point - a class, Zps_View, that is fed the path to the layouts and the layout files to use before rendering.

tagged: part5 complexviews zendframework twostep designpattern layout part5 complexviews zendframework twostep designpattern layout

Link:

IBM developerWorks:
Understanding the Zend Framework (Parts 5 & 6)
Aug 23, 2006 @ 07:50:01

The IBM developerWorks site has continued on with its "Understanding the Zend Framework" series with spotlights on two new bits of functionality - creating PDFs and sending emails from inside the framework.

In this part of the series (part 5) they show how to:

  • create PDFs
  • use positioning in adding text, graphics, and shapes to the document
  • manage long blocks of text
  • stream out a dynamic PDF to the browser
  • add information to an existing PDF document

Part six picks up where the previous part left off and includes information on working with emails in the Zend Frameork. They look at the Zend_Mail component and, making some minor changes to the application they've been constructing (the feed reader). They create an email notification to the user when a feed has been updated.

Code examples and the source code for both of these sections are provided.

tagged: understanding zend framework part5 part6 email pdf create feed understanding zend framework part5 part6 email pdf create feed

Link:

IBM developerWorks:
Understanding the Zend Framework (Parts 5 & 6)
Aug 23, 2006 @ 07:50:01

The IBM developerWorks site has continued on with its "Understanding the Zend Framework" series with spotlights on two new bits of functionality - creating PDFs and sending emails from inside the framework.

In this part of the series (part 5) they show how to:

  • create PDFs
  • use positioning in adding text, graphics, and shapes to the document
  • manage long blocks of text
  • stream out a dynamic PDF to the browser
  • add information to an existing PDF document

Part six picks up where the previous part left off and includes information on working with emails in the Zend Frameork. They look at the Zend_Mail component and, making some minor changes to the application they've been constructing (the feed reader). They create an email notification to the user when a feed has been updated.

Code examples and the source code for both of these sections are provided.

tagged: understanding zend framework part5 part6 email pdf create feed understanding zend framework part5 part6 email pdf create feed

Link: