Invalidate opcache for a newly written/deleted file immediately, if opcache* functions exist and if this was a PHP file.
Parameters
string$filepath The path to the file just written to, to flush from opcache
bool$force If set to true, the script will be invalidated regardless of whether invalidation is necessary
Returns
bool TRUE if the opcode cache for script was invalidated/nothing to invalidate,
or FALSE if the opcode cache is disabled or other conditions returning
FALSE from opcache_invalidate (like file not found).
First we check if opcache is enabled
Then we check if the opcache_invalidate function is available
Lastly we check if the host has restricted which scripts can use opcache_invalidate using opcache.restrict_api.
Returns
bool TRUE if we can proceed to use opcache_invalidate to flush a file from the OPCache