<?php
namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
use wcf\system\WCF;
/**
/**
* @see wcf\system\ICronjob::execute()
*/
- public function execute(array $data) {
- $sql = "DELETE FROM wcf".WCF_N."_cronjobs_log
+ public function execute(Cronjob $cronjob) {
+ $sql = "DELETE FROM wcf".WCF_N."_cronjob_log
WHERE execTime < ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
<?php
namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
use wcf\system\WCF;
/**
/**
* @see wcf\system\ICronjob::execute()
*/
- public function execute(array $data) {
+ public function execute(Cronjob $cronjob) {
// delete access log
$sql = "DELETE FROM wcf".WCF_N."_acp_session_access_log
WHERE sessionLogID IN (
<?php
namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
use wcf\system\cleanup\CleanupHandler;
/**
/**
* @see wcf\system\ICronjob::execute()
*/
- public function execute(array $data) {
+ public function execute(Cronjob $cronjob) {
CleanupHandler::getInstance()->execute();
}
}
<?php
namespace wcf\system\cronjob;
use wcf\acp\package\update\PackageUpdate;
+use wcf\data\cronjob\Cronjob;
/**
* Gets update package information.
* @see wcf\system\ICronjob::execute()
* @TODO Change path and move method to lib/system/package
*/
- public function execute(array $data) {
- PackageUpdate::refreshPackageDatabaseAutomatically();
+ public function execute(Cronjob $cronjob) {
+ //PackageUpdate::refreshPackageDatabaseAutomatically();
}
}
<?php
namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
/**
* Any Cronjob should implement this interface.
*/
interface ICronjob {
/**
- * To be called when executing the cronjob; the $data array e.g. might be used for passing
- * meaningful values to the cronjob in order to reasonably avail multipleExecs.
+ * Executes the cronjob.
*
- * @param array $data This array should basically contain the dataset
- * associated to the executed cronjob, particularly
- * the date of the planned execution (the nextExec
- * field).
+ * @param wcf\data\cronjob\Cronjob $cronjob Cronjob object with cronjob data
*/
- public function execute(array $data);
+ public function execute(Cronjob $cronjob);
}
<?php
namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
use wcf\system\cache\CacheHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;
/**
* @see wcf\system\ICronjob::execute()
*/
- public function execute(array $data) {
- $filename = FileUtil::downloadFileFromHttp('http://www.woltlab.com/spiderlist/spiderlist.xml', 'spiders');
+ public function execute(Cronjob $cronjob) {
+ /* $filename = FileUtil::downloadFileFromHttp('http://www.woltlab.com/spiderlist/spiderlist.xml', 'spiders');
$xml = new XML($filename);
$spiders = $xml->getElementTree('spiderlist');
}
// delete tmp file
- @unlink($filename);
+ @unlink($filename);*/
}
}
protected function findExistingItem(array $data) {
return null;
}
+
+ /**
+ * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareCreate()
+ */
+ protected function prepareCreate(array &$data) {
+ parent::prepareCreate($data);
+
+ $data['nextExec'] = TIME_NOW;
+ }
}