Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LoggingBeginner.php

class LoggingBeginner

Logs Composer Stager's Beginner process output to a file.

@internal This is an internal part of Package Manager and may be changed or removed at any time without warning. External code should not interact with this class.

Hierarchy

  • class \Drupal\package_manager\LoggingBeginner implements \PhpTuf\ComposerStager\API\Core\BeginnerInterface

Expanded class hierarchy of LoggingBeginner

File

core/modules/package_manager/src/LoggingBeginner.php, line 24

Namespace

Drupal\package_manager
View source
final class LoggingBeginner implements BeginnerInterface {
    public function __construct(BeginnerInterface $decorated, ConfigFactoryInterface $configFactory, TimeInterface $time) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function begin(PathInterface $activeDir, PathInterface $stagingDir, ?PathListInterface $exclusions = NULL, ?OutputCallbackInterface $callback = NULL, int $timeout = ProcessInterface::DEFAULT_TIMEOUT) : void {
        $path = $this->configFactory
            ->get('package_manager.settings')
            ->get('log');
        if ($path) {
            $callback = new FileProcessOutputCallback($path, $callback);
            $callback(OutputTypeEnum::OUT, sprintf("### Beginning in %s\n", $stagingDir->absolute()));
        }
        $start_time = $this->time
            ->getCurrentMicroTime();
        $this->decorated
            ->begin($activeDir, $stagingDir, $exclusions, $callback, $timeout);
        $end_time = $this->time
            ->getCurrentMicroTime();
        if ($callback) {
            $callback(OutputTypeEnum::OUT, sprintf("### Finished in %0.3f seconds\n", $end_time - $start_time));
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary
LoggingBeginner::begin public function
LoggingBeginner::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal