speedphp目前支持 bae3.0版本吗?

#1 505783958

最近百度出了bae新版,speed旧版本放上去好像有错误。

2014-03-06 15:06:51

#2 jake

什么错误

2014-03-06 17:43:35

#3 505783958

jake 发表于 2014-3-6 17:43
什么错误
数据库链接错误/无法找到数据库 : -----AK SK Invalid

  • /home/bae/app/SpeedPHP/Drivers/bae_mysqli.php on line 99
94.          $user = getenv('HTTP_BAE_ENV_AK');
95.          $pwd = getenv('HTTP_BAE_ENV_SK');
96.          if(!$host)spError('请使用BAE环境!');
97.          $this->conn = mysqli_connect($host, $user, $pwd, $dbConfig['database'], $port);
98.          // if(mysqli_connect_errno())spError('数据库链接错误/无法找到数据库 : '. mysqli_connect_error());
99.          if(mysqli_connect_errno())spError('啊啊啊数据库链接错误/无法找到数据库 : '.$user."---".$pwd."--". mysqli_connect_error());

100.          $this->exec("SET NAMES UTF8");
101.      }
102.      /**
103.       * 对特殊字符进行过滤
104.       *


  • /home/bae/app/SpeedPHP/spFunctions.php on line 149
144.          }
145.      }
146.      if(FALSE != $has_define){
147.          $argString = '';$comma = '';
148.         if(null != $args)for ($i = 0; $i < count($args); $i ++) { $argString .= $comma . "\$args[$i]"; $comma = ', '; }
149.          eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);");

150.          return $GLOBALS['G_SP']["inst_class"][$class_name];
151.      }
152.      spError($class_name."类定义不存在,请检查。");
153. }
154.


  • /home/bae/app/SpeedPHP/Core/spModel.php on line 52
47.      {
48.          if( null == $this->tbl_name )$this->tbl_name = $GLOBALS['G_SP']['db']['prefix'] . $this->table;
49.          if( '' == $GLOBALS['G_SP']['db_driver_path'] ){
50.              $GLOBALS['G_SP']['db_driver_path'] = $GLOBALS['G_SP']['sp_drivers_path'].'/'.$GLOBALS['G_SP']['db']['driver'].'.php';
51.          }
52.          $this->_db = spClass('db_'.$GLOBALS['G_SP']['db']['driver'], array(0=>$GLOBALS['G_SP']['db']), $GLOBALS['G_SP']['db_driver_path']);

53.      }
54.
55.      /**
56.       * 从数据表中查找一条记录
57.       *


  • /home/bae/app/SpeedPHP/spFunctions.php on line 149
144.          }
145.      }
146.      if(FALSE != $has_define){
147.          $argString = '';$comma = '';
148.         if(null != $args)for ($i = 0; $i < count($args); $i ++) { $argString .= $comma . "\$args[$i]"; $comma = ', '; }
149.          eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);");

150.          return $GLOBALS['G_SP']["inst_class"][$class_name];
151.      }
152.      spError($class_name."类定义不存在,请检查。");
153. }
154.


  • /home/bae/app/controller/main.php on line 9
4.
5. class main extends spController
6. {
7.      function index(){ // 这里是首页
8.          $tpl     = $this->spArgs("tpl", "upload"); // 这里接收tpl参数,使得模板变化
9.          $guestbook = spClass("guestbook");

10.          $this->results = $guestbook->findAll();
11.          $this->display("{$tpl}/upload.html");
12.      }
13.      function write(){ // 这里是留言
14.          $guestbook = spClass("guestbook");


  • /home/bae/app/SpeedPHP/spFunctions.php on line 21
16.      if(!is_object($handle_controller) || !method_exists($handle_controller, $__action)){
17.          eval($GLOBALS['G_SP']["dispatcher_error"]);
18.          exit;
19.      }
20.      // 路由并执行用户代码
21.      $handle_controller->$__action();

22.      // 控制器程序运行完毕,进行模板的自动输出
23.      if(FALSE != $GLOBALS['G_SP']['view']['auto_display']){
24.          $__tplname = $__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
25.                  $__action.$GLOBALS['G_SP']['view']['auto_display_suffix']; // 拼装模板路径
26.          $handle_controller->auto_display($__tplname);


  • /home/bae/app/index.php on line 39
34.                  'args' => array(),
35.          ),
36.      ),
37. );
38. require(SP_PATH."/SpeedPHP.php");
39. spRun();


2014-03-06 22:49:27

#4 jake

已经修改OK,请下载新的 https://git.oschina.net/SpeedPHP/framework-bae

主要是BAE3已经支持原生的链接方式,数据库IP等信息在它后台可以找到,所以之前用获取环境变量方式拿到的参数已经失效。

PS: 接近原生的PHP之后,其实可以用普通的SpeedPHP框架即可。

2014-03-07 09:09:43

#5 505783958

jake 发表于 2014-3-7 09:09
已经修改OK,请下载新的 https://git.oschina.net/SpeedPHP/framework-bae

主要是BAE3已经支持原生的链接 ...
ok,谢谢jake大哥。

2014-03-07 10:11:00

#6 505783958

jake 发表于 2014-3-7 09:09
已经修改OK,请下载新的 https://git.oschina.net/SpeedPHP/framework-bae

主要是BAE3已经支持原生的链接 ...
jake ,这个版本需要修改哪几个文件的参数, bae3.0

2014-03-09 11:29:30

#7 505783958

jake 发表于 2014-3-7 09:09
已经修改OK,请下载新的 https://git.oschina.net/SpeedPHP/framework-bae

主要是BAE3已经支持原生的链接 ...
jake, 这个版本的form跳转出现问题啦, 我本地测试也不通过.

2014-03-09 20:23:07