daycry / cronjob

- Manage Cron jobs in Codeigniter 4
MIT License
64 stars 20 forks source link

Cannot enable cronjob #40

Closed NTICompass closed 2 months ago

NTICompass commented 2 months ago

When I try to run the command php spark cronjob:enable, I get the following error:

[ErrorException]
mkdir(): No such file or directory
at VENDORPATH/daycry/cronjob/src/Commands/CronJobCommand.php:39

The block of code it's failing on is:

// dir doesn't exist, make it
if (!is_dir($this->configfilePath)) {
    mkdir($this->configfilePath);
}

Doing some basic debugging shows that $this->configfilePath is NULL. Earlier, in this file, I see $this->config = config('CronJob');, so shouldn't it be $this->config->filePath?

My app/Config/CronJob.php has the following:

/**
 * Directory
 */
public string $filePath = WRITEPATH . 'cronJob/';

/**
 * File Name in folder jobs structure
 */
public string $fileName = 'jobs';

Where does $this->configfilePath get set and should it actually be $this->config->filePath?