7$_SERVER[
'SCRIPT_NAME'] =
'/dbxapp/index.php';
9if (!defined(
'dbxSystem')) {
10 define(
'dbxSystem',
'dbxWebApp');
12if (!defined(
'dbxRunAsAdmin')) {
13 define(
'dbxRunAsAdmin', 1);
16require_once
$root .
'/dbx/vendor/autoload.php';
17require_once
$root .
'/dbx/include/dbxKernel.php';
18require_once dirname(__DIR__) .
'/dbxValidator.class.php';
19require_once dirname(__DIR__, 2) .
'/modules/dbxContent/include/dbxContent_permalink.class.php';
20require_once dirname(__DIR__, 2) .
'/modules/dbxAdmin/include/dbxAdminHelp.class.php';
26foreach (array(
'home',
'help-dashboard-admin',
'seite-51',
'a1-b2') as
$value) {
28 throw new RuntimeException(
'Gueltiger Permalink abgelehnt: ' .
$value);
32foreach (array(
'home/tutorial',
'zwei woerter',
'mit_unterstrich',
'datei.html',
'Gross',
'-start',
'ende-',
'zwei--striche',
'äöü') as
$value) {
34 throw new RuntimeException(
'Ungueltiger Permalink akzeptiert: ' .
$value);
38if (dbxContent_permalink::normalize(
' Home / Über uns ') !==
'home-ueber-uns') {
39 throw new RuntimeException(
'Permalink-Normalisierung verwendet nicht ausschliesslich Bindestriche.');
42if (dbxContent_permalink::canonicalFromLegacy(
'home/tutorial/admin-dashboard') !==
'tutorial-admin-dashboard') {
43 throw new RuntimeException(
'Legacy-Tutorial wird nicht auf den stabilen Permalink abgebildet.');
47 public array $permalinks = array(
'neue-seite' => 7);
49 public function select(
$dd, $where,
$fields =
'*',
$order =
'', $direction =
'', $group =
'', $limit = 0, $offset = 0, $debug = 0): array {
50 if (!preg_match(
"/permalink = '([^']+)'/", (
string)$where, $match)) {
53 $permalink = str_replace(
"''",
"'", $match[1]);
54 return isset($this->permalinks[$permalink]) ? array(array(
'id' => $this->permalinks[$permalink])) : array();
58if (dbxContent_permalink::build(
$db,
'content_folder_de', 99,
'Neue Seite') !==
'neue-seite-2') {
59 throw new RuntimeException(
'Automatische Permalinks sind nicht ordnerunabhaengig oder nicht eindeutig.');
62if (dbxContent_permalink::unique(
$db,
'content_de',
'neue-seite', 7) !==
'neue-seite') {
63 throw new RuntimeException(
'Eigener Datensatz wird bei der Eindeutigkeitspruefung nicht ausgeschlossen.');
67foreach ((
new \
dbx\dbxAdmin\dbxAdminHelp())->topics() as $topic => $meta) {
68 $permalink = (string)($meta[
'permalink'] ??
'');
69 if (!
$validator->validate($permalink,
'permalink|min=1|max=254')) {
70 throw new RuntimeException(
'Hilfe-Thema besitzt keinen gueltigen Permalink: ' . $topic);
73 throw new RuntimeException(
'Doppelter Hilfe-Permalink: ' . $permalink);
78echo
"OK: Permalink-Regel, Normalisierung, Legacy-Alias und Eindeutigkeit geprueft.\n";
Zentrale, strikt pruefende Eingabevalidierung.
$_SERVER['REQUEST_METHOD']
if(dbxContent_permalink::build( $db, 'content_folder_de', 99, 'Neue Seite') !=='neue-seite-2') if(dbxContent_permalink::unique($db, 'content_de', 'neue-seite', 7) !=='neue-seite') $helpPermalinks
DBX schema administration.