You are here

class UprofilerExtension in XHProf 8

Implements support for uprofiler extension.

Hierarchy

Expanded class hierarchy of UprofilerExtension

See also

https://github.com/FriendsOfPHP/uprofiler

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

File

src/Extension/UprofilerExtension.php, line 10

Namespace

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

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

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    return [
      'FLAGS_CPU' => 'UPROFILER_FLAGS_CPU',
      'FLAGS_MEMORY' => 'UPROFILER_FLAGS_MEMORY',
      'FLAGS_NO_BUILTINS' => 'UPROFILER_FLAGS_NO_BUILTINS',
    ];
  }

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

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

}

Members

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