summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php')
-rw-r--r--vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
new file mode 100644
index 0000000..7801788
--- /dev/null
+++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+namespace AWS\CRT\Internal;
+
+use \RuntimeException;
+
+/**
+ * @internal
+ * Forwards calls on to awscrt PHP extension functions
+ */
+final class Extension {
+ function __construct() {
+ if (!extension_loaded('awscrt')) {
+ throw new RuntimeException('awscrt extension is not loaded');
+ }
+ }
+
+ /**
+ * Forwards any call made on this object to the extension function of the
+ * same name with the supplied arguments. Argument type hinting and checking
+ * occurs at the CRT wrapper.
+ */
+ function __call($name, $args) {
+ return call_user_func_array($name, $args);
+ }
+}