Created
April 13, 2011 15:26
-
-
Save patcoll/917747 to your computer and use it in GitHub Desktop.
Copy only certain Zend Framework libs and their dependencies into a specified directory
This file contains 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 | |
# | |
# Copy only certain Zend Framework libs and their dependencies into a specified directory. | |
# | |
# This script was created because copying the entire Zend Framework into an existing project | |
# is not really necessary if you only want to use part of it. However you fall into dependency | |
# hell because most sub-libraries use multi-purpose libs like Zend_Exception and Zend_Validate. | |
# | |
# Put this script in a fresh copy of ZF's `library` folder and run it as follows: | |
# | |
# USAGE: | |
# ./copy_zf_files.sh Zend/Barcode <DESTINATION FOLDER> | |
# | |
lib=$1 | |
dest=$2 | |
for pattern in $(grep -Ehor "Zend_[A-Za-z0-9]+" $lib | sort | uniq | sed 's=_=/=') Zend/Loader; do | |
if [[ -d $pattern || -f $pattern.php ]]; then | |
ls -1d $pattern* | xargs -J % cp -rp % $dest | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment