Tool.php 349 B

12345678910111213141516
  1. <?php namespace Image\Lib;
  2. use Dever;
  3. class Tool
  4. {
  5. public function get($source = '')
  6. {
  7. if (class_exists('\Imagick')) {
  8. $type = 'mg';
  9. } else {
  10. $type = 'gd';
  11. }
  12. $tool = 'Image\\Lib\\Tool\\' . ucfirst($type);
  13. $tool = new $tool($source);
  14. return $tool;
  15. }
  16. }