dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
provision_docs_content.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
$base
= dirname(__DIR__, 4);
5
chdir(
$base
);
6
$_SERVER
[
'REQUEST_URI'
] =
'/dbxapp-docs/'
;
7
$_SERVER
[
'HTTP_HOST'
] =
'localhost'
;
8
$_SERVER
[
'HTTPS'
] =
'on'
;
9
$_SERVER
[
'SCRIPT_NAME'
] =
'/dbxapp-docs/index.php'
;
10
11
define(
'dbxSystem'
,
'dbxWebApp'
);
12
define(
'dbxRunAsAdmin'
, 1);
13
14
require
$base
.
'/dbx/vendor/autoload.php'
;
15
require_once
$base
.
'/dbx/include/dbxKernel.php'
;
16
require_once
$base
.
'/dbx/modules/dbxDocs/include/dbxDocsContentProvision.class.php'
;
17
18
$force
= in_array(
'--force'
,
$argv
?? array(),
true
);
19
$db
=
dbx
()->get_system_obj(
'dbxDB'
);
20
$dd
=
dbx
()->get_system_obj(
'dbxDD'
);
21
22
$schema
= array();
23
foreach
(array(
'content_de'
,
'content_en'
,
'content_es'
) as $name) {
24
$dd
->sync_dd_to_db(
'dbx'
, $name,
'reset'
);
25
$state
= array();
26
for
($step = 0; $step < 1000; $step++) {
27
$state
=
$dd
->sync_dd_to_db(
'dbx'
, $name,
'apply'
);
28
if
(in_array((
string
)(
$state
[
'status'
] ??
''
), array(
'finished'
,
'error'
,
'cancelled'
),
true
)) {
29
break
;
30
}
31
}
32
$schema
[$name] =
$state
;
33
}
34
35
$failed
= array_filter(
$schema
,
static
fn(array
$state
):
bool
=> (
$state
[
'status'
] ??
''
) !==
'finished'
);
36
if
(
$failed
!== array()) {
37
fwrite(STDERR, json_encode(array(
'ok'
=>
false
,
'schema'
=>
$schema
), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL);
38
exit
(1);
39
}
40
41
$service
= new \dbx\dbxDocs\dbxDocsContentProvision(
$db
,
$base
,
$force
);
42
$result
=
$service
->run();
43
echo json_encode(array(
'schema'
=>
$schema
,
'content'
=>
$result
), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
44
exit
(!empty(
$result
[
'ok'
]) ? 0 : 1);
$schema
$schema
Definition
configure_docs_access_20260728.php:37
$_SERVER
$_SERVER['REQUEST_METHOD']
Definition
dbxApi_head_response_test.php:10
$base
$base
Definition
dbxApi_paths_test.php:11
$failed
$failed
Definition
dbxCmsMediaMaintenancePerformance_contract_test.php:30
$db
$db
Definition
dbxDB_dd_server_binding_test.php:52
$service
$service
Definition
dbxDashboard_update_status_contract_test.php:23
$state
$state
Definition
dbxDatabaseMigrationService_test.php:198
$result
$result
Definition
dbxForm_validation_result_test.php:29
$dd
$dd
Definition
dbxMediaUsageLanguage_contract_test.php:10
$argv
$argv
Definition
doxygen_utf8_filter_test.php:17
exit
exit
Definition
index.php:146
dbx
DBX schema administration.
$force
$force
Definition
provision_docs_content.php:18
dbx
modules
dbxDocs
tools
provision_docs_content.php
Generated by
1.17.0