Created
November 18, 2011 19:55
-
-
Save adamlundrigan/1377575 to your computer and use it in GitHub Desktop.
Regenerate classmaps of all non-git-submodule modules in a ZF2 project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Place in `bin` folder within your ZF2 project, at the same level as your `modules` folder. From your project folder, run: | |
``` | |
bash bin/regen_classmaps | |
``` | |
You could also place your `bin` folder in your shell PATH variable, and then just type `regen_classmaps` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROJECT=`dirname $0`; PROJECT=`cd $PROJECT ; cd .. ;pwd`; | |
find $PROJECT/modules -name "autoload_classmap.php" | while read FILE | |
do | |
MODULE=`dirname $FILE`; | |
MODULEDIR=`echo $MODULE | sed "s{$PROJECT/{{"`; | |
if [ "`git submodule | awk '{print $2}' | egrep "^$MODULEDIR\$"`" = "" ] | |
then | |
echo $MODULEDIR; | |
/bin/env php $PROJECT/library/ZendFramework/bin/classmap_generator.php -l $MODULE -w 2>&1 | while read LINE; do echo " > $LINE"; done; | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment