GRAYBYTE WORDPRESS FILE MANAGER2944

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-content/plugins/woocommerce/src/StoreApi/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-content/plugins/woocommerce/src/StoreApi//StoreApi.php
<?php
namespace Automattic\WooCommerce\StoreApi;

use Automattic\WooCommerce\Blocks\Registry\Container;
use Automattic\WooCommerce\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Authentication;
use Automattic\WooCommerce\StoreApi\Legacy;
use Automattic\WooCommerce\StoreApi\Formatters\CurrencyFormatter;
use Automattic\WooCommerce\StoreApi\Formatters\HtmlFormatter;
use Automattic\WooCommerce\StoreApi\Formatters\MoneyFormatter;
use Automattic\WooCommerce\StoreApi\RoutesController;
use Automattic\WooCommerce\StoreApi\SchemaController;
use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;

/**
 * StoreApi Main Class.
 */
final class StoreApi {
	/**
	 * Init and hook in Store API functionality.
	 */
	public function init() {
		add_action(
			'rest_api_init',
			function () {
				if ( ! wc_rest_should_load_namespace( 'wc/store' ) && ! wc_rest_should_load_namespace( 'wc/private' ) ) {
					return;
				}
				self::container()->get( Legacy::class )->init();
				self::container()->get( RoutesController::class )->register_all_routes();
			}
		);
		// Runs on priority 11 after rest_api_default_filters() which is hooked at 10.
		add_action(
			'rest_api_init',
			function () {
				if ( ! wc_rest_should_load_namespace( 'wc/store' ) ) {
					return;
				}
				self::container()->get( Authentication::class )->init();
			},
			11
		);

		add_action(
			'woocommerce_blocks_pre_get_routes_from_namespace',
			function ( $routes, $ns ) {
				if ( 'wc/store/v1' !== $ns ) {
					return $routes;
				}

				$routes = array_merge(
					$routes,
					self::container()->get( RoutesController::class )->get_all_routes( 'v1' )
				);

				return $routes;
			},
			10,
			2
		);
	}

	/**
	 * Loads the DI container for Store API.
	 *
	 * @internal This uses the Blocks DI container. If Store API were to move to core, this container could be replaced
	 * with a different compatible container.
	 *
	 * @param boolean $reset Used to reset the container to a fresh instance. Note: this means all dependencies will be reconstructed.
	 * @return mixed
	 */
	public static function container( $reset = false ) {
		static $container;

		if ( $reset ) {
			$container = null;
		}

		if ( $container ) {
			return $container;
		}

		$container = new Container();
		$container->register(
			Authentication::class,
			function () {
				return new Authentication();
			}
		);
		$container->register(
			Legacy::class,
			function () {
				return new Legacy();
			}
		);
		$container->register(
			RoutesController::class,
			function ( $container ) {
				return new RoutesController(
					$container->get( SchemaController::class )
				);
			}
		);
		$container->register(
			SchemaController::class,
			function ( $container ) {
				return new SchemaController(
					$container->get( ExtendSchema::class )
				);
			}
		);
		$container->register(
			ExtendSchema::class,
			function ( $container ) {
				return new ExtendSchema(
					$container->get( Formatters::class )
				);
			}
		);
		$container->register(
			Formatters::class,
			function () {
				$formatters = new Formatters();
				$formatters->register( 'money', MoneyFormatter::class );
				$formatters->register( 'html', HtmlFormatter::class );
				$formatters->register( 'currency', CurrencyFormatter::class );
				return $formatters;
			}
		);
		return $container;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Exceptions
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Formatters
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Payments
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Routes
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Schemas
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
Utilities
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:19
giriqfky / giriqfky
0644
Authentication.php
11.952 KB
April 22 2025 15:40:34
giriqfky / giriqfky
0644
Formatters.php
1.21 KB
December 27 2023 00:45:02
giriqfky / giriqfky
0644
Legacy.php
3.087 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
RoutesController.php
6.203 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
SchemaController.php
3.237 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
SessionHandler.php
2.655 KB
December 27 2023 00:45:02
giriqfky / giriqfky
0644
StoreApi.php
3.254 KB
April 22 2025 15:40:34
giriqfky / giriqfky
0644
deprecated.php
7.968 KB
December 27 2023 00:45:02
giriqfky / giriqfky
0644
functions.php
2.701 KB
December 27 2023 00:45:02
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF