mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
expect parameter of type SeedDMS_SchedulerTask in execute()
This commit is contained in:
parent
7218e47558
commit
cb601a82eb
|
@ -109,7 +109,7 @@ class SeedDMS_SchedulerTaskBase {
|
||||||
$this->fulltextservice = $fulltextservice;
|
$this->fulltextservice = $fulltextservice;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
public function execute($task) { /* {{{ */
|
public function execute(SeedDMS_SchedulerTask $task) { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
* @param $dms dms
|
* @param $dms dms
|
||||||
* @return boolean true if task was executed succesfully, otherwise false
|
* @return boolean true if task was executed succesfully, otherwise false
|
||||||
*/
|
*/
|
||||||
public function execute($task) {
|
public function execute(SeedDMS_SchedulerTask $task) {
|
||||||
$dms = $this->dms;
|
$dms = $this->dms;
|
||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
$settings = $this->settings;
|
$settings = $this->settings;
|
||||||
|
@ -117,11 +117,14 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
* iterating over all folders recursively.
|
* iterating over all folders recursively.
|
||||||
*/
|
*/
|
||||||
class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */
|
class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */
|
||||||
|
protected $scheduler;
|
||||||
|
|
||||||
protected $forceupdate;
|
protected $forceupdate;
|
||||||
|
|
||||||
protected $fulltextservice;
|
protected $fulltextservice;
|
||||||
|
|
||||||
public function __construct($fulltextservice, $forceupdate) { /* {{{ */
|
public function __construct($scheduler, $fulltextservice, $forceupdate) { /* {{{ */
|
||||||
|
$this->scheduler = $scheduler;
|
||||||
$this->fulltextservice = $fulltextservice;
|
$this->fulltextservice = $fulltextservice;
|
||||||
$this->forceupdate = $forceupdate;
|
$this->forceupdate = $forceupdate;
|
||||||
$this->numdocs = $this->fulltextservice->Indexer()->count();
|
$this->numdocs = $this->fulltextservice->Indexer()->count();
|
||||||
|
@ -249,7 +252,7 @@ class SeedDMS_IndexingDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ *
|
||||||
* @param $dms dms
|
* @param $dms dms
|
||||||
* @return boolean true if task was executed succesfully, otherwise false
|
* @return boolean true if task was executed succesfully, otherwise false
|
||||||
*/
|
*/
|
||||||
public function execute($task) {
|
public function execute(SeedDMS_SchedulerTask $task) {
|
||||||
$dms = $this->dms;
|
$dms = $this->dms;
|
||||||
$logger = $this->logger;
|
$logger = $this->logger;
|
||||||
$fulltextservice = $this->fulltextservice;
|
$fulltextservice = $this->fulltextservice;
|
||||||
|
@ -273,7 +276,7 @@ class SeedDMS_IndexingDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$folderprocess = new SeedDMS_Task_Indexer_Process_Folder($fulltextservice, $recreate);
|
$folderprocess = new SeedDMS_Task_Indexer_Process_Folder($this, $fulltextservice, $recreate);
|
||||||
call_user_func(array($folderprocess, 'process'), $folder, -1);
|
call_user_func(array($folderprocess, 'process'), $folder, -1);
|
||||||
$tree = new SeedDMS_FolderTree($folder, array($folderprocess, 'process'));
|
$tree = new SeedDMS_FolderTree($folder, array($folderprocess, 'process'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -345,7 +348,7 @@ class SeedDMS_CheckSumTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
* @param $dms dms
|
* @param $dms dms
|
||||||
* @return boolean true if task was executed succesfully, otherwise false
|
* @return boolean true if task was executed succesfully, otherwise false
|
||||||
*/
|
*/
|
||||||
public function execute($task) {
|
public function execute(SeedDMS_SchedulerTask $task) {
|
||||||
$dms = $this->dms;
|
$dms = $this->dms;
|
||||||
$logger = $this->logger;
|
$logger = $this->logger;
|
||||||
$taskparams = $task->getParameter();
|
$taskparams = $task->getParameter();
|
||||||
|
@ -433,7 +436,7 @@ class SeedDMS_PreviewTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
* @param $dms dms
|
* @param $dms dms
|
||||||
* @return boolean true if task was executed succesfully, otherwise false
|
* @return boolean true if task was executed succesfully, otherwise false
|
||||||
*/
|
*/
|
||||||
public function execute($task) {
|
public function execute(SeedDMS_SchedulerTask $task) {
|
||||||
$dms = $this->dms;
|
$dms = $this->dms;
|
||||||
$logger = $this->logger;
|
$logger = $this->logger;
|
||||||
$settings = $this->settings;
|
$settings = $this->settings;
|
||||||
|
|
|
@ -84,6 +84,7 @@ foreach($tasks as $task) {
|
||||||
if(method_exists($taskobj, 'execute')) {
|
if(method_exists($taskobj, 'execute')) {
|
||||||
if(!$task->getDisabled() && $task->isDue()) {
|
if(!$task->getDisabled() && $task->isDue()) {
|
||||||
if($mode == 'run') {
|
if($mode == 'run') {
|
||||||
|
echo get_class($task);
|
||||||
if($taskobj->execute($task)) {
|
if($taskobj->execute($task)) {
|
||||||
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
|
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
|
||||||
$task->updateLastNextRun();
|
$task->updateLastNextRun();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user