VersionPress\Tests\Automation\WpAutomation::isVersionPressInitialized PHP Method

isVersionPressInitialized() public method

Returns true if VersionPress is active and tracking the site
    public function isVersionPressInitialized()
    {
        $vpdbDir = $this->getVpdbDir();
        return $vpdbDir !== '' && is_file($vpdbDir . '/.active');
    }

Usage Example

 /**
  * Check if site is set up and VersionPress fully activated, and if not, do so. The $force
  * parametr may force this.
  *
  * @param bool $force Force all the automation actions to be taken regardless of the site state
  */
 private static function setUpSite($force)
 {
     if ($force || !self::$wpAutomation->isSiteSetUp()) {
         self::$wpAutomation->setUpSite();
     }
     if ($force || !self::$wpAutomation->isVersionPressInitialized()) {
         self::$wpAutomation->copyVersionPressFiles();
         self::$wpAutomation->initializeVersionPress();
     }
 }