Use at own risk. Programs haven't been thoroughly tested.

script: pearstyle.bash

A simple BASH script to help make you PHP code compliant with PEAR(.php.net) coding standards. Uses astyle(.sf.net) to format and indent accordingly.

Info

@author Kevin van Zonneveld
@version 0.1
@link http://kevin.vanzonneveld.net
@param (string) PHP_SOURCE the path to the PHP file to convert

Example

Usage
pearstyle.bash index.php

Outputs
[ rewrites index.php and makes a backup of the original to index.orig ]

Source Code

download source
#!/bin/bash
#
astyle --style=linux -s4 -KloO --convert-tabs --break-blocks $1

Add comment

» Currently away on vacation. I can reply your message the 24th of July 2008. Please post anyway and check back then. Thank you!

for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

Comments

No comments. Be the first!