[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/imagekit/src/ -> lmbImageFactory.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  /**

  11   * class lmbImageFactory.

  12   *

  13   * @package imagekit

  14   * @version $Id: lmbImageFactory.class.php 5945 2007-06-06 08:31:43Z pachanga $

  15   */
  16  class lmbImageFactory
  17  {
  18    function create($library = 'gd', $dir = '')
  19    {
  20      if(defined('LIMB_IMAGE_LIBRARY'))
  21        $library = LIMB_IMAGE_LIBRARY;
  22  
  23      $image_class_name = 'lmbImage' . ucfirst($library);
  24  
  25      if(isset($GLOBALS['global_' . $image_class_name]))
  26        $obj = $GLOBALS['global_' . $image_class_name];
  27      else
  28        $obj = null;
  29  
  30      if(get_class($obj) != $image_class_name)
  31      {
  32        $dir = ($dir == '') ? 'limb/imagekit/src/' : $dir;
  33  
  34        if(!file_exists(dirname(__FILE__) .  '/'.  $image_class_name . '.class.php'))
  35          throw new lmbFileNotFoundException(dirname(__FILE__) .  '/'. $image_class_name . '.class.php', 'image library not found');
  36  
  37        lmb_require(dirname(__FILE__) .  '/'. $image_class_name . '.class.php');
  38  
  39        $obj = new $image_class_name();
  40        $GLOBALS['global_' . $image_class_name] = $obj;
  41      }
  42  
  43      return $obj;
  44    }
  45  
  46  }
  47  ?>


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7