Fixed the installation of cronjobs
authorMarcel Werk <burntime@woltlab.com>
Tue, 26 Jul 2011 15:58:20 +0000 (17:58 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 26 Jul 2011 15:58:20 +0000 (17:58 +0200)
XSD/cronjobs.xsd
com.woltlab.wcf/cronjobs.xml
wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php
wcfsetup/install/files/lib/system/package/plugin/CronjobsPackageInstallationPlugin.class.php

index eafaa6f8ef8772ac7a9d5958be93cd5324937e7a..da1c83945a886751ea471b65367634ddc5077b2e 100644 (file)
@@ -32,7 +32,7 @@
          <!-- Represents a cronjob which will be installed,updated or deleted. Extends the type "cronjob_delete". -->
        <xs:complexType name="cronjob">
                                 <xs:all>                                        
-                                        <xs:element name="classpath" type="woltlab_varchar_nullable" minOccurs="0" />
+                                        <xs:element name="classname" type="woltlab_varchar_nullable" minOccurs="0" />
                                         <xs:element name="description" type="woltlab_varchar_nullable" minOccurs="0" />
                                         <xs:element name="startminute" type="woltlab_varchar" minOccurs="1" />
                                         <xs:element name="starthour" type="woltlab_varchar" minOccurs="1" />
index 6894f4710c6e38b9a61274a1959ac7e4490b8321..5aa189640291b1b9288c94194c22ac50b7ae2aeb 100644 (file)
@@ -2,7 +2,7 @@
 <data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/cronjobs.xsd">
        <import>
                <cronjob>
-                       <classpath>lib/system/cronjob/GetUpdateInfoCronjob.class.php</classpath>
+                       <classname>wcf\system\cronjob\GetUpdateInfoCronjob</classname>
                        <description>Gets update package information</description>
                        <startminute>0</startminute>
                        <starthour>2</starthour>
@@ -15,7 +15,7 @@
                </cronjob>
                
                <cronjob>
-                       <classpath>lib/system/cronjob/RefreshSearchRobotsCronjob.class.php</classpath>
+                       <classname>wcf\system\cronjob\RefreshSearchRobotsCronjob</classname>
                        <description>Refreshes list of search robots</description>
                        <startminute>0</startminute>
                        <starthour>3</starthour>
@@ -28,7 +28,7 @@
                </cronjob>
                
                <cronjob>
-                       <classpath>lib/system/cronjob/CleanUpCronjobLogCronjob.class.php</classpath>
+                       <classname>wcf\system\cronjob\CleanUpCronjobLogCronjob</classname>
                        <description>Deletes old entries from cronjob log.</description>
                        <startminute>0</startminute>
                        <starthour>12</starthour>
@@ -41,7 +41,7 @@
                </cronjob>
                
                <cronjob>
-                       <classpath>lib/system/cronjob/CleanUpSessionLogCronjob.class.php</classpath>
+                       <classname>wcf\system\cronjob\CleanUpSessionLogCronjob</classname>
                        <description>Deletes old entries from session log.</description>
                        <startminute>0</startminute>
                        <starthour>10</starthour>
@@ -54,7 +54,7 @@
                </cronjob>
                
                <cronjob>
-                       <classpath>lib/system/cronjob/CleanupListenerCronjob.class.php</classpath>
+                       <classname>wcf\system\cronjob\CleanupListenerCronjob</classname>
                        <description>Executes cleanup system.</description>
                        <startminute>5,20,35,50</startminute>
                        <starthour>*</starthour>
index 198b03937f42595c4559f977c5d63eadaf1897d6..18072b59847b7341a9eca949b5700b3fc30ce34b 100755 (executable)
@@ -37,13 +37,13 @@ class CronjobListPage extends SortablePage {
        public $objectListClassName = 'wcf\data\cronjob\CronjobList';
        
        /**
-        * @see wcf\page\MultipleLinkPage::readObjects()
+        * @see wcf\page\MultipleLinkPage::initObjectList()
         */     
-       public function readObjects() {
+       public function initObjectList() {
+               parent::initObjectList();
+               
                $this->objectList->getConditionBuilder()->add("cronjob.packageID IN (?)", array(PackageDependencyHandler::getDependencies()));
                $this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
-               
-               parent::readObjects();
        }
        
        /**
index e6c64697752a21592d22a1533f1285bcd7463ea9..92c7f58942bee8b0f085ee605e2980f405367984 100644 (file)
@@ -27,19 +27,19 @@ class CronjobsPackageInstallationPlugin extends AbstractXMLPackageInstallationPl
        /**
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
         */     
-       public $tagName = 'cronjobs';
+       public $tagName = 'cronjob';
        
        /**
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
         */
        protected function handleDelete(array $items) {
                $sql = "DELETE FROM     wcf".WCF_N."_".$this->tableName."
-                       WHERE           classPath = ?
+                       WHERE           className = ?
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
                        $statement->execute(array(
-                               $item['attributes']['classpath'],
+                               $item['attributes']['classname'],
                                $this->installation->getPackageID()
                        ));
                }
@@ -67,7 +67,7 @@ class CronjobsPackageInstallationPlugin extends AbstractXMLPackageInstallationPl
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::validateImport()
         */
        protected function validateImport(array $data) {
-               CronjobUtil::validate($startMinute, $startHour, $startDom, $startMonth, $startDow);
+               CronjobUtil::validate($data['startMinute'], $data['startHour'], $data['startDom'], $data['startMonth'], $data['startDow']);
        }
        
        /**