/** * Returns the instance of the class [Singleton] * @return ManualImageCrop */ public static function getInstance() { if (self::$instance === null) { self::$instance = new ManualImageCrop(); } return self::$instance; }
/** * ajax call that does the cropping job and overrides the previous image version */ function mic_ajax_crop_image() { $ManualImageCrop = ManualImageCrop::getInstance(); $ManualImageCrop->cropImage(); exit; }