Menu

[f1bb48]: / examples / debug.php  Maximize  Restore  History

Download this file

165 lines (140 with data), 5.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?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
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.