Piwik\Common::isPhpCgiType PHP Méthode

isPhpCgiType() public static méthode

Returns true if PHP is executed as CGI type.
public static isPhpCgiType ( ) : boolean
Résultat boolean true if PHP invoked as a CGI
    public static function isPhpCgiType()
    {
        $sapiType = php_sapi_name();
        return substr($sapiType, 0, 3) === 'cgi';
    }

Usage Example

Exemple #1
0
 private function checkCompatibility()
 {
     if (Common::isPhpCgiType()) {
         echo 'Piwik Console is known to be not compatible with PHP-CGI (you are using ' . php_sapi_name() . '). ' . 'Please execute console using PHP-CLI. For instance "/usr/bin/php-cli console ..."';
         echo "\n";
         exit(1);
     }
 }
All Usage Examples Of Piwik\Common::isPhpCgiType