VersionPress\VersionPress::getEnvironment PHP Method

getEnvironment() public static method

Returns name of current environment (default for original site, clone name for clone).
public static getEnvironment ( ) : string
return string
    public static function getEnvironment()
    {
        return defined('VP_ENVIRONMENT') ? VP_ENVIRONMENT : 'default';
    }

Usage Example

コード例 #1
0
 /**
  * @param TrackedChangeInfo[] $changeInfoList
  * @param string|null $version
  * @param string|null $environment
  */
 public function __construct($changeInfoList, $version = null, $environment = null)
 {
     $this->changeInfoList = $changeInfoList;
     $this->version = $version === null ? VersionPress::getVersion() : $version;
     $this->environment = $environment ?: VersionPress::getEnvironment();
 }