Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class namespaces #98

Closed
SebKay opened this issue May 9, 2023 · 1 comment · May be fixed by #111
Closed

Add class namespaces #98

SebKay opened this issue May 9, 2023 · 1 comment · May be fixed by #111

Comments

@SebKay
Copy link

SebKay commented May 9, 2023

Hi,

I'm a big fan of the plugin and have been using it for years. Thank you for all your hard work!

As you probably know, using Composer in a WordPress plugin or theme can conflict with other plugins when they've also using Composer.

I've run into an issue where sometimes the version of wp-background-processing I'm using is different to the one another plugins pulls in, causing a problem where my code is using the version pulled in by the other plugin, not the version I've pulled in.

Are you open to adding namespace to the classes in this package? I'm more than happy to attempt a PR for this myself.

If so it'll mean I, and others, can use tools such as Imposter to prefix the class namespaces which will prevent this issue.

@mostafasoufi
Copy link

I'd prefer to Scope the namespace if you installing the package via Composer. However, if you are installing the library manually, you can add your custom namespace to the following two classes:

<?php

namespace WP_SMS\Library\BackgroundProcessing;

/**
 * WP Async Request
 *
 * @package WP-Background-Processing
 */

/**
 * Abstract WP_Async_Request class.
 *
 * @abstract
 */
abstract class WP_Async_Request {
<?php

namespace WP_SMS\Library\BackgroundProcessing;

/**
 * WP Background Process
 *
 * @package WP-Background-Processing
 */

/**
 * Abstract WP_Background_Process class.
 *
 * @abstract
 * @extends WP_Async_Request
 */
abstract class WP_Background_Process extends WP_Async_Request {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants