PLZ: A handy PHP library for lazy programmers
  • Namespace
  • Class
  • Tree
  • Todo

Namespaces

  • amekusa
    • plz
  • PHP

Classes

  • amekusa\plz\alt
  • amekusa\plz\arr
  • amekusa\plz\constant
  • amekusa\plz\dom
  • amekusa\plz\fn
  • amekusa\plz\num
  • amekusa\plz\obj
  • amekusa\plz\op
  • amekusa\plz\path
  • amekusa\plz\str
  • amekusa\plz\sys
  • amekusa\plz\T
  • amekusa\plz\type
  • amekusa\plz\xml

Exceptions

  • amekusa\plz\ErrorException
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 
<?php namespace amekusa\plz; main::required;

/**
 * System utilities
 *
 * To get started, place the following line around top of your code.
 * ```php
 * use amekusa\plz\sys;
 * ```
 */
abstract class sys {

    /**
     * Ensures whether a PHP directive has a specific value
     * @param string $X The name of a directive
     * @param mixed $Value The value that the directive should have
     * @return boolean `true` if the directive has a correct value. Otherwise `false`
     */
    static function ensure_ini($X, $Value) {
        if ($ini = ini_get($X) === false) throw new \RuntimeException("No such directive: {$X}");
        if ($ini === $Value) return true;
        if (ini_set($X, $Value) === false)
            throw new \RuntimeException("The value of the directive: {$X} must be " . print_r($Value));

        return true;
    }

    /**
     * @todo Write doc
     */
    static function ignore_errors() {
        error_reporting(0);
    }

    /**
     * @ignore
     * @todo Implement: Set error reporting level
     */
    static function ignore_warnings() {
    }
}
PLZ: A handy PHP library for lazy programmers API documentation generated by ApiGen