In php, how to persist objects and have an interface for other companies to persist? the calling code is as follows: $ com = newCOM ('hb. UI. user'); // new & nbsp; $ com-& gt; init ($ a, $ B, $ c ); // How long does the passing of parameters persist $ com in php ?, When the program ends, all resources related to the program are stored in php.
Has an interface with other companies' websites that requires persistence.
The call code is as follows:
$ Com = new COM ('hb. UI. user'); // new
$ Com-> init ($ a, $ B, $ c); // passing parameters
How long-lasting $ com in php?
------ Solution --------------------
When the program ends, all resources related to the program will be closed.
Although php provides serialize (serialization), this serialization is only for php's own output
If the serialized object contains external resources, the programmer must decide whether to restore the original connection (that is, reconnect)
COM is a service provided by Microsoft, because the traditional dynamic link library (DLL) is not acceptable to all programming languages.
Once the COM application service is started, it will be resident in the memory.
$ Com = new COM ('hb. UI. user ');
Connects to the HB. UI. User service. if the service has not been started, load HB. DLL and start it.
$ Com tells php that it carries the HB. UI. User service object among many services.
------ Solution --------------------
COM itself should be a proxy class. it does not know which attributes it has. In the end, it calls the COM interface. The interface cannot be persisted.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service