/** * Validate and set static values * * @param array $init Configuration values. */ public function __construct($init) { // Validate arguments is_dir($init['imgDir']) or $this->errorMessage('The image dir is not a valid directory.'); is_writable($init['cacheDir']) or $this->errorMessage('The cache dir is not a writable directory.'); // Set static values self::$imgDir = $init['imgDir']; self::$cacheDir = $init['cacheDir']; self::$maxWidth = $init['maxWidth']; self::$maxHeight = $init['maxHeight']; }