/php-misc

Miscellaneous, lonely PHP classes that don't already have a home in another CubicleSoft product but want to be free and open source and loved. MIT or LGPL.

Primary LanguagePHP

Miscellaneous CubicleSoft PHP Classes

Miscellaneous, lonely PHP classes that don't already have a home in a CubicleSoft library but want to be free and open source and loved. MIT or LGPL, your choice.

Donate Discord

Classes

  • AppleICNS - Create and parse Apple icon (.icns) files. Documentation
  • ArrayUtils - Implements missing functions for associative arrays. Documentation
  • CalendarEvent - Powerful scheduling class. Feed in a cron line, get back the next timestamp of when something should trigger. Documentation
  • CLI - Static functions in a class to extract command-line options, parse user input on the command-line, and log messages to the console. Do you really need a separate logging library? I don't. Documentation
  • ColorTools - Static functions in a class to convert RGB to other color spaces and calculate readable foreground text colors for any background color. Documentation
  • DirHelper - Static functions in a class for simplifying common file system tasks regarding directories, including recursive copy, delete, and permissions changes when building installers, live demos, and testing tools. Documentation
  • EventManager - Register to listen for events whenever the application fires them. Can be the basis of a plugin/module system. Documentation
  • FastCGI - Implements a FactCGI client. Documentation
  • GenericServer - Implements a generic TCP/IP server. Can be used for creating custom protocols. Documentation
  • IPAddr - Static functions in a class for processing IPv4 and IPv6 addresses into a uniform format. Documentation
  • LineDiff - Static functions in a class for generating line-by-line diffs. Documentation
  • NaturalLanguage - Static functions in a class for dynamically generating content based on data inputs and rulesets via PHP arrays. Documentation
  • PHPMinifier - Static functions in a class for minifying PHP code while still generally maintaining readability. Documentation
  • ProcessHelper - Static functions in a class for starting and terminating non-blocking processes across all platforms. Documentation
  • Request - Static functions in a class for doing basic, common, but missing request initialization handling. Common initialization routines for CubicleSoft applications. Documentation
  • SerialNumber - Generates and validates encrypted 16 character serial numbers. The basis of CubicleSoft License Server. Documentation
  • Str - Static functions in a class for doing basic, common, but missing string manipulation. Common initialization routines for CubicleSoft applications. Some minor carryover from extremely old C++ libraries. Documentation
  • StringBitStream - Parse data stored in a bit stream such as Flash (SWF) files. Documentation
  • SystemProfile - Static functions in a class to generate an array of internal device hardware information for the current device. Documentation
  • UTF8 - Flexible UTF-8 string manipulation static functions in a class. CubicleSoft was doing Unicode and UTF-8 long before Unicode and UTF-8 were cool. Documentation
  • UTFUtils - Convert between various Unicode Transformation Formats (UTF-8, UTF-16, UTF-32) and a Punycode implementation. Documentation
  • XTerm - Static functions in a class for emitting XTerm-compatible escape codes to alter terminal behavior. Mostly for changing font styles and colors but also supports most escape codes with easier to comprehend functions. Many features also work with the Command Prompt in Windows 10 and later. Documentation

How To Use

See the 'docs' directory for official documentation and example usage.

The 'test.php' file also contains example usage patterns. Run it via the command-line like this:

php test.php -e something -f -v -v -v N Y

The 'test_request.php' file contains example usage patterns for the Request class. Run it via a web server request like:

http://localhost/path/to/test_request.php?action=test&id=5

The 'test_colors.php' file performs a variety of color tests. Requires a XTerm-compatible terminal. Command Prompt in Windows 10 and later works too! Run it via the command-line like this:

php test_colors.php