 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
php|architect: Seeing Triple!
by Chris Cornutt March 03, 2011 @ 10:05:47
php|architect Magazine has officially announced the introduction of a new publishing format for their magazine. Readers are no longer tied to just PDF versions - they can now opt for ePUB editions of the magazine starting with this month's issue (and retroactively!).
Still, even though PDF was a less popular format in 2002 than it has become today, it was a much easier choice for us when the only way to read an electronic publication was to sit in front of a computer. The advent of portable e-book readers demanded that we consider other formats; as a result, about six months ago we started a skunkworks program, spearheaded by our very own Keith Casey, to create ePub and MOBI versions of our magazine.
Thanks to an ePUB document generator, the magazine can now be dynamically generated into three formats - the usual PDF file, an ePUB edition and a MOBI edition for the Kindle fans out there. All subscribers have been upgraded to this plan - the Premium subscription - and are able to start pulling down these editions today.
voice your opinion now!
publishing format phparchitect pdf epub mobi
Volker Dusch's Blog: Creating your custom PHPUnit output formats
by Chris Cornutt January 20, 2011 @ 08:36:00
Volker Dusch has a new post to his blog today talking about PHPUnit and how you can make custom output formats to get the results exactly how you need them. The trick is in using XSLT for transformation.
While tackling with someones question i decided it's time to play around with xslt for learning purposes and i found something useful to do.
He wanted to extend the --testdox-html output and i proposed to just transform phpunits xml output using an xslt since i didn't see a easy way to prove a custom implemenation for PHPUnit/Util/TestDox/ResultPrinter/HTML.php and i didn't want to change the file its self.
He gives an example of how to use the textdox output method to generate an XML document of the unit test run's results and a simple XSLT style sheet to format the results as a custom HTML page. He uses the "xsltproc" command line tool to make the translation happen.
voice your opinion now!
phpunit textdox xml xslt convert output format
Rob Allen's Blog: Validating dates
by Chris Cornutt November 09, 2010 @ 12:11:12
In a new Zend Framework related post to his blog today Rob Allen takes a look at a different operating mode he found with Zend_Date changing how it handles format specifiers.
I discovered recently that Zend Framework 1's Zend_Date has two operating modes when it comes to format specifiers: iso and php, where iso is the default. When using Zend_Validate_Date in forms, I like to use the php format specifiers as they are what I'm used to and so can easily know what they mean when reviewing code that I wrote months ago.
His example code shows how you can use the standard date formatting strings in a Zend_Form validator (the "php" format) and an example using the Zend_Date::MONTH or Zend_Date::YEAR identifiers (the "iso" format). He also shows how he met two other requirements - validation for empty and a consistent format on the date validation ("Y-m-d").
voice your opinion now!
validate date zendform zendframework iso format
Brian Swan's Blog: Rendering SQL Server Reports as Excel Documents with PHP
by Chris Cornutt September 27, 2010 @ 10:15:51
Brian Swan has a new post to his blog that looks at a method for pulling back the reports from a SQL Server instance in something a bit more readable/useful - an Excel document.
One of the most common questions [from his previous post] has been "How do I render a report as an Excel document?" I've been telling folks that this is easy with the SSRS SDK for PHP (and it is easy), but when I sat down to do it, I ran into a problem. So, in this post, I'll show you how to render a SSRS report as an Excel document and how to avoid the one problem that caused me headaches.
This post's a short one with a code snippet (and download) showing how to connect to the server and create a "RenderAsEXCEL" object and request the report information with that in the rendering function. Then it's just as simple as pushing that information out to a file as a ".xls". The included download will also let you pull down the report as HTML or as a PDF.
voice your opinion now!
sqlserver report excel format pdf html
Court Ewing's Blog: Forget Concatenation; Format your strings!
by Chris Cornutt September 16, 2010 @ 08:38:35
On his blog today Court Ewing has posted a tutorial about a different approach to merging strings while formatting them at the same time - using sprintf and printf for more than just a single-shot output.
I do it, you do it, everyone does it! We all concatenate. If you're simply combining a few variables or constants together, concatenation is the way to go. After all, it is quick and easy, and who can complain about that? However, concatenation does have two serious drawbacks: any sort of string formatting must be done manually, and it is difficult to visualize the "goal" string when it is sufficiently complex.
He talks about the benefits of string formatting over basic string concatination like how easy it makes casting variable values - multiple or single - without you having to cast them manually and append. He gives a few code examples of how it can be used for simple formatting and how it can make escaping data used in multiple spots easier. He also includes a SQL query example showing the difference between using sprintf and a normal concatinated statement.
voice your opinion now!
format string concatination sprintf printf tutorial
Stefan Koopmanschap's Blog: Formatting valid xsdateTime fields with PHP
by Chris Cornutt September 09, 2009 @ 09:19:15
Stefan Koopmanschap had a problem - the formatting on his dateTime fields (the XSD type) wasn't cooperating and couldn't be validated. He asked the question of the community of how to correct this and was given a short and easy answer from David Zuelke using date.
Recently I had to compose some XML documents that needed to be validated with XSDs. All fine of course, but I had some problem with two date/time fields that according to the XSD were supposed to be xs:dateTime fields. Googling around I found a lot of references to the ISO8601 format, so I decided to format my date using the DATE_ISO8601 constant. That did not work though.
David's suggestion was to use "date('c')" (the full ISO 8601 date) instead of the DATE_ISO8601 constant. The trouble is caused by a missing colon in the second choice's output.
voice your opinion now!
format valid xsd datetime
Federico Cargnelutti's Blog: Format a time interval with the requested granularity
by Chris Cornutt June 25, 2009 @ 12:56:51
Federico Cargnelutti has posted a class (DateIntervalFormat) that gives you the difference between a date and "now" in words rather than an integer.
This class, a refactored version of Drupal's format_interval function, makes it relatively easy to format an interval value. The format will automatically format as compactly as possible. For example: if the difference between the two dates is only a few hours and both dates occur on the same day, the year, month, and day parts of the date will be omitted.
So, instead of getting a value of "86400 seconds" you'd get back something like "5 days 3 hours".
voice your opinion now!
tutorial granularity time format
SmartyCode.com: Serving XHTML in Zend Framework App
by Chris Cornutt April 27, 2009 @ 07:55:39
On the SmartyCode.com site, there was a new article posted recently looking at making the output of your Zend Framework application XHTML compliant.
Serving XHTML is often misunderstood by php developers. Frontend engineers simply include the XHTML doctype to their documents, without actually serving document as XHTML. This triggers majority of the browsers to treat such pages as 'tag-soup'. [...] This front controller plugin's code mostly takes concepts from the excellent article by Keystone Websites, but implements in Zend Framework environment in an object-oriented way.
The code works as a plugin to the controller and runs a few checks on the contents of the data being pushed out (dispatchLoopShutdown) and returns the correct header information (DOCTYPE, language attribute) in the correct XHTML format for the data. When the plugin is registered, all it takes is a call to the "doctype()" method to output the correct information.
voice your opinion now!
zendframework xhtml doctype serve format plugin controller
TotalPHP.com: Creating a text or csv file of information from your database
by Chris Cornutt December 10, 2008 @ 08:47:44
On the TotalPHP site there's a new tutorial showing how to pull data from your database and export it as a CSV file that tools like Excel can read in and use.
There are some occasions where you would want to export your site's information in CSV or similar text format. You might want to do this so you can view reports in a spreadsheet, or you might want an export of your product information to upload to a service like Google Products. Either way the method and end result are essentially the same.
The tutorial shows how to grab the information (via the mysqli functionality in PHP5) and formatting each row with the correct values in a certain order. Finally, the entire contents are echoed back out with the correct header() to force a download on the user's browser.
voice your opinion now!
csv tutorial mysqli database export txt format
Zend Developer Zone: Working with RAR, LZF and BZ2 Compression Formats in PHP
by Chris Cornutt November 03, 2008 @ 12:03:01
The Zend Developer Zone has posted this new tutorial from Vikram Vaswani covering the use of different archive formats (like RAR, LZF and BZ2 compression methods) from inside PHP.
When it comes to dealing with different file formats, it's hard to faze PHP. XML documents, PDF files, JPEG images, MP3 media...you name it and, chances are, there's a PHP extension to handle it. And so it is with compression formats like RAR, LZF and Bzip2 - although these archive formats are far less common today than the ubiquitous TAR and ZIP formats, they are still actively used by many applications and projects, and continue to be supported in PHP via PECL extensions.
He pulls in a few PECL extensions to give PHP the power it needs, both for unix-based systems and Windows DLL files. He includes some sample code showing how to open up a rar file and list the contents inside as well as extract the files themselves. And, of course, code examples for compressing files into a new archive is included too.
voice your opinion now!
rar lzf bz2 compression format pecl extension dll windows tutorial
|
Community Events
Don't see your event here? Let us know!
|