Description
Check to see if opcache is being usedIf it is then we will not be able to read the docblock using $refFunc->getDocComment() against a function which is already loaded. Instead we use the dummy load and reflect technique Prior to PHP 5.5.5 we can't find out anything about opcache so we have to make it up. WP Engine sets some constants which we might be able to use BUT what we'll actually do is to see if we can get our own docBlock written right here.
Usage
$bool = oikai_using_opcache();Parameters
Returns
bool true if we believe that opcache processing is being usedSource
File name: oik-shortcodes/shortcodes/oik-api-importer.phpLines:
1 to 16 of 16
function oikai_using_opcache() { static $using_opcache = null; if ( null === $using_opcache ) { $using_opcache = false; $refFunc = oikai_reflect( __FUNCTION__ ); if ( $refFunc ) { $docComment = $refFunc->getDocComment(); bw_trace2( $docComment, "docComment", false, BW_TRACE_DEBUG ); if ( $docComment === false ) { $using_opcache = true; } } bw_trace2( $using_opcache, "using_opcache", false, BW_TRACE_DEBUG ); } return( $using_opcache ); }View on GitHub
Called by
1 to 1 of 1
Invoked by
Calls
1 to 4 of 4
