dbXapp
2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Toggle main menu visibility
Loading...
Searching...
No Matches
run_context_help_provision.php
Go to the documentation of this file.
1
<?php
2
$base
= dirname(__DIR__, 4);
3
chdir(
$base
);
4
$_SERVER
[
'REQUEST_URI'
] =
'/dbxapp/'
;
5
$_SERVER
[
'HTTP_HOST'
] =
'localhost'
;
6
$_SERVER
[
'HTTPS'
] =
'on'
;
7
$_SERVER
[
'SCRIPT_NAME'
] =
'/dbxapp/index.php'
;
8
9
define(
'dbxSystem'
,
'dbxWebApp'
);
10
define(
'dbxRunAsAdmin'
, 0);
11
12
function
dbx_get_base_dir
($cut_Data = 0) {
13
global
$base
;
14
$path = str_replace(
'\\'
,
'/'
,
$base
) .
'/'
;
15
if
($cut_Data) {
16
$path = str_ends_with($path,
'/Data/'
) ? substr($path, 0, -5) : $path;
17
}
18
return
rtrim($path,
'/'
) .
'/'
;
19
}
20
21
function
dbx_get_file_dir
() {
22
return
dbx_get_base_dir
() .
'files/'
;
23
}
24
25
function
dbx_os_path_file
(
$path_file
) {
26
$path_file
= str_replace(array(
'\\'
,
'//'
,
'\\\\'
),
'/'
,
$path_file
);
27
$path_file
= preg_replace(
'#(?<!:)//+#'
,
'/'
,
$path_file
);
28
if
(DIRECTORY_SEPARATOR ===
'\\'
) {
29
$path_file
= str_replace(
'/'
,
'\\'
,
$path_file
);
30
}
31
return
$path_file
;
32
}
33
34
require
$base
.
'/dbx/vendor/autoload.php'
;
35
require_once
$base
.
'/dbx/include/dbxKernel.php'
;
36
require_once
$base
.
'/dbx/modules/dbxContent/include/dbxContentContextHelpProvision.class.php'
;
37
38
$db
=
dbx
()->get_system_obj(
'dbxDB'
);
39
$server
=
'dbx|dbxContent.db3'
;
40
if
(!
$db
->connect_db_server(
$server
)) {
41
fwrite(STDERR,
"DB connect failed\n"
);
42
exit
(1);
43
}
44
45
$result
=
\dbx\dbxContent\dbxContentContextHelpProvision::provisionAll
(
$db
);
46
echo json_encode(
$result
, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
47
48
if
(empty(
$result
[
'errors'
]) && ((
int
) (
$result
[
'created'
] ?? 0) + (
int
) (
$result
[
'updated'
] ?? 0)) > 0) {
49
$config
=
dbx
()->get_config(
'dbxContent'
);
50
if
(!is_array(
$config
)) {
51
$config
= array();
52
}
53
$config
[
'context_help_provision_version'
] = 3;
54
dbx
()->set_config(
'dbxContent'
,
$config
);
55
}
dbx\dbxContent\dbxContentContextHelpProvision\provisionAll
static provisionAll($db)
Definition
dbxContentContextHelpProvision.class.php:35
$config
$config['version']
Definition
config.php:2
exit
exit
Definition
index.php:532
$path_file
$path_file
Definition
index.php:270
dbx
DBX schema administration.
$db
$db
Definition
run_context_help_provision.php:38
dbx_os_path_file
dbx_os_path_file($path_file)
Definition
run_context_help_provision.php:25
$result
if(! $db->connect_db_server($server)) $result
Definition
run_context_help_provision.php:45
dbx_get_file_dir
dbx_get_file_dir()
Definition
run_context_help_provision.php:21
$base
$base
Definition
run_context_help_provision.php:2
$server
$server
Definition
run_context_help_provision.php:39
dbx_get_base_dir
dbx_get_base_dir($cut_Data=0)
Definition
run_context_help_provision.php:12
$_SERVER
$_SERVER['REQUEST_URI']
Definition
run_context_help_provision.php:4
dbx
modules
dbxAdmin
tools
run_context_help_provision.php
Generated by
1.17.0