3.2, SDK问题

浏览:896 发布日期:2014/04/01 分类:求助交流 关键字: sdk




用import加载类,也不行,请问怎么解决?

我把sdk目录放在,ThinkPHP/Library/Common/Util

IndexController.class.phpnamespace Home\Controller;
use Think\Controller;
use Common\Util\ThinkOauth;
class IndexController extends Controller{

}
ThinkOauth.class.phpnamespace Common\Util;
abstract class ThinkOauth{
                ...
   /**
     * 取得Oauth实例
     * @static
     * @return mixed 返回Oauth
     */
    public static function getInstance($type, $token = null) {
        $name = ucfirst(strtolower($type)) . 'SDK';
        require_once "sdk/{$name}.class.php";
        if (class_exists($name)) {
            return new $name($token);
        } else {
            E(L('_CLASS_NOT_EXIST_') . ':' . $name);
        }
    }

           ...
}
SinaSDK.class.phpnamespace Common\Util\sdk;
use Common\Util\ThinkOauth;
class SinaSDK extends ThinkOauth{
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>