Skip to content

Commit

Permalink
move and adjust data to cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastocker committed Sep 18, 2023
1 parent 19389a2 commit 01490ac
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 21 deletions.
51 changes: 51 additions & 0 deletions cli/ilias/client.ini.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
; <?php exit; ?>
[server]
start = "./login.php"

[client]
name = "ilias"
description = "ILIAS"
access = "1"

[db]
type = "innodb"
host = "localhost"
user = "ilias"
pass = "ca44c5a63cbfb162cca43982c9aa5581"
name = "ilias"
port = "3306"

[auth]
table = "usr_data"
usercol = "login"
passcol = "passwd"

[language]
default = "en"
path = "./lang"

[layout]
skin = "default"
style = "delos"

[session]
expire = "1800"

[system]
USE_WHOOPS = "1"
DEVMODE = "1"
ROOT_FOLDER_ID = "1"
SYSTEM_FOLDER_ID = "9"
ROLE_FOLDER_ID = "8"
MAIL_SETTINGS_ID = "12"
MAXLENGTH_OBJ_TITLE = "65"
MAXLENGTH_OBJ_DESC = "123"

[cache]
activate_global_cache = "0"
global_cache_service_type = "static"

[log]
error_recipient = ""

[cache_activated_components]
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function __construct()
}

if (!defined("ILIAS_WEB_DIR")) {
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/data/");
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/cli/");
}

return $DIC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function __construct()
}

if (!defined("ILIAS_WEB_DIR")) {
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/data/");
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/cli/");
}

return $DIC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function __construct()
}

if (!defined("ILIAS_WEB_DIR")) {
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/data/");
define('ILIAS_WEB_DIR', dirname(__DIR__, 5) . "/cli/");
}

return [$ORIG_DIC, $ORIG_ilDB];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function setIniFile(): void
define("CLIENT_DATA_DIR", $ini->readVariable("clients", "datadir") . "/" . $client_id);
}
if (!defined("CLIENT_WEB_DIR")) {
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/data/" . $client_id);
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/cli/" . $client_id);
}
if (!defined("ILIAS_ABSOLUTE_PATH")) {
define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 6));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function setIniFile(): void
define("CLIENT_DATA_DIR", $ini->readVariable("clients", "datadir") . "/" . $client_id);
}
if (!defined("CLIENT_WEB_DIR")) {
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/data/" . $client_id);
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/cli/" . $client_id);
}
if (!defined("ILIAS_ABSOLUTE_PATH")) {
define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 6));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function __construct()
}

if (!defined("ILIAS_WEB_DIR")) {
define('ILIAS_WEB_DIR', dirname(__DIR__, 4) . "/data/");
define('ILIAS_WEB_DIR', dirname(__DIR__, 4) . "/cli/");
}

return [$ORIG_DIC, $ORIG_ilDB];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public static function _lookupItemPath(
? ILIAS_HTTP_PATH
: ".";

return $path . "/data/" . CLIENT_ID . "/mobs/mm_" . $a_mob_id . "/" . $location;
return $path . "/cli/" . CLIENT_ID . "/mobs/mm_" . $a_mob_id . "/" . $location;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/RTE_/classes/class.ilRTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public static function _replaceMediaObjectImageSrc(
$mob_obj = new ilObjMediaObject((int) $mob);
$replace = 'il_' . $matches[1][$idx] . '_mob_' . $mob;
$path_to_file = ilWACSignedPath::signFile(
ILIAS_HTTP_PATH . '/data/' . CLIENT_ID . '/mobs/mm_' . $mob . '/' . $mob_obj->getTitle()
ILIAS_HTTP_PATH . '/cli/' . CLIENT_ID . '/mobs/mm_' . $mob . '/' . $mob_obj->getTitle()
);
$resulttext = str_replace("src=\"$replace\"", "src=\"" . $path_to_file . "\"", $resulttext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
$data_dir = $ilias_ini->readVariable('clients', 'datadir');
$client_data_dir = "{$data_dir}/{$client_id}";
if (!defined("CLIENT_WEB_DIR")) {
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/data/" . $client_id);
define("CLIENT_WEB_DIR", dirname(__DIR__, 5) . "/cli/" . $client_id);
}
if (!defined("ILIAS_WEB_DIR")) {
define("ILIAS_WEB_DIR", dirname(__DIR__, 5));
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/User_/classes/Export/UserHtmlExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct()
*/
public function exportUserImages(string $dir, array $user_ids): void
{
$base_dir = $dir . "/data/" . CLIENT_ID . "/usr_images";
$base_dir = $dir . "/cli/" . CLIENT_ID . "/usr_images";
ilFileUtils::makeDirParents($base_dir);
foreach ($user_ids as $id) {
$source = "./data/" . CLIENT_ID . "/usr_images/usr_$id.jpg";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __construct(string $path)

$result['path_without_query'] = strstr(
parse_url($path)['path'],
'/data/',
'/cli/',
false
);

Expand Down
2 changes: 1 addition & 1 deletion scripts/PHPStan/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
const CLIENT_NAME = 'PHPStan';
const ABSOLUTE_PATH = '/';
const ILIAS_DATA_DIR = './external_data';
const ILIAS_WEB_DIR = './data';
const ILIAS_WEB_DIR = './cli';
const CLIENT_DATA_DIR = './external_data';
const CLIENT_WEB_DIR = './data';

Expand Down
2 changes: 1 addition & 1 deletion setup/classes/class.ilIniFilesPopulatedObjective.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function isApplicable(Setup\Environment $environment): bool

protected function getClientDir(string $client_id): string
{
return dirname(__DIR__, 2) . "/data/" . $client_id;
return dirname(__DIR__, 2) . "/cli/" . $client_id;
}

protected function getClientIniPath(string $client_id): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ public function clientIniExists(): bool

protected function getClientDir(): string
{
return dirname(__DIR__, 2) . "/data/" . ((string) $this->config->getClientId());
return dirname(__DIR__, 2) . "/cli/" . ((string) $this->config->getClientId());
}
}
6 changes: 0 additions & 6 deletions tests/App/RootFolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,16 @@ final class RootFolderTest extends TestCase
'cli',
'components',
'Customizing',
'cron',
'data',
'docs',
'extern',
'include',
'lang',
'libs',
'node_modules',
'scripts',
'setup',
'src',
'templates',
'test',
'tests',
'webservice',
'xml',
'.settings'
];

Expand Down
2 changes: 1 addition & 1 deletion tests/Filesystem/Util/LegacyPathHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function setUp(): void

$iliasAbsolutePath = '/dummy/var/www/html/ilias';
$dataDir = '/dummy/var/www/ildata';
$webDir = 'data';
$webDir = 'cli';
$clientId = 'default';

//constants needed for test subject
Expand Down

0 comments on commit 01490ac

Please sign in to comment.