Do not directly use native function in API

As fedb877023 showed, we can not directly
use native fuctions because they have no proper type hinting in PHP7.4
This commit is contained in:
Andreas Gohr 2023-12-01 15:53:04 +01:00
parent 5b379b5045
commit e7323dfb8c
1 changed files with 12 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class ApiCore
'dokuwiki.logoff' => new ApiCall([$this, 'logoff']),
'dokuwiki.getPagelist' => new ApiCall([$this, 'readNamespace']),
'dokuwiki.search' => new ApiCall([$this, 'search']),
'dokuwiki.getTime' => (new ApiCall('time'))
'dokuwiki.getTime' => (new ApiCall([$this, 'time']))
->setSummary('Returns the current server time')
->setReturnDescription('unix timestamp'),
'dokuwiki.setLocks' => new ApiCall([$this, 'setLocks']),
@ -83,6 +83,17 @@ class ApiCore
];
}
/**
* Return the current server time
*
* Uses a Unix timestamp (seconds since 1970-01-01 00:00:00 UTC)
*
* @return int A unix timestamp
*/
public function time() {
return time();
}
/**
* Return a raw wiki page
*