PHP RMI for a class
I have made a class file which are running on my server.I am using it as a API.my some client will use it.In their program i have to create an object remotely of this class. How will use my class file as RMI that object can create easily on other server. Thanks
I don't think anything close to Java's RMI (as far as I understand it) can be done in PHP.
The best thing that comes to my mind is
Create an object in the remote script
Serialize that object
Return the serialized data to the calling script
Unserialize the data back into an object (note that all class definitions must be present locally for this to work!)
Note that things like active database connections, file handles and so on can not be transferred this way.
Whether this is a good - and fast enough - way to do what you want is hard to say. Maybe it helps.
To connect as a user other than 'anonymous', you need to specify the username (and possibly password) within the URL, such as 'ftp://user:[email protected]/path/to/file'. (You can use the same sort of syntax to access files via HTTP when they require Basic authentication.)