This topic lists the PHP API functions of the Zend OPcache.
Function |
Description |
Compiles and caches a PHP script without executing it. |
|
Returns configuration information about the cache instance. |
|
Returns state information about the cache instance. |
|
invalidates a particular script from the opcode cache. If force is unset or FALSE, the script will only be invalidated if the modification time of the script is newer than the cached opcodes. |
|
Resets the entire opcode cache. After calling opcache_reset(), all scripts will be reloaded and reparsed the next time they are hit. |
Compiles and caches a PHP script without executing it.
Available Since Version: 6.3
Parameter |
Type |
Required |
Description |
file |
string |
Yes |
The path to the PHP script to be compiled. |
Return Value: boolean - Returns TRUE if file was compiled successfully or FALSE on failure.
Returns configuration information about the cache instance.
Available Since Version: 6.3
Return Value: array - Returns an array of information, including ini, blacklist and version.
Returns state information about the cache instance.
Available Since Version: 6.3
Parameter |
Type |
Required |
Description |
get_scripts |
string |
Yes |
Include script specific state information. |
Return Value: array - Returns an array of information, optionally containing script specific state information.
invalidates a particular script from the opcode cache. If force is unset or FALSE, the script will only be invalidated if the modification time of the script is newer than the cached opcodes.
Available Since Version: 6.3
Parameter |
Type |
Required |
Description |
script |
string |
Yes |
The path to the script being invalidated. |
force |
string |
No |
If set to TRUE, the script will be invalidated regardless of whether invalidation is necessary. |
Return Value: boolean - Returns TRUE if the opcode cache for script was invalidated or if there was nothing to invalidate, or FALSE if the opcode cache is disabled.
Resets the entire opcode cache. After calling opcache_reset(), all scripts will be reloaded and reparsed the next time they are hit.
Available Since Version: 6.3
Return Value: boolean - Returns TRUE if the opcode cache was reset, or FALSE if the opcode cache is disabled.