dbXapp 2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Loading...
Searching...
No Matches
run_context_help_provision.php
Go to the documentation of this file.
1<?php
2$base = dirname(__DIR__, 4);
3chdir($base);
4$_SERVER['REQUEST_URI'] = '/dbxapp/';
5$_SERVER['HTTP_HOST'] = 'localhost';
6$_SERVER['HTTPS'] = 'on';
7$_SERVER['SCRIPT_NAME'] = '/dbxapp/index.php';
8
9define('dbxSystem', 'dbxWebApp');
10define('dbxRunAsAdmin', 0);
11
12function 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
21function dbx_get_file_dir() {
22 return dbx_get_base_dir() . 'files/';
23}
24
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
34require $base . '/dbx/vendor/autoload.php';
35require_once $base . '/dbx/include/dbxKernel.php';
36require_once $base . '/dbx/modules/dbxContent/include/dbxContentContextHelpProvision.class.php';
37
38$db = dbx()->get_system_obj('dbxDB');
39$server = 'dbx|dbxContent.db3';
40if (!$db->connect_db_server($server)) {
41 fwrite(STDERR, "DB connect failed\n");
42 exit(1);
43}
44
46echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
47
48if (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}
$config['version']
Definition config.php:2
exit
Definition index.php:532
$path_file
Definition index.php:270
DBX schema administration.
dbx_os_path_file($path_file)
if(! $db->connect_db_server($server)) $result
dbx_get_base_dir($cut_Data=0)
$_SERVER['REQUEST_URI']