By far, it seems that yii has no any cloud compute tools or extensions integrated, but the related product is more and more popular, like amazon cloud aws.
so i want to integrate the popular aws tools tarzan into yii as a third party.
the following are the steps :
1.make a dir ‘vendors’ under the ‘protected’ folder
2.copy the tarzan folder(tarzan_2.0.5) into it
3.add these lines at the begining of a controller class file:
Yii::import('application.vendors.*');
require once('tarzan_2.0.5/tarzan.class.php');
{[url="http://tarzan-aws.com/wiki/technical/overview"]the tarzan documentation[/url] said: In your application (e.g. a specific PHP document), simply use require_once() (or require() or include_once() or include()) to add the tarzan.class.php file to your page. This will load the core Tarzan API.}
-
add a test action,like that:
public function actionTest()
{
$sdb = new AmazonSDB(); /** * Create a new SimpleDB domain. */ $domain = $sdb->create_domain('mysdb_test2'); // As long as the request was successful... if ($domain->isOK()) { echo('create domain successfully'); }
}
but when i access the action, an error occurs:
PHP Error
Description
YiiBase::include(AmazonSDB.php) [<a href=‘yiibase.include’>yiibase.include</a>]: failed to open stream: No such file or directory
Source File
/var/www/yii-1.0.9.r1396/framework/YiiBase.php(324)
00312: * @param string class name
00313: * @return boolean whether the class has been loaded successfully
00314: */
00315: public static function autoload($className)
00316: {
00317: // use include so that the error PHP file may appear
00318: if(isset(self::$_coreClasses[$className]))
00319: include(YII_PATH.self::$_coreClasses[$className]);
00320: else if(isset(self::$_classes[$className]))
00321: include(self::$_classes[$className]);
00322: else
00323: {
00324: include($className.’.php’);
00325: return class_exists($className,false) || interface_exists($className,false);
00326: }
00327: return true;
00328: }
00329:
00330: /**
00331: * Writes a trace message.
00332: * This method will only log a message when the application is in debug mode.
00333: * @param string message to be logged
00334: * @param string category of the message
00335: * @see log
00336: */
the tarzan.class.php also relies on SPL autoload to perform class file inclusion.
i am really confused why yii cannot include the tarzan class file.
does anyone has any suggestion?
and brother Qiang ,pls help me.
thanks