From 4756e9685fd8557cce5db283f4da48a621875d43 Mon Sep 17 00:00:00 2001 From: Sergiotarxz Date: Thu, 15 Jun 2023 02:58:02 +0200 Subject: [PATCH] Adding example connector. --- composer.json | 17 +++++++++++++++++ composer.lock | 18 ++++++++++++++++++ src/index.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 src/index.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c5d201b --- /dev/null +++ b/composer.json @@ -0,0 +1,17 @@ +{ + "name": "sergio/exec_libvips_php", + "type": "library", + "license": "proprietary", + "autoload": { + "psr-4": { + "Sergio\\ExecLibvipsPhp\\": "src/" + } + }, + "authors": [ + { + "name": "Sergiotarxz", + "email": "sergiotarxz@posteo.net" + } + ], + "require": {} +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..f4002a9 --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "2b1115d0fe6887ac144d9b0248d72ced", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..2e68aef --- /dev/null +++ b/src/index.php @@ -0,0 +1,36 @@ + $inputFile, + "output_file" => $outputFile, + "cyan" => $cyan, + "magenta" => $magenta, + "black" => $black, + "yellow" => $yellow, + "colorType" => $colorType, + "blackType" => $blackType, + ]); + $json_len = strlen($json); + socket_write($socket, pack("J", $json_len), 8); + socket_write($socket, $json, $json_len); + $json_len = ""; + socket_recv($socket, $json_len, 8, MSG_WAITALL); + $json_len = unpack("J", $json_len)[1]; + $json = ""; + socket_recv($socket, $json, $json_len, MSG_WAITALL); + $json = json_decode($json, true); + var_dump($json); + return $json; +}