You are here

class XHProfExtension in XHProf 8

Implements support for PHP 7 XHProf extension.

Hierarchy

Expanded class hierarchy of XHProfExtension

See also

https://github.com/longxinH/xhprof

1 file declares its use of XHProfExtension
Profiler.php in src/Profiler.php

File

src/Extension/XHProfExtension.php, line 10

Namespace

Drupal\xhprof\Extension
View source
class XHProfExtension implements ExtensionInterface {

  /**
   * {@inheritdoc}
   */
  public static function isLoaded() {
    return extension_loaded('xhprof');
  }

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    return [
      'FLAGS_CPU' => 'XHPROF_FLAGS_CPU',
      'FLAGS_MEMORY' => 'XHPROF_FLAGS_MEMORY',
      'FLAGS_NO_BUILTINS' => 'XHPROF_FLAGS_NO_BUILTINS',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function enable($modifier, $options) {
    xhprof_enable($modifier, $options);
  }

  /**
   * {@inheritdoc}
   */
  public function disable() {
    return xhprof_disable();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
XHProfExtension::disable public function Disables the extension. Overrides ExtensionInterface::disable
XHProfExtension::enable public function Enables the profiling with the extension. Overrides ExtensionInterface::enable
XHProfExtension::getOptions public function Returns the options supported by this extension. Overrides ExtensionInterface::getOptions
XHProfExtension::isLoaded public static function Returns TRUE if this extension is loaded into the PHP interpreter. Overrides ExtensionInterface::isLoaded