diff --git a/composer.json b/composer.json
index e2839205..df5af390 100644
--- a/composer.json
+++ b/composer.json
@@ -10,12 +10,10 @@
"robmorgan/phinx": "^0.12",
"symfony/yaml": "^5.0",
"google/cloud-storage": "^1.12",
- "opencensus/opencensus-exporter-stackdriver": "^0.1.0",
"smarty/smarty": "^4.5.3",
"sendgrid/sendgrid": "^7.3",
"google/cloud-logging": "^1.18",
"auth0/auth0-php": "^8.0.5",
- "opencensus/opencensus": "^0.6.0",
"kriswallsmith/buzz": "^1.2",
"nyholm/psr7": "^1.4",
"steampixel/simple-php-router": "^0.7.0",
@@ -24,9 +22,7 @@
"sentry/sentry": "^4.3",
"php-http/curl-client": "^2.2",
"google/cloud-error-reporting": "^0.19.5",
- "google/cloud-datastore": "^1.18",
- "open-telemetry/exporter-otlp": "^1.0",
- "open-telemetry/sdk": "^1.0" },
+ "google/cloud-datastore": "^1.18" },
"config": {
"allow-plugins": {
"php-http/discovery": true
diff --git a/composer.lock b/composer.lock
index 9d153b07..85ed7818 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c7e007895b1cb7da11474304344c3f07",
+ "content-hash": "83fade6f9eddfd534e16b4c992cb4018",
"packages": [
{
"name": "auth0/auth0-php",
@@ -159,129 +159,6 @@
},
"time": "2022-12-07T17:46:57+00:00"
},
- {
- "name": "cache/adapter-common",
- "version": "1.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-cache/adapter-common.git",
- "reference": "8788309be72aa7be69b88cdc0687549c74a7d479"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/8788309be72aa7be69b88cdc0687549c74a7d479",
- "reference": "8788309be72aa7be69b88cdc0687549c74a7d479",
- "shasum": ""
- },
- "require": {
- "cache/tag-interop": "^1.0",
- "php": ">=7.4",
- "psr/cache": "^1.0 || ^2.0",
- "psr/log": "^1.0 || ^2.0 || ^3.0",
- "psr/simple-cache": "^1.0"
- },
- "require-dev": {
- "cache/integration-tests": "^0.17",
- "phpunit/phpunit": "^7.5.20 || ^9.5.10"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Cache\\Adapter\\Common\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Aaron Scherer",
- "email": "aequasi@gmail.com",
- "homepage": "https://github.com/aequasi"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- }
- ],
- "description": "Common classes for PSR-6 adapters",
- "homepage": "http://www.php-cache.com/en/latest/",
- "keywords": [
- "cache",
- "psr-6",
- "tag"
- ],
- "support": {
- "source": "https://github.com/php-cache/adapter-common/tree/1.3.0"
- },
- "time": "2022-01-15T15:47:19+00:00"
- },
- {
- "name": "cache/tag-interop",
- "version": "1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-cache/tag-interop.git",
- "reference": "b062b1d735357da50edf8387f7a8696f3027d328"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/b062b1d735357da50edf8387f7a8696f3027d328",
- "reference": "b062b1d735357da50edf8387f7a8696f3027d328",
- "shasum": ""
- },
- "require": {
- "php": "^5.5 || ^7.0 || ^8.0",
- "psr/cache": "^1.0 || ^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Cache\\TagInterop\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/nyholm"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com",
- "homepage": "https://github.com/nicolas-grekas"
- }
- ],
- "description": "Framework interoperable interfaces for tags",
- "homepage": "https://www.php-cache.com/en/latest/",
- "keywords": [
- "cache",
- "psr",
- "psr6",
- "tag"
- ],
- "support": {
- "issues": "https://github.com/php-cache/tag-interop/issues",
- "source": "https://github.com/php-cache/tag-interop/tree/1.1.0"
- },
- "time": "2021-12-31T10:03:23+00:00"
- },
{
"name": "cakephp/core",
"version": "4.5.4",
@@ -1204,61 +1081,6 @@
},
"time": "2023-04-21T22:21:40+00:00"
},
- {
- "name": "google/cloud-trace",
- "version": "v0.18.0",
- "source": {
- "type": "git",
- "url": "https://github.com/googleapis/google-cloud-php-trace.git",
- "reference": "153d099445d61587b20a0e821dc23ca7199774dc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-cloud-php-trace/zipball/153d099445d61587b20a0e821dc23ca7199774dc",
- "reference": "153d099445d61587b20a0e821dc23ca7199774dc",
- "shasum": ""
- },
- "require": {
- "google/cloud-core": "^1.35",
- "google/gax": "^1.1",
- "ramsey/uuid": "^3.0|^4.0"
- },
- "require-dev": {
- "erusev/parsedown": "^1.6",
- "phpdocumentor/reflection": "^3.0",
- "phpunit/phpunit": "^4.8|^5.0",
- "squizlabs/php_codesniffer": "2.*"
- },
- "suggest": {
- "ext-grpc": "The gRPC extension enables use of the performant gRPC transport",
- "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.",
- "opencensus/opencensus": "Provides application tracing integrations."
- },
- "type": "library",
- "extra": {
- "component": {
- "id": "cloud-trace",
- "target": "googleapis/google-cloud-php-trace.git",
- "path": "Trace",
- "entry": "src/TraceClient.php"
- }
- },
- "autoload": {
- "psr-4": {
- "Google\\Cloud\\Trace\\": "src",
- "GPBMetadata\\Google\\Devtools\\Cloudtrace\\": "metadata"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "description": "Stackdriver Trace Client for PHP",
- "support": {
- "source": "https://github.com/googleapis/google-cloud-php-trace/tree/v0.18.0"
- },
- "time": "2020-03-30T20:36:58+00:00"
- },
{
"name": "google/common-protos",
"version": "v4.6.0",
@@ -2223,753 +2045,192 @@
"time": "2023-11-13T09:31:12+00:00"
},
{
- "name": "open-telemetry/api",
- "version": "1.0.3",
+ "name": "php-http/curl-client",
+ "version": "2.3.2",
"source": {
"type": "git",
- "url": "https://github.com/opentelemetry-php/api.git",
- "reference": "87de95d926f46262885d0d390060c095af13e2e5"
+ "url": "https://github.com/php-http/curl-client.git",
+ "reference": "0b869922458b1cde9137374545ed4fff7ac83623"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/87de95d926f46262885d0d390060c095af13e2e5",
- "reference": "87de95d926f46262885d0d390060c095af13e2e5",
+ "url": "https://api.github.com/repos/php-http/curl-client/zipball/0b869922458b1cde9137374545ed4fff7ac83623",
+ "reference": "0b869922458b1cde9137374545ed4fff7ac83623",
"shasum": ""
},
"require": {
- "open-telemetry/context": "^1.0",
+ "ext-curl": "*",
"php": "^7.4 || ^8.0",
- "psr/log": "^1.1|^2.0|^3.0",
- "symfony/polyfill-php80": "^1.26",
- "symfony/polyfill-php81": "^1.26",
- "symfony/polyfill-php82": "^1.26"
+ "php-http/discovery": "^1.6",
+ "php-http/httplug": "^2.0",
+ "php-http/message": "^1.2",
+ "psr/http-client": "^1.0",
+ "psr/http-factory-implementation": "^1.0",
+ "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
},
- "conflict": {
- "open-telemetry/sdk": "<=1.0.4"
+ "provide": {
+ "php-http/async-client-implementation": "1.0",
+ "php-http/client-implementation": "1.0",
+ "psr/http-client-implementation": "1.0"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.0.x-dev"
- }
+ "require-dev": {
+ "guzzlehttp/psr7": "^2.0",
+ "laminas/laminas-diactoros": "^2.0",
+ "php-http/client-integration-tests": "^3.0",
+ "php-http/message-factory": "^1.1",
+ "phpunit/phpunit": "^7.5 || ^9.4"
},
+ "type": "library",
"autoload": {
- "files": [
- "Trace/functions.php"
- ],
"psr-4": {
- "OpenTelemetry\\API\\": "."
+ "Http\\Client\\Curl\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "Apache-2.0"
+ "MIT"
],
"authors": [
{
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
+ "name": "Михаил Красильников",
+ "email": "m.krasilnikov@yandex.ru"
}
],
- "description": "API for OpenTelemetry PHP.",
+ "description": "PSR-18 and HTTPlug Async client with cURL",
+ "homepage": "http://php-http.org",
"keywords": [
- "Metrics",
- "api",
- "apm",
- "logging",
- "opentelemetry",
- "otel",
- "tracing"
+ "curl",
+ "http",
+ "psr-18"
],
"support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
+ "issues": "https://github.com/php-http/curl-client/issues",
+ "source": "https://github.com/php-http/curl-client/tree/2.3.2"
},
- "time": "2024-02-06T01:32:25+00:00"
+ "time": "2024-03-03T08:21:07+00:00"
},
{
- "name": "open-telemetry/context",
- "version": "1.0.2",
+ "name": "php-http/discovery",
+ "version": "1.19.4",
"source": {
"type": "git",
- "url": "https://github.com/opentelemetry-php/context.git",
- "reference": "e9d254a7c89885e63fd2fde54e31e81aaaf52b7c"
+ "url": "https://github.com/php-http/discovery.git",
+ "reference": "0700efda8d7526335132360167315fdab3aeb599"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/e9d254a7c89885e63fd2fde54e31e81aaaf52b7c",
- "reference": "e9d254a7c89885e63fd2fde54e31e81aaaf52b7c",
+ "url": "https://api.github.com/repos/php-http/discovery/zipball/0700efda8d7526335132360167315fdab3aeb599",
+ "reference": "0700efda8d7526335132360167315fdab3aeb599",
"shasum": ""
},
"require": {
- "php": "^7.4 || ^8.0",
- "symfony/polyfill-php80": "^1.26",
- "symfony/polyfill-php81": "^1.26",
- "symfony/polyfill-php82": "^1.26"
+ "composer-plugin-api": "^1.0|^2.0",
+ "php": "^7.1 || ^8.0"
},
- "suggest": {
- "ext-ffi": "To allow context switching in Fibers"
+ "conflict": {
+ "nyholm/psr7": "<1.0",
+ "zendframework/zend-diactoros": "*"
},
- "type": "library",
+ "provide": {
+ "php-http/async-client-implementation": "*",
+ "php-http/client-implementation": "*",
+ "psr/http-client-implementation": "*",
+ "psr/http-factory-implementation": "*",
+ "psr/http-message-implementation": "*"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0.2|^2.0",
+ "graham-campbell/phpspec-skip-example-extension": "^5.0",
+ "php-http/httplug": "^1.0 || ^2.0",
+ "php-http/message-factory": "^1.0",
+ "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
+ "sebastian/comparator": "^3.0.5 || ^4.0.8",
+ "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
+ },
+ "type": "composer-plugin",
"extra": {
- "branch-alias": {
- "dev-main": "1.0.x-dev"
- }
+ "class": "Http\\Discovery\\Composer\\Plugin",
+ "plugin-optional": true
},
"autoload": {
- "files": [
- "fiber/initialize_fiber_handler.php"
- ],
"psr-4": {
- "OpenTelemetry\\Context\\": "."
- }
+ "Http\\Discovery\\": "src/"
+ },
+ "exclude-from-classmap": [
+ "src/Composer/Plugin.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "Apache-2.0"
+ "MIT"
],
"authors": [
{
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
}
],
- "description": "Context implementation for OpenTelemetry PHP.",
+ "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
+ "homepage": "http://php-http.org",
"keywords": [
- "Context",
- "opentelemetry",
- "otel"
+ "adapter",
+ "client",
+ "discovery",
+ "factory",
+ "http",
+ "message",
+ "psr17",
+ "psr7"
],
"support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
+ "issues": "https://github.com/php-http/discovery/issues",
+ "source": "https://github.com/php-http/discovery/tree/1.19.4"
},
- "time": "2024-01-13T05:50:44+00:00"
+ "time": "2024-03-29T13:00:05+00:00"
},
{
- "name": "open-telemetry/exporter-otlp",
- "version": "1.0.4",
+ "name": "php-http/httplug",
+ "version": "2.4.0",
"source": {
"type": "git",
- "url": "https://github.com/opentelemetry-php/exporter-otlp.git",
- "reference": "342686bfce05867b56561a0af2fc8a4a8f27b3cc"
+ "url": "https://github.com/php-http/httplug.git",
+ "reference": "625ad742c360c8ac580fcc647a1541d29e257f67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/342686bfce05867b56561a0af2fc8a4a8f27b3cc",
- "reference": "342686bfce05867b56561a0af2fc8a4a8f27b3cc",
+ "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67",
+ "reference": "625ad742c360c8ac580fcc647a1541d29e257f67",
"shasum": ""
},
"require": {
- "open-telemetry/api": "^1.0",
- "open-telemetry/gen-otlp-protobuf": "^1.1",
- "open-telemetry/sdk": "^1.0",
- "php": "^7.4 || ^8.0",
- "php-http/discovery": "^1.14"
+ "php": "^7.1 || ^8.0",
+ "php-http/promise": "^1.1",
+ "psr/http-client": "^1.0",
+ "psr/http-message": "^1.0 || ^2.0"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.0.x-dev"
- }
+ "require-dev": {
+ "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
+ "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
},
+ "type": "library",
"autoload": {
- "files": [
- "_register.php"
- ],
"psr-4": {
- "OpenTelemetry\\Contrib\\Otlp\\": "."
+ "Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "Apache-2.0"
+ "MIT"
],
"authors": [
{
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
- }
- ],
- "description": "OTLP exporter for OpenTelemetry.",
- "keywords": [
- "Metrics",
- "exporter",
- "gRPC",
- "http",
- "opentelemetry",
- "otel",
- "otlp",
- "tracing"
- ],
- "support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
- },
- "time": "2024-02-28T21:57:02+00:00"
- },
- {
- "name": "open-telemetry/gen-otlp-protobuf",
- "version": "1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git",
- "reference": "76e2a44357f8c3fdcabcb070ec8a59e52ae3e3c3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/76e2a44357f8c3fdcabcb070ec8a59e52ae3e3c3",
- "reference": "76e2a44357f8c3fdcabcb070ec8a59e52ae3e3c3",
- "shasum": ""
- },
- "require": {
- "google/protobuf": "^3.3.0",
- "php": "^7.4 || ^8.0"
- },
- "suggest": {
- "ext-protobuf": "For better performance, when dealing with the protobuf format"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Opentelemetry\\Proto\\": "Opentelemetry/Proto/",
- "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
- }
- ],
- "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.",
- "keywords": [
- "Metrics",
- "apm",
- "gRPC",
- "logging",
- "opentelemetry",
- "otel",
- "otlp",
- "protobuf",
- "tracing"
- ],
- "support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
- },
- "time": "2024-01-16T21:54:57+00:00"
- },
- {
- "name": "open-telemetry/sdk",
- "version": "1.0.8",
- "source": {
- "type": "git",
- "url": "https://github.com/opentelemetry-php/sdk.git",
- "reference": "1da4c0ca4f1a3c0fe84b81729dadec16f464fa77"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/1da4c0ca4f1a3c0fe84b81729dadec16f464fa77",
- "reference": "1da4c0ca4f1a3c0fe84b81729dadec16f464fa77",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "open-telemetry/api": "^1.0",
- "open-telemetry/context": "^1.0",
- "open-telemetry/sem-conv": "^1.0",
- "php": "^7.4 || ^8.0",
- "php-http/discovery": "^1.14",
- "psr/http-client": "^1.0",
- "psr/http-client-implementation": "^1.0",
- "psr/http-factory-implementation": "^1.0",
- "psr/http-message": "^1.0.1|^2.0",
- "psr/log": "^1.1|^2.0|^3.0",
- "symfony/polyfill-mbstring": "^1.23",
- "symfony/polyfill-php80": "^1.26",
- "symfony/polyfill-php81": "^1.26",
- "symfony/polyfill-php82": "^1.26"
- },
- "suggest": {
- "ext-gmp": "To support unlimited number of synchronous metric readers",
- "ext-mbstring": "To increase performance of string operations"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.0.x-dev"
- }
- },
- "autoload": {
- "files": [
- "Common/Util/functions.php",
- "Logs/Exporter/_register.php",
- "Metrics/MetricExporter/_register.php",
- "Propagation/_register.php",
- "Trace/SpanExporter/_register.php",
- "Common/Dev/Compatibility/_load.php",
- "_autoload.php"
- ],
- "psr-4": {
- "OpenTelemetry\\SDK\\": "."
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
- }
- ],
- "description": "SDK for OpenTelemetry PHP.",
- "keywords": [
- "Metrics",
- "apm",
- "logging",
- "opentelemetry",
- "otel",
- "sdk",
- "tracing"
- ],
- "support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
- },
- "time": "2024-02-02T03:42:40+00:00"
- },
- {
- "name": "open-telemetry/sem-conv",
- "version": "1.24.0",
- "source": {
- "type": "git",
- "url": "https://github.com/opentelemetry-php/sem-conv.git",
- "reference": "d03e6501d21c04cd1b1e66e4cbcc7c2dd2e2cfa3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/d03e6501d21c04cd1b1e66e4cbcc7c2dd2e2cfa3",
- "reference": "d03e6501d21c04cd1b1e66e4cbcc7c2dd2e2cfa3",
- "shasum": ""
- },
- "require": {
- "php": "^7.4 || ^8.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "OpenTelemetry\\SemConv\\": "."
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "opentelemetry-php contributors",
- "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
- }
- ],
- "description": "Semantic conventions for OpenTelemetry PHP.",
- "keywords": [
- "Metrics",
- "apm",
- "logging",
- "opentelemetry",
- "otel",
- "semantic conventions",
- "semconv",
- "tracing"
- ],
- "support": {
- "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V",
- "docs": "https://opentelemetry.io/docs/php",
- "issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
- "source": "https://github.com/open-telemetry/opentelemetry-php"
- },
- "time": "2024-01-23T21:47:17+00:00"
- },
- {
- "name": "opencensus/opencensus",
- "version": "v0.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/census-instrumentation/opencensus-php.git",
- "reference": "007b35d8f7ed21cab9aa47406578ae02f73f91c5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/census-instrumentation/opencensus-php/zipball/007b35d8f7ed21cab9aa47406578ae02f73f91c5",
- "reference": "007b35d8f7ed21cab9aa47406578ae02f73f91c5",
- "shasum": ""
- },
- "require": {
- "cache/adapter-common": "^1.0",
- "php": ">=7.1",
- "psr/cache": "^1.0",
- "psr/log": "^1.0",
- "ramsey/uuid": "~3"
- },
- "conflict": {
- "ext-opencensus": "< 0.1.0"
- },
- "require-dev": {
- "guzzlehttp/guzzle": "~5.3",
- "guzzlehttp/psr7": "~1.4",
- "phpunit/phpunit": "^5.0",
- "squizlabs/php_codesniffer": "2.*",
- "symfony/yaml": "~3.3",
- "twig/twig": "~2.0 || ~1.35"
- },
- "suggest": {
- "cache/apc-adapter": "Enable QpsSampler to use apc cache.",
- "cache/apcu-adapter": "Enable QpsSampler to use apcu cache.",
- "cache/memcached-adapter": "Enable QpsSampler to use memcached cache.",
- "ext-opencensus": "Enable tracing arbitrary functions.",
- "opencensus/opencensus-exporter-jaeger": "Export data to Jaeger",
- "opencensus/opencensus-exporter-stackdriver": "Export data to Stackdriver",
- "opencensus/opencensus-exporter-zipkin": "Export data to Zipkin"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "OpenCensus\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Jeff Ching",
- "email": "chingor@google.com"
- },
- {
- "name": "Bas van Beek",
- "email": "bas.vanbeek@gmail.com"
- }
- ],
- "description": "OpenCensus Trace Client for PHP",
- "support": {
- "issues": "https://github.com/census-instrumentation/opencensus-php/issues",
- "source": "https://github.com/census-instrumentation/opencensus-php/tree/master"
- },
- "abandoned": true,
- "time": "2020-06-12T18:56:55+00:00"
- },
- {
- "name": "opencensus/opencensus-exporter-stackdriver",
- "version": "v0.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/census-instrumentation/opencensus-php-exporter-stackdriver.git",
- "reference": "f3017cebd5c01b212b889af7fb430921de6b45b0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/census-instrumentation/opencensus-php-exporter-stackdriver/zipball/f3017cebd5c01b212b889af7fb430921de6b45b0",
- "reference": "f3017cebd5c01b212b889af7fb430921de6b45b0",
- "shasum": ""
- },
- "require": {
- "google/cloud-trace": "~0.4",
- "opencensus/opencensus": "~0.4",
- "php": ">=5.6"
- },
- "require-dev": {
- "phpunit/phpunit": "^6.0",
- "squizlabs/php_codesniffer": "2.*"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "OpenCensus\\Trace\\Exporter\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Jeff Ching",
- "email": "chingor@google.com"
- }
- ],
- "description": "OpenCensus Stackdriver Exporter for PHP",
- "support": {
- "issues": "https://github.com/census-instrumentation/opencensus-php-exporter-stackdriver/issues",
- "source": "https://github.com/census-instrumentation/opencensus-php-exporter-stackdriver/tree/master"
- },
- "abandoned": true,
- "time": "2018-04-19T16:43:12+00:00"
- },
- {
- "name": "paragonie/random_compat",
- "version": "v9.99.100",
- "source": {
- "type": "git",
- "url": "https://github.com/paragonie/random_compat.git",
- "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
- "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
- "shasum": ""
- },
- "require": {
- "php": ">= 7"
- },
- "require-dev": {
- "phpunit/phpunit": "4.*|5.*",
- "vimeo/psalm": "^1"
- },
- "suggest": {
- "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
- },
- "type": "library",
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Paragon Initiative Enterprises",
- "email": "security@paragonie.com",
- "homepage": "https://paragonie.com"
- }
- ],
- "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
- "keywords": [
- "csprng",
- "polyfill",
- "pseudorandom",
- "random"
- ],
- "support": {
- "email": "info@paragonie.com",
- "issues": "https://github.com/paragonie/random_compat/issues",
- "source": "https://github.com/paragonie/random_compat"
- },
- "time": "2020-10-15T08:29:30+00:00"
- },
- {
- "name": "php-http/curl-client",
- "version": "2.3.2",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/curl-client.git",
- "reference": "0b869922458b1cde9137374545ed4fff7ac83623"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/curl-client/zipball/0b869922458b1cde9137374545ed4fff7ac83623",
- "reference": "0b869922458b1cde9137374545ed4fff7ac83623",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "php": "^7.4 || ^8.0",
- "php-http/discovery": "^1.6",
- "php-http/httplug": "^2.0",
- "php-http/message": "^1.2",
- "psr/http-client": "^1.0",
- "psr/http-factory-implementation": "^1.0",
- "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
- },
- "provide": {
- "php-http/async-client-implementation": "1.0",
- "php-http/client-implementation": "1.0",
- "psr/http-client-implementation": "1.0"
- },
- "require-dev": {
- "guzzlehttp/psr7": "^2.0",
- "laminas/laminas-diactoros": "^2.0",
- "php-http/client-integration-tests": "^3.0",
- "php-http/message-factory": "^1.1",
- "phpunit/phpunit": "^7.5 || ^9.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Client\\Curl\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Михаил Красильников",
- "email": "m.krasilnikov@yandex.ru"
- }
- ],
- "description": "PSR-18 and HTTPlug Async client with cURL",
- "homepage": "http://php-http.org",
- "keywords": [
- "curl",
- "http",
- "psr-18"
- ],
- "support": {
- "issues": "https://github.com/php-http/curl-client/issues",
- "source": "https://github.com/php-http/curl-client/tree/2.3.2"
- },
- "time": "2024-03-03T08:21:07+00:00"
- },
- {
- "name": "php-http/discovery",
- "version": "1.19.4",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/discovery.git",
- "reference": "0700efda8d7526335132360167315fdab3aeb599"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/discovery/zipball/0700efda8d7526335132360167315fdab3aeb599",
- "reference": "0700efda8d7526335132360167315fdab3aeb599",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^1.0|^2.0",
- "php": "^7.1 || ^8.0"
- },
- "conflict": {
- "nyholm/psr7": "<1.0",
- "zendframework/zend-diactoros": "*"
- },
- "provide": {
- "php-http/async-client-implementation": "*",
- "php-http/client-implementation": "*",
- "psr/http-client-implementation": "*",
- "psr/http-factory-implementation": "*",
- "psr/http-message-implementation": "*"
- },
- "require-dev": {
- "composer/composer": "^1.0.2|^2.0",
- "graham-campbell/phpspec-skip-example-extension": "^5.0",
- "php-http/httplug": "^1.0 || ^2.0",
- "php-http/message-factory": "^1.0",
- "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
- "sebastian/comparator": "^3.0.5 || ^4.0.8",
- "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "Http\\Discovery\\Composer\\Plugin",
- "plugin-optional": true
- },
- "autoload": {
- "psr-4": {
- "Http\\Discovery\\": "src/"
- },
- "exclude-from-classmap": [
- "src/Composer/Plugin.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
- "homepage": "http://php-http.org",
- "keywords": [
- "adapter",
- "client",
- "discovery",
- "factory",
- "http",
- "message",
- "psr17",
- "psr7"
- ],
- "support": {
- "issues": "https://github.com/php-http/discovery/issues",
- "source": "https://github.com/php-http/discovery/tree/1.19.4"
- },
- "time": "2024-03-29T13:00:05+00:00"
- },
- {
- "name": "php-http/httplug",
- "version": "2.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/httplug.git",
- "reference": "625ad742c360c8ac580fcc647a1541d29e257f67"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67",
- "reference": "625ad742c360c8ac580fcc647a1541d29e257f67",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0",
- "php-http/promise": "^1.1",
- "psr/http-client": "^1.0",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
- "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Client\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Eric GELOEN",
- "email": "geloen.eric@gmail.com"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
+ "name": "Eric GELOEN",
+ "email": "geloen.eric@gmail.com"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"description": "HTTPlug, the HTTP client abstraction for PHP",
@@ -4194,119 +3455,19 @@
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
- ],
- "authors": [
- {
- "name": "Ralph Khattar",
- "email": "ralph.khattar@gmail.com"
- }
- ],
- "description": "A polyfill for getallheaders.",
- "support": {
- "issues": "https://github.com/ralouphie/getallheaders/issues",
- "source": "https://github.com/ralouphie/getallheaders/tree/develop"
- },
- "time": "2019-03-08T08:55:37+00:00"
- },
- {
- "name": "ramsey/uuid",
- "version": "3.9.7",
- "source": {
- "type": "git",
- "url": "https://github.com/ramsey/uuid.git",
- "reference": "dc75aa439eb4c1b77f5379fd958b3dc0e6014178"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ramsey/uuid/zipball/dc75aa439eb4c1b77f5379fd958b3dc0e6014178",
- "reference": "dc75aa439eb4c1b77f5379fd958b3dc0e6014178",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "paragonie/random_compat": "^1 | ^2 | ^9.99.99",
- "php": "^5.4 | ^7.0 | ^8.0",
- "symfony/polyfill-ctype": "^1.8"
- },
- "replace": {
- "rhumsaa/uuid": "self.version"
- },
- "require-dev": {
- "codeception/aspect-mock": "^1 | ^2",
- "doctrine/annotations": "^1.2",
- "goaop/framework": "1.0.0-alpha.2 | ^1 | >=2.1.0 <=2.3.2",
- "mockery/mockery": "^0.9.11 | ^1",
- "moontoast/math": "^1.1",
- "nikic/php-parser": "<=4.5.0",
- "paragonie/random-lib": "^2",
- "php-mock/php-mock-phpunit": "^0.3 | ^1.1 | ^2.6",
- "php-parallel-lint/php-parallel-lint": "^1.3",
- "phpunit/phpunit": ">=4.8.36 <9.0.0 | >=9.3.0",
- "squizlabs/php_codesniffer": "^3.5",
- "yoast/phpunit-polyfills": "^1.0"
- },
- "suggest": {
- "ext-ctype": "Provides support for PHP Ctype functions",
- "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator",
- "ext-openssl": "Provides the OpenSSL extension for use with the OpenSslGenerator",
- "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator",
- "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).",
- "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
- "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid",
- "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type."
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/functions.php"
- ],
- "psr-4": {
- "Ramsey\\Uuid\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ben Ramsey",
- "email": "ben@benramsey.com",
- "homepage": "https://benramsey.com"
- },
- {
- "name": "Marijn Huizendveld",
- "email": "marijn.huizendveld@gmail.com"
- },
+ ],
+ "authors": [
{
- "name": "Thibaud Fabre",
- "email": "thibaud@aztech.io"
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
}
],
- "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).",
- "homepage": "https://github.com/ramsey/uuid",
- "keywords": [
- "guid",
- "identifier",
- "uuid"
- ],
+ "description": "A polyfill for getallheaders.",
"support": {
- "issues": "https://github.com/ramsey/uuid/issues",
- "rss": "https://github.com/ramsey/uuid/releases.atom",
- "source": "https://github.com/ramsey/uuid",
- "wiki": "https://github.com/ramsey/uuid/wiki"
+ "issues": "https://github.com/ralouphie/getallheaders/issues",
+ "source": "https://github.com/ralouphie/getallheaders/tree/develop"
},
- "funding": [
- {
- "url": "https://github.com/ramsey",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid",
- "type": "tidelift"
- }
- ],
- "time": "2022-12-19T21:55:10+00:00"
+ "time": "2019-03-08T08:55:37+00:00"
},
{
"name": "rize/uri-template",
@@ -5194,265 +4355,27 @@
"time": "2023-08-08T10:16:24+00:00"
},
{
- "name": "symfony/polyfill-ctype",
- "version": "v1.29.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
- "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "provide": {
- "ext-ctype": "*"
- },
- "suggest": {
- "ext-ctype": "For best performance"
- },
- "type": "library",
- "extra": {
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Gert de Pagter",
- "email": "BackEndTea@gmail.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for ctype functions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "ctype",
- "polyfill",
- "portable"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2024-01-29T20:11:03+00:00"
- },
- {
- "name": "symfony/polyfill-intl-grapheme",
- "version": "v1.29.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f",
- "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "suggest": {
- "ext-intl": "For best performance"
- },
- "type": "library",
- "extra": {
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for intl's grapheme_* functions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "grapheme",
- "intl",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2024-01-29T20:11:03+00:00"
- },
- {
- "name": "symfony/polyfill-intl-normalizer",
- "version": "v1.29.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
- "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "suggest": {
- "ext-intl": "For best performance"
- },
- "type": "library",
- "extra": {
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for intl's Normalizer class and related functions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "intl",
- "normalizer",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2024-01-29T20:11:03+00:00"
- },
- {
- "name": "symfony/polyfill-mbstring",
+ "name": "symfony/polyfill-ctype",
"version": "v1.29.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
- "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"provide": {
- "ext-mbstring": "*"
+ "ext-ctype": "*"
},
"suggest": {
- "ext-mbstring": "For best performance"
+ "ext-ctype": "For best performance"
},
"type": "library",
"extra": {
@@ -5466,7 +4389,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
+ "Symfony\\Polyfill\\Ctype\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -5475,25 +4398,24 @@
],
"authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for the Mbstring extension",
+ "description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
- "mbstring",
+ "ctype",
"polyfill",
- "portable",
- "shim"
+ "portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
},
"funding": [
{
@@ -5512,22 +4434,25 @@
"time": "2024-01-29T20:11:03+00:00"
},
{
- "name": "symfony/polyfill-php80",
+ "name": "symfony/polyfill-intl-grapheme",
"version": "v1.29.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
- "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f",
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
"type": "library",
"extra": {
"thanks": {
@@ -5540,21 +4465,14 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@@ -5564,16 +4482,18 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "description": "Symfony polyfill for intl's grapheme_* functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
+ "grapheme",
+ "intl",
"polyfill",
"portable",
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0"
},
"funding": [
{
@@ -5592,22 +4512,25 @@
"time": "2024-01-29T20:11:03+00:00"
},
{
- "name": "symfony/polyfill-php81",
+ "name": "symfony/polyfill-intl-normalizer",
"version": "v1.29.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d"
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d",
- "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
"type": "library",
"extra": {
"thanks": {
@@ -5620,7 +4543,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php81\\": ""
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
},
"classmap": [
"Resources/stubs"
@@ -5640,16 +4563,18 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
+ "intl",
+ "normalizer",
"polyfill",
"portable",
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
},
"funding": [
{
@@ -5668,22 +4593,28 @@
"time": "2024-01-29T20:11:03+00:00"
},
{
- "name": "symfony/polyfill-php82",
+ "name": "symfony/polyfill-mbstring",
"version": "v1.29.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php82.git",
- "reference": "559d488c38784112c78b9bf17c5ce8366a265643"
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/559d488c38784112c78b9bf17c5ce8366a265643",
- "reference": "559d488c38784112c78b9bf17c5ce8366a265643",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
"type": "library",
"extra": {
"thanks": {
@@ -5696,11 +4627,8 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php82\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -5716,16 +4644,17 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions",
+ "description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
+ "mbstring",
"polyfill",
"portable",
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php82/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
},
"funding": [
{
@@ -7423,6 +6352,162 @@
],
"time": "2024-01-29T20:11:03+00:00"
},
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php81",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d",
+ "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php81\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
{
"name": "symfony/process",
"version": "v7.0.4",
diff --git a/gcloud-entry.php b/gcloud-entry.php
index 492393f7..10e3f964 100644
--- a/gcloud-entry.php
+++ b/gcloud-entry.php
@@ -1,5 +1,8 @@
('gcloud-entry:'.$parsedUrl)],
- function () use ($parsedUrl) {
- // this is horrible, but in order to wrap these includes in this tracing function
- // we have to declare every possible global variable usage
- // ideally we wouldn't be using globals at all, but that's for another day :)
- global $settings,$translate,$action,$lan,$pdf,$_txt,$formbuttons;
- global $error,$listdata,$data,$table,$listconfig,$thisfile,$formdata;
- global $rolesToActions, $menusToActions;
-
- switch ($parsedUrl) {
- case '/':
- case '/index.php':
- require 'index.php';
-
- break;
-
- // old path of QR-codes
- case '/flip/scan.php':
- require 'mobile.php';
-
- break;
-
- case '/ajax.php':
- case '/mobile.php':
- case '/cypress-session.php':
- case '/pdf/workshopcard.php':
- case '/pdf/bicyclecard.php':
- case '/pdf/idcard.php':
- case '/pdf/qr.php':
- case '/pdf/dryfood.php':
- case '/cron/dailyroutine.php':
- case '/cron/reseed-auth0.php':
- case '/cron/reseed-roles-auth0.php':
- case '/fake-error.php':
- require substr($parsedUrl, 1); // trim /
-
- break;
-
- case '/ping':
- http_response_code(200);
-
- exit('pong');
-
- break;
-
- default:
- http_response_code(404);
-
- exit('Not Found');
- }
- }
-);
+// Tracer::inSpan(
+// ['name' => ('gcloud-entry:'.$parsedUrl)],
+// function () use ($parsedUrl) {
+// // this is horrible, but in order to wrap these includes in this tracing function
+// // we have to declare every possible global variable usage
+// // ideally we wouldn't be using globals at all, but that's for another day :)
+// global $settings,$translate,$action,$lan,$pdf,$_txt,$formbuttons;
+// global $error,$listdata,$data,$table,$listconfig,$thisfile,$formdata;
+// global $rolesToActions, $menusToActions;
+
+switch ($parsedUrl) {
+ case '/':
+ case '/index.php':
+ require 'index.php';
+
+ break;
+
+ // old path of QR-codes
+ case '/flip/scan.php':
+ require 'mobile.php';
+
+ break;
+
+ case '/ajax.php':
+ case '/mobile.php':
+ case '/cypress-session.php':
+ case '/pdf/workshopcard.php':
+ case '/pdf/bicyclecard.php':
+ case '/pdf/idcard.php':
+ case '/pdf/qr.php':
+ case '/pdf/dryfood.php':
+ case '/cron/dailyroutine.php':
+ case '/cron/reseed-auth0.php':
+ case '/cron/reseed-roles-auth0.php':
+ case '/fake-error.php':
+ require substr($parsedUrl, 1); // trim /
+
+ break;
+
+ case '/ping':
+ http_response_code(200);
+
+ exit('pong');
+
+ break;
+
+ default:
+ http_response_code(404);
+
+ exit('Not Found');
+}
+
+// }
+// );
diff --git a/include/people.php b/include/people.php
index 38fb540c..d81bb480 100644
--- a/include/people.php
+++ b/include/people.php
@@ -1,126 +1,126 @@
'include/people.php'],
- function () use ($action, &$cmsmain) {
- global $settings, $table, $listconfig, $listdata;
+// Tracer::inSpan(
+// ['name' => 'include/people.php'],
+// function () use ($action, &$cmsmain) {
+// global $settings, $table, $listconfig, $listdata;
- $table = $action;
- $ajax = checkajax();
+$table = $action;
+$ajax = checkajax();
- if (!$ajax) {
- if (!$_SESSION['camp']['id']) {
- throw new Exception('The list of beneficiaries is not available when there is no camp selected');
- }
+if (!$ajax) {
+ if (!$_SESSION['camp']['id']) {
+ throw new Exception('The list of beneficiaries is not available when there is no camp selected');
+ }
- // Title
- $cmsmain->assign('title', 'Beneficiaries');
+ // Title
+ $cmsmain->assign('title', 'Beneficiaries');
- initlist();
+ initlist();
- // Filter
- $tags = db_simplearray('SELECT id, label FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND type in ("All","People") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']]);
- if (!empty($tags)) {
- $tagfilter = ['id' => 'tagfilter', 'placeholder' => 'Tag filter', 'options' => db_array('SELECT id, id AS value, label, color FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND type in ("All","People") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']])];
- listsetting('multiplefilter', $tagfilter);
- }
+ // Filter
+ $tags = db_simplearray('SELECT id, label FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND type in ("All","People") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']]);
+ if (!empty($tags)) {
+ $tagfilter = ['id' => 'tagfilter', 'placeholder' => 'Tag filter', 'options' => db_array('SELECT id, id AS value, label, color FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND type in ("All","People") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']])];
+ listsetting('multiplefilter', $tagfilter);
+ }
- $statusarray = ['day' => 'New today', 'week' => 'New this week', 'month' => 'New this month', 'inactive' => 'Inactive', 'approvalsigned' => 'No signature', 'notregistered' => 'Not registered'];
- if ($_SESSION['camp']['beneficiaryisregistered']) {
- $statusarray['notregistered'] = 'Not registered';
- }
- if ($_SESSION['camp']['beneficiaryisvolunteer']) {
- $statusarray['volunteer'] = 'Volunteers';
- }
- listfilter3(['label' => 'Quick filters', 'options' => $statusarray, 'filter' => '"show"']);
-
- // Search
- listsetting('manualquery', true);
- listsetting('search', ['firstname', 'lastname', 'container', 'comments']);
- $search = substr((string) db_escape(trim((string) $listconfig['searchvalue'])), 1, strlen((string) db_escape(trim((string) $listconfig['searchvalue']))) - 2);
-
- $is_filtered = (isset($listconfig['filtervalue3']) || isset($listconfig['multiplefilter_selected']) || isset($listconfig['searchvalue'])) ? true : false;
-
- // filter for up to 500 records
- if (!$is_filtered) {
- $number_of_people = db_value('SELECT COUNT(id) FROM people WHERE camp_id = :camp_id AND deleted IS NULL', ['camp_id' => $_SESSION['camp']['id']]);
- if ($number_of_people > 500) {
- listfilter(['label' => 'List size', 'options' => ['all' => 'Show all'], 'filter' => '"show"']);
-
- if ('all' != $listconfig['filtervalue']) {
- // limits the number of rows displayed
- listsetting('maxlimit', 500);
- // Notify the user of the limit on the number of records
- $cmsmain->assign('notification', 'Only the first 500 beneficiaries are shown. Use the filter and search to find the rest.');
- }
- }
+ $statusarray = ['day' => 'New today', 'week' => 'New this week', 'month' => 'New this month', 'inactive' => 'Inactive', 'approvalsigned' => 'No signature', 'notregistered' => 'Not registered'];
+ if ($_SESSION['camp']['beneficiaryisregistered']) {
+ $statusarray['notregistered'] = 'Not registered';
+ }
+ if ($_SESSION['camp']['beneficiaryisvolunteer']) {
+ $statusarray['volunteer'] = 'Volunteers';
+ }
+ listfilter3(['label' => 'Quick filters', 'options' => $statusarray, 'filter' => '"show"']);
+
+ // Search
+ listsetting('manualquery', true);
+ listsetting('search', ['firstname', 'lastname', 'container', 'comments']);
+ $search = substr((string) db_escape(trim((string) $listconfig['searchvalue'])), 1, strlen((string) db_escape(trim((string) $listconfig['searchvalue']))) - 2);
+
+ $is_filtered = (isset($listconfig['filtervalue3']) || isset($listconfig['multiplefilter_selected']) || isset($listconfig['searchvalue'])) ? true : false;
+
+ // filter for up to 500 records
+ if (!$is_filtered) {
+ $number_of_people = db_value('SELECT COUNT(id) FROM people WHERE camp_id = :camp_id AND deleted IS NULL', ['camp_id' => $_SESSION['camp']['id']]);
+ if ($number_of_people > 500) {
+ listfilter(['label' => 'List size', 'options' => ['all' => 'Show all'], 'filter' => '"show"']);
+
+ if ('all' != $listconfig['filtervalue']) {
+ // limits the number of rows displayed
+ listsetting('maxlimit', 500);
+ // Notify the user of the limit on the number of records
+ $cmsmain->assign('notification', 'Only the first 500 beneficiaries are shown. Use the filter and search to find the rest.');
}
+ }
+ }
- // make sorting optional
- listfilter2(['label' => 'List settings', 'options' => ['sort' => 'Make sortable'], 'filter' => '"show"']);
-
- listsetting('allowcopy', false);
- listsetting('allowshowhide', false);
- listsetting('add', 'New person');
- listsetting('delete', 'Deactivate');
- if (isset($listconfig['filtervalue2']) && 'sort' === $listconfig['filtervalue2']) {
- listsetting('allowsort', true);
- listsetting('allowmove', false);
- listsetting('noindent', true);
- } else {
- listsetting('allowsort', false);
- listsetting('allowmove', true);
- listsetting('allowmoveto', 1);
- }
+ // make sorting optional
+ listfilter2(['label' => 'List settings', 'options' => ['sort' => 'Make sortable'], 'filter' => '"show"']);
+
+ listsetting('allowcopy', false);
+ listsetting('allowshowhide', false);
+ listsetting('add', 'New person');
+ listsetting('delete', 'Deactivate');
+ if (isset($listconfig['filtervalue2']) && 'sort' === $listconfig['filtervalue2']) {
+ listsetting('allowsort', true);
+ listsetting('allowmove', false);
+ listsetting('noindent', true);
+ } else {
+ listsetting('allowsort', false);
+ listsetting('allowmove', true);
+ listsetting('allowmoveto', 1);
+ }
- // Toplevel tabs
- listsetting('haspagemenu', true);
- addpagemenu('all', 'All', ['link' => '?action=people', 'active' => true]);
- addpagemenu('deactivated', 'Deactivated', ['link' => '?action=people_deactivated']);
+ // Toplevel tabs
+ listsetting('haspagemenu', true);
+ addpagemenu('all', 'All', ['link' => '?action=people', 'active' => true]);
+ addpagemenu('deactivated', 'Deactivated', ['link' => '?action=people_deactivated']);
- // List Buttons
- addbutton('export', 'Export', ['icon' => 'fa-download', 'showalways' => false, 'testid' => 'exportBeneficiariesButton']);
- if (!empty($tags)) {
- addbutton('tag', 'Add Tag', ['icon' => 'fa-tag', 'options' => $tags]);
- addbutton('rtag', 'Remove Tag', ['icon' => 'fa-tags', 'options' => $tags]);
- }
- addbutton('give', 'Give '.ucwords((string) $_SESSION['camp']['currencyname']), ['image' => 'one_coin.png', 'imageClass' => 'coinsImage', 'oneitemonly' => false, 'testid' => 'giveTokensListButton']);
- addbutton('merge', 'Merge to family', ['icon' => 'fa-link', 'oneitemonly' => false, 'testid' => 'mergeToFamily']);
- addbutton('detach', 'Detach from family', ['icon' => 'fa-unlink', 'oneitemonly' => false, 'testid' => 'detachFromFamily']);
- if ($_SESSION['camp']['bicycle']) {
- $printoptions['bicycle'] = 'Bicycle card';
- }
- if ($_SESSION['camp']['bicycle']) {
- $printoptions['workshop'] = 'Workshop card';
- }
- if ($_SESSION['camp']['idcard']) {
- $printoptions['id'] = 'ID Card';
- }
- if (isset($printoptions)) {
- addbutton('print', 'Print', ['icon' => 'fa-print', 'options' => $printoptions]);
- }
- addbutton('touch', 'Touch', ['icon' => 'fa-hand-pointer-o']);
-
- // Columns
- addcolumn('text', 'Surname', 'lastname');
- addcolumn('text', 'Firstname', 'firstname');
- addcolumn('text', 'Gender', 'gender');
- addcolumn('text', 'Age', 'age');
- addcolumn('text', $_SESSION['camp']['familyidentifier'], 'container');
- addcolumn('text', ucwords((string) $_SESSION['camp']['currencyname']), 'tokens');
- if (!empty($tags)) {
- addcolumn('tag', 'Tags', 'tags');
- }
- addcolumn('text', 'Comments', 'comments');
- if ($is_filtered) {
- addcolumn('text', 'Last Activity', 'last_activity');
- }
- addcolumn('html', ' ', 'icons');
+ // List Buttons
+ addbutton('export', 'Export', ['icon' => 'fa-download', 'showalways' => false, 'testid' => 'exportBeneficiariesButton']);
+ if (!empty($tags)) {
+ addbutton('tag', 'Add Tag', ['icon' => 'fa-tag', 'options' => $tags]);
+ addbutton('rtag', 'Remove Tag', ['icon' => 'fa-tags', 'options' => $tags]);
+ }
+ addbutton('give', 'Give '.ucwords((string) $_SESSION['camp']['currencyname']), ['image' => 'one_coin.png', 'imageClass' => 'coinsImage', 'oneitemonly' => false, 'testid' => 'giveTokensListButton']);
+ addbutton('merge', 'Merge to family', ['icon' => 'fa-link', 'oneitemonly' => false, 'testid' => 'mergeToFamily']);
+ addbutton('detach', 'Detach from family', ['icon' => 'fa-unlink', 'oneitemonly' => false, 'testid' => 'detachFromFamily']);
+ if ($_SESSION['camp']['bicycle']) {
+ $printoptions['bicycle'] = 'Bicycle card';
+ }
+ if ($_SESSION['camp']['bicycle']) {
+ $printoptions['workshop'] = 'Workshop card';
+ }
+ if ($_SESSION['camp']['idcard']) {
+ $printoptions['id'] = 'ID Card';
+ }
+ if (isset($printoptions)) {
+ addbutton('print', 'Print', ['icon' => 'fa-print', 'options' => $printoptions]);
+ }
+ addbutton('touch', 'Touch', ['icon' => 'fa-hand-pointer-o']);
+
+ // Columns
+ addcolumn('text', 'Surname', 'lastname');
+ addcolumn('text', 'Firstname', 'firstname');
+ addcolumn('text', 'Gender', 'gender');
+ addcolumn('text', 'Age', 'age');
+ addcolumn('text', $_SESSION['camp']['familyidentifier'], 'container');
+ addcolumn('text', ucwords((string) $_SESSION['camp']['currencyname']), 'tokens');
+ if (!empty($tags)) {
+ addcolumn('tag', 'Tags', 'tags');
+ }
+ addcolumn('text', 'Comments', 'comments');
+ if ($is_filtered) {
+ addcolumn('text', 'Last Activity', 'last_activity');
+ }
+ addcolumn('html', ' ', 'icons');
- // Query
- $data = getlistdata('
+ // Query
+ $data = getlistdata('
SELECT
people_filtered_with_tags.*,
IFNULL(SUM(CASE WHEN people_filtered_with_tags.level = 0 THEN transactions.drops ELSE 0 END),0) AS tokens,
@@ -146,8 +146,8 @@ function () use ($action, &$cmsmain) {
people.approvalsigned
FROM
people'.
- // Join tags here only if a tag filter is selected and only people with a certain tag should be returned
- ($listconfig['multiplefilter_selected'] ? '
+ // Join tags here only if a tag filter is selected and only people with a certain tag should be returned
+ ($listconfig['multiplefilter_selected'] ? '
LEFT JOIN
tags_relations AS people_tags_filter ON people_tags_filter.object_id = people.id AND people_tags_filter.object_type = "People"
LEFT JOIN
@@ -155,19 +155,19 @@ function () use ($action, &$cmsmain) {
WHERE
people.deleted IS NULL AND
people.camp_id = '.$_SESSION['camp']['id'].
- ('day' == $listconfig['filtervalue3'] ? ' AND DATE(NOW()) = DATE(people.created) ' : '').
- ('week' == $listconfig['filtervalue3'] ? ' AND DATE_FORMAT(NOW(),"%v-%x") = DATE_FORMAT(people.created,"%v-%x") ' : '').
- ('month' == $listconfig['filtervalue3'] ? ' AND DATE_FORMAT(NOW(),"%m-%Y") = DATE_FORMAT(people.created,"%m-%Y") ' : '').
- ('volunteer' == $listconfig['filtervalue3'] ? ' AND people.volunteer ' : '').
- ('notregistered' == $listconfig['filtervalue3'] ? ' AND people.notregistered ' : '').
- ($listconfig['searchvalue'] ? ' AND
+ ('day' == $listconfig['filtervalue3'] ? ' AND DATE(NOW()) = DATE(people.created) ' : '').
+ ('week' == $listconfig['filtervalue3'] ? ' AND DATE_FORMAT(NOW(),"%v-%x") = DATE_FORMAT(people.created,"%v-%x") ' : '').
+ ('month' == $listconfig['filtervalue3'] ? ' AND DATE_FORMAT(NOW(),"%m-%Y") = DATE_FORMAT(people.created,"%m-%Y") ' : '').
+ ('volunteer' == $listconfig['filtervalue3'] ? ' AND people.volunteer ' : '').
+ ('notregistered' == $listconfig['filtervalue3'] ? ' AND people.notregistered ' : '').
+ ($listconfig['searchvalue'] ? ' AND
(people.lastname LIKE "%'.$search.'%" OR
people.firstname LIKE "%'.$search.'%" OR
people.container = "'.$search.'" OR
people.comments LIKE "%'.$search.'%")
' : ' ').
- // filter for selected tags
- ($listconfig['multiplefilter_selected'] ? ' AND tags_filter.id IN ('.implode(',', $listconfig['multiplefilter_selected']).') ' : '').'
+ // filter for selected tags
+ ($listconfig['multiplefilter_selected'] ? ' AND tags_filter.id IN ('.implode(',', $listconfig['multiplefilter_selected']).') ' : '').'
GROUP BY
people.id
) AS people_filtered
@@ -186,11 +186,11 @@ function () use ($action, &$cmsmain) {
people AS parent ON people_filtered_with_tags.parent_id = parent.id
LEFT JOIN
transactions ON transactions.people_id = people_filtered_with_tags.id '.
- (
- 'approvalsigned' == $listconfig['filtervalue3'] ? '
+ (
+ 'approvalsigned' == $listconfig['filtervalue3'] ? '
WHERE
((NOT people_filtered_with_tags.approvalsigned AND people_filtered_with_tags.parent_id IS NULL) OR NOT parent.approvalsigned)' : ''
- ).'
+ ).'
GROUP BY
people_filtered_with_tags.id
ORDER BY
@@ -205,313 +205,313 @@ function () use ($action, &$cmsmain) {
IF(people_filtered_with_tags.parent_id, people_filtered_with_tags.lastname, ""),
IF(people_filtered_with_tags.parent_id, people_filtered_with_tags.firstname, "")');
- // Prepare data
- $daysinactive = db_value('SELECT delete_inactive_users/2 FROM camps WHERE id = '.$_SESSION['camp']['id']);
-
- Tracer::inSpan(
- ['name' => 'include/people.php:inactive'],
- function () use (&$data, $daysinactive) {
- global $listconfig;
-
- foreach ($data as $key => $value) {
- $created = new DateTime($data[$key]['created']);
- $modified = is_null($data[$key]['modified']) ? new DateTime($data[$key]['created']) : new DateTime($data[$key]['modified']);
- $last_activity = is_null($data[$key]['last_activity']) ? new DateTime($data[$key]['created']) : new DateTime($data[$key]['last_activity']);
- $data[$key]['last_activity'] = $last_activity->format('Y-m-d');
- $data[$key]['days_last_active'] = max($created, $modified, $last_activity)->diff(new DateTime())->format('%a');
- $data[$key]['tokens'] = $data[$key]['level'] ? null : $data[$key]['tokens'];
-
- if ($data[$key]['days_last_active'] > $daysinactive) {
- $data[$key]['icons'] = ' ';
- } else {
- if ('inactive' == $listconfig['filtervalue3']) {
- unset($data[$key]);
-
- continue;
- }
- $data[$key]['icons'] = '';
- }
- }
- }
- );
-
- Tracer::inSpan(
- ['name' => 'include/people.php:approvalsigned_volunteer_unregistered'],
- function () use (&$data) {
- foreach ($data as $key => $value) {
- if (0 == $data[$key]['level'] && !$data[$key]['approvalsigned']) {
- $data[$key]['icons'] .= ' ';
- }
- }
- }
- );
-
- Tracer::inSpan(
- ['name' => 'include/people.php:idcard'],
- function () use (&$data) {
- global $settings;
-
- if ($_SESSION['camp']['idcard']) {
- foreach ($data as $key => $value);
- // if (file_exists($settings['upload_dir'].'/people/'.$data[$key]['id'].'.jpg')) {
- // $data[$key]['icons'] .= ' ';
- // }
+ // Prepare data
+ $daysinactive = db_value('SELECT delete_inactive_users/2 FROM camps WHERE id = '.$_SESSION['camp']['id']);
+
+ // Tracer::inSpan(
+ // ['name' => 'include/people.php:inactive'],
+ // function () use (&$data, $daysinactive) {
+ // global $listconfig;
+
+ foreach ($data as $key => $value) {
+ $created = new DateTime($data[$key]['created']);
+ $modified = is_null($data[$key]['modified']) ? new DateTime($data[$key]['created']) : new DateTime($data[$key]['modified']);
+ $last_activity = is_null($data[$key]['last_activity']) ? new DateTime($data[$key]['created']) : new DateTime($data[$key]['last_activity']);
+ $data[$key]['last_activity'] = $last_activity->format('Y-m-d');
+ $data[$key]['days_last_active'] = max($created, $modified, $last_activity)->diff(new DateTime())->format('%a');
+ $data[$key]['tokens'] = $data[$key]['level'] ? null : $data[$key]['tokens'];
+
+ if ($data[$key]['days_last_active'] > $daysinactive) {
+ $data[$key]['icons'] = ' ';
+ } else {
+ if ('inactive' == $listconfig['filtervalue3']) {
+ unset($data[$key]);
+
+ continue;
+ }
+ $data[$key]['icons'] = '';
+ }
+ }
+ // }
+ // );
+
+ // Tracer::inSpan(
+ // ['name' => 'include/people.php:approvalsigned_volunteer_unregistered'],
+ // function () use (&$data) {
+ foreach ($data as $key => $value) {
+ if (0 == $data[$key]['level'] && !$data[$key]['approvalsigned']) {
+ $data[$key]['icons'] .= ' ';
+ }
+ }
+ // }
+ // );
+
+ // Tracer::inSpan(
+ // ['name' => 'include/people.php:idcard'],
+ // function () use (&$data) {
+ // global $settings;
+
+ if ($_SESSION['camp']['idcard']) {
+ foreach ($data as $key => $value);
+ // if (file_exists($settings['upload_dir'].'/people/'.$data[$key]['id'].'.jpg')) {
+ // $data[$key]['icons'] .= ' ';
+ // }
+ }
+ // }
+ // );
+
+ // Tracer::inSpan(
+ // ['name' => 'include/people.php:idcard'],
+ // function () use (&$data) {
+ foreach ($data as $key => $value) {
+ if ($data[$key]['taglabels']) {
+ $taglabels = explode(chr(0x1D), (string) $data[$key]['taglabels']);
+ $tagcolors = explode(',', (string) $data[$key]['tagcolors']);
+ foreach ($taglabels as $tagkey => $taglabel) {
+ $data[$key]['tags'][$tagkey] = ['label' => $taglabel, 'color' => $tagcolors[$tagkey], 'textcolor' => get_text_color($tagcolors[$tagkey])];
+ }
+ }
+ }
+ // }
+ // );
+
+ // Tracer::inSpan(
+ // ['name' => 'people.php:addtemplatedata'],
+ // function () use ($cmsmain, $data) {
+ // global $listdata, $listdata, $listconfig;
+
+ // Pass information to template
+ $cmsmain->assign('data', $data);
+ $cmsmain->assign('listconfig', $listconfig);
+ $cmsmain->assign('listdata', $listdata);
+ $cmsmain->assign('include', 'cms_list.tpl');
+// }
+// );
+} else {
+ $valid_ids = array_column(db_array('SELECT id from people as p where p.camp_id = :camp_id', ['camp_id' => $_SESSION['camp']['id']]), 'id');
+ $ids = [];
+ if ('move' == $_POST['do']) { // move passes the ids in pairs with the level the id is moved to. Therefore, it needs to be handled differently.
+ foreach (json_decode((string) $_POST['ids']) as $pair) {
+ $ids[] = $pair[0];
+ }
+ } else {
+ $ids = explode(',', (string) $_POST['ids']);
+ }
+ $delta = array_diff($ids, $valid_ids);
+ if (0 != count($delta)) {
+ $message = 'You do not have access to this beneficiary record!';
+ trigger_error($message, E_USER_ERROR);
+ $success = false;
+ } else {
+ switch ($_POST['do']) {
+ case 'merge':
+ $ids = explode(',', (string) $_POST['ids']);
+ foreach ($ids as $key => $value) {
+ if (db_value('SELECT parent_id FROM people WHERE id = :id', ['id' => $value])) {
+ $containsmembers = true;
}
}
- );
-
- Tracer::inSpan(
- ['name' => 'include/people.php:idcard'],
- function () use (&$data) {
- foreach ($data as $key => $value) {
- if ($data[$key]['taglabels']) {
- $taglabels = explode(chr(0x1D), (string) $data[$key]['taglabels']);
- $tagcolors = explode(',', (string) $data[$key]['tagcolors']);
- foreach ($taglabels as $tagkey => $taglabel) {
- $data[$key]['tags'][$tagkey] = ['label' => $taglabel, 'color' => $tagcolors[$tagkey], 'textcolor' => get_text_color($tagcolors[$tagkey])];
+ if ($containsmembers) {
+ $message = 'Please select only individuals or family heads to merge';
+ $success = false;
+ } elseif (1 == count($ids)) {
+ $message = 'Please select more than one person to merge them into a family';
+ $success = false;
+ } else {
+ $oldest = db_value('SELECT id FROM people WHERE id IN ('.$_POST['ids'].') ORDER BY date_of_birth ASC LIMIT 1');
+ $extradrops = db_value('SELECT SUM(drops) FROM transactions WHERE people_id IN ('.$_POST['ids'].') AND people_id != :oldest', ['oldest' => $oldest]);
+ // Transaction block added over update queriesTransaction block added over update and insert queries
+ db_transaction(function () use ($ids, $oldest) {
+ foreach ($ids as $id) {
+ if ($id != $oldest) {
+ db_query('UPDATE people SET parent_id = :oldest WHERE id = :id', ['oldest' => $oldest, 'id' => $id]);
+ db_query('UPDATE transactions SET people_id = :oldest WHERE people_id = :id', ['oldest' => $oldest, 'id' => $id]);
}
}
- }
- }
- );
-
- Tracer::inSpan(
- ['name' => 'people.php:addtemplatedata'],
- function () use ($cmsmain, $data) {
- global $listdata, $listdata, $listconfig;
-
- // Pass information to template
- $cmsmain->assign('data', $data);
- $cmsmain->assign('listconfig', $listconfig);
- $cmsmain->assign('listdata', $listdata);
- $cmsmain->assign('include', 'cms_list.tpl');
+ });
+ $success = true;
+ $message = 'The merge has be successfully applied';
+ $redirect = true;
+ correctchildren();
}
- );
- } else {
- $valid_ids = array_column(db_array('SELECT id from people as p where p.camp_id = :camp_id', ['camp_id' => $_SESSION['camp']['id']]), 'id');
- $ids = [];
- if ('move' == $_POST['do']) { // move passes the ids in pairs with the level the id is moved to. Therefore, it needs to be handled differently.
- foreach (json_decode((string) $_POST['ids']) as $pair) {
- $ids[] = $pair[0];
- }
- } else {
- $ids = explode(',', (string) $_POST['ids']);
- }
- $delta = array_diff($ids, $valid_ids);
- if (0 != count($delta)) {
- $message = 'You do not have access to this beneficiary record!';
- trigger_error($message, E_USER_ERROR);
- $success = false;
- } else {
- switch ($_POST['do']) {
- case 'merge':
- $ids = explode(',', (string) $_POST['ids']);
- foreach ($ids as $key => $value) {
- if (db_value('SELECT parent_id FROM people WHERE id = :id', ['id' => $value])) {
- $containsmembers = true;
- }
- }
- if ($containsmembers) {
- $message = 'Please select only individuals or family heads to merge';
- $success = false;
- } elseif (1 == count($ids)) {
- $message = 'Please select more than one person to merge them into a family';
- $success = false;
- } else {
- $oldest = db_value('SELECT id FROM people WHERE id IN ('.$_POST['ids'].') ORDER BY date_of_birth ASC LIMIT 1');
- $extradrops = db_value('SELECT SUM(drops) FROM transactions WHERE people_id IN ('.$_POST['ids'].') AND people_id != :oldest', ['oldest' => $oldest]);
- // Transaction block added over update queriesTransaction block added over update and insert queries
- db_transaction(function () use ($ids, $oldest) {
- foreach ($ids as $id) {
- if ($id != $oldest) {
- db_query('UPDATE people SET parent_id = :oldest WHERE id = :id', ['oldest' => $oldest, 'id' => $id]);
- db_query('UPDATE transactions SET people_id = :oldest WHERE people_id = :id', ['oldest' => $oldest, 'id' => $id]);
- }
- }
- });
- $success = true;
- $message = 'The merge has be successfully applied';
- $redirect = true;
- correctchildren();
- }
- break;
+ break;
- case 'detach':
- $ids = explode(',', (string) $_POST['ids']);
- foreach ($ids as $key => $value) {
- if (!db_value('SELECT parent_id FROM people WHERE id = :id', ['id' => $value])) {
- $containsmembers = true;
- }
- }
- if ($containsmembers) {
- $message = 'Please select only members of a family, not family heads';
- $success = false;
- } else {
- // Transaction block added over update queries
- db_transaction(function () use ($ids) {
- foreach ($ids as $id) {
- db_query('UPDATE people SET parent_id = NULL WHERE id = :id', ['id' => $id]);
- }
- });
- $redirect = true;
- $success = true;
- $message = ($success) ? 'Selected people have been detached' : 'Something went wrong';
+ case 'detach':
+ $ids = explode(',', (string) $_POST['ids']);
+ foreach ($ids as $key => $value) {
+ if (!db_value('SELECT parent_id FROM people WHERE id = :id', ['id' => $value])) {
+ $containsmembers = true;
+ }
+ }
+ if ($containsmembers) {
+ $message = 'Please select only members of a family, not family heads';
+ $success = false;
+ } else {
+ // Transaction block added over update queries
+ db_transaction(function () use ($ids) {
+ foreach ($ids as $id) {
+ db_query('UPDATE people SET parent_id = NULL WHERE id = :id', ['id' => $id]);
}
+ });
+ $redirect = true;
+ $success = true;
+ $message = ($success) ? 'Selected people have been detached' : 'Something went wrong';
+ }
- break;
+ break;
- case 'give':
- $ids = $_POST['ids'];
- $success = true;
- $redirect = '?action=give&ids='.$ids;
+ case 'give':
+ $ids = $_POST['ids'];
+ $success = true;
+ $redirect = '?action=give&ids='.$ids;
- break;
+ break;
- case 'move':
- $ids = json_decode((string) $_POST['ids']);
- // list($success, $message, $redirect, $aftermove) = listMove($table, $ids, true, 'correctdrops');
- // Refactored list move method to use a transaction block and bulk insert for the correctdrops method
- [$success, $message, $redirect, $aftermove] = listBulkMove($table, $ids, true, 'bulkcorrectdrops', true);
+ case 'move':
+ $ids = json_decode((string) $_POST['ids']);
+ // list($success, $message, $redirect, $aftermove) = listMove($table, $ids, true, 'correctdrops');
+ // Refactored list move method to use a transaction block and bulk insert for the correctdrops method
+ [$success, $message, $redirect, $aftermove] = listBulkMove($table, $ids, true, 'bulkcorrectdrops', true);
- break;
+ break;
- case 'delete':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listDelete($table, $ids);
+ case 'delete':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listDelete($table, $ids);
- break;
+ break;
- case 'copy':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listCopy($table, $ids, 'name');
+ case 'copy':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listCopy($table, $ids, 'name');
- break;
+ break;
- case 'hide':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listShowHide($table, $ids, 0);
+ case 'hide':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listShowHide($table, $ids, 0);
- break;
+ break;
- case 'show':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listShowHide($table, $ids, 1);
+ case 'show':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listShowHide($table, $ids, 1);
- break;
+ break;
- case 'touch':
- $ids = explode(',', (string) $_POST['ids']);
- $userId = $_SESSION['user']['id'];
- // Query speed optimised for 500 records from 6.2 seconds to 0.54 seconds using transaction blocks over UPDATE and bulk inserts
- db_transaction(function () use ($ids, $userId) {
- foreach ($ids as $id) {
- db_query('UPDATE people SET modified = NOW(), modified_by = :user WHERE id = :id', ['id' => $id, 'user' => $userId]);
+ case 'touch':
+ $ids = explode(',', (string) $_POST['ids']);
+ $userId = $_SESSION['user']['id'];
+ // Query speed optimised for 500 records from 6.2 seconds to 0.54 seconds using transaction blocks over UPDATE and bulk inserts
+ db_transaction(function () use ($ids, $userId) {
+ foreach ($ids as $id) {
+ db_query('UPDATE people SET modified = NOW(), modified_by = :user WHERE id = :id', ['id' => $id, 'user' => $userId]);
+ }
+ });
+ // Bulk insert used to insert into history table
+ simpleBulkSaveChangeHistory('people', $ids, 'Touched');
+
+ $success = true;
+ $message = 'Selected people have been touched';
+ $redirect = false;
+
+ break;
+
+ case 'print':
+ $success = true;
+ $redirect = '/pdf/'.$_POST['option'].'card.php?id='.$_POST['ids'];
+
+ break;
+
+ case 'export':
+ $success = true;
+ $_SESSION['export_ids_people'] = $_POST['ids'];
+ $redirect = '?action=people_export';
+
+ break;
+
+ case 'tag':
+ if ('undefined' == $_POST['option']) {
+ $success = false;
+ $message = 'No tags exist. Please go to "Manage tags" to create tags.';
+ $redirect = false;
+ } else {
+ // set tag id
+ $tag_id = $_POST['option'];
+ $people_ids = $ids ?? [];
+ if (sizeof($people_ids) > 0) {
+ // Query speed optimised for 500 records from 3.2 seconds to 0.039 seconds using bulk inserts
+ $query = 'INSERT IGNORE INTO tags_relations (tag_id, object_type, `object_id`) VALUES ';
+
+ $params = [];
+
+ for ($i = 0; $i < sizeof($people_ids); ++$i) {
+ $query .= "(:tag_id, 'People', :people_id{$i})";
+ $params = array_merge($params, ['people_id'.$i => $people_ids[$i]]);
+ if ($i !== sizeof($people_ids) - 1) {
+ $query .= ',';
}
- });
- // Bulk insert used to insert into history table
- simpleBulkSaveChangeHistory('people', $ids, 'Touched');
-
- $success = true;
- $message = 'Selected people have been touched';
- $redirect = false;
+ }
- break;
+ $params = array_merge($params, ['tag_id' => $tag_id]);
+ db_query($query, $params);
- case 'print':
$success = true;
- $redirect = '/pdf/'.$_POST['option'].'card.php?id='.$_POST['ids'];
-
- break;
+ $message = 'Tags added';
+ $redirect = true;
+ } else {
+ $success = false;
+ $message = 'To apply the tag, the beneficiary must be checked';
+ $redirect = false;
+ }
+ }
- case 'export':
- $success = true;
- $_SESSION['export_ids_people'] = $_POST['ids'];
- $redirect = '?action=people_export';
-
- break;
-
- case 'tag':
- if ('undefined' == $_POST['option']) {
- $success = false;
- $message = 'No tags exist. Please go to "Manage tags" to create tags.';
- $redirect = false;
- } else {
- // set tag id
- $tag_id = $_POST['option'];
- $people_ids = $ids ?? [];
- if (sizeof($people_ids) > 0) {
- // Query speed optimised for 500 records from 3.2 seconds to 0.039 seconds using bulk inserts
- $query = 'INSERT IGNORE INTO tags_relations (tag_id, object_type, `object_id`) VALUES ';
-
- $params = [];
-
- for ($i = 0; $i < sizeof($people_ids); ++$i) {
- $query .= "(:tag_id, 'People', :people_id{$i})";
- $params = array_merge($params, ['people_id'.$i => $people_ids[$i]]);
- if ($i !== sizeof($people_ids) - 1) {
- $query .= ',';
- }
- }
-
- $params = array_merge($params, ['tag_id' => $tag_id]);
- db_query($query, $params);
-
- $success = true;
- $message = 'Tags added';
- $redirect = true;
- } else {
- $success = false;
- $message = 'To apply the tag, the beneficiary must be checked';
- $redirect = false;
+ break;
+
+ case 'rtag':
+ if ('undefined' == $_POST['option']) {
+ $success = false;
+ $message = 'No tags exist. Please go to "Manage tags" to create tags.';
+ $redirect = false;
+ } else {
+ // set tag id
+ $tag_id = $_POST['option'];
+ $people_ids = $ids;
+ if (is_array($people_ids) && sizeof($people_ids) > 0) {
+ // Query speed optimised using transaction block and bulk delete
+ // related to this trello card https://trello.com/c/g24mIVb8
+ db_transaction(function () use ($tag_id, $people_ids) {
+ $deleteClause = [];
+ foreach ($people_ids as $people_id) {
+ $deleteClause[] = sprintf('(%d, "%s", %d)', $tag_id, 'People', $people_id);
}
- }
-
- break;
-
- case 'rtag':
- if ('undefined' == $_POST['option']) {
- $success = false;
- $message = 'No tags exist. Please go to "Manage tags" to create tags.';
- $redirect = false;
- } else {
- // set tag id
- $tag_id = $_POST['option'];
- $people_ids = $ids;
- if (is_array($people_ids) && sizeof($people_ids) > 0) {
- // Query speed optimised using transaction block and bulk delete
- // related to this trello card https://trello.com/c/g24mIVb8
- db_transaction(function () use ($tag_id, $people_ids) {
- $deleteClause = [];
- foreach ($people_ids as $people_id) {
- $deleteClause[] = sprintf('(%d, "%s", %d)', $tag_id, 'People', $people_id);
- }
- if (sizeof($deleteClause) > 0) {
- db_query('DELETE FROM tags_relations WHERE (tag_id, object_type, `object_id`) IN ('.join(',', $deleteClause).')');
- }
- });
- $success = true;
- $message = 'Tags removed';
- $redirect = true;
- } else {
- $success = false;
- $message = 'To remove the tag, the beneficiary must be checked';
- $redirect = false;
+ if (sizeof($deleteClause) > 0) {
+ db_query('DELETE FROM tags_relations WHERE (tag_id, object_type, `object_id`) IN ('.join(',', $deleteClause).')');
}
- }
-
- break;
+ });
+ $success = true;
+ $message = 'Tags removed';
+ $redirect = true;
+ } else {
+ $success = false;
+ $message = 'To remove the tag, the beneficiary must be checked';
+ $redirect = false;
+ }
}
- }
- $return = ['success' => $success, 'message' => $message, 'redirect' => $redirect, 'action' => $aftermove];
-
- echo json_encode($return);
-
- exit;
+ break;
}
}
-);
+
+ $return = ['success' => $success, 'message' => $message, 'redirect' => $redirect, 'action' => $aftermove];
+
+ echo json_encode($return);
+
+ exit;
+}
+// }
+// );
function correctchildren()
{
diff --git a/include/people_deactivated.php b/include/people_deactivated.php
index f1baaef8..8516798c 100644
--- a/include/people_deactivated.php
+++ b/include/people_deactivated.php
@@ -1,6 +1,6 @@
'fa-trash', 'oneitemonly' => false, 'confirm' => true, 'testId' => 'fullDeleteUser']);
addcolumn('html', ' ', 'icons');
- Tracer::inSpan(
- ['name' => 'include/people_deactivated.php:hasActiveParent'],
- function () use (&$data) {
- global $settings;
+ // Tracer::inSpan(
+ // ['name' => 'include/people_deactivated.php:hasActiveParent'],
+ // function () use (&$data) {
+ // global $settings;
- foreach ($data as $key => $value) {
- if ('1' == $data[$key]['has_not_active_parent']) {
- $data[$key]['icons'] .= sprintf('', $data[$key]['firstname'].' '.$data[$key]['lastname'], $data[$key]['family_head']);
- }
- }
+ foreach ($data as $key => $value) {
+ if ('1' == $data[$key]['has_not_active_parent']) {
+ $data[$key]['icons'] .= sprintf('', $data[$key]['firstname'].' '.$data[$key]['lastname'], $data[$key]['family_head']);
}
- );
+ }
+ // }
+ // );
$cmsmain->assign('data', $data);
$cmsmain->assign('listconfig', $listconfig);
$cmsmain->assign('listdata', $listdata);
diff --git a/include/stock.php b/include/stock.php
index bebf8ebc..f464b09f 100644
--- a/include/stock.php
+++ b/include/stock.php
@@ -1,76 +1,76 @@
'stock.php'],
- function () use ($action, &$cmsmain) {
- global $table, $listconfig, $listdata;
-
- $table = $action;
- $ajax = checkajax();
-
- if (!$ajax) {
- initlist();
- listsetting('manualquery', true);
-
- // title
- $cmsmain->assign('title', 'Manage Boxes');
-
- // search box
- listsetting('search', ['box_id', 'l.label', 's.label', 'g.label', 'p.name', 'stock.comments']);
-
- // Location filter
- listfilter(['label' => 'By Location', 'query' => 'SELECT id, label FROM locations WHERE deleted IS NULL AND locations.box_state_id IN (1,5) AND camp_id = '.$_SESSION['camp']['id'].' AND type = "Warehouse" ORDER BY seq', 'filter' => 'l.id']);
-
- // Status Filter
- $statusarray = [
- 'in_stock' => 'In Stock',
- 'all' => 'All Box States',
- 'donated' => 'Donated',
- 'lost' => 'Lost',
- 'scrap' => 'Scrap',
- // 'marked_for_shipment' => 'Marked for Shipment',
- 'dispose' => 'Untouched for 3 months',
- ];
- listfilter2(['label' => 'Boxes', 'options' => $statusarray, 'filter' => '"show"']);
- // Set filter to InStock by default
- if (!isset($listconfig['filtervalue2'])) {
- $listconfig['filtervalue2'] = 'in_stock';
- }
+// use OpenCensus\Trace\Tracer;
+
+// Tracer::inSpan(
+// ['name' => 'stock.php'],
+// function () use ($action, &$cmsmain) {
+// global $table, $listconfig, $listdata;
+
+$table = $action;
+$ajax = checkajax();
+
+if (!$ajax) {
+ initlist();
+ listsetting('manualquery', true);
+
+ // title
+ $cmsmain->assign('title', 'Manage Boxes');
+
+ // search box
+ listsetting('search', ['box_id', 'l.label', 's.label', 'g.label', 'p.name', 'stock.comments']);
+
+ // Location filter
+ listfilter(['label' => 'By Location', 'query' => 'SELECT id, label FROM locations WHERE deleted IS NULL AND locations.box_state_id IN (1,5) AND camp_id = '.$_SESSION['camp']['id'].' AND type = "Warehouse" ORDER BY seq', 'filter' => 'l.id']);
+
+ // Status Filter
+ $statusarray = [
+ 'in_stock' => 'In Stock',
+ 'all' => 'All Box States',
+ 'donated' => 'Donated',
+ 'lost' => 'Lost',
+ 'scrap' => 'Scrap',
+ // 'marked_for_shipment' => 'Marked for Shipment',
+ 'dispose' => 'Untouched for 3 months',
+ ];
+ listfilter2(['label' => 'Boxes', 'options' => $statusarray, 'filter' => '"show"']);
+ // Set filter to InStock by default
+ if (!isset($listconfig['filtervalue2'])) {
+ $listconfig['filtervalue2'] = 'in_stock';
+ }
- function get_filter2_query($applied_filter)
- {
- return match ($applied_filter) {
- 'in_stock' => ' AND stock.box_state_id = 1 ',
- 'all' => ' ',
- 'donated' => ' AND stock.box_state_id = 5',
- 'lost' => ' AND stock.box_state_id = 2',
- 'scrap' => ' AND stock.box_state_id = 6',
- 'marked_for_shipment' => ' AND stock.box_state_id = 3',
- 'dispose' => ' AND DATEDIFF(now(),stock.modified) > 90 AND stock.box_state_id = 1',
- default => ' AND stock.box_state_id = 1',
- };
- }
- $applied_filter2_query = get_filter2_query($_SESSION['filter2']['stock']);
+ function get_filter2_query($applied_filter)
+ {
+ return match ($applied_filter) {
+ 'in_stock' => ' AND stock.box_state_id = 1 ',
+ 'all' => ' ',
+ 'donated' => ' AND stock.box_state_id = 5',
+ 'lost' => ' AND stock.box_state_id = 2',
+ 'scrap' => ' AND stock.box_state_id = 6',
+ 'marked_for_shipment' => ' AND stock.box_state_id = 3',
+ 'dispose' => ' AND DATEDIFF(now(),stock.modified) > 90 AND stock.box_state_id = 1',
+ default => ' AND stock.box_state_id = 1',
+ };
+ }
+ $applied_filter2_query = get_filter2_query($_SESSION['filter2']['stock']);
- // Gender Filter
- $genders = db_simplearray('SELECT id AS value, label FROM genders ORDER BY seq');
- listfilter3(['label' => 'Gender', 'options' => $genders, 'filter' => '"s.gender_id"']);
+ // Gender Filter
+ $genders = db_simplearray('SELECT id AS value, label FROM genders ORDER BY seq');
+ listfilter3(['label' => 'Gender', 'options' => $genders, 'filter' => '"s.gender_id"']);
- // Category Filter
- $itemlist = db_simplearray('SELECT pc.id, pc.label from products AS p INNER JOIN product_categories AS pc ON pc.id = p.category_id WHERE (camp_id = '.$_SESSION['camp']['id'].')');
- listfilter4(['label' => 'Category', 'options' => $itemlist, 'filter' => 'p.category_id']);
+ // Category Filter
+ $itemlist = db_simplearray('SELECT pc.id, pc.label from products AS p INNER JOIN product_categories AS pc ON pc.id = p.category_id WHERE (camp_id = '.$_SESSION['camp']['id'].')');
+ listfilter4(['label' => 'Category', 'options' => $itemlist, 'filter' => 'p.category_id']);
- // Tag Filter
- $tags = db_simplearray('SELECT id, label FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND `type` IN ("All", "Stock") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']]);
- if (!empty($tags)) {
- $tagfilter = ['id' => 'tagfilter', 'placeholder' => 'Tag filter', 'options' => db_array('SELECT id, id AS value, label, color FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND `type` in ("All","Stock") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']])];
- listsetting('multiplefilter', $tagfilter);
- }
+ // Tag Filter
+ $tags = db_simplearray('SELECT id, label FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND `type` IN ("All", "Stock") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']]);
+ if (!empty($tags)) {
+ $tagfilter = ['id' => 'tagfilter', 'placeholder' => 'Tag filter', 'options' => db_array('SELECT id, id AS value, label, color FROM tags WHERE camp_id = :camp_id AND deleted IS NULL AND `type` in ("All","Stock") ORDER BY seq', ['camp_id' => $_SESSION['camp']['id']])];
+ listsetting('multiplefilter', $tagfilter);
+ }
- // Note for boxage: same day creation gets logged as 0 days
- $query = '
+ // Note for boxage: same day creation gets logged as 0 days
+ $query = '
SELECT
stock_filtered.*,
GROUP_CONCAT(tags.label ORDER BY tags.seq SEPARATOR 0x1D) AS taglabels,
@@ -85,8 +85,8 @@ function get_filter2_query($applied_filter)
stock.box_state_id IN (3,4,7,8) AS disableifistrue
FROM
stock '.
- // Join tags here only if a tag filter is selected and only boxes with a certain tag should be returned
- ($listconfig['multiplefilter_selected'] ? '
+ // Join tags here only if a tag filter is selected and only boxes with a certain tag should be returned
+ ($listconfig['multiplefilter_selected'] ? '
LEFT JOIN
tags_relations AS stock_tags_filter ON stock_tags_filter.object_id = stock.id AND stock_tags_filter.object_type = "Stock"
LEFT JOIN
@@ -104,16 +104,16 @@ function get_filter2_query($applied_filter)
(NOT stock.deleted OR stock.deleted IS NULL) AND
l.camp_id = '.$_SESSION['camp']['id'].
- ($listconfig['searchvalue'] ? ' AND (box_id LIKE "%'.$listconfig['searchvalue'].'%" OR l.label LIKE "%'.$listconfig['searchvalue'].'%" OR s.label LIKE "%'.$listconfig['searchvalue'].'%" OR g.label LIKE "%'.$listconfig['searchvalue'].'%" OR p.name LIKE "%'.$listconfig['searchvalue'].'%" OR stock.comments LIKE "%'.$listconfig['searchvalue'].'%")' : '').
+ ($listconfig['searchvalue'] ? ' AND (box_id LIKE "%'.$listconfig['searchvalue'].'%" OR l.label LIKE "%'.$listconfig['searchvalue'].'%" OR s.label LIKE "%'.$listconfig['searchvalue'].'%" OR g.label LIKE "%'.$listconfig['searchvalue'].'%" OR p.name LIKE "%'.$listconfig['searchvalue'].'%" OR stock.comments LIKE "%'.$listconfig['searchvalue'].'%")' : '').
- $applied_filter2_query.
+ $applied_filter2_query.
- ($_SESSION['filter3']['stock'] ? ' AND (p.gender_id = '.intval($_SESSION['filter3']['stock']).')' : '').
+ ($_SESSION['filter3']['stock'] ? ' AND (p.gender_id = '.intval($_SESSION['filter3']['stock']).')' : '').
- ($_SESSION['filter']['stock'] ? ' AND (stock.location_id = '.$_SESSION['filter']['stock'].')' : '').
- ($_SESSION['filter4']['stock'] ? ' AND (p.category_id = '.$_SESSION['filter4']['stock'].')' : '').
- // filter for boxes tags
- ($listconfig['multiplefilter_selected'] ? ' AND tags_filter.id IN ('.implode(',', $listconfig['multiplefilter_selected']).') ' : '').'
+ ($_SESSION['filter']['stock'] ? ' AND (stock.location_id = '.$_SESSION['filter']['stock'].')' : '').
+ ($_SESSION['filter4']['stock'] ? ' AND (p.category_id = '.$_SESSION['filter4']['stock'].')' : '').
+ // filter for boxes tags
+ ($listconfig['multiplefilter_selected'] ? ' AND tags_filter.id IN ('.implode(',', $listconfig['multiplefilter_selected']).') ' : '').'
GROUP BY
stock.id ) AS stock_filtered
LEFT JOIN
@@ -123,62 +123,62 @@ function get_filter2_query($applied_filter)
GROUP BY
stock_filtered.id
';
- $data = getlistdata($query);
-
- $totalboxes = 0;
- $totalitems = 0;
- foreach ($data as $key => $value) {
- if (3 == $data[$key]['box_state_id']) {
- $data[$key]['order'] = '1';
- } elseif (in_array(intval($data[$key]['box_state_id']), [4, 7])) {
- $data[$key]['order'] = '2';
- } elseif (in_array(intval($data[$key]['box_state_id']), [2, 6])) {
- $modifiedtext = $data[$key]['modified'] ? 'on '.(string) $data[$key]['modified']?->format('d-m-Y') : '';
- $icon = 2 === intval($data[$key]['box_state_id']) ? 'fa-ban' : 'fa-chain-broken';
- $statelabel = 2 === intval($data[$key]['box_state_id']) ? 'lost' : 'scrapped';
- $data[$key]['order'] = sprintf('3', $icon, $statelabel, $modifiedtext);
- } else {
- $data[$key]['order'] = '0';
- }
- ++$totalboxes;
- $totalitems += $value['items'];
-
- if ($data[$key]['taglabels']) {
- $taglabels = explode(chr(0x1D), (string) $data[$key]['taglabels']);
- $tagcolors = explode(',', (string) $data[$key]['tagcolors']);
- foreach ($taglabels as $tagkey => $taglabel) {
- $data[$key]['tags'][$tagkey] = ['label' => $taglabel, 'color' => $tagcolors[$tagkey], 'textcolor' => get_text_color($tagcolors[$tagkey])];
- }
- }
-
- // TODO add link to new app
- // $data[$key]['href'] = $settings['v2_base_url'].'/bases/'.$_SESSION['camp']['id'].'/boxes/'.$data[$key]['box_id'];
+ $data = getlistdata($query);
+
+ $totalboxes = 0;
+ $totalitems = 0;
+ foreach ($data as $key => $value) {
+ if (3 == $data[$key]['box_state_id']) {
+ $data[$key]['order'] = '1';
+ } elseif (in_array(intval($data[$key]['box_state_id']), [4, 7])) {
+ $data[$key]['order'] = '2';
+ } elseif (in_array(intval($data[$key]['box_state_id']), [2, 6])) {
+ $modifiedtext = $data[$key]['modified'] ? 'on '.(string) $data[$key]['modified']?->format('d-m-Y') : '';
+ $icon = 2 === intval($data[$key]['box_state_id']) ? 'fa-ban' : 'fa-chain-broken';
+ $statelabel = 2 === intval($data[$key]['box_state_id']) ? 'lost' : 'scrapped';
+ $data[$key]['order'] = sprintf('3', $icon, $statelabel, $modifiedtext);
+ } else {
+ $data[$key]['order'] = '0';
+ }
+ ++$totalboxes;
+ $totalitems += $value['items'];
+
+ if ($data[$key]['taglabels']) {
+ $taglabels = explode(chr(0x1D), (string) $data[$key]['taglabels']);
+ $tagcolors = explode(',', (string) $data[$key]['tagcolors']);
+ foreach ($taglabels as $tagkey => $taglabel) {
+ $data[$key]['tags'][$tagkey] = ['label' => $taglabel, 'color' => $tagcolors[$tagkey], 'textcolor' => get_text_color($tagcolors[$tagkey])];
}
+ }
- addcolumn('text', 'Box ID', 'box_id');
- addcolumn('text', 'Product', 'product');
- addcolumn('text', 'Gender', 'gender');
- addcolumn('text', 'Size', 'size');
- if (!empty($tags)) {
- addcolumn('tag', 'Tags', 'tags');
- }
- addcolumn('text', 'Comments', 'shortcomment');
- addcolumn('text', 'Items', 'items');
- addcolumn('text', 'Location', 'location');
- addcolumn('text', 'Age', 'boxage');
- addcolumn('html', ' ', 'order');
-
- listsetting('allowsort', true);
- listsetting('allowcopy', false);
- listsetting('add', 'Add');
-
- // TODO enable forward to new app only for beta users
- // if (in_array('beta_user', $_SESSION['auth0_user'][$settings['jwt_claim_prefix'].'/roles'])) {
- // listsetting('beta_box_view_edit', true);
- // }
-
- // related to https://trello.com/c/Ci74t1Wj
- $locations = db_simplearray('SELECT
+ // TODO add link to new app
+ // $data[$key]['href'] = $settings['v2_base_url'].'/bases/'.$_SESSION['camp']['id'].'/boxes/'.$data[$key]['box_id'];
+ }
+
+ addcolumn('text', 'Box ID', 'box_id');
+ addcolumn('text', 'Product', 'product');
+ addcolumn('text', 'Gender', 'gender');
+ addcolumn('text', 'Size', 'size');
+ if (!empty($tags)) {
+ addcolumn('tag', 'Tags', 'tags');
+ }
+ addcolumn('text', 'Comments', 'shortcomment');
+ addcolumn('text', 'Items', 'items');
+ addcolumn('text', 'Location', 'location');
+ addcolumn('text', 'Age', 'boxage');
+ addcolumn('html', ' ', 'order');
+
+ listsetting('allowsort', true);
+ listsetting('allowcopy', false);
+ listsetting('add', 'Add');
+
+ // TODO enable forward to new app only for beta users
+ // if (in_array('beta_user', $_SESSION['auth0_user'][$settings['jwt_claim_prefix'].'/roles'])) {
+ // listsetting('beta_box_view_edit', true);
+ // }
+
+ // related to https://trello.com/c/Ci74t1Wj
+ $locations = db_simplearray('SELECT
l.id AS value, if(l.box_state_id <> 1, concat(l.label," - Boxes are ",bs.label),l.label) as label
FROM
locations l
@@ -187,184 +187,184 @@ function get_filter2_query($applied_filter)
l.deleted IS NULL AND l.camp_id = '.$_SESSION['camp']['id'].'
AND l.type = "Warehouse"
ORDER BY l.seq');
- addbutton('export', 'Export', ['icon' => 'fa-download', 'showalways' => false]);
- if (!empty($tags)) {
- addbutton('tag', 'Add Tag', ['icon' => 'fa-tag', 'options' => $tags]);
- addbutton('rtag', 'Remove Tag', ['icon' => 'fa-tags', 'options' => $tags]);
- }
- addbutton('movebox', 'Move', ['icon' => 'fa-truck', 'options' => $locations, 'disableif' => true]);
- addbutton('qr', 'Make label', ['icon' => 'fa-print']);
+ addbutton('export', 'Export', ['icon' => 'fa-download', 'showalways' => false]);
+ if (!empty($tags)) {
+ addbutton('tag', 'Add Tag', ['icon' => 'fa-tag', 'options' => $tags]);
+ addbutton('rtag', 'Remove Tag', ['icon' => 'fa-tags', 'options' => $tags]);
+ }
+ addbutton('movebox', 'Move', ['icon' => 'fa-truck', 'options' => $locations, 'disableif' => true]);
+ addbutton('qr', 'Make label', ['icon' => 'fa-print']);
- $cmsmain->assign('firstline', ['Total', $totalboxes.' boxes', $totalitems.' items', '', '', '', '', '', '', '']);
- $cmsmain->assign('listfooter', ['Total', $totalboxes.' boxes', $totalitems.' items', '', '', '', '', '', '', '']);
+ $cmsmain->assign('firstline', ['Total', $totalboxes.' boxes', $totalitems.' items', '', '', '', '', '', '', '']);
+ $cmsmain->assign('listfooter', ['Total', $totalboxes.' boxes', $totalitems.' items', '', '', '', '', '', '', '']);
- $cmsmain->assign('data', $data);
- $cmsmain->assign('listconfig', $listconfig);
- $cmsmain->assign('listdata', $listdata);
- $cmsmain->assign('include', 'cms_list.tpl');
- } else {
- switch ($_POST['do']) {
- case 'movebox':
- // @todo: replace signle update/insert to bulk update/insert
+ $cmsmain->assign('data', $data);
+ $cmsmain->assign('listconfig', $listconfig);
+ $cmsmain->assign('listdata', $listdata);
+ $cmsmain->assign('include', 'cms_list.tpl');
+} else {
+ switch ($_POST['do']) {
+ case 'movebox':
+ // @todo: replace signle update/insert to bulk update/insert
- $ids = explode(',', (string) $_POST['ids']);
+ $ids = explode(',', (string) $_POST['ids']);
- [$count, $message] = move_boxes($ids, $_POST['option']);
+ [$count, $message] = move_boxes($ids, $_POST['option']);
- $success = $count;
- $redirect = '?action='.$_GET['action'];
+ $success = $count;
+ $redirect = '?action='.$_GET['action'];
- break;
+ break;
- case 'qr':
- $id = $_POST['ids'];
- $redirect = '/pdf/qr.php?label='.$id;
+ case 'qr':
+ $id = $_POST['ids'];
+ $redirect = '/pdf/qr.php?label='.$id;
- break;
+ break;
- case 'move':
- $ids = json_decode((string) $_POST['ids']);
- [$success, $message, $redirect] = listMove($table, $ids);
+ case 'move':
+ $ids = json_decode((string) $_POST['ids']);
+ [$success, $message, $redirect] = listMove($table, $ids);
- break;
+ break;
- case 'delete':
- $stock_ids = explode(',', (string) $_POST['ids']) ?? [];
- [$success, $message, $redirect] = db_transaction(function () use ($table, $stock_ids) {
- [$success, $message, $redirect] = listDelete($table, $stock_ids);
+ case 'delete':
+ $stock_ids = explode(',', (string) $_POST['ids']) ?? [];
+ [$success, $message, $redirect] = db_transaction(function () use ($table, $stock_ids) {
+ [$success, $message, $redirect] = listDelete($table, $stock_ids);
- $params = [];
- $query = 'DELETE FROM tags_relations WHERE object_type = "Stock" AND (`object_id`) IN (';
- foreach ($stock_ids as $index => $stock_id) {
- $query .= sprintf(' (:stock_id_%s) ', $index);
+ $params = [];
+ $query = 'DELETE FROM tags_relations WHERE object_type = "Stock" AND (`object_id`) IN (';
+ foreach ($stock_ids as $index => $stock_id) {
+ $query .= sprintf(' (:stock_id_%s) ', $index);
- if (sizeof($stock_ids) - 1 !== $index) {
- $query .= ', ';
- } else {
- $query .= ') ';
- }
+ if (sizeof($stock_ids) - 1 !== $index) {
+ $query .= ', ';
+ } else {
+ $query .= ') ';
+ }
- $params = array_merge($params, ['stock_id_'.$index => $stock_id]);
- }
- if (sizeof($params) > 0) {
- db_query($query, $params);
- }
+ $params = array_merge($params, ['stock_id_'.$index => $stock_id]);
+ }
+ if (sizeof($params) > 0) {
+ db_query($query, $params);
+ }
- return [$success, $message, $redirect];
- });
+ return [$success, $message, $redirect];
+ });
- break;
+ break;
- case 'copy':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listCopy($table, $ids, 'menutitle');
+ case 'copy':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listCopy($table, $ids, 'menutitle');
- break;
+ break;
- case 'hide':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listShowHide($table, $ids, 0);
+ case 'hide':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listShowHide($table, $ids, 0);
- break;
+ break;
- case 'show':
- $ids = explode(',', (string) $_POST['ids']);
- [$success, $message, $redirect] = listShowHide($table, $ids, 1);
+ case 'show':
+ $ids = explode(',', (string) $_POST['ids']);
+ [$success, $message, $redirect] = listShowHide($table, $ids, 1);
- break;
+ break;
- case 'export':
- $_SESSION['export_ids_stock'] = $_POST['ids'];
- [$success, $message, $redirect] = [true, '', '?action=stock_export'];
+ case 'export':
+ $_SESSION['export_ids_stock'] = $_POST['ids'];
+ [$success, $message, $redirect] = [true, '', '?action=stock_export'];
- break;
+ break;
- case 'tag':
- $ids = explode(',', (string) $_POST['ids']);
- if ('undefined' == $_POST['option']) {
- $success = false;
- $message = 'No tags exist. Please go to "Manage tags" to create tags.';
- $redirect = false;
- } else {
- // set tag id
- $tag_id = $_POST['option'];
- $stock_ids = $ids;
- if (is_array($stock_ids) && sizeof($stock_ids) > 0) {
- // Query speed optimised for 500 records from 3.2 seconds to 0.039 seconds using bulk inserts
- $query = 'INSERT IGNORE INTO tags_relations (tag_id, object_type, `object_id`) VALUES ';
-
- $params = [];
-
- for ($i = 0; $i < sizeof($stock_ids); ++$i) {
- $query .= "(:tag_id, 'Stock', :stock_id{$i})";
- $params = array_merge($params, ['stock_id'.$i => $stock_ids[$i]]);
- if ($i !== sizeof($stock_ids) - 1) {
- $query .= ',';
- }
- }
+ case 'tag':
+ $ids = explode(',', (string) $_POST['ids']);
+ if ('undefined' == $_POST['option']) {
+ $success = false;
+ $message = 'No tags exist. Please go to "Manage tags" to create tags.';
+ $redirect = false;
+ } else {
+ // set tag id
+ $tag_id = $_POST['option'];
+ $stock_ids = $ids;
+ if (is_array($stock_ids) && sizeof($stock_ids) > 0) {
+ // Query speed optimised for 500 records from 3.2 seconds to 0.039 seconds using bulk inserts
+ $query = 'INSERT IGNORE INTO tags_relations (tag_id, object_type, `object_id`) VALUES ';
- $params = array_merge($params, ['tag_id' => $tag_id]);
- db_query($query, $params);
+ $params = [];
- $success = true;
- $message = 'Tags added';
- $redirect = true;
- } else {
- $success = false;
- $message = 'To apply the tag, the beneficiary must be checked';
- $redirect = false;
+ for ($i = 0; $i < sizeof($stock_ids); ++$i) {
+ $query .= "(:tag_id, 'Stock', :stock_id{$i})";
+ $params = array_merge($params, ['stock_id'.$i => $stock_ids[$i]]);
+ if ($i !== sizeof($stock_ids) - 1) {
+ $query .= ',';
}
}
- break;
+ $params = array_merge($params, ['tag_id' => $tag_id]);
+ db_query($query, $params);
- case 'rtag':
- $ids = explode(',', (string) $_POST['ids']);
- if ('undefined' == $_POST['option']) {
- $success = false;
- $message = 'No tags exist. Please go to "Manage tags" to create tags.';
- $redirect = false;
- } else {
- // set tag id
- $tag_id = $_POST['option'];
- $stock_ids = $ids;
- if (is_array($stock_ids) && sizeof($stock_ids) > 0) {
- db_transaction(function () use ($tag_id, $stock_ids) {
- $query = 'DELETE FROM tags_relations WHERE object_type = "Stock" AND (tag_id, `object_id`) IN (';
-
- $params = [];
-
- for ($i = 0; $i < sizeof($stock_ids); ++$i) {
- $query .= "(:tag_id, :stock_id{$i})";
- $params = array_merge($params, ['stock_id'.$i => $stock_ids[$i]]);
- if ($i !== sizeof($stock_ids) - 1) {
- $query .= ',';
- } else {
- $query .= ')';
- }
- }
-
- $params = array_merge($params, ['tag_id' => $tag_id]);
- db_query($query, $params);
- });
- $success = true;
- $message = 'Tags removed';
- $redirect = true;
- } else {
- $success = false;
- $message = 'To remove the tag, the boxes must be checked';
- $redirect = false;
+ $success = true;
+ $message = 'Tags added';
+ $redirect = true;
+ } else {
+ $success = false;
+ $message = 'To apply the tag, the beneficiary must be checked';
+ $redirect = false;
+ }
+ }
+
+ break;
+
+ case 'rtag':
+ $ids = explode(',', (string) $_POST['ids']);
+ if ('undefined' == $_POST['option']) {
+ $success = false;
+ $message = 'No tags exist. Please go to "Manage tags" to create tags.';
+ $redirect = false;
+ } else {
+ // set tag id
+ $tag_id = $_POST['option'];
+ $stock_ids = $ids;
+ if (is_array($stock_ids) && sizeof($stock_ids) > 0) {
+ db_transaction(function () use ($tag_id, $stock_ids) {
+ $query = 'DELETE FROM tags_relations WHERE object_type = "Stock" AND (tag_id, `object_id`) IN (';
+
+ $params = [];
+
+ for ($i = 0; $i < sizeof($stock_ids); ++$i) {
+ $query .= "(:tag_id, :stock_id{$i})";
+ $params = array_merge($params, ['stock_id'.$i => $stock_ids[$i]]);
+ if ($i !== sizeof($stock_ids) - 1) {
+ $query .= ',';
+ } else {
+ $query .= ')';
+ }
}
- }
- break;
+ $params = array_merge($params, ['tag_id' => $tag_id]);
+ db_query($query, $params);
+ });
+ $success = true;
+ $message = 'Tags removed';
+ $redirect = true;
+ } else {
+ $success = false;
+ $message = 'To remove the tag, the boxes must be checked';
+ $redirect = false;
+ }
}
- $return = ['success' => $success, 'message' => $message, 'redirect' => $redirect];
+ break;
+ }
+
+ $return = ['success' => $success, 'message' => $message, 'redirect' => $redirect];
- echo json_encode($return);
+ echo json_encode($return);
- exit;
- }
- }
-);
+ exit;
+}
+// }
+// );
diff --git a/index.php b/index.php
index aef0a3e6..f41c4b84 100644
--- a/index.php
+++ b/index.php
@@ -1,54 +1,54 @@
'index.php'],
- function () {
- global $settings,$translate,$action,$lan,$pdf,$_txt,$formbuttons, $rolesToActions, $menusToActions;
- global $error,$listdata,$data,$table,$listconfig,$thisfile,$formdata;
+// Tracer::inSpan(
+// ['name' => 'index.php'],
+// function () {
+// global $settings,$translate,$action,$lan,$pdf,$_txt,$formbuttons, $rolesToActions, $menusToActions;
+// global $error,$listdata,$data,$table,$listconfig,$thisfile,$formdata;
- $ajax = false;
- $mobile = false;
+$ajax = false;
+$mobile = false;
- require_once 'library/core.php';
+require_once 'library/core.php';
- // action set by POST will override GET
- $action = ($_POST['action'] ?? $_GET['action'] ?? 'start');
- $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+// action set by POST will override GET
+$action = ($_POST['action'] ?? $_GET['action'] ?? 'start');
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
- if ('logout' == $action) {
- logoutWithRedirect();
- }
+if ('logout' == $action) {
+ logoutWithRedirect();
+}
- if ('login' == $action) {
- loginWithRedirect();
- }
+if ('login' == $action) {
+ loginWithRedirect();
+}
- if ('logoutfromv2' == $action) {
- logout("https://{$settings['auth0_domain']}/v2/logout?client_id={$settings['auth0_client_id']}&returnTo={$settings['v2_base_url']}");
- }
+if ('logoutfromv2' == $action) {
+ logout("https://{$settings['auth0_domain']}/v2/logout?client_id={$settings['auth0_client_id']}&returnTo={$settings['v2_base_url']}");
+}
- $cmsmain = new Zmarty();
+$cmsmain = new Zmarty();
- // Link to v2
- $cmsmain->assign('v2mobile', $settings['v2_base_url'].'/bases/'.$_SESSION['camp']['id'].'/qrreader');
+// Link to v2
+$cmsmain->assign('v2mobile', $settings['v2_base_url'].'/bases/'.$_SESSION['camp']['id'].'/qrreader');
- // Fill the organisation menu
- $cmsmain->assign('currentOrg', $_SESSION['organisation']);
- if ($_SESSION['user']['is_admin']) {
- $cmsmain->assign('organisations', organisationlist());
- }
- // This fills the camp menu in the top bar (only if the user has access to more than 1 camp
- $cmsmain->assign('camps', camplist());
- $cmsmain->assign('currentcamp', $_SESSION['camp']);
- $cmsmain->assign('campaction', strpos($action, '_edit') ? substr($action, 0, -5) : $action);
- $cmsmain->assign('haswarehouse', db_value('SELECT id FROM locations WHERE type = "Warehouse" AND camp_id = '.intval($_SESSION['camp']['id']).' LIMIT 1 '));
+// Fill the organisation menu
+$cmsmain->assign('currentOrg', $_SESSION['organisation']);
+if ($_SESSION['user']['is_admin']) {
+ $cmsmain->assign('organisations', organisationlist());
+}
+// This fills the camp menu in the top bar (only if the user has access to more than 1 camp
+$cmsmain->assign('camps', camplist());
+$cmsmain->assign('currentcamp', $_SESSION['camp']);
+$cmsmain->assign('campaction', strpos($action, '_edit') ? substr($action, 0, -5) : $action);
+$cmsmain->assign('haswarehouse', db_value('SELECT id FROM locations WHERE type = "Warehouse" AND camp_id = '.intval($_SESSION['camp']['id']).' LIMIT 1 '));
- $cmsmain->assign('menu', CMSmenu());
+$cmsmain->assign('menu', CMSmenu());
- // checks if the requested action is allowed for the user's usergroup and camp
- $allowed = db_numrows('
+// checks if the requested action is allowed for the user's usergroup and camp
+$allowed = db_numrows('
SELECT
f.id, f.title_en, IF(f2.parent_id IS NOT NULL,"3","2") FROM cms_functions AS f
LEFT OUTER JOIN
@@ -92,13 +92,13 @@ function () {
)
)', ['usergroup' => $_SESSION['usergroup']['id'], 'camp_id' => $_SESSION['camp']['id'], 'action' => $action]);
- // if the action is allowed or if the user is a system admin, we load it
- if ($allowed || $_SESSION['user']['is_admin']) {
- include 'include/'.$action.'.php';
- }
+// if the action is allowed or if the user is a system admin, we load it
+if ($allowed || $_SESSION['user']['is_admin']) {
+ include 'include/'.$action.'.php';
+}
- $cmsmain->assign('action', $action);
- $cmsmain->assign('identifyUserToAnalytics', shouldIdentifyUserToAnalytics());
- $cmsmain->display('cms_index.tpl');
- }
-);
+$cmsmain->assign('action', $action);
+$cmsmain->assign('identifyUserToAnalytics', shouldIdentifyUserToAnalytics());
+$cmsmain->display('cms_index.tpl');
+// }
+// );
diff --git a/library/core.php b/library/core.php
index 72970d3d..55ed7606 100644
--- a/library/core.php
+++ b/library/core.php
@@ -1,70 +1,70 @@
'library/core.php'],
- function () use ($bypassAuthentication, $mobile, $ajax) {
- global $settings, $lan, $translate, $menusToActions, $rolesToActions;
+// Tracer::inSpan(
+// ['name' => 'library/core.php'],
+// function () use ($bypassAuthentication, $mobile, $ajax) {
+// global $settings, $lan, $translate, $menusToActions, $rolesToActions;
- if (!defined('LOADED_VIA_SINGLE_ENTRY_POINT')) {
- throw new Exception('This app must now be running through the single entry point. Is your web server config directing all php traffic to gcloud-entry.php?');
- }
- define('CORE', true);
- session_start();
+if (!defined('LOADED_VIA_SINGLE_ENTRY_POINT')) {
+ throw new Exception('This app must now be running through the single entry point. Is your web server config directing all php traffic to gcloud-entry.php?');
+}
+define('CORE', true);
+session_start();
- // load database library
- require_once 'lib/database.php';
+// load database library
+require_once 'lib/database.php';
- if (!array_key_exists('upload_dir', $settings)) {
- $settings['upload_dir'] = $_SERVER['DOCUMENT_ROOT'].'/uploads';
- }
+if (!array_key_exists('upload_dir', $settings)) {
+ $settings['upload_dir'] = $_SERVER['DOCUMENT_ROOT'].'/uploads';
+}
- // connect to database
- if (array_key_exists('db_socket', $settings)) {
- $db_dsn = 'mysql:dbname='.$settings['db_database'].';unix_socket='.$settings['db_socket'];
- } else {
- $db_dsn = 'mysql:host='.$settings['db_host'].';dbname='.$settings['db_database'];
- }
- db_connect($db_dsn, $settings['db_user'], $settings['db_pass']);
+// connect to database
+if (array_key_exists('db_socket', $settings)) {
+ $db_dsn = 'mysql:dbname='.$settings['db_database'].';unix_socket='.$settings['db_socket'];
+} else {
+ $db_dsn = 'mysql:host='.$settings['db_host'].';dbname='.$settings['db_database'];
+}
+db_connect($db_dsn, $settings['db_user'], $settings['db_pass']);
- // set timezone
- date_default_timezone_set('UTC');
- db_query('SET time_zone = "+00:00"');
+// set timezone
+date_default_timezone_set('UTC');
+db_query('SET time_zone = "+00:00"');
- // get settings from settings table
- $result = db_query('SELECT code, value FROM cms_settings');
- while ($row = db_fetch($result)) {
- $settings[$row['code']] = $row['value'];
- }
+// get settings from settings table
+$result = db_query('SELECT code, value FROM cms_settings');
+while ($row = db_fetch($result)) {
+ $settings[$row['code']] = $row['value'];
+}
- $locale = db_row('SELECT locale FROM languages WHERE code = :lan', ['lan' => $settings['cms_language']]);
- setlocale(LC_ALL, $locale);
- mb_internal_encoding('UTF-8');
+$locale = db_row('SELECT locale FROM languages WHERE code = :lan', ['lan' => $settings['cms_language']]);
+setlocale(LC_ALL, $locale);
+mb_internal_encoding('UTF-8');
- // load translate library
- require_once 'lib/translate.php';
+// load translate library
+require_once 'lib/translate.php';
- // load other libraries
- require_once 'lib/session.php';
+// load other libraries
+require_once 'lib/session.php';
- require_once 'lib/tools.php';
+require_once 'lib/tools.php';
- require_once 'lib/mail.php';
+require_once 'lib/mail.php';
- require_once 'lib/csvexport.php';
+require_once 'lib/csvexport.php';
- // load CMS specific libraries
- require_once 'lib/form.php';
+// load CMS specific libraries
+require_once 'lib/form.php';
- require_once 'lib/list.php';
+require_once 'lib/list.php';
- require_once 'lib/formhandler.php';
+require_once 'lib/formhandler.php';
- // functions that are app specific but need to available globally
- require_once 'functions.php';
- if (!$bypassAuthentication) {
- authenticate($settings, $ajax);
- }
- }
-);
+// functions that are app specific but need to available globally
+require_once 'functions.php';
+if (!$bypassAuthentication) {
+ authenticate($settings, $ajax);
+}
+// }
+// );
diff --git a/library/error-reporting.php b/library/error-reporting.php
index c2bf08f9..739e0934 100644
--- a/library/error-reporting.php
+++ b/library/error-reporting.php
@@ -1,6 +1,6 @@
'sentry.init'],
- function () {
- global $settings;
- if (isset($settings['release'])) {
- Sentry\init(
- [
- 'dsn' => $settings['sentry_key'],
- 'environment' => $_SERVER['HTTP_HOST'],
- 'error_types' => error_reporting(),
- 'release' => 'dropapp@'.$settings['release'],
- ]
- );
- } else {
- Sentry\init(
- [
- 'dsn' => $settings['sentry_key'],
- 'environment' => $_SERVER['HTTP_HOST'],
- 'error_types' => error_reporting(),
- ]
- );
- }
- }
-);
+// Tracer::inSpan(
+// ['name' => 'sentry.init'],
+// function () {
+// global $settings;
+if (isset($settings['release'])) {
+ Sentry\init(
+ [
+ 'dsn' => $settings['sentry_key'],
+ 'environment' => $_SERVER['HTTP_HOST'],
+ 'error_types' => error_reporting(),
+ 'release' => 'dropapp@'.$settings['release'],
+ ]
+ );
+} else {
+ Sentry\init(
+ [
+ 'dsn' => $settings['sentry_key'],
+ 'environment' => $_SERVER['HTTP_HOST'],
+ 'error_types' => error_reporting(),
+ ]
+ );
+}
+// }
+// );
diff --git a/library/functions.php b/library/functions.php
index ace3696d..3a73033a 100644
--- a/library/functions.php
+++ b/library/functions.php
@@ -6,41 +6,42 @@
use Endroid\QrCode\QrCode;
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
use Endroid\QrCode\Writer\PngWriter;
-use OpenCensus\Trace\Tracer;
+
+// use OpenCensus\Trace\Tracer;
// Generate QR-png
function generateQrPng($hash, $legacy = false)
{
- Tracer::inSpan(
- ['name' => 'QR png generation'],
- function () use ($hash, $legacy, &$return) {
- try {
- // related to this trello https://trello.com/c/5H7ByALh
- $writer = new PngWriter();
-
- // Create QR code
- $qrCode = QrCode::create('https://'.$_SERVER['HTTP_HOST'].'/mobile.php?barcode='.$hash.($legacy ? '&qrlegacy=1' : ''))
- ->setEncoding(new Encoding('UTF-8'))
- ->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
- ->setSize(150)
- ->setMargin(0)
- ->setRoundBlockSizeMode(new RoundBlockSizeModeMargin())
- ->setForegroundColor(new Color(0, 0, 0))
- ->setBackgroundColor(new Color(255, 255, 255))
- ;
-
- $result = $writer->write($qrCode);
-
- $testUrl = '/mobile.php?'.explode('/mobile.php?', $qrCode->getData())[1];
-
- $return = [$result->getDataUri(), $testUrl];
- } catch (Exception) {
- trigger_error('QR-code png generation error.');
-
- $return = ['QR-CODE ERROR', 'QR-CODE ERROR'];
- }
- }
- );
+ // Tracer::inSpan(
+ // ['name' => 'QR png generation'],
+ // function () use ($hash, $legacy, &$return) {
+ try {
+ // related to this trello https://trello.com/c/5H7ByALh
+ $writer = new PngWriter();
+
+ // Create QR code
+ $qrCode = QrCode::create('https://'.$_SERVER['HTTP_HOST'].'/mobile.php?barcode='.$hash.($legacy ? '&qrlegacy=1' : ''))
+ ->setEncoding(new Encoding('UTF-8'))
+ ->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
+ ->setSize(150)
+ ->setMargin(0)
+ ->setRoundBlockSizeMode(new RoundBlockSizeModeMargin())
+ ->setForegroundColor(new Color(0, 0, 0))
+ ->setBackgroundColor(new Color(255, 255, 255))
+ ;
+
+ $result = $writer->write($qrCode);
+
+ $testUrl = '/mobile.php?'.explode('/mobile.php?', $qrCode->getData())[1];
+
+ $return = [$result->getDataUri(), $testUrl];
+ } catch (Exception) {
+ trigger_error('QR-code png generation error.');
+
+ $return = ['QR-CODE ERROR', 'QR-CODE ERROR'];
+ }
+ // }
+ // );
return $return;
}
diff --git a/library/gcloud.php b/library/gcloud.php
index 84ca13da..500c6b50 100644
--- a/library/gcloud.php
+++ b/library/gcloud.php
@@ -3,12 +3,13 @@
use Google\Cloud\Datastore\DatastoreClient;
use Google\Cloud\Datastore\DatastoreSessionHandler;
use Google\Cloud\Storage\StorageClient;
-use OpenCensus\Trace\Exporter\StackdriverExporter;
-use OpenCensus\Trace\Integrations\Mysql;
-use OpenCensus\Trace\Integrations\PDO;
-use OpenCensus\Trace\Sampler\AlwaysSampleSampler;
-use OpenCensus\Trace\Sampler\NeverSampleSampler;
-use OpenCensus\Trace\Tracer;
+
+// use OpenCensus\Trace\Exporter\StackdriverExporter;
+// use OpenCensus\Trace\Integrations\Mysql;
+// use OpenCensus\Trace\Integrations\PDO;
+// use OpenCensus\Trace\Sampler\AlwaysSampleSampler;
+// use OpenCensus\Trace\Sampler\NeverSampleSampler;
+// use OpenCensus\Trace\Tracer;
function registerGoogleCloudServices($projectId)
{
@@ -18,22 +19,22 @@ function registerGoogleCloudServices($projectId)
// has not been defined
require_once __DIR__.'/../vendor/google/cloud-error-reporting/src/prepend.php';
- $exporter = new StackdriverExporter([
- 'clientConfig' => [
- 'projectId' => $projectId,
- ],
- ]);
- // opentrace seems to have a 1+ second overhead right now
- // so only trace when specifically requested
- $sampler = isset($_GET['trace']) ? new AlwaysSampleSampler() : new NeverSampleSampler();
- Tracer::start($exporter, [
- 'sampler' => $sampler,
- ]);
-
- if (extension_loaded('opencensus')) {
- Mysql::load();
- PDO::load();
- }
+ // $exporter = new StackdriverExporter([
+ // 'clientConfig' => [
+ // 'projectId' => $projectId,
+ // ],
+ // ]);
+ // // opentrace seems to have a 1+ second overhead right now
+ // // so only trace when specifically requested
+ // $sampler = isset($_GET['trace']) ? new AlwaysSampleSampler() : new NeverSampleSampler();
+ // Tracer::start($exporter, [
+ // 'sampler' => $sampler,
+ // ]);
+
+ // if (extension_loaded('opencensus')) {
+ // Mysql::load();
+ // PDO::load();
+ // }
$client = new StorageClient(['projectId' => $projectId]);
$client->registerStreamWrapper();
diff --git a/library/lib/smarty.php b/library/lib/smarty.php
index dae9019a..7f7ebd1f 100644
--- a/library/lib/smarty.php
+++ b/library/lib/smarty.php
@@ -1,6 +1,6 @@
'smarty:display:'.$template],
- fn () => parent::display($template, $cache_id, $compile_id, $parent)
- );
+ // return Tracer::inSpan(
+ // ['name' => 'smarty:display:'.$template],
+ // fn () => parent::display($template, $cache_id, $compile_id, $parent)
+ // );
+ return parent::display($template, $cache_id, $compile_id, $parent);
}
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null)
{
- return Tracer::inSpan(
- ['name' => 'smarty:fetch:'.$template],
- fn () => parent::fetch($template, $cache_id, $compile_id, $parent)
- );
+ // return Tracer::inSpan(
+ // ['name' => 'smarty:fetch:'.$template],
+ // fn () => parent::fetch($template, $cache_id, $compile_id, $parent)
+ // );
+ return parent::fetch($template, $cache_id, $compile_id, $parent);
}
// Register custom modifiers
diff --git a/pdf/qr.php b/pdf/qr.php
index 7a62541c..10188095 100644
--- a/pdf/qr.php
+++ b/pdf/qr.php
@@ -1,125 +1,125 @@
'pdf/qr.php'],
- function () {
- define('PDFSCRIPT', true);
- define('FPDF_FONTPATH', 'fonts/');
+// Tracer::inSpan(
+// ['name' => 'pdf/qr.php'],
+// function () {
+define('PDFSCRIPT', true);
+define('FPDF_FONTPATH', 'fonts/');
- $pdf = new PDF();
+$pdf = new PDF();
- $pdf->SetLineWidth(0.1);
+$pdf->SetLineWidth(0.1);
- $pdf->AddFont('helvetica', '', 'helvetica.php');
- $pdf->AddFont('helvetica', 'B', 'helveticab.php');
- $pdf->AddFont('helvetica', 'I', 'helveticai.php');
- $pdf->AddFont('helvetica', 'BI', 'helveticabi.php');
+$pdf->AddFont('helvetica', '', 'helvetica.php');
+$pdf->AddFont('helvetica', 'B', 'helveticab.php');
+$pdf->AddFont('helvetica', 'I', 'helveticai.php');
+$pdf->AddFont('helvetica', 'BI', 'helveticabi.php');
- // Add Open Sans Fonts variations
- $pdf->AddFont('opensans', '', 'OpenSans-Regular.php'); // Regular
- $pdf->AddFont('opensans', 'B', 'OpenSans-Bold.php'); // Bold
- $pdf->AddFont('opensans', 'I', 'OpenSans-Italic.php'); // Italic
- $pdf->AddFont('opensans', 'BI', 'OpenSans-BoldItalic.php'); // Bold_Italic
+// Add Open Sans Fonts variations
+$pdf->AddFont('opensans', '', 'OpenSans-Regular.php'); // Regular
+$pdf->AddFont('opensans', 'B', 'OpenSans-Bold.php'); // Bold
+$pdf->AddFont('opensans', 'I', 'OpenSans-Italic.php'); // Italic
+$pdf->AddFont('opensans', 'BI', 'OpenSans-BoldItalic.php'); // Bold_Italic
- $pdf->SetFont('opensans', '', 9);
- $pdf->SetAutoPageBreak(false);
+$pdf->SetFont('opensans', '', 9);
+$pdf->SetAutoPageBreak(false);
- if ($_GET['label']) {
- $labels = explode(',', (string) $_GET['label']);
- $_GET['count'] = count($labels);
- }
-
- for ($i = 0; $i < intval($_GET['count']); ++$i) {
- if (!($i % 2)) {
- $pdf->AddPage();
- $y = 0;
- } else {
- // $pdf->Line(0,148.5,210,148.5);
- $y = 148.5;
- }
+if ($_GET['label']) {
+ $labels = explode(',', (string) $_GET['label']);
+ $_GET['count'] = count($labels);
+}
- if ($labels[$i]) {
- $box = db_row('SELECT s.box_id, p.name AS product, s.items, s2.label AS size, g.label AS gender, s.qr_id, qr.code, qr.legacy FROM stock AS s LEFT OUTER JOIN products AS p ON s.product_id = p.id LEFT OUTER JOIN sizes AS s2 ON s.size_id = s2.id LEFT OUTER JOIN genders AS g ON p.gender_id = g.id LEFT OUTER JOIN qr ON s.qr_id = qr.id WHERE s.id = :id', ['id' => $labels[$i]]);
- }
+for ($i = 0; $i < intval($_GET['count']); ++$i) {
+ if (!($i % 2)) {
+ $pdf->AddPage();
+ $y = 0;
+ } else {
+ // $pdf->Line(0,148.5,210,148.5);
+ $y = 148.5;
+ }
- // qr code generation
- if ($box['code'] && !$box['legacy']) {
- $hash = $box['code'];
- } else {
- [$id, $hash] = generateQRIDForDB();
-
- if ($labels[$i]) {
- db_query('UPDATE stock SET qr_id = :qr_id WHERE id = :id', ['id' => $labels[$i], 'qr_id' => $id]);
- $from = [];
- if ($box['legacy']) {
- db_query('DELETE FROM qr WHERE id=:id', ['id' => $box['qr_id']]);
- $from['int'] = $box['qr_id'];
- }
- // Optimise query for updating history
- simpleBulkSaveChangeHistory('stock', $labels[$i], 'New Qr-code assigned by pdf generation.', $from, ['int' => $id]);
- }
- // Optimise query for updating history
- simpleBulkSaveChangeHistory('qr', $id, 'New QR-code generated by pdf');
- }
+ if ($labels[$i]) {
+ $box = db_row('SELECT s.box_id, p.name AS product, s.items, s2.label AS size, g.label AS gender, s.qr_id, qr.code, qr.legacy FROM stock AS s LEFT OUTER JOIN products AS p ON s.product_id = p.id LEFT OUTER JOIN sizes AS s2 ON s.size_id = s2.id LEFT OUTER JOIN genders AS g ON p.gender_id = g.id LEFT OUTER JOIN qr ON s.qr_id = qr.id WHERE s.id = :id', ['id' => $labels[$i]]);
+ }
- [$qrPng, $url] = generateQrPng($hash);
- if ('QR-CODE ERROR' === $qrPng) {
- $pdf->Text(88, 12 + $y, 'QR-CODE ERROR!');
- } else {
- $pdf->Image($qrPng, 88, 12 + $y, 34, 34, 'png');
+ // qr code generation
+ if ($box['code'] && !$box['legacy']) {
+ $hash = $box['code'];
+ } else {
+ [$id, $hash] = generateQRIDForDB();
+
+ if ($labels[$i]) {
+ db_query('UPDATE stock SET qr_id = :qr_id WHERE id = :id', ['id' => $labels[$i], 'qr_id' => $id]);
+ $from = [];
+ if ($box['legacy']) {
+ db_query('DELETE FROM qr WHERE id=:id', ['id' => $box['qr_id']]);
+ $from['int'] = $box['qr_id'];
}
+ // Optimise query for updating history
+ simpleBulkSaveChangeHistory('stock', $labels[$i], 'New Qr-code assigned by pdf generation.', $from, ['int' => $id]);
+ }
+ // Optimise query for updating history
+ simpleBulkSaveChangeHistory('qr', $id, 'New QR-code generated by pdf');
+ }
- $pdf->Image($_SERVER['DOCUMENT_ROOT'].'/pdf/logo.png', 85, 100 + $y, 40, 36);
+ [$qrPng, $url] = generateQrPng($hash);
+ if ('QR-CODE ERROR' === $qrPng) {
+ $pdf->Text(88, 12 + $y, 'QR-CODE ERROR!');
+ } else {
+ $pdf->Image($qrPng, 88, 12 + $y, 34, 34, 'png');
+ }
- $pdf->SetFont('opensans', '', 9);
+ $pdf->Image($_SERVER['DOCUMENT_ROOT'].'/pdf/logo.png', 85, 100 + $y, 40, 36);
- $pdf->Line(140, $y + 30, 200, $y + 30);
- $pdf->Text(140, $y + 34, 'Box Number');
+ $pdf->SetFont('opensans', '', 9);
- $pdf->Line(40, $y + 80, 180, $y + 80);
- $pdf->Text(40, $y + 84, 'Contents');
+ $pdf->Line(140, $y + 30, 200, $y + 30);
+ $pdf->Text(140, $y + 34, 'Box Number');
- $pdf->Line(10, $y + 30, 70, $y + 30);
- $pdf->Text(10, $y + 34, 'Number of items');
+ $pdf->Line(40, $y + 80, 180, $y + 80);
+ $pdf->Text(40, $y + 84, 'Contents');
- $pdf->Line(10, $y + 130, 70, $y + 130);
- $pdf->Text(10, $y + 134, 'Gender');
+ $pdf->Line(10, $y + 30, 70, $y + 30);
+ $pdf->Text(10, $y + 34, 'Number of items');
- $pdf->Line(140, $y + 130, 200, $y + 130);
- $pdf->Text(140, $y + 134, 'Size');
+ $pdf->Line(10, $y + 130, 70, $y + 130);
+ $pdf->Text(10, $y + 134, 'Gender');
- if ($box) {
- $pdf->SetFont('opensans', 'B', 42);
+ $pdf->Line(140, $y + 130, 200, $y + 130);
+ $pdf->Text(140, $y + 134, 'Size');
- $pdf->Text(140, $y + 27, $box['box_id']);
- $pdf->Text(10, $y + 27, $box['items']);
+ if ($box) {
+ $pdf->SetFont('opensans', 'B', 42);
- $pdf->SetFont('opensans', 'B', 32);
+ $pdf->Text(140, $y + 27, $box['box_id']);
+ $pdf->Text(10, $y + 27, $box['items']);
- $pdf->SetXY(38, $y + 72);
- $pdf->CellFit(140, 0, $box['product'], 0, 0, 'L', false, '', true, false);
+ $pdf->SetFont('opensans', 'B', 32);
- $pdf->SetXY(8, $y + 122);
- $pdf->CellFit(60, 0, $box['gender'], 0, 0, 'L', false, '', true, false);
+ $pdf->SetXY(38, $y + 72);
+ $pdf->CellFit(140, 0, $box['product'], 0, 0, 'L', false, '', true, false);
- $pdf->SetXY(138, $y + 122);
- $pdf->CellFit(60, 0, $box['size'], 0, 0, 'L', false, '', true, false);
+ $pdf->SetXY(8, $y + 122);
+ $pdf->CellFit(60, 0, $box['gender'], 0, 0, 'L', false, '', true, false);
- // $pdf->Text(40,$y+77,);
- // $pdf->Text(10,$y+127,$box['gender']);
- // $pdf->Text(140,
- }
- }
+ $pdf->SetXY(138, $y + 122);
+ $pdf->CellFit(60, 0, $box['size'], 0, 0, 'L', false, '', true, false);
- $pdf->Output('I');
+ // $pdf->Text(40,$y+77,);
+ // $pdf->Text(10,$y+127,$box['gender']);
+ // $pdf->Text(140,
}
-);
+}
+
+$pdf->Output('I');
+// }
+// );
function remoteFileExists($url)
{
diff --git a/php.ini b/php.ini
index e482c7d9..66d59f9b 100644
--- a/php.ini
+++ b/php.ini
@@ -5,4 +5,4 @@ short_open_tag = On
; unfortunately it seems this has to be hard coded for now
; as the documented #default# shortcut doesn't work
google_app_engine.allow_include_gs_buckets = "dropapp-242214.appspot.com"
-extension=opencensus.so
\ No newline at end of file
+; extension=opencensus.so
\ No newline at end of file