You are here

class StorageManager in XHProf 8

Provides service to collect available storage services.

Hierarchy

Expanded class hierarchy of StorageManager

1 string reference to 'StorageManager'
xhprof.services.yml in ./xhprof.services.yml
xhprof.services.yml
1 service uses StorageManager
xhprof.storage_manager in ./xhprof.services.yml
Drupal\xhprof\XHProfLib\Storage\StorageManager

File

src/XHProfLib/Storage/StorageManager.php, line 8

Namespace

Drupal\xhprof\XHProfLib\Storage
View source
class StorageManager {

  /**
   * @var \Drupal\xhprof\XHProfLib\Storage\StorageInterface[]
   */
  private $storages;

  /**
   * @return array
   */
  public function getStorages() {
    $output = [];
    foreach ($this->storages as $id => $storage) {
      $output[$id] = $storage
        ->getName();
    }
    return $output;
  }

  /**
   * @param \Drupal\xhprof\XHProfLib\Storage\StorageInterface $storage
   *
   * @see \Drupal\xhprof\Compiler\StoragePass::process()
   */
  public function addStorage($id, StorageInterface $storage) {
    $this->storages[$id] = $storage;
  }

}

Members