Overview

Packages

  • LegiScan
    • API
    • Cache
    • Common
    • Exceptions
    • Utility
  • PHP

Functions

  • expect_user
  • is_cli
  • legiscan_getopt
  • legiscan_help
  • legiscan_option
  • memory_usage
  • prettyPrint
  • sec2hms
  • timer_clear
  • timer_read
  • timer_start
  • timer_stop
  • yes_no_prompt
  • Overview
  • Package
  • Class

Package LegiScan\Common

Functions summary
expect_user Check to see if the current user is the expected user
is_cli Simple check to see if script running via the CLI SAPI
legiscan_getopt Wrapper around getopt() that also strips recognized options from $argv
legiscan_help Print some help text for command line options and exit()
legiscan_option Check to see if an option is set and return the value if it had an argument, otherwise true/false
memory_usage Get the current and peak memory usage as a string for logging
prettyPrint Given a compact JSON string return a pretty printed version
sec2hms Convert elapsed seconds to H:M:S format
timer_clear Clear and reset a named timer
timer_read Read a named timer value without stopping it
timer_start Start a named timer, if a timer is started and stopped multiple times, the intervals will be accumulated
timer_stop Stop a named timer and return the timer values
yes_no_prompt Ask for a Yes/No response if on terminal, otherwise return default answer
LegiScan API Client API documentation generated by ApiGen