/** * enable or disable sending errors to log file * @param boolean $active if true enable sending errors if false disable sending errors * @param boolean $newLogFile if true new log file error will be created if false <br/> * append errors to last created log file */ public static function log($active = true, $newLogFile = true) { if ($newLogFile) { @unlink(LOGGER); } if ($active) { self::$log = true; } }
* Important : Using This Method Is Optional * ========= * * Note : tulipIP Class does not throw any kinds of errors * ====== or exceptions instead tuliIP log file will be created * contains all errors or exception raised throw progress * PLUS: errors or exception raised throw progress will * be also writen to Apache log file * * First argument will allow tulipIP to write the log file - change it to false * to prevent tuliIP to write errors to the log file * second argumengt if true: exist log file will be removed then new one will be created * if false : tulipIP will write errors to exist log file * */ tulipIP::log(true, true); /** * Load Image from source File * return gd resource in success false otherwise */ $path = "../../src.jpg"; $img = tulipIP::loadImage($path); /** * Here We use tuliIP gray filter on loaded img * return true on success false otherwise */ if ($img) { $result = tulipIP::gray($img); } else { echo "Unable To Load The Image"; }