将服务器DLL挂钩到PHP中 [英] Hooking server DLL into PHP

查看:63
本文介绍了将服务器DLL挂钩到PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个基于RPC的客户端/服务器托管系统(Wildcat!)。各种RPC

客户端包括FTP,TELNET,DIALUP以及WEB服务器。每个使用一个

RPC SDK / API与中央RPC服务器通信以建立上下文

和用户会话。


A几年前(在PHP 4.0之前),一位非常熟悉PHP的前员工开始添加PHP服务器端支持并写了一个PHP模块?。支持

PHP 3.0将SDK API暴露给PHP脚本。


它从未完成(并非所有函数都暴露出来)虽然它是

非正式地发布给一些PHP开发人员,出于某种原因

它不再适用于PHP 4.0。我们被要求更新DLL for

PHP 4.0 / 5.0。


不幸的是,3.0版本的DLL的C / C ++源代码是丢失了

或放错地方。


我相信我从PHP支持网站获得了所有信息,但它确实没有... b $ b isn''对我来说太明显了如何重新设计工作。


我想在编写支持DLL模块时获得基本的瘦身来

暴露我们的服务器函数库。


下面是一些示例C / C ++函数和用于建立线程上下文的

服务器端applet的最基本要求: />

BOOL WINAPI wcConnect(const char * szServerName ="");

BOOL WINAPI wcCreateContext();

BOOL WINAPI wcCreateContextByChallenge (const char * szChalllege);

BOOL WINAPI wcDeleteContext();


我不是PHP脚本编程专家,但我看到一个类似的脚本所以:


<?PHP

//建立上下文


$ challenge = getenv(" WILDCATCONTEXT");

if(!wcCreateContextByChallenge($ challenge)) {

echo"创建上下文时出错;

结束??

}


。 ..使用其他API函数....

wcDeleteContext();

?>


我感谢您的任何指导可以提供帮助获得这个PHP

4.0 / 5.0野猫DLL模块。


提前致谢


- Hector

We have a RPC based client/server hosting system (Wildcat!). Various RPC
clients include FTP, TELNET, DIALUP as well as WEB server. Each use a
RPC SDK/API to communicate with the central RPC server to establish context
and user sessions.

A few years back (before PHP 4.0) a former employee very familiar with PHP
began to add PHP server side support and wrote a "PHP Module?" to support
PHP 3.0 to expose the SDK API to PHP scripts.

It was never finished (not all the functions were exposed) and although it
was unofficially release to some PHP developers, for some reason or another
it no longer worked with PHP 4.0. We have been asked to update the DLL for
PHP 4.0/5.0.

Unfortunately, the C/C++ source code for the 3.0 version of the DLL was lost
or misplaced.

I believe I got all the information from the PHP support sites, but it
wasn''t too obvious to me how to re-engineer the work.

I would like to get the basic skinny on writing a support DLL module to
expose our library of server functions.

Here are some example C/C++ functions and most primitive requirements for a
server-side applet to establish thread context:

BOOL WINAPI wcConnect(const char *szServerName="");
BOOL WINAPI wcCreateContext();
BOOL WINAPI wcCreateContextByChallenge(const char *szChalllege);
BOOL WINAPI wcDeleteContext();

I''m not a PHP script programming expert, but I see a script like so:

<?PHP
// establish context

$challenge = getenv("WILDCATCONTEXT");
if (!wcCreateContextByChallenge($challenge)) {
echo "Error creating context";
end??
}

... use other API functions ....
wcDeleteContext();
?>

I appreciate any guidance you may provide to assist in getting this PHP
4.0/5.0 wildcat DLL module written.

Thanks in advance

-- Hector

推荐答案

challenge = getenv(" WILDCATCONTEXT");

if(! wcCreateContextByChallenge(
challenge = getenv("WILDCATCONTEXT");
if (!wcCreateContextByChallenge(


challenge)){

echo"创建上下文时出错;

end ??

}


...使用其他API函数....

wcDeleteContext();

?>


我感谢您提供的任何指导以帮助您获得此信息PHP

4.0 / 5.0写的野猫DLL模块。


提前致谢


- Hector

challenge)) {
echo "Error creating context";
end??
}

... use other API functions ....
wcDeleteContext();
?>

I appreciate any guidance you may provide to assist in getting this PHP
4.0/5.0 wildcat DLL module written.

Thanks in advance

-- Hector


PHP手册有一个关于创建自己的扩展的部分:
http://www.php.net/manual/en/zend.php

The PHP manual has a section on creating your own extensions:
http://www.php.net/manual/en/zend.php


这篇关于将服务器DLL挂钩到PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆