 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Brandon Savage's Blog: FIEO Filtering Input with PHP's Filter Functions
by Chris Cornutt August 28, 2009 @ 08:55:03
Brandon Savage has a new post about a key concept that both new and experienced developers need to remember when working with user input - Filter Input, Escape Output (FIEO).
Brand-new PHP developers have drilled into their heads the concept of Filter Input, Escape Output (FIEO). This concept essentially insists that all user-provided content be filtered or escaped, without exception. With the delivery of PHP 5.2.0, this got a lot easier, because PHP included, by default, the Filter library.
He gives two examples of an email validation method - one using a regular expression and the other using the filter_var function of the filter extension with the FILTER_VALIDATE_EMAIL constant for the type.
voice your opinion now!
filter input output extension
Derick Rethans' Blog: Variable tracing with Xdebug
by Chris Cornutt March 25, 2009 @ 11:16:52
Derick Rethans has made a quick post about an update he's made to the XDebug function traces to add in information on variable modifications.
After I had a quick look at the feasibility of this feature I spend some time on implementing it for Xdebug's HEAD branch that is going to become Xdebug 2.1. Variable modification tracing can be enabled by setting the php.ini xdebug.collect_assignments setting to 1. Of course this can also be done in either .htaccess or by using ini_set(). This setting requires general execution tracing to be enabled as well and it's only available for human readable trace files (the default format).
He gives examples of how two example scripts would be logged to the trace file - one inside of a basic function and another showing updates to the properties on a class.
voice your opinion now!
variable trace update change xdebug trace file output
DevShed: Working with the XDebug extension's var_dump() function
by Chris Cornutt February 18, 2009 @ 07:57:55
DevShed has posted the next part in their series looking at using the XDebug extension. This time they focus on the var_dump function and the enhancements the extension brings to the table.
As you may know, "var_dump()" is a PHP native function, but the X-debug library provides an enhanced version of it that's capable of retrieving much more information about a supplied variable. These capabilities greatly extend its usefulness in debugging.
This enhanced version of var_dump displays not only the usual variable information (types, value, etc) but also allows for more advanced output like the object definition, including properties, in their example.
voice your opinion now!
xdebug tutorial extension vardump output enhanced
Fabien Potencier's Blog: Getting information from SVN with PHP
by Chris Cornutt February 05, 2009 @ 12:08:23
In a recent post Fabien Potencier took a look at one method for getting metadata information from a subversion repository about the project(s) inside.
Last year, I deployed a new tool to manage symfony plugins. The first goal of this tool was to simplify the process of contributing new plugins. [...] The question I wanted to answer was quite simple: How many plugins were created per month before and after the change?
He uses a very handy option to modify the output of an "svn log" command - the "--xml" argument. This outputs the latest information (like author, date, paths and msg) for each of the log entries. This can then be thrown into a call to simple_xml_load_file and parsed down into the numbers he was looking for. He even generated a graph of the results as they coordinated with the different symfony releases.
voice your opinion now!
subversion svn log xml output parse simplexml graph
Sameer Borate's Blog: PHP built in functions map
by Chris Cornutt January 16, 2009 @ 09:31:22
Sameer has put together a few images, the results from the Wordle website when he plugged in the names of the built-in functions included in PHP.
The application is simple. You enter a bunch of text and Wordle does the rest. The applet provides options to change color, font and layout. Just for fun I created a Wordle cloud to display php's built in functions. Two samples are shown below. The size of the font in the cloud is proportional to the number of functions starting with the particular name.
Among the largest on the list are words like "array", "get", "mysql" and "mcrypt". He used a call to the get_defined_functions() method and looped through the "internal" subarray to build his lists.
voice your opinion now!
function wordle builtin output image text size
Kae Verens' Blog: Serving files through a script
by Chris Cornutt January 14, 2009 @ 09:37:55
Kae Verens has posted a quick tutorial about serving up files by routing them through a "fetch" script, pulling their contents in one side and back out the other.
One thing I need to do while building the multi-user version of webme is to convert it so file references such as /f/photos/an_image.jpg get transparently converted so they serve correctly, even though the actual file may be located somewhere entirely else.
There's two steps involved - rewriting the URL request for the types of files you'd like to pull through the script (using some mod_rewrite magic in Apache) and make the script to do the actual work. Source for that is included too. Not only can something like this help you keep things organized but it also allows for extra security if you need to store the files outside of the webserver's document root.
voice your opinion now!
serve file script modrewrite output buffer readfile
|
Community Events
Don't see your event here? Let us know!
|