dbXapp
2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Toggle main menu visibility
Loading...
Searching...
No Matches
run_cms_anleitung_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'
, 1);
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
function
dbx_path_is_absolute
(
string
$path): bool {
35
$path = str_replace(
'\\'
,
'/'
, trim($path));
36
if
($path ===
''
) {
37
return
false
;
38
}
39
if
($path[0] ===
'/'
) {
40
return
true
;
41
}
42
return
(
bool
) preg_match(
'#^[A-Za-z]:/#'
, $path);
43
}
44
45
function
dbx_config_path_store
(
string
$path,
bool
$dirTrailingSlash =
false
): string {
46
$path = str_replace(
'\\'
,
'/'
, trim($path));
47
if
($path ===
''
) {
48
return
''
;
49
}
50
$base
= str_replace(
'\\'
,
'/'
,
dbx_get_base_dir
());
51
if
(
dbx_path_is_absolute
($path) || str_starts_with($path,
$base
)) {
52
$abs = str_replace(
'\\'
,
'/'
,
dbx_os_path_file
($path));
53
$baseNorm = str_replace(
'\\'
,
'/'
,
dbx_os_path_file
(
$base
));
54
if
(str_starts_with($abs, $baseNorm)) {
55
$path = substr($abs, strlen($baseNorm));
56
}
57
}
58
$path = ltrim($path,
'/'
);
59
if
($dirTrailingSlash && $path !==
''
) {
60
$path = rtrim($path,
'/'
) .
'/'
;
61
}
62
return
$path;
63
}
64
65
function
dbx_config_path_resolve
(
string
$path): string {
66
$path = str_replace(
'\\'
,
'/'
, trim($path));
67
if
($path ===
''
) {
68
return
''
;
69
}
70
if
(!
dbx_path_is_absolute
($path)) {
71
$path =
dbx_get_base_dir
() . ltrim($path,
'/'
);
72
}
73
return
dbx_os_path_file
($path);
74
}
75
76
require
$base
.
'/dbx/vendor/autoload.php'
;
77
require_once
$base
.
'/dbx/include/dbxKernel.php'
;
78
require_once
$base
.
'/dbx/modules/dbxKi/include/dbxKiCmsHelpProvision.class.php'
;
79
80
$result
=
\dbx\dbxKi\dbxKiCmsHelpProvision::provision
();
81
echo json_encode(
$result
, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
82
83
if
(empty(
$result
[
'errors'
])) {
84
$config
=
dbx
()->get_config(
'dbxKi'
);
85
if
(!is_array(
$config
)) {
86
$config
= array();
87
}
88
$config
[\
dbx\dbxKi\dbxKiCmsHelpProvision::CONFIG_KEY
] = \
dbx\dbxKi\dbxKiCmsHelpProvision::PROVISION_VERSION
;
89
dbx
()->set_config(
'dbxKi'
,
$config
);
90
exit
(0);
91
}
92
93
exit
(1);
dbx\dbxKi\dbxKiCmsHelpProvision\provision
static provision()
Definition
dbxKiCmsHelpProvision.class.php:30
dbx\dbxKi\dbxKiCmsHelpProvision\PROVISION_VERSION
const PROVISION_VERSION
Definition
dbxKiCmsHelpProvision.class.php:17
dbx\dbxKi\dbxKiCmsHelpProvision\CONFIG_KEY
const CONFIG_KEY
Definition
dbxKiCmsHelpProvision.class.php:16
$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.
dbx_os_path_file
dbx_os_path_file($path_file)
Definition
run_cms_anleitung_provision.php:25
dbx_config_path_store
dbx_config_path_store(string $path, bool $dirTrailingSlash=false)
Definition
run_cms_anleitung_provision.php:45
dbx_config_path_resolve
dbx_config_path_resolve(string $path)
Definition
run_cms_anleitung_provision.php:65
dbx_path_is_absolute
dbx_path_is_absolute(string $path)
Definition
run_cms_anleitung_provision.php:34
dbx_get_file_dir
dbx_get_file_dir()
Definition
run_cms_anleitung_provision.php:21
dbx_get_base_dir
dbx_get_base_dir($cut_Data=0)
Definition
run_cms_anleitung_provision.php:12
$result
if(! $db->connect_db_server($server)) $result
Definition
run_context_help_provision.php:45
$base
$base
Definition
run_context_help_provision.php:2
$_SERVER
$_SERVER['REQUEST_URI']
Definition
run_context_help_provision.php:4
dbx
modules
dbxKi
tools
run_cms_anleitung_provision.php
Generated by
1.17.0