X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=namespacify.sh;h=541f32f600e452087fc476122a4145a0b01d4bbc;hp=f7bc6f06beb2d51f185b7e62f7279074647f02df;hb=HEAD;hpb=13cee08524dc328f40f089631ef9efa1fc13e251 diff --git a/namespacify.sh b/namespacify.sh index f7bc6f0..541f32f 100644 --- a/namespacify.sh +++ b/namespacify.sh @@ -1,5 +1,10 @@ #!/bin/bash +# This program is in the public domain within the United States. Additionally, +# we waive copyright and related rights in the work worldwide through the CC0 +# 1.0 Universal public domain dedication, which can be found at +# http://creativecommons.org/publicdomain/zero/1.0/ + # This script is designed to make it easier to use wfpl in other projects, and # not worry about include paths or name collisions. # @@ -52,4 +57,4 @@ if [ "$1" = 'wordpress' ]; then echo '}' wordpress_regex='s/function db_\(send_get\|insert_ish\|update\|delete\|\)(.*{/\0\n\t$table = add_wp_table_prefix($table);/; s/\$GLOBALS\['\''wfpl_db_handle'\''\]/$GLOBALS['\''wpdb'\'']->dbh/g;' fi -cat atexit.php csv.php db.php email.php encode.php file.php file_run.php format.php http.php messages.php misc.php template.php time.php | grep -v -e '' -e '^\s*//' -e 'require_once' -e '^\s*$' | grep -v -P -e '^\s*#\s*((?!NAMESPACIFY).)*$' | sed -e "$wordpress_regex"'s/\(register_shutdown_function\|function_exists\|call_user_func_array\)(/\0'\''\\\\wfpl\\\\'\'' . /; s/^\(\s*\)# NAMESPACIFY \(.*\)/\1\2 = '\''\\\\wfpl\\\\'\'' . \2;/' +cat atexit.php csv.php db.php email.php encode.php file.php file_run.php format.php http.php messages.php misc.php template.php time.php | grep -v -e '