The following methods are added and can be invoked using `WC()`,
they just redirect to the same methods in LegacyProxy:
call_function
call_static
get_instance_of
- The `Container` class now implements `Psr\Container\ContainerInterface`
(and registers itself as such), holding a private instance of the
real container. This way it's a read-only container from the point
of view of plugins (which should use their own containers, but
can still use this to get WooCommerce classes).
- All registrations are now done in the `Container` constructor via
service providers.
- The container instance is now held in a global variable, set in
`woocommerce.php`
- Added the `wc_get_container` function for old code.
- Added the `AbstractServiceProvider` class, which inherits with the
corresponding League's class and adds some utility methods,
most notably `add/shareWithAutoArguments`.
- Added the `ActionsProxy` and `LegacyProxy` classes, they are
registered via a dedicated service provider.
- `WC_Queue_Interface` is no longer resolvable via the container
(which is for classes inside `src` only).
- All the method names in the new classes have the format `fooBarFizz`
to be PSR4 compliant, so the MethodNameInvalid error has been
disabled in phpcs.xml for the `src` directory.
- Introduced the `@public` annotation for public API classes
(classes that plugins can use and whose backwards compatibility
we guarantee), applied to `ActionsProxy` and to `LegacyProxy` for now.
- Removed the hack for the autoloader as now it doesn't work anyway.
For the changes in this branch to work, now WP_DEBUG must be false.
- Renamed from `ObjectContainer` to `Container`.
- It now inherits from PHP League's `Container`.
- It has now a `defineAsSharedAutowired` method.
- Initialization moved to the `WooCommerce::init_container` method.
- The static method for object resolution is now `WooCommerce::get_instance_of`.
- Add PHP League's Container package via Composer.
- Add an ObjectContainer class that encapsulates all the configuration
and insulates the codebase from the concrete DI engine used.
- Add an improved ReflectionContainer class that will allow to
register individual classes as singletons while autowiring.
- Use ObjectContainer to resolve the WooCommerce class, everything
instantiated with "new" inside it, and all singletons that are
usually obtained via WC() function.
- Introduce the CustomerProvider class.
- Introduce a service provider to resolve WC_Queue_Interface,
this replaces the WC_Queue class.
- Mark as obsolete all the replaced "instance()" methods,
and the entire WC_Queue class.
`WC_Abstract_Order` and `WC_Cart_Totals` have their own logic to calculate totals. This means that we would have to fix in two places. This commit adds a trait which can be used to place shared logic between above two classes.
This commit introduces a banner that notifies and prompts users to upgrade their WordPress and/or PHP if they are outdated and not part of the minimum required versions going into WooCommerce 3.7.
* Add backward compatible function wp_check_php_version for sites running WP version smaller than 5.1
* Refactor some messaging, move widget to top of WC dashboard widgets, add buttons linking out to WP pages with instructions.
* Add missing variables for adding nag class
* Add styling to dashboard widget
* Rework css to use exclamation instead
* Clean up widget, make sure no widget is registered when dismissed. Add banner that links to widget and make it dismissable.
* Update constant to reflect minimum requirements.
* Don't show banner. Fix undefined variable.
* Remove dashboard widget
* Update banner link to docs site
* Add link to docs page where instructions live for updating
* Change button text
* Add UTM params to docs link
* Moved the msg logic from template to php file.
* Bail out early when PHP and WP versions are ok.
* Added missing translation functiog
* Extracted notice function from reset_admin_notices.
To follow suit with other similar functions in the file.
* Synchronize fetching of WP version.
* Removed unused functions.
* Corrected indent.
* Reduce number of variables and fixed coding standards
* Updated wording of the notice.
To take care of instantiating a canonical job queue for use across
all of WooCommerce, and by 3rd party code.
Also use this new API for enqueuing webhooks instead of raw Action
Scheduler APIs.
As a wrapper for Action Scheduler. This implements the WC_Queue_Interface
so it can be used as WC core's job queue. Implementing WC_Queue_Interface
also means this class has more generic and appropriate job queue nomenclature
than Action Scheduler itself. For exsample, it provides a method for
non-delayed jobs, i.e. WC_Queue_Interface::add(), unlike Action Scheduler,
which requires scheduling a job for now(), which while fairly simple, is not
intuitive or immediately obvious to new comers.
This makes it both more clear and convenient to use Action Scheduler
as a simple job queue instead of just a queue for delayed jobs.
To provide an agreed set of public methods that need to be defined
for any class wanting to act as WooCommerce's queue handler.
The require APIs support both delay jobs, by providing APIs to
schedule an action/job/event for some time in the future, and a
non-delayed job API, to add an event to the queue to run as soon
as possible.