Is it possible to make a new resource function in PHP? For example can I replace a fsockopen or fopen with a custom resource that does something else with the data passed to it? I can't seem to find much information on this. Perhaps I'm using the wrong terminology?
Should I be looking at building a streamWrapper?
Making a resource?
Moderator: General Moderators
Re: Making a resource?
I'm not 100% sure about classes (never tried them myself) but if PHP is anything like C or C++ (which it is) then a class is what you're looking for
Re: Making a resource?
I don't think resources are the same as classes in php. http://php.net/manual/en/language.types.resource.php
"Special variable"? The example in the manual doesn't help me much.
"Special variable"? The example in the manual doesn't help me much.
Re: Making a resource?
hmm... seems like you'd have to code that directly into the Zend engine 
Seriously, it depends what you want to do exactly, you could perhaps achieve this with the streamWrapper.
Greets.
Seriously, it depends what you want to do exactly, you could perhaps achieve this with the streamWrapper.
Greets.
Re: Making a resource?
I think a resource is a name for an external entry point to a compiled library. So streamwrapper it is.