-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small session system / cronjob optimization
- Loading branch information
Showing
8 changed files
with
125 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
wcfsetup/install/files/lib/system/cronjob/AbstractCronjob.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace wcf\system\cronjob; | |||
use wcf\data\cronjob\Cronjob; | |||
use wcf\system\event\EventHandler; | |||
|
|||
/** | |||
* Provides a default implementation for cronjobs. | |||
* | |||
* @author Marcel Werk | |||
* @copyright 2001-2012 WoltLab GmbH | |||
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |||
* @package com.woltlab.wcf | |||
* @subpackage system.cronjob | |||
* @category Community Framework | |||
*/ | |||
abstract class AbstractCronjob implements ICronjob { | |||
/** | |||
* @see wcf\system\cronjob\ICronjob::execute() | |||
*/ | |||
public function execute(Cronjob $cronjob) { | |||
EventHandler::getInstance()->fireAction($this, 'execute'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
wcfsetup/install/files/lib/system/cronjob/SessionCleanUpCronjob.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
<?php | |||
namespace wcf\system\cronjob; | |||
use wcf\data\acp\session\ACPSessionEditor; | |||
use wcf\data\cronjob\Cronjob; | |||
use wcf\data\session\SessionEditor; | |||
use wcf\system\WCF; | |||
|
|||
/** | |||
* Deletes expired sesions. | |||
* | |||
* @author Marcel Werk | |||
* @copyright 2001-2012 WoltLab GmbH | |||
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |||
* @package com.woltlab.wcf | |||
* @subpackage system.cronjob | |||
* @category Community Framework | |||
*/ | |||
class SessionCleanUpCronjob extends AbstractCronjob { | |||
/** | |||
* @see wcf\system\cronjob\ICronjob::execute() | |||
*/ | |||
public function execute(Cronjob $cronjob) { | |||
parent::execute($cronjob); | |||
|
|||
ACPSessionEditor::deleteExpiredSessions(TIME_NOW - SESSION_TIMEOUT); | |||
SessionEditor::deleteExpiredSessions(TIME_NOW - SESSION_TIMEOUT); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This broke the installation. During installation, the original user has no username and is switched to the newly created admin afterwards.