Compare commits

...

4 Commits

Author SHA1 Message Date
Clemens Schwaighofer
f151509bfe Update CoreLibs with remove of flash folder and add data folder 2021-08-30 11:25:19 +09:00
Clemens Schwaighofer
e252a76c4c Fix for test datetime, indet on test db, remove debug in test lang 2021-08-13 18:11:37 +09:00
Clemens Schwaighofer
7005e07f4c Composer core updates, Fix for Form/Generate 2021-08-12 16:49:36 +09:00
Clemens Schwaighofer
a86ae3efc3 DB IO updates for settings return, Smarty Extended update
Update core template main body with better position for overlib init,
pagename div id add, remove px from any size call (width)

DB IO adds return for config settings, fix db async check to always
return boolean only, add had error variable return method

Some minor fixes in Smarty Extended for some legacy admin page variables
needed.

Update Error reporting to be self containing with defines
2021-07-26 16:09:51 +09:00
21 changed files with 122 additions and 76 deletions

View File

@@ -33,7 +33,7 @@ use CoreLibs\Combined\DateTime;
use CoreLibs\Debug\Support as DgS; use CoreLibs\Debug\Support as DgS;
$basic = new CoreLibs\Basic(); $basic = new CoreLibs\Basic();
$datetime_class = 'CoreLibs\Combination\DateTime'; $datetime_class = 'CoreLibs\Combined\DateTime';
print "<html><head><title>TEST CLASS: DATE/TIME</title><head>"; print "<html><head><title>TEST CLASS: DATE/TIME</title><head>";
print "<body>"; print "<body>";

View File

@@ -63,9 +63,9 @@ while ($res = $db->dbReturn("SELECT * FROM max_test")) {
print "<pre>"; print "<pre>";
$status = $db->dbExec("INSERT INTO foo (test) VALUES ('FOO TEST " . time() . "') RETURNING test"); $status = $db->dbExec("INSERT INTO foo (test) VALUES ('FOO TEST " . time() . "') RETURNING test");
print "DIRECT INSERT STATUS: $status | " print "DIRECT INSERT STATUS: $status | "
. "PRIMARY KEY: " . $db->dbGetInsertPK() . " | " . "PRIMARY KEY: " . $db->dbGetInsertPK() . " | "
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | " . "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>"; . "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
// should throw deprecated error // should throw deprecated error
// $db->getReturningExt(); // $db->getReturningExt();
@@ -74,9 +74,9 @@ print "DIRECT INSERT PREVIOUS INSERTED: "
$db->dbPrepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)"); $db->dbPrepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)");
$status = $db->dbExecute("ins_foo", array('BAR TEST ' . time())); $status = $db->dbExecute("ins_foo", array('BAR TEST ' . time()));
print "PREPARE INSERT STATUS: $status | " print "PREPARE INSERT STATUS: $status | "
. "PRIMARY KEY: " . $db->dbGetInsertPK() . " | " . "PRIMARY KEY: " . $db->dbGetInsertPK() . " | "
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | " . "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING RETURN: " . print_r($db->dbGetReturningArray(), true) . "<br>"; . "RETURNING RETURN: " . print_r($db->dbGetReturningArray(), true) . "<br>";
print "PREPARE INSERT PREVIOUS INSERTED: " print "PREPARE INSERT PREVIOUS INSERTED: "
. print_r($db->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = " . $db->dbGetInsertPK()), true) . "<br>"; . print_r($db->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = " . $db->dbGetInsertPK()), true) . "<br>";
@@ -96,22 +96,22 @@ $status = $db->dbExec(
. "RETURNING foo_id, test" . "RETURNING foo_id, test"
); );
print "DIRECT MULTIPLE INSERT STATUS: $status | " print "DIRECT MULTIPLE INSERT STATUS: $status | "
. "PRIMARY KEYS: " . print_r($db->dbGetInsertPK(), true) . " | " . "PRIMARY KEYS: " . print_r($db->dbGetInsertPK(), true) . " | "
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | " . "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>"; . "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
// no returning, but not needed ; // no returning, but not needed ;
$status = $db->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST " . time() . "');"); $status = $db->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST " . time() . "');");
print "DIRECT INSERT STATUS: $status | " print "DIRECT INSERT STATUS: $status | "
. "PRIMARY KEY: " . $db->dbGetInsertPK() . " | " . "PRIMARY KEY: " . $db->dbGetInsertPK() . " | "
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | " . "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>"; . "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
// UPDATE WITH RETURNING // UPDATE WITH RETURNING
$status = $db->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test"); $status = $db->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test");
print "UPDATE STATUS: $status | " print "UPDATE STATUS: $status | "
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | " . "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>"; . "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
print "</pre>"; print "</pre>";
// REEAD PREPARE // REEAD PREPARE

View File

@@ -52,9 +52,6 @@ echo "LANGUAGE FILE: " . $l->__getMoFile() . "<br>";
echo "INPUT TEST: " . $string . " => " . $l->__($string) . "<br>"; echo "INPUT TEST: " . $string . " => " . $l->__($string) . "<br>";
// TODO: run compare check input must match output // TODO: run compare check input must match output
// error message
print $basic->log->printErrorMsg();
print "</body></html>"; print "</body></html>";
// __END__ // __END__

View File

@@ -32,6 +32,7 @@ $LOG_FILE_ID = 'classTest-form';
ob_end_flush(); ob_end_flush();
// define an array for page use // define an array for page use
$table_arrays = [];
$table_arrays[\CoreLibs\Get\System::getPageName(1)] = [ $table_arrays[\CoreLibs\Get\System::getPageName(1)] = [
// form fields mtaching up with db fields // form fields mtaching up with db fields
'table_array' => [ 'table_array' => [

View File

@@ -84,6 +84,7 @@ $options = [
]; ];
$smarty->DATA['drop_down_test'] = $options; $smarty->DATA['drop_down_test'] = $options;
$smarty->DATA['drop_down_test_selected'] = '';
$smarty->DATA['loop_start'] = 2; $smarty->DATA['loop_start'] = 2;
// require BASE.INCLUDES.'admin_smarty.php'; // require BASE.INCLUDES.'admin_smarty.php';
$smarty->setSmartyVarsAdmin(); $smarty->setSmartyVarsAdmin();

View File

@@ -133,8 +133,8 @@ define('USE_SCRIPTACULOUS', false);
define('USE_JQUERY', true); define('USE_JQUERY', true);
/************* LAYOUT WIDTHS *************/ /************* LAYOUT WIDTHS *************/
define('PAGE_WIDTH', 800); define('PAGE_WIDTH', '100%');
define('CONTENT_WIDTH', 800); define('CONTENT_WIDTH', '100%');
// the default template name // the default template name
define('MASTER_TEMPLATE_NAME', 'main_body.tpl'); define('MASTER_TEMPLATE_NAME', 'main_body.tpl');

View File

@@ -10,7 +10,7 @@
declare(strict_types=1); declare(strict_types=1);
// DEFINE('SOME_ID', <SOME VALUE>); // define('SOME_ID', <SOME VALUE>);
/************* CONVERT *******************/ /************* CONVERT *******************/
// this only needed if the external thumbnail create is used // this only needed if the external thumbnail create is used

View File

@@ -100,10 +100,10 @@
</script> </script>
<!-- /TinyMCE --> <!-- /TinyMCE -->
{/if} {/if}
{popup_init src="`$js`/overlib/overlib.js"}
</head> </head>
<body> <body>
<div style="margin: 2px; width: {$table_width}px; margin-bottom: 10px;"> {popup_init src="`$js`/overlib/overlib.js"}
<div style="margin: 2px; width: {$table_width}; margin-bottom: 10px;">
<div style="position: relative; height: 20px;" class="menu"> <div style="position: relative; height: 20px;" class="menu">
<div style="position: absolute; width: 200px;">{t 1=$USER_NAME|upper}Hello %1{/t}</div> <div style="position: absolute; width: 200px;">{t 1=$USER_NAME|upper}Hello %1{/t}</div>
<div style="position: absolute; text-align: right; right: 0px; width: 120px;"> <div style="position: absolute; text-align: right; right: 0px; width: 120px;">
@@ -127,13 +127,13 @@
{/if} {/if}
{/foreach} {/foreach}
</div> </div>
<div class="pagename"> <div id="pagename" class="pagename">
{$page_name} {$page_name}
</div> </div>
</div> </div>
{* error/warning *} {* error/warning *}
{if $messages} {if $messages}
<div style="margin: 2px; width: {$table_width}px;"> <div style="margin: 2px; width: {$table_width};">
{foreach from=$messages item=item key=key} {foreach from=$messages item=item key=key}
<div class="{$item.class}">{$item.msg}</div> <div class="{$item.class}">{$item.msg}</div>
{/foreach} {/foreach}
@@ -143,7 +143,7 @@
{* debug info *} {* debug info *}
{if $DEBUG} {if $DEBUG}
<div style="width:{$table_width}px;" class="debug_message"> <div style="width:{$table_width};" class="debug_message">
{$Id}<br> {$Id}<br>
<b>{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}</b><br> <b>{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}</b><br>
{$debug_error_msg} {$debug_error_msg}

View File

@@ -40,7 +40,7 @@ function expandTA(ta_id) {
ta = document.getElementById(ta_id); ta = document.getElementById(ta_id);
} }
var maxChars = ta.cols; var maxChars = ta.cols;
var theRows = ta.value.split("\n"); var theRows = ta.value.split('\n');
var numNewRows = 0; var numNewRows = 0;
for ( var i = 0; i < theRows.length; i++ ) { for ( var i = 0; i < theRows.length; i++ ) {
@@ -214,14 +214,14 @@ function convertLBtoBR(string)
*/ */
if (!String.prototype.escapeHTML) { if (!String.prototype.escapeHTML) {
String.prototype.escapeHTML = function() { String.prototype.escapeHTML = function() {
return this.replace(/[&<>"'\/]/g, function (s) { return this.replace(/[&<>"'/]/g, function (s) {
var entityMap = { var entityMap = {
"&": "&amp;", '&': '&amp;',
"<": "&lt;", '<': '&lt;',
">": "&gt;", '>': '&gt;',
'"': '&quot;', '"': '&quot;',
"'": '&#39;', '\'': '&#39;',
"/": '&#x2F;' '/': '&#x2F;'
}; };
return entityMap[s]; return entityMap[s];
@@ -238,12 +238,12 @@ if (!String.prototype.unescapeHTML) {
String.prototype.unescapeHTML = function() { String.prototype.unescapeHTML = function() {
return this.replace(/&[#\w]+;/g, function (s) { return this.replace(/&[#\w]+;/g, function (s) {
var entityMap = { var entityMap = {
"&amp;": "&", '&amp;': '&',
"&lt;": "<", '&lt;': '<',
"&gt;": ">", '&gt;': '>',
'&quot;': '"', '&quot;': '"',
'&#39;': "'", '&#39;': '\'',
'&#x2F;': "/" '&#x2F;': '/'
}; };
return entityMap[s]; return entityMap[s];
@@ -403,7 +403,7 @@ function valueInObject(object, value)
function deepCopyFunction(inObject) function deepCopyFunction(inObject)
{ {
var outObject, value, key; var outObject, value, key;
if (typeof inObject !== "object" || inObject === null) { if (typeof inObject !== 'object' || inObject === null) {
return inObject; // Return the value if inObject is not an object return inObject; // Return the value if inObject is not an object
} }
// Create an array or object to hold the values // Create an array or object to hold the values
@@ -441,7 +441,8 @@ function formatBytes(bytes)
bytes = bytes / 1024; bytes = bytes / 1024;
i++; i++;
} while (bytes > 99); } while (bytes > 99);
return parseFloat(Math.round(bytes * Math.pow(10, 2)) / Math.pow(10, 2)) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i]; return parseFloat(Math.round(bytes * Math.pow(10, 2)) / Math.pow(10, 2)) +
['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
} }
/** /**
@@ -1067,6 +1068,7 @@ function html_options_block(name, data, selected = '', multiple = 0, options_onl
var element_option; var element_option;
var data_list = []; // for sorted output var data_list = []; // for sorted output
var value; var value;
var options = {};
// var option; // var option;
if (multiple > 0) { if (multiple > 0) {
select_options.multiple = ''; select_options.multiple = '';
@@ -1190,17 +1192,17 @@ function parseQueryString(query = '', return_key = '') {
if (!query) { if (!query) {
query = window.location.search.substring(1); query = window.location.search.substring(1);
} }
var vars = query.split("&"); var vars = query.split('&');
var query_string = {}; var query_string = {};
for (var i = 0; i < vars.length; i++) { for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("="); var pair = vars[i].split('=');
var key = decodeURIComponent(pair[0]); var key = decodeURIComponent(pair[0]);
var value = decodeURIComponent(pair[1]); var value = decodeURIComponent(pair[1]);
// If first entry with this name // If first entry with this name
if (typeof query_string[key] === "undefined") { if (typeof query_string[key] === 'undefined') {
query_string[key] = decodeURIComponent(value); query_string[key] = decodeURIComponent(value);
// If second entry with this name // If second entry with this name
} else if (typeof query_string[key] === "string") { } else if (typeof query_string[key] === 'string') {
var arr = [query_string[key], decodeURIComponent(value)]; var arr = [query_string[key], decodeURIComponent(value)];
query_string[key] = arr; query_string[key] = arr;
// If third or later entry with this name // If third or later entry with this name

View File

@@ -87,7 +87,7 @@ class Basic
$abort = false; $abort = false;
foreach ( foreach (
[ [
'DS', 'DIR', 'BASE', 'ROOT', 'LIB', 'INCLUDES', 'LAYOUT', 'PICTURES', 'FLASH', 'DS', 'DIR', 'BASE', 'ROOT', 'LIB', 'INCLUDES', 'LAYOUT', 'PICTURES', 'DATA',
'VIDEOS', 'DOCUMENTS', 'PDFS', 'BINARIES', 'ICONS', 'UPLOADS', 'CSV', 'JS', 'VIDEOS', 'DOCUMENTS', 'PDFS', 'BINARIES', 'ICONS', 'UPLOADS', 'CSV', 'JS',
'CSS', 'TABLE_ARRAYS', 'SMARTY', 'LANG', 'CACHE', 'TMP', 'LOG', 'TEMPLATES', 'CSS', 'TABLE_ARRAYS', 'SMARTY', 'LANG', 'CACHE', 'TMP', 'LOG', 'TEMPLATES',
'TEMPLATES_C', 'DEFAULT_LANG', 'DEFAULT_ENCODING', 'DEFAULT_HASH', 'TEMPLATES_C', 'DEFAULT_LANG', 'DEFAULT_ENCODING', 'DEFAULT_HASH',

View File

@@ -288,7 +288,7 @@ class IO extends \CoreLibs\Basic
private $nbsp = ''; // used by print_array recursion function private $nbsp = ''; // used by print_array recursion function
// error & warning id // error & warning id
protected $error_id; protected $error_id;
private $had_error; private $had_error = 0;
private $warning_id; private $warning_id;
private $had_warning; private $had_warning;
// error thrown on class init if we cannot connect to db // error thrown on class init if we cannot connect to db
@@ -1097,6 +1097,25 @@ class IO extends \CoreLibs\Basic
case 'user': case 'user':
$setting = $this->db_user; $setting = $this->db_user;
break; break;
case 'encoding':
$setting = $this->db_encoding;
break;
case 'schema':
$setting = $this->db_schema;
break;
case 'host':
$setting = $this->db_host;
break;
case 'port':
$setting = $this->db_port;
break;
case 'ssl':
$setting = $this->db_ssl;
break;
// we return *** and never the actual password
case 'password':
$setting = '***';
break;
default: default:
$setting = false; $setting = false;
break; break;
@@ -1439,9 +1458,10 @@ class IO extends \CoreLibs\Basic
/** /**
* checks a previous async query and returns data if finished * checks a previous async query and returns data if finished
* NEEDS : dbExecAsync * NEEDS : dbExecAsync
* @return bool true if the query is still running, false if an error occured or cursor of that query * @return bool|resource cursor resource if the query is still running,
* false if an error occured or cursor of that query
*/ */
public function dbCheckAsync(): bool public function dbCheckAsync()
{ {
// if there is actually a async query there // if there is actually a async query there
if ($this->async_running) { if ($this->async_running) {
@@ -2376,6 +2396,17 @@ class IO extends \CoreLibs\Basic
trigger_error('Method ' . __METHOD__ . ' is deprecated, use dbGetNumRows()', E_USER_DEPRECATED); trigger_error('Method ' . __METHOD__ . ' is deprecated, use dbGetNumRows()', E_USER_DEPRECATED);
return $this->dbGetNumRows(); return $this->dbGetNumRows();
} }
/**
* Sets error number that was last
* So we always have the last error number stored even if a new one is created
*
* @return int last error number
*/
public function getHadError()
{
return $this->had_error;
}
// end if db class // end if db class
} }

View File

@@ -321,9 +321,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if (isset($config_array['load_query']) && $config_array['load_query']) { if (isset($config_array['load_query']) && $config_array['load_query']) {
$this->load_query = $config_array['load_query']; $this->load_query = $config_array['load_query'];
} }
$this->archive_pk_name = 'a_' . $this->pk_name; $this->archive_pk_name = 'a_' . $this->pk_name ?? '';
$this->col_name = str_replace('_id', '', $this->pk_name); $this->col_name = str_replace('_id', '', $this->pk_name ?? '');
$this->int_pk_name = $this->pk_name; $this->int_pk_name = $this->pk_name ?? '';
// check if reference_arrays are given and proceed them // check if reference_arrays are given and proceed them
if (isset($config_array['reference_arrays']) && is_array($config_array['reference_arrays'])) { if (isset($config_array['reference_arrays']) && is_array($config_array['reference_arrays'])) {
foreach ($config_array['reference_arrays'] as $key => $value) { foreach ($config_array['reference_arrays'] as $key => $value) {

View File

@@ -361,6 +361,11 @@ class SmartyExtend extends SmartyBC
$this->HEADER['ENCODING'] = $this->encoding; $this->HEADER['ENCODING'] = $this->encoding;
$this->HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING; $this->HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
// form name
$this->DATA['FORM_NAME'] = !$this->FORM_NAME ?
str_replace('.php', '', $this->page_name) :
$this->FORM_NAME;
$this->DATA['FORM_ACTION'] = $this->FORM_ACTION;
// special for admin // special for admin
if ($admin_call === true) { if ($admin_call === true) {
// set ACL extra show // set ACL extra show
@@ -385,6 +390,7 @@ class SmartyExtend extends SmartyBC
// the page name // the page name
$this->DATA['page_name'] = $this->page_name; $this->DATA['page_name'] = $this->page_name;
$this->DATA['table_width'] = $this->PAGE_WIDTH ?? PAGE_WIDTH; $this->DATA['table_width'] = $this->PAGE_WIDTH ?? PAGE_WIDTH;
$this->DATA['form_name'] = $this->DATA['FORM_NAME'];
// for tinymce special // for tinymce special
$this->DATA['TINYMCE_LANG'] = $this->lang_short; $this->DATA['TINYMCE_LANG'] = $this->lang_short;
// include flags // include flags
@@ -404,11 +410,6 @@ class SmartyExtend extends SmartyBC
// LANG // LANG
$this->DATA['LANG'] = $this->lang; $this->DATA['LANG'] = $this->lang;
// form name
$this->DATA['FORM_NAME'] = !$this->FORM_NAME ?
str_replace('.php', '', $this->page_name) :
$this->FORM_NAME;
$this->DATA['FORM_ACTION'] = $this->FORM_ACTION;
// include flags // include flags
$this->DATA['JS_DATEPICKR'] = $this->JS_DATEPICKR; $this->DATA['JS_DATEPICKR'] = $this->JS_DATEPICKR;
$this->DATA['JS_FLATPICKR'] = $this->JS_FLATPICKR; $this->DATA['JS_FLATPICKR'] = $this->JS_FLATPICKR;

View File

@@ -1,24 +1,17 @@
<?php <?php // phpcs:ignore PSR1.Files.SideEffects
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2011/2/8 * CREATED: 2011/2/8
* DESCRIPTION: pre function to collect all non critical errors into a log file if possible * DESCRIPTION: pre function to collect all non critical errors
* include this file at the very beginning of the script to get the notices, strict, etc messages. * into a log file if possible
* include this file at the very beginning of the script to get the notices,
* strict, etc messages.
* error etc will still be written to the log/display * error etc will still be written to the log/display
*********************************************************************/ *********************************************************************/
declare(strict_types=1); declare(strict_types=1);
// define the base working directory outside because in the function it might return undefined
// if we have config set BASE use this
if (defined('BASE')) {
DEFINE('CURRENT_WORKING_DIR', BASE);
} else {
// else we set. We fully assuem that Error.Handling is where it should be, in lib dir
DEFINE('CURRENT_WORKING_DIR', str_replace('lib', '', __DIR__));
}
/** /**
* will catch any error except E_ERROR and try to write them to the log file * will catch any error except E_ERROR and try to write them to the log file
* in log/php_error-<DAY>.log * in log/php_error-<DAY>.log
@@ -67,8 +60,15 @@ function MyErrorHandler(int $type, string $message, string $file, int $line, arr
// : the php error message // : the php error message
$output = '{' . array_pop($page_temp) . '} [' . $file . '] ' $output = '{' . array_pop($page_temp) . '} [' . $file . '] '
. '<' . $line . '> [' . $error_level[$type] . '|' . $type . ']: ' . $message; . '<' . $line . '> [' . $error_level[$type] . '|' . $type . ']: ' . $message;
# try to open file // define the base working directory outside because in the function it might return undefined
$ROOT = CURRENT_WORKING_DIR; // if we have config set BASE use this
$ROOT = '';
if (defined('BASE')) {
$ROOT = BASE;
} else {
// else we set. We fully assuem that Error.Handling is where it should be, in lib dir
$ROOT = str_replace('lib', '', __DIR__);
}
$LOG = 'log' . DIRECTORY_SEPARATOR; $LOG = 'log' . DIRECTORY_SEPARATOR;
// if the log folder is not found, try to create it // if the log folder is not found, try to create it
if (!is_dir($ROOT . $LOG) && !is_file($ROOT . LOG)) { if (!is_dir($ROOT . $LOG) && !is_file($ROOT . LOG)) {

View File

@@ -1,4 +1,4 @@
<?php <?php // phpcs:ignore PSR1.Files.SideEffects
declare(strict_types=1); declare(strict_types=1);

View File

@@ -37,8 +37,8 @@ namespace Composer\Autoload;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/ * @see https://www.php-fig.org/psr/psr-4/
*/ */
class ClassLoader class ClassLoader
{ {
@@ -60,7 +60,7 @@ class ClassLoader
public function getPrefixes() public function getPrefixes()
{ {
if (!empty($this->prefixesPsr0)) { if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0); return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
} }
return array(); return array();

View File

@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
); );

View File

@@ -13,6 +13,9 @@ class ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9
} }
} }
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader() public static function getLoader()
{ {
if (null !== self::$loader) { if (null !== self::$loader) {
@@ -25,7 +28,7 @@ class ComposerAutoloaderInit10fe8fe2ec4017b8644d2b64bcf398b9
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::getInitializer($loader));
} else { } else {

View File

@@ -6,9 +6,14 @@ namespace Composer\Autoload;
class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9 class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
{ {
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@@ -1 +1,5 @@
[] {
"packages": [],
"dev": true,
"dev-package-names": []
}