Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel Artisan命令-“;“未找到类”;_Php_Laravel_Laravel Artisan_Octobercms - Fatal编程技术网

Php Laravel Artisan命令-“;“未找到类”;

Php Laravel Artisan命令-“;“未找到类”;,php,laravel,laravel-artisan,octobercms,Php,Laravel,Laravel Artisan,Octobercms,好的,我这里有一些巫术。inb4-我已经让作曲家转储和转储自动加载100000次 <? namespace Cds\Goods\Classes; use Cds\Goods\Classes\Logs; use Cds\Goods\Classes\AttributeUniteFront; class ShiptorSync extends Shiptor{ public static function sync_products() { Logs::ad

好的,我这里有一些巫术。inb4-我已经让作曲家转储和转储自动加载100000次

<?
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);
    }
}

添加到命令控制器:

 public function __construct()
    {
        parent::__construct();
    }
在Kernel.php中:

protected $commands = [
        //
        '\App\Console\Commands\ShiptorSynchronizeProducts',
    ];
那么,为什么不直接在命令中处理sync_产品呢?另外,$item似乎未定义

将其添加到命令文件:

    use Cds\Goods\Classes\Logs;
    use Cds\Goods\Classes\AttributeUniteFront;

public function handle()
  {
    Logs::add_to_log("shiptor_sync", date("d.m.Y"), "begin sync shiptor products");
        $name = AttributeUniteFront::getSlugProduct($item->cds_products_id);
  }
}

天哪,我不知道为什么,但情况是在打开短PHP标签,虽然短开放标签是启用的。但是我改变了它,一切都正常了

第一行问题-是否为100000次cds\Goods\Classes\AttributeUniteFront该类是否位于供应商中?它位于文件夹/var/www/site.test/web/plugins/cds/Goods/classesnear class Logs中的OctoberCMS plugin中。您可以将composer.json发布到该命名空间注册的位置吗?
    use Cds\Goods\Classes\Logs;
    use Cds\Goods\Classes\AttributeUniteFront;

public function handle()
  {
    Logs::add_to_log("shiptor_sync", date("d.m.Y"), "begin sync shiptor products");
        $name = AttributeUniteFront::getSlugProduct($item->cds_products_id);
  }
}