Comments (4)
你添加的别名叫 test,所以你用 TestModel 访问是不行的。
from hprose-php.
@andot 调用test_one()也调用不行呀~
另外$server->add(new TestModel(),'TestModel'); 别名和类名一样的话就不会抛警告~
from hprose-php.
嗯,你说得对,参数顺序应该是这样的:
$server->add(new TestModel(), '', 'test');
或者
$server->add(new TestModel(), 'TestModel', 'test');
第二个参数表示的是对象实例所在的类(因为类有继承层次,hprose只发布指定的类的那一层的方法,第二个参数如果跟第一个对象创建的类一致,可以省略为 ''
),第三个参数才是别名前缀。
from hprose-php.
@andot 按照你说的参数调用成功拉~,谢谢小马哥~
from hprose-php.
Related Issues (20)
- PHP7.4 下2.0版本数组语法问题 HOT 3
- 系统安装 HOT 1
- Es17"Wrong Request: "z,请问各位大神这个是怎么回事呀 HOT 5
- 3.0版本的client计划支持批量调用吗? HOT 1
- 2.0按照示例做报错啊Exception Argument func must be callable. HOT 2
- 报错 找不到这个类 Hprose\BytesIO HOT 3
- 怎么重启已经启动的tcp服务 HOT 1
- 协程Future\co,yield偶发返回promise对象。 HOT 2
- hprose能否支持stream响应,在获取数据量很大时候用 HOT 4
- php服务端如何获取ip? HOT 2
- composer怎么安装v3.0的版本 HOT 1
- request write error? HOT 2
- 服务端抛出系统异常没有经过Filter怎么办? HOT 3
- 找不到类“Hprose\Socket\Service” HOT 2
- php8.1.4 编辑 hprose1.8.0扩展报错 HOT 2
- php8+支持吗,扩展一直装不成功 HOT 1
- 请求返回错误,数据太大了 ?“18: transfer closed with 332804 bytes remaining to read” HOT 3
- Hprose\Socket\Transporter->syncSendAndReceive('Cs11"..) HOT 1
- 本地Mac命令行启动正常,线上环境Ubuntu启动马上退出
- hprose 客户端怎么管理服务端的事务呢? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hprose-php.