<?php
// DEBUG - uncomment to enable
declare(strict_types=1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
global $debug_query; $debug_query = true;
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
include(dirname(__FILE__).'/phpMyEditHeader.php');
function phpMyEditHeaderInit($opts, $inst = NULL) {
echo '<h3>phpMyEditHeaderInit</h3>' . "\n";
echo '<pre>' . "\n";
echo 'Opts: ' . print_r($opts, true);
if (isset($inst)) {
echo 'Obj: ' . print_r($inst, true);
$language = $opts['language'];
echo 'Lang <5.7.6 : ' . $language . "\n";
if (strrpos($language, '-UTF8')) $language = substr($language, 0, -5);
echo 'Lang : ' . $language . "\n";
$languages = explode(";", $language);
foreach ($languages as $curlang) {
// remove q=value, from language
if (strpos($curlang, ',')) $curlang = substr($curlang, strpos($curlang, ',') + 1);
if (substr($curlang, 0, 2) == 'q=') break; // do not attempt default wildcard language
$file = getLanguageFile($inst->dir['lang'], strtoupper($curlang));
if (! file_exists($file)) {
// remove all suffixes starting with - until language found
while ($pos = strrpos($curlang, '-')) {
$curlang = substr($curlang, 0, $pos);
$file = getLanguageFile($inst->dir['lang'], strtoupper($curlang));
if (file_exists($file)) break;
}
}
if (file_exists($file)) break;
}
if (!file_exists($file)) {
$file = getLanguageFile($inst->dir['lang'], 'EN');
}
echo 'Lang file : ' . $file . "\n";
$ret = @include($file);
echo 'Lang content : ' . print_r($ret, true) . "\n";
}
echo '</pre>' . "\n";
}
function getLanguageFile($dir, $language) {
if (!strpos($language, 'UTF8')) {
$file = $dir.'PME.lang.'.$language.'-UTF8.inc';
echo 'Testing file : ' . $file . "\n";
if (file_exists($file)) return $file;
}
echo 'Testing file : ' . $dir.'PME.lang.'.$language.'.inc' . "\n";
return $dir.'PME.lang.'.$language.'.inc';
}
function phpMyEditPageHeader($inst) {
echo '<h3>phpMyEditPageHeader</h3>' . "\n";
echo '<pre>' . "\n";
echo 'Obj: ' . print_r($inst, true);
echo '</pre>' . "\n";
}
function phpMyEditPageFooter($inst) {
echo '<h3>phpMyEditPageFooter</h3>' . "\n";
echo '<pre>' . "\n";
echo 'Obj: ' . print_r($inst, true);
echo '</pre>' . "\n";
}
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, please check the documentation. It is available
* on the phpMyEdit pages or in the manuals folder. Some information can also be
* found in the examples/configoptions.md file.
*
* https://sourceforge.net/projects/phpmariaedit/
*
* This file was generated by:
*
* phpMyEdit version: 5.7.6
* lib/phpMyEdit.class.php class: 5.7.6
* phpMyEditSetup.php script: 5.7.6
* generated script: 5.7.6
*
* This file was manually updated.
*/
require_once(dirname(__FILE__).'/../lib/extensions/phpMyEdit-multiquery.class.php');
require_once(dirname(__FILE__).'/../lib/phpMyEditDB.php');
require_once(dirname(__FILE__).'/../phpMyEditDefaults.php');
// custom settings overwriting general edit defaults
$opts['url'] = array('images' => '../images/');
$opts['tb'] = 'pme_changelog';
// Name of field which is the unique key
$opts['key'] = 'rowid';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int';
// Sorting field(s)
$opts['sort_field'] = array('rowid');
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';
/* please refer to lib/phpMyEditInfo.php for additional options
that can be added in this file
*/
$opts['fdd']['rowid'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
$opts['fdd']['updated'] = array(
'name' => 'Updated on',
'select' => 'T',
'options' => 'AVCPD', // updated automatically (MySQL feature)
'maxlen' => 22,
'default' => 'CURRENT_TIMESTAMP',
'sort' => true
);
// now copy php variables over to js variables
// protect sensitive variables so they cannot be read
$cleanopts = $opts;
unset($cleanopts['hn']); unset($cleanopts['pt']);
unset($cleanopts['un']); unset($cleanopts['pw']);
echo '
<script>
var phpOpts = ' . json_encode($cleanopts) . ';
try {
if (typeof PME_js_init === \'function\') {
PME_js_init(phpOpts);
}
} catch(err) {
console.log(err);
}
</script>
';
echo '
<script>
PME_js_setPageTitle("DEBUG THE SYSTEM");
</script>
';
// Now important call to phpMyEdit
new phpMyEdit_MultiQuery($opts);
//eof