C5-8.4* Class 'Concrete\Package\MyPackage\Src\MyPackage\Utilities\Installer' not found

Permalink
Can't figure out what might be the problem.

My package controller has this:
namespace Concrete\Package\MyPackage;
use Concrete\Package\MyPackage\Src\MyPackage\Utilities\Installer;
class Controller extends Package {
    public function install() 
    {
        $pkg = parent::install();
        $this->installMyPackage();
    }
    public function installMyPackage()
    {
        $pkg = Package::getByHandle('my_package');
        Installer::installSinglePages($pkg);
    }
    ...

and the Installer class in my_package\src\MyPackage\Utilities\Installer.php:
namespace Concrete\Package\MyPackage\Src\MyPackage\Utilities;
defined('C5_EXECUTE') or die(_("Access Denied."));
class Installer
{
    public static function installSinglePages($pkg)
    {
...

Why can't it find the Installer class? I've checked all file name a hundred times, can't find what's wrong.

linuxoid
 
linuxoid replied on at Permalink Reply
linuxoid
Well, apparently I was looking at package examples for C5 < v8.0. In v8.3+ there's gotta be a 'Concrete' folder in the 'src' but the 'src' is not used in namespaces:

https://documentation.concrete5.org/developers/packages/adding-custo...
use Concrete\Package\MyPackage\MyPackage\Utilities\Installer;
namespace Concrete\Package\MyPackage\MyPackage\Utilities;