- 论坛徽章:
- 0
|
[设计]后台调用php程序
原帖由 "alex99051" 发表:
先把我的意图说出来:
有两个页面,call.php呼叫start.php,当call.php确认已经呼叫到start.php(根据http status code)后,不管start.php的任务是否完成,都会退出(关闭IE或者退出程序)。就是说call.php只负责?.........
不用2个php,只要一个就可以了。因为有时候你可能需要呼叫多个功能模块。
- class call{
- var output = array(); //由来保存输出的数组
-
- //构造函数,更具输入条件,分别呼叫不同模块
- function call($input){
- //如果有多个条件,逐个呼叫
- for($i=0;$i<sizeof($input["条件们"]); $i++){
- switch(条件){
- case 条件1:
- $this->;start();
- break;
-
- case 条件2:
- $this->;playmore();
- break;
- }
- }
- }
-
- //析构函数,输出结果
- function destory(){
- return ($this->;output);
- }
- //具体干活的函数们
- function start($input){
- // 处理start的活.....
- array_push($this->;output, $startoutput);
- return true;
- }
- function playmore($input){
- //处理playmore
- return true;
- }
-
-
- }
- //具体使用
- $mycall = new call($input);
- $outpt = $mycall->;destory();
- // 然后把你的output给表现层处理
复制代码 |
|