【发布时间】:2018-12-19 12:11:54
【问题描述】:
好的,我这里有一些巫术魔法。 inb4 - 我已经让 composer dump 和 dump-autoload 100 000 次。
<?
namespace Cds\Goods\Classes;
use Cds\Goods\Classes\Logs;
use Cds\Goods\Classes\AttributeUniteFront;
class ShiptorSync extends Shiptor{
public static function sync_products() {
Logs::add_to_log("shiptor_sync", date("d.m.Y"), "begin sync shiptor products");
$name = AttributeUniteFront::getSlugProduct($item->cds_products_id);
}
}
这是我在控制台命令中调用的函数 sync_products() 的类,就像那样
<?php
namespace App\Console\Commands;
use Cds\Goods\Classes\ShiptorSync;
use Illuminate\Console\Command;
/**
* Class ShiptorSynchronizeProducts
*/
class ShiptorSynchronizeProducts extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'shiptor:products:synchronize';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Sync goods';
/**
* Execute the console command.
*/
public function handle()
{
ShiptorSync::sync_products();
}
}
每次我从控制台运行它时 - 找不到 Class 'Cds\Goods\Classes\AttributeUniteFront'
但是!成功找到类日志。什么鬼……
班级在他的位置
即使在 IDE 中,它也会使用灰色字体和错误来绘制,就像它在页面上未使用一样。会是什么????
不,这到底是什么?它告诉我找不到类,并错误地抛出了未找到类的完整列表!!!
【问题讨论】:
-
第一行问题 - 做了 100 000 次
-
Cds\Goods\Classes\AttributeUniteFront 是这个类在 vendor 中的位置吗?
-
十月CMS插件在文件夹/var/www/site.test/web/plugins/cds/goods/classes
-
近类日志加载完美
-
你能在注册这个命名空间的地方发布 composer.json 吗?
标签: php laravel laravel-artisan octobercms