Closed EmanuelSorin closed 1 year ago
Hey... In my opinion you should use:
require '/var/www/mubu-cscart/app/lib/vendor/autoload.php';
use Spatie\Async\Pool;
...
without that globbing / foreach and require
Have a awesome Day! best, Michael
Tried that but I get the same error, I am executing from console
For me it looks that you have downloaded the code as zip and not installed via
composer require spatie/async
I am working with cscart, do you know how to use their composer to install the package?
I am sorry… No Idea. Never heard something about cscart
No problema, in cscart I could install it, but I need to execute my code from console, without the use of cscart composer, how can I install package so I can use it with command "php file.php" and it to work?
If cscart have it’s own composer you have to ask the cscart Team.
for all composer Packages i used… it is no Problem to run from console if your file include the autoload.php from the vendor folder…
I installed composer from console, and used it to install this repository, but where is that autload.php in php files?
Looks like I managed to add it to composer and work from console! But now I have the problema that it seems to not recognize functions or vairables created before or out of pool, how can I fix that?
And I am getting this error
Right now I am working with Tasks, but I get error This is my code: `class MyTask extends Task { public $store; public function __construct(array $store) { $this->store = $store; } public function configure() { // Setup eg. dependency container, load config,...
require '/var/www/mubu-cscart/app/lib/vendor/phpmailer/phpmailer/src/Exception.php';
require '/var/www/mubu-cscart/app/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php';
require '/var/www/mubu-cscart/app/lib/vendor/phpmailer/phpmailer/src/SMTP.php';
//CONSEGUIMOS LOS FICHEROS NECESARIOS DE WOOCOMMERCE PARA QUE FUNCIONE
$files = glob('/var/www/mubu-cscart/app/lib/vendor/woocommerce/wc/src/WooCommerce/*.php');
foreach ($files as $file) {
require($file);
}
$files = glob('/var/www/mubu-cscart/app/lib/vendor/woocommerce/wc/src/WooCommerce/HttpClient/*.php');
foreach ($files as $file) {
require($file);
}
}
public function run()
{
// Do the real work here.
}
}`
foreach ($stores as $store) { $pool->add(new MyTask($store)); } $pool->wait();
And this is the error i am getting
Hello I am getting this error : PHP Fatal error: Trait 'Spatie\Async\Process\ProcessCallbacks' not found in /var/www/mubu-cscart/app/lib/vendor/async-master/async-master/src/Process/ParallelProcess.php on line 12
I get all files, and a Pool is created
Any ideas?