Make Archive.php use PHP CLI instead of Web, more reliable / performant#4610

Labels

Milestone

Assignee

2 participants

The implementation of our Cron Archive script should use Php CLI instead of doing Http requests to the webserver. This would remove one system in the middle and should make archive script slightly more reliable.

Because the piwik.php webcron also uses the CronArchive logic then either we change this logic, or keep the CURL wrapper in the CronArchive (when Php CLI not available or exec() disabled).

In 279a4d6: refs #4610 I moved the Lock class to CliMulti as it does not 100% work on windows and is only used in CliMulti so far. As the Lock class can be quite useful and maybe needed in other use cases it would be nice to have it somewhere under core or so as it is not directly related to CLI. We might have to move it later again. Need to find a better solution for windows

In cb994c9: refs #4610 prevent some notices like "failed to read from stream" which happens if a subprocess tries to write to a file and the archiver just tries to file_get_content at the same time. So file_exists returned true just a few ms before but while trying to read it fails

…k on windows and is only used in CliMulti so far. As the Lock class can be quite useful and maybe needed in other use cases it would be nice to have it somewhere under core or so as it is not directly related to CLI. We might have to move it later again. Need to find a better solution for windows

…ch happens if a subprocess tries to write to a file and the archiver just tries to file_get_content at the same time. So file_exists returned true just a few ms before but while trying to read it fails