php5.3版本不推荐使用的方法(Testlink部署)

上一篇 / 下一篇  2010-03-23 16:14:32 / 个人分类:Testlink

Windows 下用PHP 5.3.2 部署 Testlink 1.8.5, Apache2.2的error.log中会发生
PHP Deprecated:  Function ereg_replace() is deprecated in (Dir):\\testlink\\lib\\functions\\lang_api.php on line 173, referer: ...
的错误。
这是由于Testlink 1.8.5 的php源码中有些方法在 php 5.3版本中已不推荐使用。

===============================
这个是我个人解决安装出现问题的方法:
修改testlink1.8.5的php源码,修复此问题。
需要修改的文件以及方法:
1. testlink\lib\functions\lang_api.php, line173
   将 $t_lang_var = ereg_replace( '^TLS_', '', $t_var );
   修改为 $t_lang_var = preg_replace( '^TLS_^', '', $t_var );
   (这里添加^是因为方法中关于delimiter的用法。否则会发生 Warning: preg_replace() [function.preg-replace]: No ending delimiter ':' found in ...)
2. testlink\third_party\phplayersmenu\dumps\sqlite.demo_data.dump.php5 中 ereg_replace方法改为preg_replace;
 testlink\third_party\phplayersmenu\dumps\sqlite.start.dump.php5 中 ereg_replace方法改为preg_replace;
3. testlink\third_party\phplayersmenu\lib\layersmenu-common.inc.php 中 ereg_replace方法改为preg_replace.
===============================

参考官方文档说明: http://php.net/manual/en/migration53.deprecated.php

Deprecated features in PHP 5.3.x

PHP 5.3.0 introduces two new error levels:E_DEPRECATEDandE_USER_DEPRECATED. TheE_DEPRECATEDerror level is used to indicate that a function or feature has been deprecated. TheE_USER_DEPRECATEDlevel is intended for indicating deprecated features in user code, similarly to theE_USER_ERRORandE_USER_WARNINGlevels.

The following is a list of deprecated INI directives. Use of any of these INI directives will cause anE_DEPRECATEDerror to be thrown at startup.

Deprecated functions:

Deprecated features:

  • Assigning the return value ofnewby reference is now deprecated.
  • Call-time pass-by-reference is now deprecated.
  • The use of{}to access string offsets is deprecated. Use[]instead.

TAG:

schiffahr的个人空间 引用 删除 schiffahr   /   2010-09-06 18:44:17
原帖由wanghong_liska于2010-08-10 16:15:00发表
我是第一次装testlink,想请教一个问题:
为什么我配置好LDAP后,用域账户登录不成功呢?系统总是提示用.


非常感谢你提出的问题,之前我也没有用过LDAP 用户验证。我配置了PHP,Apache对于ldap 的支持。单独用php页面测试了ldap,都可以通过。不过我配置testlink 中关于ldap 的参数可以有错误,登录的时候提示我“用户名或者密码错误”,我会尽快找到这个问题的解决方法。
wanghong_liska的个人空间 引用 删除 wanghong_liska   /   2010-08-10 16:15:00
我是第一次装testlink,想请教一个问题:
为什么我配置好LDAP后,用域账户登录不成功呢?系统总是提示用户名密码错误。
苦恼中。。。
wanghong_liska的个人空间 引用 删除 wanghong_liska   /   2010-08-10 16:07:43
5
 

评分:0

我来说两句

Open Toolbar