Skip to content

zionsg/standalone-php-scripts

Repository files navigation

Standalone PHP Scripts

In general, folders with names in StudlyCaps contain classes (OOP) while those in lowercase/camelCase contain functions or procedural scripts.

Usage

To clone just a folder, follow these steps taken from a StackOverflow post:

mkdir <repo>
cd <repo>
git init
git remote add origin <url>
git config core.sparsecheckout true
echo "<folderInRepo>/*" >> .git/info/sparse-checkout
git pull --depth=1 origin master

Classes

  • BitbucketApi
    Get list of all repositories in Bitbucket workspace, together with access keys, pipeline SSH keys and repository variables.

  • CompareDatabases
    Compare columns and rows between 2 databases.

  • CrawlSite
    Crawl website using downwards traversal only.

  • DirectoryListing
    Retrieve directory listing with folder/file count and size info.

  • Grep
    Grep (UNIX command) all files for search text recursively in current directory.

  • InlineImages
    Get url content and replace images with inline images.

  • JiraTitles
    Convert issue numbers in text to JIRA issue keys and titles.

  • ReplaceShortTags
    Reads PHP file and replaces short tags

  • SplitSchoolClass
    Split text containing school class names into individual classes.

  • TextToCalendar
    Generate Excel calendar from formatted text using PHPExcel library (http://phpexcel.codeplex.com).

  • TokenizeHtml
    Tokenize HTML content into words and tags

  • VirtualHosts
    Generate list and config for port-based virtual hosts on local development machine.

Procedural scripts

  • alignText
    Align text in columns.

  • array_diff_key_recursive
    Compare keys of 2 arrays recursively in both directions.

  • array_reduce_lists_recursive
    Reduce lists in an array to 1 element each recursively.

  • composer_browser
    Run composer install in browser.

  • find_long_filenames
    Find long filenames in path.

  • getExcelSubstituteFormula
    Generate Excel formula for substituting multiple words.

  • getMacIpFromArp
    Get MAC addresses and their IPv4 addresses from arp -a output

  • groupCsv
    Parse CSV, group by the first X columns and return CSV

  • permutate
    Generate permutations of a fixed length given a list of characters.

  • phpcsfixer_browser
    Run PHP-CS-Fixer in browser (checking only, no fixing).

  • phpunit_browser
    Run PHPUnit tests in browser.

  • pixel
    Output 1-pixel transparent GIF image.

  • rename_files
    Rename files in folder especially images with numbering

  • replacePlaceholders
    Replace placeholders in format string with variable values

  • show_database_schema
    List out all the tables in a database together with the column information

  • split_sql_file
    Split large SQL database dump file into smaller parts

About

Standalone PHP Scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published