Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit 68c2e36

Browse files
author
Lars Peipmann
committed
[FEATURE] Runs tcemain commands with a faked admin backend user
1 parent 4dd1763 commit 68c2e36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Classes/Service/CacheApiService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@ class Tx_Coreapi_Service_CacheApiService {
3939
*
4040
*/
4141
public function initializeObject() {
42+
// Create a fake admin user
43+
$adminUser = new t3lib_beUserAuth();
44+
$adminUser->user['uid'] = $GLOBALS['BE_USER']->user['uid'];
45+
$adminUser->user['username'] = '_CLI_lowlevel';
46+
$adminUser->user['admin'] = 1;
47+
$adminUser->workspace = 0;
48+
4249
$this->tce = t3lib_div::makeInstance('t3lib_TCEmain');
4350
$this->tce->start(Array(), Array());
51+
$this->tce->start(Array(), Array(), $adminUser);
4452
}
4553

4654
/**

0 commit comments

Comments
 (0)