Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

+31 -1
View File
@@ -468,7 +468,7 @@ class _Request extends \IPS\Patterns\Singleton
*
* @return string
*/
public function requestMethod()
public function requestMethod() :string
{
return mb_strtoupper( $_SERVER['REQUEST_METHOD'] );
}
@@ -519,6 +519,26 @@ class _Request extends \IPS\Patterns\Singleton
return false;
}
/**
* Check, if this was called by command line
*
* @return bool
*/
public static function isCliEnvironment(): bool
{
return php_sapi_name() == 'cli';
}
/**
* Is this a request coming from Zapier?
*
* @return bool
*/
public function isZapier() : bool
{
return str_starts_with( \IPS\Request::i()->userAgent(), 'IPS Zapier Integration' );
}
/**
* Confirmation check
@@ -717,4 +737,14 @@ class _Request extends \IPS\Patterns\Singleton
/* Still here? We got nothing */
return NULL;
}
/**
* Return the user agent
*
* @return string|null
*/
public function userAgent() : ?string
{
return $_SERVER['HTTP_USER_AGENT'] ?? NULL;
}
}