PHP Fatal error: Uncaught Error: Class 'PKP\plugins\GenericPlugin'

I am updating my custom plugins from OJS 3.1 to 3.3,

I have not been using PHP that much lately, and am getting used to namespaces. However, if I update my code from

import('lib.pkp.classes.plugins.GenericPlugin');

to

`namespace APP\plugins\generic\SS;

use APP\facades\Repo;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\LazyCollection;
use PKP\core\EntityDAO;
use PKP\db\DAO;
//use PKP\plugins;

class EmbedGalleyPlugin extends \PKP\plugins\GenericPlugin {
`

to

I get an error:

PHP Fatal error: Uncaught Error: Class ‘PKP\plugins\GenericPlugin’

Can someone point me into the right direction?

thanks

Hi @ssciberras,

It sounds like you’re trying to follow patterns for the forthcoming 3.4 release, which adopts namespaces. The 3.3 release does not support them.

If you’re following examples, check for a branch called stable-3_3_0; that’ll be compatible with OJS 3.3.0. Any of our repos should have a branch with that name.

Regards,
Alec Smecher
Public Knowledge Project

Thanks!

I just realised this afternoon, by going through examples of some other plugins. I will need to brush up my use of namespaces before 3.4 is released.

Hi @ssciberras,

When it comes time, have a look at the 3.4 Release Notebook; it has a section on namespaces, and generally tries to capture all the technical knowledge needed to go from 3.3 to 3.4. (There are similar release notebooks for earlier releases.)

Regards,
Alec Smecher
Public Knowledge Project Team