在php中強制重新緩存WSDL

[英]Force re-cache of WSDL in php


I know how to disable WSDL-cache in PHP, but what about force a re-caching of the WSDL?

我知道如何在PHP中禁用WSDL-cache,但是強制重新緩存WSDL呢?

This is what i tried: I run my code with caching set to disabled, and the new methods showed up as espected. Then I activated caching, but of some reason my old non-working wsdl showed up again. So: how can I force my new WSDL to overwrite my old cache?

這就是我嘗試的:我運行我的代碼,緩存設置為禁用,並且新方法顯示為受到尊重。然后我激活了緩存,但由於某種原因,我的舊的非工作wsdl再次出現。那么:我如何強制我的新WSDL覆蓋我的舊緩存?

4 个解决方案

#1


34  

I guess when you disable caching it will also stop writing to the cache. So when you re-enable the cache the old cached copy will still be there and valid. You could try (with caching enabled)

我想當你禁用緩存時它也會停止寫入緩存。因此,當您重新啟用緩存時,舊的緩存副本仍然存在且有效。你可以嘗試(啟用緩存)

ini_set('soap.wsdl_cache_ttl', 1);

I put in a time-to-live of one second in because I think if you put zero in it will disable the cache entirely but not remove the entry. You probably will only want to put that line in when you want to kill the cached copy.

我投入了一秒鍾的生存時間,因為我認為如果你把零放入它將完全禁用緩存但不刪除條目。您可能只想在要殺死緩存副本時放入該行。

#2


12  

In my php.ini there's an entry which looks like this:

在我的php.ini中有一個看起來像這樣的條目:

soap.wsdl_cache_dir="/tmp"

In /tmp, I found a bunch of files named wsdl-[some hexadecimal string]

在/ tmp中,我發現了一堆名為wsdl的文件 - [有些十六進制字符串]

I can flush the cached wsdl files with this command:

我可以使用以下命令刷新緩存的wsdl文件:

rm /tmp/wsdl-*

#3


3  

Delete the old WSDL from the cache.

從緩存中刪除舊的WSDL。

#4


1  

I'd try

我試試

$limit = ini_get('soap.wsdl_cache_limit');
ini_set('soap.wsdl_cache_limit', 0);
ini_set('soap.wsdl_cache_limit', $limit);

Or possibly set soap.wsdl_cache_ttl to 0 and back

或者可能將soap.wsdl_cache_ttl設置為0並返回


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2008/11/27/72091983010aca6fa4aeb5438bee3b21.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com