Permalink
Browse files

Merge pull request #34 from edorian/patch-1

Added examples showing how to automate the autoload file generation
  • Loading branch information...
2 parents 38c092a + 2881cf0 commit d44c827f99bae226facd510e0843d45a4b0c45ac @theseer committed Aug 22, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 readme.markdown
View
27 readme.markdown
@@ -126,3 +126,30 @@ Usage Samples
[theseer@rikka ~]$ phpab -b . --tolerant -o zf1_autoload.php -e '*/Test/*' Zend
+
+Ease of use
+-----------
+
+When using `phpab` it is necessary to recreate the autoload file every time a new class is created. This usually also happens after pulling from a repo or when switchting branches.
+
+Using a git `post-checkout` hook placed in `.git/hooks/post-update` this can be automated for most cases.
+
+###Basic Sample:
+
+```bash
+#!/bin/bash
+phpab -c -o src/autoload.inc.php src
+```
+
+###Sample using an `ant build.xml` file.
+
+```bash
+#!/bin/bash
+if [ -f build.xml ]; then
+ ant -p | grep phpab > /dev/null
+
+ if [ $? -eq 0 ]; then
+ ant phpab > /dev/null &
+ fi
+fi
+```

0 comments on commit d44c827

Please sign in to comment.