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

Breadcrumb

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

function Perforce::isLoggedIn

1 call to Perforce::isLoggedIn()
Perforce::p4Login in vendor/composer/composer/src/Composer/Util/Perforce.php

File

vendor/composer/composer/src/Composer/Util/Perforce.php, line 323

Class

Perforce
@author Matt Whittom <Matt.Whittom@veteransunited.com>

Namespace

Composer\Util

Code

public function isLoggedIn() : bool {
    $command = $this->generateP4Command('login -s', false);
    $exitCode = $this->executeCommand($command);
    if ($exitCode) {
        $errorOutput = $this->process
            ->getErrorOutput();
        $index = strpos($errorOutput, $this->getUser());
        if ($index === false) {
            $index = strpos($errorOutput, 'p4');
            if ($index === false) {
                return false;
            }
            throw new \Exception('p4 command not found in path: ' . $errorOutput);
        }
        throw new \Exception('Invalid user name: ' . $this->getUser());
    }
    return true;
}

API Navigation

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