background preloader

PHP

Facebook Twitter

Reading and writing the XML DOM with PHP. Reading and writing Extensible Markup Language (XML) in PHP may seem a little frightening.

Reading and writing the XML DOM with PHP

In fact, XML and all its related technologies can be intimidating. However, reading and writing XML in PHP doesn't have to be a daunting task. First, you need to learn a little about XML -- what it is and what it's used for. Then, you need to learn how to read and write XML in PHP, which you can do in many ways. This article provides a short primer on XML, then explains how to read and write XML in PHP. What is XML? XML is a data storage format. <name>Jack Herrington</name> Xml2array() - XML Parser for PHP < PHP. PHP 5.4 is Here! What You Must Know. PHP 5.4 is here; the next major step forward since version 5.3 - keeping PHP 6 (full Unicode support) on hold for now.

PHP 5.4 is Here! What You Must Know

The latest enhancements significantly improve its elegance, while removing deprecated functionality, resulting in a dramatic optimization of the runtime (up to 20% more speed and memory usage reduction). Umentor Tutorial. PhpDocumentor Basics Starting Out From Scratch The documentation process begins with the most basic element of phpDocumentor: a Documentation block or DocBlock.

umentor Tutorial

A basic DocBlock looks like this: A DocBlock is an extended C++-style PHP comment that begins with "/**" and has an "*" at the beginning of every line. DocBlocks precede the element they are documenting. Any line within a DocBlock that doesn't begin with a * will be ignored. To document function "foo()", place the DocBlock immediately before the function declaration: /** * Defies imagination, extends boundaries and saves the world ...all before breakfast! This example will apply the DocBlock to "define('me',2);" instead of to "function foo()": /** * DocBlock for function foo?

Salesforce

JavaScriptMVC. File Handling. Index ImageMagick Examples Preface and Index Image Formats Summary Reading Images Saving Images Special Output File Formats (Specific to IM) miff: info: null: txt: sparse-color: histogram: mpr: mpc: fd: inline: clipboard: -- Read/Write to/from windows clipboard ephemeral: -- Auto-delete after read show:, win:, and x: -- Display Images Directly x: (as input) -- Display Capture and Re-draw Delegates and Coders for Image Formats Really Massive Image Handling Long Streams of Lots of Images, Video sequences To process an image, you not only need operators to work on the images, but you also need ways to read in and write out the image in as many different file formats as possible.

File Handling

Image Formats Summary One of the most common uses of ImageMagick is not to modify images at all, but only to convert an image from one image format to another. Reading Images IM by default will attempt to determine the image format type by the 'magic' file identification codes within the file itself. '[#x#]' Read Resize bytes. Command-line Options. ImageMagick® is a software suite to create, edit, compose, or convert bitmap images.

Command-line Options

It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite language.

Another Serious Security Bug on PHP 5.3.9 - PHP Classes blog. Contents PHP 5.3.9 Arbitrary Remote Code Execution Vulnerability What shall you do now?

Another Serious Security Bug on PHP 5.3.9 - PHP Classes blog

Suhosin Security versus the PHP World Conclusion PHP 5.3.9 Arbitrary Remote Code Execution Vulnerability Earlier today, the well known security expert Stefan Esser has revealed again yet another serious security bug in PHP. This time it is a bug that allows arbitrary remote code execution. In December it was publicly disclosed a security bug named hash collision that could make the server consume too much CPU cycles just to process the parameters sent by a HTTP request.

This time the bug was found precisely in the code that was added as work around the hash collision problem. This is just a reminder of something that I commented in a previous post about whether you should try new PHP versions or not.

Frameworks

Crautos.com. Testing with PHPUnit and Selenium. NetBeans IDE for PHP supports PHPUnit automated tests.

Testing with PHPUnit and Selenium

Thanks to PHPUnit, NetBeans IDE provides code coverage for PHP, similar to the code coverage the IDE provides for Python. Test output appears in the same feature-rich output window that the IDE's JUnit and Python test runners use. NetBeans IDE also supports the Selenium portable test framework, in combination with PHPUnit. A Selenium plug-in is available from the Update Center. Installing this plugin adds a Selenium server to the IDE's registered servers and adds Selenium test options to the PHP menus. Contents To follow this tutorial, you need the following software and resources. Installing PHPUnit Use PEAR to install PHPUnit as described in the PHPUnit documentation and PHPUnit's Skeleton Generator as described in the Skeleton Generator documentation. To check that NetBeans IDE recognizes your PHPUnit installation, open Tools > Options (On Mac, open NetBeans Preferences) and look at the PHP window.