Update script to work with base class

This commit is contained in:
Zach Borboa
2023-01-12 08:29:24 -08:00
parent c5421e3be1
commit bdec727f63
2 changed files with 27 additions and 4 deletions
+1 -1
View File
@@ -365,7 +365,7 @@ MultiCurl::stop()
MultiCurl::success($callback)
MultiCurl::unsetHeader($key)
MultiCurl::unsetProxy()
MultiCurl::verbose($on = true, $output = STDERR)
MultiCurl::verbose($on = true, $output = 'STDERR')
```
### Security
+26 -3
View File
@@ -11,10 +11,33 @@ after=$(tail -n +$(
echo "${before}" > "README.md"
basecurl_path="src/Curl/BaseCurl.php"
curl_path="src/Curl/Curl.php"
multicurl_path="src/Curl/MultiCurl.php"
echo '```php' >> "README.md"
find "src/Curl" -type f -name "*Curl*" |
sort |
xargs -L 1 -I {} bash -c 'class_name="$(basename --suffix=".php" "{}")" && egrep "^ .* function .*" "{}" | egrep "^ public" | sort | perl -pe "s/^ public (.* )?function /${class_name}::/"' >> "README.md"
curl_class_name="$(basename --suffix=".php" "${curl_path}")" &&
curl_fns="$(
grep --extended-regexp "^ .* function .*" "${curl_path}" |
grep --extended-regexp "^ public" |
perl -pe "s/^ public (.* )?function /${curl_class_name}::/")"
multicurl_class_name="$(basename --suffix=".php" "${multicurl_path}")" &&
multicurl_fns="$(
grep --extended-regexp "^ .* function .*" "${multicurl_path}" |
grep --extended-regexp "^ public" |
perl -pe "s/^ public (.* )?function /${multicurl_class_name}::/")"
common_fns="$(
grep --extended-regexp "^ .* function .*" "${basecurl_path}" |
grep --extended-regexp "^ public" |
perl -pe "s/^ public .* ?function (.*)/Curl::\1\nMultiCurl::\1/")"
echo "${curl_fns}
${multicurl_fns}
${common_fns}" | sort >> "README.md"
echo '```' >> "README.md"
echo >> "README.md"