Ejemplo n.º 1
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OXID eShop Community Edition.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @link      http://www.oxid-esales.com
 * @copyright (C) OXID eSales AG 2003-2014
 * @version   OXID eShop CE
 */
/**
  In case you need to extend current generator class:
    - create some alternative file;
    - edit htaccess file and replace core/utils/getimg.php with your custom handler;
    - add here function "getGeneratorInstanceName()" which returns name of your generator class;
    - implement class and required methods which extends "oxdynimggenerator" class
    e.g.:

      file name "testgenerator.php"

      function getGeneratorInstanceName()
      {
          return "testImageGenerator";
      }
      include_once "oxdynimggenerator.php";
      class testImageGenerator extends oxdynimggenerator.php {...}
*/
// including generator class
require_once "core/oxdynimggenerator.php";
// rendering requested image
oxDynImgGenerator::getInstance()->outputImage();
Ejemplo n.º 2
0
 /**
  * Creates and returns picture generator instance
  *
  * @return oxDynImgGenerator
  */
 public static function getInstance()
 {
     if (self::$_oInstance === null) {
         $sInstanceName = getGeneratorInstanceName();
         self::$_oInstance = new $sInstanceName();
     }
     return self::$_oInstance;
 }
 /**
  * Testing instance getter
  *
  * @return null
  */
 public function testGetInstance()
 {
     $this->assertTrue(oxDynImgGenerator::getInstance() instanceof oxDynImgGenerator);
 }