summaryrefslogtreecommitdiff
path: root/protected/extensions/SimpleImage/CSimpleImage.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/extensions/SimpleImage/CSimpleImage.php')
-rw-r--r--protected/extensions/SimpleImage/CSimpleImage.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/protected/extensions/SimpleImage/CSimpleImage.php b/protected/extensions/SimpleImage/CSimpleImage.php
new file mode 100644
index 0000000..754344b
--- /dev/null
+++ b/protected/extensions/SimpleImage/CSimpleImage.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Application component to load SimpleImage instance.
+ * The original component was developed by Khanh Nam.
+ * @link http://www.yiiframework.com/extension/simpleimage/
+ * @author tzur
+ *
+ */
+class CSimpleImage extends CApplicationComponent{
+ /**
+ * Initializes the SimpleImage component.
+ * Imports the SimpleImage class to be used by this component.
+ * @see CApplicationComponent::init()
+ */
+ public function init() {
+ parent::init();
+ $dir = dirname(__FILE__);
+ $alias = md5($dir);
+ Yii::setPathOfAlias($alias, $dir);
+ Yii::import($alias.'.SimpleImage');
+ }
+
+ /**
+ * Loads the image and creates a SimpleImage instance.
+ * @param string $filename
+ * @return SimpleImage
+ */
+ public function load($filename){
+ return new SimpleImage($filename);
+ }
+}
+?>