全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:3578
推到 Plurk!
推到 Facebook!

我發現RADPHP的FORM的loadResource(__FILE__)有嚴重問題

尚未結案
ganlnyn
一般會員


發表:2
回覆:4
積分:1
註冊:2011-09-29

發送簡訊給我
#1 引用回覆 回覆 發表時間:2011-09-29 18:35:58 IP:115.216.xxx.xxx 訂閱
我使用的是Rad PHP XE2,就創建一個簡單的程式,過程如下:
創建一個FORM,然后在FORM上放一個EDIT控件,然后寫代碼如下:
<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
//Class definition
class TestForm extends Page
{
public $Edit1 = null;
function TestFormJSLoad($sender, $params)
{
?>
//begin js
if(timerReload!=null)
{
clearTimeout(timerReload);
timerReload = null;
}
timerReload = self.setTimeout("Reload()",1000);
//end
<?php
}
function TestFormShowHeader($sender, $params)
{
echo "\r\n";
echo "var timerReload = null;\r\n";
echo "function Reload()\r\n";
echo "{\r\n";
echo " = ;\r\n";
echo "}\r\n";
echo "\r\n";
}
function TestFormShow($sender, $params)
{
$this->Edit1->Text = Date("Y-m-d H:i:s");
}
}
global $application;
global $TestForm;
//Creates the form
$TestForm=new TestForm($application);
//Read from resource file
$TestForm->loadResource(__FILE__);
//Shows the form
$TestForm->show();
?>

功能就是1秒重新加載一次頁面,在EDIT中顯示當前時間,我用兩臺電腦同時打開這個頁面,過一會兒會導致httpd內存錯誤,彈出一個錯誤框(見附件),看錯誤日志發現httpd重啟了;我在IE中將這個頁面的源碼存為另一個PHP,然后再用同樣方式訪問,就不會出錯,后來我發現如果把$TestForm->loadResource(__FILE__);去掉,自己創建控件,就不會出錯;
不知哪位兄弟遇到過沒,是不是RADPHP的一個BUG
------
e天之下任我行
ganlnyn
一般會員


發表:2
回覆:4
積分:1
註冊:2011-09-29

發送簡訊給我
#2 引用回覆 回覆 發表時間:2011-09-29 18:48:46 IP:115.216.xxx.xxx 訂閱
在apache的error.log中會出現以下錯誤提示:
[Thu Sep 29 12:02:04 2011] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Thu Sep 29 12:02:05 2011] [notice] Digest: generating secret for digest authentication ...
[Thu Sep 29 12:02:05 2011] [notice] Digest: done

網上很多人說Parent: child process exited with status 3221225477 -- Restarting這個是由于訪問數據庫引起的,但其實不然
------
e天之下任我行
ganlnyn
一般會員


發表:2
回覆:4
積分:1
註冊:2011-09-29

發送簡訊給我
#3 引用回覆 回覆 發表時間:2011-09-29 19:32:34 IP:115.216.xxx.xxx 訂閱
我把源碼也放上來,見附件:
errrefresh.php和errrefresh.xml.php是出錯的頁面
okrefresh.php是在IE中把errrefresh.php另存源碼后的頁面,不會出錯
errrefresh.php:
<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
//Class definition
class TestForm extends Page
{
public $Edit1 = null;
function TestFormJSLoad($sender, $params)
{
?>
//begin js
if(timerReload!=null)
{
clearTimeout(timerReload);
timerReload = null;
}
timerReload = self.setTimeout("Reload()",1000);
//end
<?php
}
function TestFormShowHeader($sender, $params)
{
echo "\r\n";
echo "var timerReload = null;\r\n";
echo "function Reload()\r\n";
echo "{\r\n";
echo " = ;\r\n";
echo "}\r\n";
echo "\r\n";
}
function TestFormShow($sender, $params)
{
$this->Edit1->Text = Date("Y-m-d H:i:s");
}
}
global $application;
global $TestForm;
//Creates the form
$TestForm=new TestForm($application);
//Read from resource file
$TestForm->loadResource(__FILE__);
//Shows the form
$TestForm->show();
?>

errrefreshp.xml.php:
<?php
<object class="TestForm" name="TestForm" baseclass="Page"><br />
refresh test
dtNone
Unicode (UTF-8) |utf-8
39
0
TestForm
181
TestFormShow
TestFormShowHeader
TestFormJSLoad
<object class="Edit" name="Edit1" ><br /> 21
32
Edit1
8
121
</object><br /></object><br />?>

okrefresh.php:
<html DIR=ltr ><br /><head><br />
var timerReload = null;
function Reload()
{
= ;
}

<title>refresh test</title><br /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br />
var TestForm=new Object(Object);

<!--
function TestFormJSLoad(event)
{
var event = event || window.event;
var params=null;
//begin js
if(timerReload!=null)
{
clearTimeout(timerReload);
timerReload = null;
}
timerReload = self.setTimeout("Reload()",1000);
//end
}
function Edit1_updatehidden(event)
{
edit=findObj('Edit1');
hidden=findObj('Edit1_hidden');
hidden.value=edit.value;
}
-->

</head><br /><body ="margin-bottom: 0" id="TestForm" name="TestForm" method="post" action="/errrefresh.php"><input type="hidden" name="serverevent" value=""><input type="hidden" name="serverparams" value=""><input type="hidden" name="Edit1_hidden" value="2011-09-29 10:23:30">

<input type="text" id="Edit1" Edit1_updatehidden(event)" name="Edit1" value="<?php echo Date('Y-m-d H:i:s') ?>" font-family: Tahoma; font-size: 11px; cursor: default;width:121px;height:20px;" tabindex="0" /><br />

</form></body>
</html><br /><!-- TestForm end -->

------
e天之下任我行
系統時間:2024-04-26 11:32:12
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!