Changeset 3371958
- Timestamp:
- 10/02/2025 06:44:36 PM (6 months ago)
- Location:
- pay-with-flex/trunk
- Files:
-
- 16 edited
-
composer.lock (modified) (6 diffs)
-
pay-with-flex.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
src/Controller/OrderController.php (modified) (2 diffs)
-
src/Resource/CheckoutSession/CheckoutSession.php (modified) (1 diff)
-
vendor/composer/installed.json (modified) (6 diffs)
-
vendor/composer/installed.php (modified) (1 diff)
-
vendor/scoper-autoload.php (modified) (2 diffs)
-
vendor/sentry/sentry/CHANGELOG.md (modified) (3 diffs)
-
vendor/sentry/sentry/src/Client.php (modified) (1 diff)
-
vendor/sentry/sentry/src/Logs/Log.php (modified) (1 diff)
-
vendor/sentry/sentry/src/Logs/LogLevel.php (modified) (1 diff)
-
vendor/sentry/sentry/src/Logs/LogsAggregator.php (modified) (3 diffs)
-
vendor/sentry/sentry/src/Monolog/LogsHandler.php (modified) (2 diffs)
-
vendor/sentry/sentry/src/Options.php (modified) (2 diffs)
-
vendor/sentry/sentry/src/Transport/Result.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pay-with-flex/trunk/composer.lock
r3352167 r3371958 387 387 { 388 388 "name": "sentry/sentry", 389 "version": "4.1 5.0",389 "version": "4.16.0", 390 390 "source": { 391 391 "type": "git", 392 392 "url": "https://github.com/getsentry/sentry-php.git", 393 "reference": " b2d84de69f3eda8ca22b0b00e9f923be3b837355"394 }, 395 "dist": { 396 "type": "zip", 397 "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/ b2d84de69f3eda8ca22b0b00e9f923be3b837355",398 "reference": " b2d84de69f3eda8ca22b0b00e9f923be3b837355",393 "reference": "c5b086e4235762da175034bc463b0d31cbb38d2e" 394 }, 395 "dist": { 396 "type": "zip", 397 "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/c5b086e4235762da175034bc463b0d31cbb38d2e", 398 "reference": "c5b086e4235762da175034bc463b0d31cbb38d2e", 399 399 "shasum": "" 400 400 }, … … 460 460 "support": { 461 461 "issues": "https://github.com/getsentry/sentry-php/issues", 462 "source": "https://github.com/getsentry/sentry-php/tree/4.1 5.0"462 "source": "https://github.com/getsentry/sentry-php/tree/4.16.0" 463 463 }, 464 464 "funding": [ … … 472 472 } 473 473 ], 474 "time": "2025-0 8-20T14:26:37+00:00"474 "time": "2025-09-22T13:38:03+00:00" 475 475 }, 476 476 { … … 543 543 { 544 544 "name": "symfony/options-resolver", 545 "version": "v7.3. 2",545 "version": "v7.3.3", 546 546 "source": { 547 547 "type": "git", 548 548 "url": "https://github.com/symfony/options-resolver.git", 549 "reference": " 119bcf13e67dbd188e5dbc74228b1686f66acd37"550 }, 551 "dist": { 552 "type": "zip", 553 "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ 119bcf13e67dbd188e5dbc74228b1686f66acd37",554 "reference": " 119bcf13e67dbd188e5dbc74228b1686f66acd37",549 "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" 550 }, 551 "dist": { 552 "type": "zip", 553 "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", 554 "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", 555 555 "shasum": "" 556 556 }, … … 590 590 ], 591 591 "support": { 592 "source": "https://github.com/symfony/options-resolver/tree/v7.3. 2"592 "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" 593 593 }, 594 594 "funding": [ … … 610 610 } 611 611 ], 612 "time": "2025-0 7-15T11:36:08+00:00"612 "time": "2025-08-05T10:16:07+00:00" 613 613 }, 614 614 { -
pay-with-flex/trunk/pay-with-flex.php
r3352167 r3371958 4 4 * Plugin Name: Flex HSA/FSA Payments 5 5 * Description: Accept HSA/FSA payments directly in the checkout flow. 6 * Version: 3.1. 66 * Version: 3.1.7 7 7 * Plugin URI: https://wordpress.org/plugins/pay-with-flex/ 8 8 * Author: Flex … … 66 66 if ( null === $hub ) { 67 67 $data = array(); 68 if ( function_exists( ' get_plugin_data' ) ) {68 if ( function_exists( 'Flex\get_plugin_data' ) ) { 69 69 $data = get_plugin_data( plugin_file: __FILE__, translate: \false ); 70 70 } … … 158 158 if ( empty( $event->getModules() ) ) { 159 159 $modules = array(); 160 if ( function_exists( ' wp_get_wp_version' ) ) {160 if ( function_exists( 'Flex\wp_get_wp_version' ) ) { 161 161 $modules['wordpress'] = wp_get_wp_version(); 162 162 } 163 if ( function_exists( ' get_plugins' ) && function_exists( 'is_plugin_active' ) ) {163 if ( function_exists( 'Flex\get_plugins' ) && function_exists( 'Flex\is_plugin_active' ) ) { 164 164 foreach ( get_plugins() as $plugin => $info ) { 165 165 if ( ! is_plugin_active( $plugin ) ) { -
pay-with-flex/trunk/readme.txt
r3352167 r3371958 4 4 Requires at least: 6.8 5 5 Tested up to: 6.8 6 Stable tag: 3.1. 66 Stable tag: 3.1.7 7 7 Requires PHP: 8.1 8 8 License: GPLv3 or later … … 55 55 56 56 == Changelog == 57 58 = 3.1.7 = 59 * Fixed a security vulnerability that allowed an attacker to retrieve completed orders within a short window after the order was placed. 57 60 58 61 = 3.1.6 = … … 130 133 == Upgrade Notice == 131 134 135 = 3.1.7 = 136 This version fixes a security vulnerability that allowed an attacker to retrieve order details within a short window 137 after the order was placed. 138 132 139 = 1.0.0 = 133 140 This version fixes a critical error and implements a webhook handler to prevent orders from failing to be marked as -
pay-with-flex/trunk/src/Controller/OrderController.php
r3352167 r3371958 28 28 args: array( 29 29 'callback' => array( $controller, 'complete' ), 30 'permission_callback' => '__return_true',30 'permission_callback' => array( $controller, 'permission_callback' ), 31 31 'args' => array( 'id' => array( 'required' => \true ) ), 32 32 ) 33 33 ); 34 } 35 /** 36 * Ensure the nonce matches before attempting to process the request. 37 * 38 * @param \WP_REST_Request $request The Request. 39 */ 40 public function permission_callback( \WP_REST_Request $request ): bool { 41 $id = $request->get_param( 'id' ); 42 if ( empty( $id ) ) { 43 return \false; 44 } 45 $key = $request->get_param( 'key' ); 46 if ( empty( $key ) ) { 47 return \false; 48 } 49 $order = wc_get_order( $id ); 50 if ( \false === $order ) { 51 return \false; 52 } 53 return $order->key_is_valid( $key ); 34 54 } 35 55 /** … … 47 67 } 48 68 // If the order is in a 'pending' state and the nonce is valid, then attempt to update the order. 49 if ( OrderStatus::PENDING === $order->get_status() && \false !== wp_verify_nonce( $request->get_param( '_wpnonce' ), 'wp_rest' )) {69 if ( OrderStatus::PENDING === $order->get_status() ) { 50 70 $checkout_session = CheckoutSession::from_wc( $order ); 51 71 $checkout_session->exec( ResourceAction::REFRESH ); -
pay-with-flex/trunk/src/Resource/CheckoutSession/CheckoutSession.php
r3352167 r3371958 134 134 $id = $order->get_transaction_id(); 135 135 $order_id = $order->get_id(); 136 $success_url = wp_nonce_url( actionurl: get_rest_url( path: Controller::NAMESPACE . "/orders/{$order_id}/complete" ), action: 'wp_rest');136 $success_url = add_query_arg( 'key', $order->get_order_key(), get_rest_url( path: Controller::NAMESPACE . "/orders/{$order_id}/complete" ) ); 137 137 // A map of item_id => LineItem. 138 138 $line_items = array_map( static fn( $item ) => \Flex\Resource\CheckoutSession\LineItem::from_wc( $item ), $order->get_items() ); -
pay-with-flex/trunk/vendor/composer/installed.json
r3352167 r3371958 399 399 { 400 400 "name": "sentry\/sentry", 401 "version": "4.1 5.0",402 "version_normalized": "4.1 5.0.0",401 "version": "4.16.0", 402 "version_normalized": "4.16.0.0", 403 403 "source": { 404 404 "type": "git", 405 405 "url": "https:\/\/github.com\/getsentry\/sentry-php.git", 406 "reference": " b2d84de69f3eda8ca22b0b00e9f923be3b837355"407 }, 408 "dist": { 409 "type": "zip", 410 "url": "https:\/\/api.github.com\/repos\/getsentry\/sentry-php\/zipball\/ b2d84de69f3eda8ca22b0b00e9f923be3b837355",411 "reference": " b2d84de69f3eda8ca22b0b00e9f923be3b837355",406 "reference": "c5b086e4235762da175034bc463b0d31cbb38d2e" 407 }, 408 "dist": { 409 "type": "zip", 410 "url": "https:\/\/api.github.com\/repos\/getsentry\/sentry-php\/zipball\/c5b086e4235762da175034bc463b0d31cbb38d2e", 411 "reference": "c5b086e4235762da175034bc463b0d31cbb38d2e", 412 412 "shasum": "" 413 413 }, … … 439 439 "monolog\/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." 440 440 }, 441 "time": "2025-0 8-20T14:26:37+00:00",441 "time": "2025-09-22T13:38:03+00:00", 442 442 "type": "library", 443 443 "installation-source": "dist", … … 475 475 "support": { 476 476 "issues": "https:\/\/github.com\/getsentry\/sentry-php\/issues", 477 "source": "https:\/\/github.com\/getsentry\/sentry-php\/tree\/4.1 5.0"477 "source": "https:\/\/github.com\/getsentry\/sentry-php\/tree\/4.16.0" 478 478 }, 479 479 "funding": [ … … 561 561 { 562 562 "name": "symfony\/options-resolver", 563 "version": "v7.3. 2",564 "version_normalized": "7.3. 2.0",563 "version": "v7.3.3", 564 "version_normalized": "7.3.3.0", 565 565 "source": { 566 566 "type": "git", 567 567 "url": "https:\/\/github.com\/symfony\/options-resolver.git", 568 "reference": " 119bcf13e67dbd188e5dbc74228b1686f66acd37"569 }, 570 "dist": { 571 "type": "zip", 572 "url": "https:\/\/api.github.com\/repos\/symfony\/options-resolver\/zipball\/ 119bcf13e67dbd188e5dbc74228b1686f66acd37",573 "reference": " 119bcf13e67dbd188e5dbc74228b1686f66acd37",568 "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" 569 }, 570 "dist": { 571 "type": "zip", 572 "url": "https:\/\/api.github.com\/repos\/symfony\/options-resolver\/zipball\/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", 573 "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", 574 574 "shasum": "" 575 575 }, … … 578 578 "symfony\/deprecation-contracts": "^2.5|^3" 579 579 }, 580 "time": "2025-0 7-15T11:36:08+00:00",580 "time": "2025-08-05T10:16:07+00:00", 581 581 "type": "library", 582 582 "installation-source": "dist", … … 611 611 ], 612 612 "support": { 613 "source": "https:\/\/github.com\/symfony\/options-resolver\/tree\/v7.3. 2"613 "source": "https:\/\/github.com\/symfony\/options-resolver\/tree\/v7.3.3" 614 614 }, 615 615 "funding": [ -
pay-with-flex/trunk/vendor/composer/installed.php
r3352167 r3371958 3 3 namespace Flex; 4 4 5 return array('root' => array('name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => ' 69ec6bef00f745f4c201c37ee9e81ec06ee22277', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \true), 'versions' => array('__root__' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '69ec6bef00f745f4c201c37ee9e81ec06ee22277', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => '21dc724a0583619cd1652f673303492272778051', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'jean85/pretty-package-versions' => array('pretty_version' => '2.1.1', 'version' => '2.1.1.0', 'reference' => '4d7aa5dab42e2a76d99559706022885de0e18e1a', 'type' => 'library', 'install_path' => __DIR__ . '/../jean85/pretty-package-versions', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'sentry/sentry' => array('pretty_version' => '4.15.0', 'version' => '4.15.0.0', 'reference' => 'b2d84de69f3eda8ca22b0b00e9f923be3b837355', 'type' => 'library', 'install_path' => __DIR__ . '/../sentry/sentry', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.6.0', 'version' => '3.6.0.0', 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/options-resolver' => array('pretty_version' => 'v7.3.2', 'version' => '7.3.2.0', 'reference' => '119bcf13e67dbd188e5dbc74228b1686f66acd37', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/options-resolver', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-php84' => array('pretty_version' => 'v1.33.0', 'version' => '1.33.0.0', 'reference' => 'd8ced4d875142b6a7426000426b8abc631d6b191', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php84', 'aliases' => array(), 'dev_requirement' => \false)));5 return array('root' => array('name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '2cc5f9f0241f62d276da7dc35577596593e348e7', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \true), 'versions' => array('__root__' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '2cc5f9f0241f62d276da7dc35577596593e348e7', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => '21dc724a0583619cd1652f673303492272778051', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'jean85/pretty-package-versions' => array('pretty_version' => '2.1.1', 'version' => '2.1.1.0', 'reference' => '4d7aa5dab42e2a76d99559706022885de0e18e1a', 'type' => 'library', 'install_path' => __DIR__ . '/../jean85/pretty-package-versions', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'sentry/sentry' => array('pretty_version' => '4.16.0', 'version' => '4.16.0.0', 'reference' => 'c5b086e4235762da175034bc463b0d31cbb38d2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sentry/sentry', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.6.0', 'version' => '3.6.0.0', 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/options-resolver' => array('pretty_version' => 'v7.3.3', 'version' => '7.3.3.0', 'reference' => '0ff2f5c3df08a395232bbc3c2eb7e84912df911d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/options-resolver', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-php84' => array('pretty_version' => 'v1.33.0', 'version' => '1.33.0.0', 'reference' => 'd8ced4d875142b6a7426000426b8abc631d6b191', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php84', 'aliases' => array(), 'dev_requirement' => \false))); -
pay-with-flex/trunk/vendor/scoper-autoload.php
r3352167 r3371958 42 42 if (!function_exists('bcdivmod')) { function bcdivmod() { return \Flex\bcdivmod(...func_get_args()); } } 43 43 if (!function_exists('fpow')) { function fpow() { return \Flex\fpow(...func_get_args()); } } 44 if (!function_exists('get_plugin_data')) { function get_plugin_data() { return \Flex\get_plugin_data(...func_get_args()); } } 45 if (!function_exists('get_plugins')) { function get_plugins() { return \Flex\get_plugins(...func_get_args()); } } 44 46 if (!function_exists('getallheaders')) { function getallheaders() { return \Flex\getallheaders(...func_get_args()); } } 45 47 if (!function_exists('grapheme_str_split')) { function grapheme_str_split() { return \Flex\grapheme_str_split(...func_get_args()); } } 48 if (!function_exists('is_plugin_active')) { function is_plugin_active() { return \Flex\is_plugin_active(...func_get_args()); } } 46 49 if (!function_exists('mb_lcfirst')) { function mb_lcfirst() { return \Flex\mb_lcfirst(...func_get_args()); } } 47 50 if (!function_exists('mb_ltrim')) { function mb_ltrim() { return \Flex\mb_ltrim(...func_get_args()); } } … … 50 53 if (!function_exists('mb_ucfirst')) { function mb_ucfirst() { return \Flex\mb_ucfirst(...func_get_args()); } } 51 54 if (!function_exists('trigger_deprecation')) { function trigger_deprecation() { return \Flex\trigger_deprecation(...func_get_args()); } } 55 if (!function_exists('wp_get_wp_version')) { function wp_get_wp_version() { return \Flex\wp_get_wp_version(...func_get_args()); } } 52 56 53 57 return $loader; -
pay-with-flex/trunk/vendor/sentry/sentry/CHANGELOG.md
r3352167 r3371958 1 1 # CHANGELOG 2 3 ## 4.16.0 4 5 The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.16.0. 6 7 ### Features 8 9 - Remove `max_breadcrumbs` limit. [(#1890)](https://github.com/getsentry/sentry-php/pull/1890) 10 - Implement `__destruct` in `LogsHandler` to make sure logs are always flushed. [(#1916)](https://github.com/getsentry/sentry-php/pull/1916) 11 12 ### Bug Fixes 13 14 - Use PSR log level when logging messages using the PSR-3 logger within the SDK. [(#1907)](https://github.com/getsentry/sentry-php/pull/1907) 15 - Remove `@internal` annotation from `Sentry\Transport\Result`. [(#1904)](https://github.com/getsentry/sentry-php/pull/1904) 16 17 ### Misc 18 19 - Add `sentry.origin` attribute to `LogsHandler`. [(#1917)](https://github.com/getsentry/sentry-php/pull/1917) 20 21 ## 4.15.2 22 23 The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.15.2. 24 25 ### Bug Fixes 26 27 - Ensure the Monolog handler only processes records permitted by their log level. [(#1888)](https://github.com/getsentry/sentry-php/pull/1888) 28 29 ## 4.15.1 30 31 The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.15.1. 32 33 ### Bug Fixes 34 35 - Do not send `template` attribute with logs when there are no template values [(#1885)](https://github.com/getsentry/sentry-php/pull/1885) 2 36 3 37 ## 4.15.0 … … 15 49 use Sentry\Monolog\LogsHandler; 16 50 use Sentry\Logs\LogLevel; 17 51 18 52 // Initialize Sentry SDK first (make sure 'enable_logs' is set to true) 19 53 \Sentry\init([ … … 21 55 'enable_logs' => true, 22 56 ]); 23 57 24 58 // Create a Monolog logger 25 59 $logger = new Logger('my-app'); 26 60 27 61 // Add the Sentry logs handler 28 62 // Optional: specify minimum log level (defaults to LogLevel::debug()) 29 63 $handler = new LogsHandler(LogLevel::info()); 30 64 $logger->pushHandler($handler); 31 65 32 66 // Now your logs will be sent to Sentry 33 67 $logger->info('User logged in', ['user_id' => 123]); 34 68 $logger->error('Payment failed', ['order_id' => 456]); 35 69 ``` 36 70 37 71 Note: The handler will not collect logs for exceptions (they should be handled separately via `captureException`). 38 72 -
pay-with-flex/trunk/vendor/sentry/sentry/src/Client.php
r3352167 r3371958 29 29 * The version of the SDK. 30 30 */ 31 public const SDK_VERSION = '4.1 5.0';31 public const SDK_VERSION = '4.16.0'; 32 32 /** 33 33 * Regex pattern to detect if a string is a regex pattern (starts and ends with / optionally followed by flags). -
pay-with-flex/trunk/vendor/sentry/sentry/src/Logs/Log.php
r3352167 r3371958 62 62 return $this; 63 63 } 64 public function getPsrLevel(): string 65 { 66 return $this->level->toPsrLevel(); 67 } 64 68 public function getBody(): string 65 69 { -
pay-with-flex/trunk/vendor/sentry/sentry/src/Logs/LogLevel.php
r3352167 r3371958 58 58 return $this->priority; 59 59 } 60 public function toPsrLevel(): string 61 { 62 switch ($this->value) { 63 case 'trace': 64 case 'debug': 65 return \Flex\Psr\Log\LogLevel::DEBUG; 66 case 'warn': 67 return \Flex\Psr\Log\LogLevel::WARNING; 68 case 'error': 69 return \Flex\Psr\Log\LogLevel::ERROR; 70 case 'fatal': 71 return \Flex\Psr\Log\LogLevel::CRITICAL; 72 case 'info': 73 default: 74 return \Flex\Psr\Log\LogLevel::INFO; 75 } 76 } 60 77 private static function getInstance(string $value, int $priority): self 61 78 { -
pay-with-flex/trunk/vendor/sentry/sentry/src/Logs/LogsAggregator.php
r3352167 r3371958 52 52 $formattedMessage = $message; 53 53 } 54 $log = (new Log($timestamp, $this->getTraceId($hub), $level, $formattedMessage))->setAttribute('sentry.release', $options->getRelease())->setAttribute('sentry.environment', $options->getEnvironment() ?? Event::DEFAULT_ENVIRONMENT)->setAttribute('sentry.server.address', $options->getServerName())->setAttribute('sentry. message.template', $message)->setAttribute('sentry.trace.parent_span_id', $hub->getSpan() ? $hub->getSpan()->getSpanId() : null);54 $log = (new Log($timestamp, $this->getTraceId($hub), $level, $formattedMessage))->setAttribute('sentry.release', $options->getRelease())->setAttribute('sentry.environment', $options->getEnvironment() ?? Event::DEFAULT_ENVIRONMENT)->setAttribute('sentry.server.address', $options->getServerName())->setAttribute('sentry.trace.parent_span_id', $hub->getSpan() ? $hub->getSpan()->getSpanId() : null); 55 55 if ($client instanceof Client) { 56 56 $log->setAttribute('sentry.sdk.name', $client->getSdkIdentifier()); … … 71 71 } 72 72 }); 73 foreach ($values as $key => $value) { 74 $log->setAttribute("sentry.message.parameter.{$key}", $value); 73 if (\count($values)) { 74 $log->setAttribute('sentry.message.template', $message); 75 foreach ($values as $key => $value) { 76 $log->setAttribute("sentry.message.parameter.{$key}", $value); 77 } 75 78 } 76 79 $attributes = Arr::simpleDot($attributes); … … 98 101 return; 99 102 } 100 // We check if it's a `LogsLogger` to avoid a infinite loop where the logger is logging the logs it's writing101 103 if ($sdkLogger !== null) { 102 $sdkLogger->log( (string) $log->getLevel(), "Logs item: {$log->getBody()}", $log->attributes()->toSimpleArray());104 $sdkLogger->log($log->getPsrLevel(), "Logs item: {$log->getBody()}", $log->attributes()->toSimpleArray()); 103 105 } 104 106 $this->logs[] = $log; -
pay-with-flex/trunk/vendor/sentry/sentry/src/Monolog/LogsHandler.php
r3352167 r3371958 48 48 public function handle($record): bool 49 49 { 50 if (!$this->isHandling($record)) { 51 return \false; 52 } 50 53 // Do not collect logs for exceptions, they should be handled seperately by the `Handler` or `captureException` 51 54 if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) { 52 55 return \false; 53 56 } 54 Logs::getInstance()->aggregator()->add(self::getSentryLogLevelFromMonologLevel($record['level']), $record['message'], [], array_merge($record['context'], $record['extra'] ));57 Logs::getInstance()->aggregator()->add(self::getSentryLogLevelFromMonologLevel($record['level']), $record['message'], [], array_merge($record['context'], $record['extra'], ['sentry.origin' => 'auto.logger.monolog'])); 55 58 return $this->bubble === \false; 56 59 } … … 92 95 return new LineFormatter(); 93 96 } 97 public function __destruct() 98 { 99 try { 100 $this->close(); 101 } catch (\Throwable $e) { 102 // Just in case so that the destructor can never fail. 103 } 104 } 94 105 } -
pay-with-flex/trunk/vendor/sentry/sentry/src/Options.php
r3352167 r3371958 1226 1226 } 1227 1227 /** 1228 * Validates if the value of the max_breadcrumbs option is in range.1228 * Validates if the value of the max_breadcrumbs option is valid. 1229 1229 * 1230 1230 * @param int $value The value to validate … … 1232 1232 private function validateMaxBreadcrumbsOptions(int $value): bool 1233 1233 { 1234 return $value >= 0 && $value <= self::DEFAULT_MAX_BREADCRUMBS;1234 return $value >= 0; 1235 1235 } 1236 1236 /** -
pay-with-flex/trunk/vendor/sentry/sentry/src/Transport/Result.php
r3352167 r3371958 8 8 * This class contains the details of the sending operation of an event, e.g. 9 9 * if it was sent successfully or if it was skipped because of some reason. 10 *11 * @internal12 10 */ 13 11 class Result
Note: See TracChangeset
for help on using the changeset viewer.