for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Workaround for OKAPI issue #246
***************************************************************************/
checkJob(new OkapiCleanup());
class OkapiCleanup
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public $name = 'okapi_cleanup';
public $interval = 3600;
public function run()
global $opt;
$files = glob($opt['okapi']['var_dir'] . '/garmin*.zip');
foreach ($files as $file) {
// delete old download files after 24 hours; this large interval filters out any
// timezone mismatches in file systems (e.g. on unconventional development
// environments)
if (is_file($file) && (time() - filemtime($file)) > 24 * 3600) {
unlink($file);
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.