Session:
regenerate session id after some time or random.
Default is 'never', can be 'interval' form 0 to 1h and random from always to 1 in 100
Session also checks that strict session settings are enabled
Login class:
Automatic re-read of acl settings after some time (default 5min, can be chnaged via option).
Default set strict headers, can be turned off via option
Moved various parts into their own methods and cleaned up double call logic.
Login is now recorded in the last login entry
no more debug flags are read from the database anymore
All options are set via array and not with a single option (was auto login)
all action data goes into a JSON block and the old action columns will be deprecated
Same for ip, new ip address block with all possible ip addeses
Additional HTTP_ data goes into the http_data block
new request_schema column to get if the request was done to http or https
All ACL\Login loaded _SESSION vars are now prefixd with LOGIN_
only the language one stay as "DEFAULT_"
Removed DEBUG_ALL/DB_DEBUG as they are now fully removed from everywhere
- removed the edit user entries
- removed from the edit user table
The LANG direct loaded language entries is removed too. We only use locale and encoding.
No more LOCALE_PATH and DEFAULT_DOMAIN _SESSION are set during the option set
make all calls that go through primary keys as deprecated
create CUID calls for all of them
Update phpunit tests with new cuid tests, keep old deprecated tests
create new session on class call, there is no need to delay that at all
new option to auto write close a session
session_id and session_name are stored as class vars
deprecate the __set/__get part because we do not want to set via ->session_var_name
but use the set()/get() methods.
They have been renamed from setS/getS... to set/get alone
Add a UUIDv4 column to edit_generic as cuuid, add the cuid column to all reads with
the cuuid too
The cuuid will replace the cuid and remove the EUID as the session login var
Moved the adbEditLog to login class as writeLog and renamed the current private writeLog to writeEditLog which is only for internal logging in the class
The Backend log class is deprecated and a new get all action var method has been added to get the action vars into the edit log
Add more checks in phpunit for this,
Update the placeholder check and convert and move all regex into the
placeholder convert support class
Move $ placeholder count function to the SQL\PgSQL class
Note: further moves of PgSQL only stuff have to be done for SQLite
SQL class add
Math has a compare with epsilon for float numbers.
Use this for fixing sligth color conversion issues.
NOTE: this might need some adjustment over time
All phpunint tests written and checked
move creation into the main constructor and do not rely on "::create" or
any other pass through creation.
Make all constructors equal with options array so we can create an Interface
Remove all outsite setters. Once a color is set this color stays
Also fixes for various things that come up during test writing
Test phpunit not yet finished (exceptions, etc)
Note: a lot of checks for extreme values are (int) so we do not fail
for small float values
Clean up old Colors class with calling new class calls
Test all and set phpstan deprecated messages
Add all missing convert functions for oklab/cielab/oklch/cielch calls
Prepare for test run creation
change the curlRequest call to options array and build the options array
there.
Remove any options check + pre build from the get/request calls
Update phpunit tests with string type body return
Removed the parseHeaders public call, headers must be set as array
Throw errors on invalid headers before sending them: Key/Value check
Add headers invalid check in phpunit
Auth headers can be set per call and will override global settings if matching
Header default build was not done well, pass original headers inside and
set them. On new default start with empty array.
Switch to CoreLibs Json calls, because we use this libarary anyway already
Instead of just throwing exception on 401 auth, throw exception for any
error code from 400 on
This can be turned off with the option "http_errors" set to false
Also updaed the exception content to match 400 or 500 error type with
more information attached
General Exception error codes:
Cnnn: Curl errors (FAILURE)
Rnnn: general class errors (ERROR)
Hnnn: http response errors (ERROR)
Move the build auth content to dedicated variables
Add a default User-Agent that is always sent
Default headers like Authorization and User-Agent are always set, even when
request is sent with headers null
Fix timeout, was sent as is and not converted to milliseconds
Fix headers not correctly set to null if array entry was set to null
Basic interface class to CURL calls
Open:
clean up and check code is neutral
write tests, for this we need a running localhost server for tests to request to
the not filled data or data_binary part is a JSON with "type" set to the
type that is used with a general message
To decode try to read both sides if data = JSON + "type" and "message" set
then data is in data_binary else data_binary holds the type on the left side
All queries uses now Params
On load checks for valid write types for edit log write, eg if bzip and lzip compression
are avaiable
adbEditLog:
Also add JSON type encoding for data outside STRING/SERIAL and BINARY/BZIP (bzip compressed)
Add ZLIB as altnerative to BZIP
Add alert if invalid type was set
Auto fallback to JSON if other write types are not available
adbLiveQueue:
Also convert the live queue query to a params style call
On default it still auto loads the _POST vars for backwards compatible, but add a load class
flag to ignore it "init_action_vars"
also add a get vor tha "acl" array adbGetAcl()
The Logger/MessageLevel gets "success" as level 110 to something a bit
heigher than "ok" which is the general "OK" for anything ending without
an error. The "success" is currently only used in file uploads with the
java script ajax file uploader
Fix any "type $var = null" with correctly "?type $var = null" for PHP 8.4 (phphan)
Fix preg match no return catches for DB IO compare version and for language
look up.
Add the following new static methods
Convert\Strings::stripUTF8BomBytes: removes the UTF8 BOM bytes from the beginning of a line
Used for CSV files created in Excel for the first header entry (line 0/row 0)
Get\Systen::getIpAddresses: gets all IP addresses for the the current access user
and returns an array
Moved the frontend folder detection from the first load config to the config.path.php
Cleaned up the translations JS scripts
Changed Params form ENT_COMPAT | ENT_HTML401 to ENT_QUOTES | ENT_HTML5
Flags can be overwritten on call
Logic clean up for return flow
HTML::checked gets logic updated with less nested ifs
In the past we had a special function to do mb_encode_mimeheader correctly.
Since PHP 8.2 this works perfectly fine, so all the code was removed and
replaced with just the normal "mb_encode_mimeheader" call with the same
settings as before:
- set global encoding to parameter
- run encoding with charset, 'B' for transfer and use the line break given in parameter
- reset the global encoding to previous set
new method to replace old timeStringFormat method:
- has year/month data too
- can format with natural names (minutes, seconds, etc)
- can have normal naming (5 hours, 1 minute and 10 seconds)
- skip or not skip zero values in between (6h 0m 1s -> 6h 1s)
- skip or add trailing zero values (6m 0s -> 6m)
- add or not add milliseconds with decimal nano seconds
- drop nano seconds (115.55ms -> 115ms)
- truncate value after a certain part (eg only show up to days)
- add leading 0s to only milli seconds values (115ms -> 0s 115ms)
- namespace separator (6h -> 6 h)
Bug fix for timeStringFormat
- 1.5s and 1.05s and 1.005s all where 5ms -> fixed to 500ms, 50ms 5ms
- bug fix for 0ms drop even thought show ms is requested
Start unit testing part
All errors have context that is used to add query, params, etc info
for logging into the DB.
Avoid double logging for PostGreSQL direct errors as those will be
logged now in context to the actual error log
Remove error: 16 missing/empty dbh has this is handled with error 14
in the connect method.
Auto convert ?, :named to $numbered, default off. Activate with
'db_convert_placeholder' flag or method dbSetConvertPlaceholder.
Converted result data for single queries in dbGetPlaceholderConverted
or in the cursor_ext array in placeholer_converted key
Do not auto translate debug queries with placeholder values in query
but keep them in the array in the context array. If needed
'db_debug_replace_placeholder' can be set to show prepared query
with placeholder replaced in the context
New methods:
public function dbSetConvertPlaceholder(bool $flag): void
public function dbGetConvertPlaceholder(): bool
public function dbSetConvertPlaceholderTarget(string $target): bool
public function dbGetConvertPlaceholderTarget(): string
public function dbSetDebugReplacePlaceholder(bool $flag): void
public function dbGetDebugReplacePlaceholder(): bool
public function dbGetPlaceholderConverted(): array
Chagned to public:
public function dbCheckQueryForSelect(string $query): bool
public function dbCheckQueryForInsert(string $query, bool $pure = false): bool
public function dbCheckQueryForUpdate(string $query): bool
- Fix the regex to proper match $n params in al;l kind of combinations
- Move the count into a sub private method and use this instead of using
the same code twice
So we can have different stylesheets for the levels like in the error
messages.
Output changes to ...[$target] = ['info' ..., 'level'] and on return
this is converted into an array for each entry so it can be handled
like the error msg return string
if log level is debug, automatically log the error messages.
We still skip warn and info levels from logging.
The rest is based on the logging level (notice eg only gets logged if
log level is at least notice)
Move DB\Extend\ArrayIO to internal class in variable and do not extend
Form\Generate from it (as we do not have a base class anymore, this is
no longer neded)
Update all calls in connected classes.
Add interface methods for DB\Extend\ArrayIO to interface with all class
vars that are now all private
string: if it is stringable in anyway, set string (it converts)
this is not check IF it is a string value as it was before
int/float: same, if it is numerc it will be convert to int or float
All other stay the same
Note "set ..." imply to set, and not to convert to 0 if it is int
string that can be covnerted to int
DB Class throws Exception if on init it fails to connect to the DB,
will not throw Exception if failed connection during execution but
will do the normal retry and soft failure run
DB\ArrayIO will throw Exception on missing table array and table name
All Exceptions have a code set
All Color methods will throw Exceptions:
LengthException,
InvalidArgumentException,
UnexpectedValueException
instead of returning bool: false
All methods will return valid color data as expected only
exit will add message as first parameter (string) next to code (int)
Log this to info or critical.
3000 -> 100: info
rest >=1000: critical
previous 4000 = 3000 (options not set)
update unit tests for this
Possible change idea: critical abort throw error?
Make sure cursor_ext is set before we access it, else return null for
not set yet.
false for errors, else data value
Other class var access checks to be sure to never fail
Debug Support:
getCallerClass now returns level 1 class from the trace like the
getCallerMethod. There is also a new getCallerClassMethod that returns
namespace\class->method (or :: for static).
getCallerTopLevelClass works like getCallerClass did before and returns
the TOP level (first entry on the call stack that has a set class name)
Logging:
Do not use the Support getCallerClass/Method/File but call it inside
and use level 2 in trace to get the data we need For the last call
before debug call
Also update the strack trace for the debug call to use ->/:: for method
type
All convert color either return the color value or false.
To make sure any checker knows that we only return "value" or "false"
change all return bool to false
It has to be int or null but because the SQL result is undefined (string)
it needs to be converted on return if it is a numeric value, else
null will be returned (it is the edit access id PK so it has to be
numeric)
on Admin\Backend init check that the provided default acl level is valid
DB\IO warning and error drop the "db :" prefix part as this is not needed
we have [DB_ERROR] and [DB_WARNING] sub prefixes anyway, also we run
dedicated log level alerts with context
We do not return old style bool on error, we throw Exceptions: HtmlBuilderExcpetion
Element has more classes to set tag, id, etc with basic checks for valid data
String Replace to set strings is one array with key -> value entries
Errors thrown on index for element/replace blocks
Object build is a replicata from the JS one
Array is similar but build on pure Array elements
String replace is just a simple string replacer for now
General\Error for overall error handling
General\Settings for Object/Array based checks and settings
set via db options "db_convert_type" as array with "on", "json", "numeric",
"bytea"
"on" only converts know good types: "bool", "int"
"json" will convert json/jsonb to array
"bytea" will decode escaped bytea to string (note: this might change to resource)
"numeric" will convert to float.
NOTE: if a numeric number is too large a covnersion might drop data.
Use with care.
Convert flags can be chagned with dbSetConvertFlag and dbUnsetConvertFlag
All convert flags are in "DB\Options\Convert" as enum.
the params order is the actual correct one:
log level, message, context, group_id, prefix
not that group_id and prefix are only used if log level is debug
Switched debug params order for context and prefix so prefix is last
if setFlag was set for per_run or per_date the init values where not set
Fixed that on setFlag it is checked if we have per_date or per_run and
then set if not set.
Not that for date, set the flag will set a new date, for per run no.
- Removed echo from Support Debug dumpVar call
- deprecated DB\IO toggle dbDebug and changed set/get to be like normal
ones where set just sets and doesn't return anything
- Renamed the logJsDebug to loggingLevelIsDebug
(other levels can be checked with ->getLoggingLevel()->includes(Level::...))
Adjusted tests for all changes
All variable declarations in all classes have a strict type set
Exception: constants (will be setable from PHP 8.3 on), resources (no type)
Debug\LoggingLegacy is kept as is, will be deprecated
old Debug\Logging is in Debug\LoggingLegacy and Debug\Logging extends
Logging\Logging
Logging\Logging is a new class with most of the functionality except
there is no more print/outout to screen, but we use the default log
levels (RFC5424)
The plan is to be a frontend between the old type class and
Monolog\Monolog
Updated all other classes to use new class interface
Move Passwords from Check to Security and deprecate old
Add new SymmetricEncryption and CreateKey
CreateKey class just creates keys for the SymmetricEncryption
SymmetricEncryption uses the hex2bin calls to convert the hex key to the
internal binary key
Example:
$key = CreateKey::generateRandomKey();
$encrypted = SymmetricEncryption::encrypt($string, $key);
$decrypted = SymmetricEncryption::decrypt($encrypted, $key);
Above $key must be stored in some secure location (.env file)
On error with query with params the query was sent to the server and
if ther query itself is ok but there is a problem with the parameters
a wrong error message ($1 not found) will be returned
Add pg_last_error reporting to catch this too.
Update both error reporting to return not string and prefix combined
but prefix + error string in array
In error return check that both strings are not equal, so we do not
return the same error string twice.
Also default set dbh variable in the PgSQL class to false so it will
skip last error report if there is no dbh set yet.
Bug fix for db query with params debug output. if there are more than 9
entries the $1 of eg $10 is replaced with $1 entry again. Changed to
'#' instead '$' to avoid this.
Other:
ACL\Login: replace EOM with HTML
config.master: replace list() with []
Add single DB tester where we can test single db calls without adding
more to the general test run
On error with query with params the query was sent to the server and
if ther query itself is ok but there is a problem with the parameters
a wrong error message ($1 not found) will be returned
Add pg_last_error reporting to catch this too.
Update both error reporting to return not string and prefix combined
but prefix + error string in array
In error return check that both strings are not equal, so we do not
return the same error string twice.
Also default set dbh variable in the PgSQL class to false so it will
skip last error report if there is no dbh set yet.
Bug fix for db query with params debug output. if there are more than 9
entries the $1 of eg $10 is replaced with $1 entry again. Changed to
'#' instead '$' to avoid this.
Other:
ACL\Login: replace EOM with HTML
config.master: replace list() with []
Add single DB tester where we can test single db calls without adding
more to the general test run
search in an array in any format and returns value of key if found.
Either as set with path to key, or as flat with only values.
Optional possible to prefix with the search keys to group found entries
in dbReturn with params on not matching param the system exited on fail
without printing the query making it hard to find where the error is.
Added debug output in case the params count is not matching.
Same move in the dbExecute call
removed param count check from dbReturnRow/dbReturnArray as this check
is done in the dbExecParams call anyway
Param detection found too many params, for example '$1'.
Fixed the regex to only allow params that are no preceeded by '
And must start with space/tab, =, (
Removed cms object from Frontend and replaced with optional smarty data
array (HEADER, DATA, DEBUG_DATA)
Updated admin call that if $cms is given above data will be extracted.
Added a CONTENT_PATH option for admin, must be set if $cms is set
Is used for the adbTopMenu call
Moved the $cms global check and trigger to the admin call branch only
Instead of having each parameter single, group them into an options array
so we do not have to worry about updating the whole function call.
Keep the main core call as is
If ACL\Login is used, the loginGetLocale() call should be used to fetch
the locale data set during login
Language\L10n now has new encoding/charset optional parameter 4
If the locale does not have a charset set the defautl charset is UTF-8
unless set via the new parameter or setOverrideEncoding()
Because of the deprecation of the getLocales call the following methods
do no longer need $locales
- Admin\Backend
- Admin\EditBase
- Output\Form\Generate
- Template\SmartyExtend
They all use the new l10n->getLocaleAsArray() call to set all the local
variables
* Admin\EditBase has new parameter "options" to set
- cache_id
- compile_id
which must be passed on the SmartyExtend class init
Remove unused code and classes.
Clean up code to remove all named constant from them and throw
deprecation alerts if used.
Add basic psalm setup in root folder and remove from www folder
Also split all queries into multi line ones
Fixes in Form\Generate for TableArray Interface location move
Update EditBase to new and old edit schema (scheme) file name
Convert\VarSetType for always return type expected (eg string will be string)
or Convert\VarSetTypeNull to return string or null on failure
The return value for failure if not matching type can be set for both, but
only for Convert\VarSetTypeNull the return value can be set to null.
Fix for basic query detection:
Simeple starts with
SELECT/WITH/SHOW
INSERT INTO/UPDATE/DELETE FROM
UPDATE
Above does no complex query detection, just if the string starts with this
Fix form table detection for primary key auto set trial.
missed two table arrays as class EditVisibleGroup and EditAccess
also fix wrong name for EditSchemas (wrong: EditSchemes) with a shim
lookup.
edit_schemes.php file will stay the same for now.
also remove the legacy edit_base.LEGACY.php file
All previous includes/table_arrays load via include are now moved to a
class system so we have all implemented in one folder and can easy update
and add unit tests to it.
- remove auto load _POST vars
- Update color settings to # leading 6/8 digit hex code
- remove any global variable calls/requests
- fix some isset/empty clean ups (isset + set = !empty)
- fix on delete of reference data that loaded data was not shown again
- fix on reference data save error that wrong data is still shown and not removed
- do not sync .user.ini file in sync template
- add PHP 8.2 for test target phpunit
- cel/phfo builder update to not close br or img tags (besides input)
- psalm settings update
- add doctype to all base templates
create_mo:
set auto base folder bases on current location so we do not need do
adjust paths in script
phpstan fixes:
edit_base.php
CoreLibs/Basci.php
CoreLibs/DB/SQL/PgSQL.php
Update documentation in method headers
CoreLibs/Combined/DateTime.php
Fixed phpunit test runs with encoding test run and not resetting the
subsitute character back to default
Note: There are mime encoding failures for php 7.4 and 8.0 and one ACL
login failure test for php 7.4
update debug support to add html escape for html strings on request.
Default is keep as is. debugString gets new third parameter for this as
bool flag.
Add Create\Email to send basic text emails to several too addresses.
Content replace in subject and body is possible with {} entries.
Default encoding is UTF-8 but others can be set and content will be
converted to this.
The dynamic replace works on all data or can be set per receiver.
the former public var $login is now private and if it is set can be
checked with loginActionSet (true if login_login was in _POST as login
action.
Some info update for phpUnit ACL\Login test file
- DB function had wrong column name
- Queries in ACL\Login had wrong column name
- Renamed from login_user_id_last_login to login_user_id_last_revalidate
to make it more clear what this column is
- add edit_user admin page output for this column
- add phpUnit test case for revalidate is needed and login with next
loginUserId is ok again
After revalidate time was reached, it was never reset because it used
the original loginUserId set date.
A new column has been added that gets reset every time the user logs in
with username and password if a loginUserId is set in the database
Form\Generate for intervals also allows day(s), month(s), year(s), call
case insensitive
ArrayIO fix for missing escale literal for
date/datetime/interval/emptynull text type
login_user_id is unique if not null (as index, constraint only with
PostgreSQL 15)
login_user_id_revalidate_after is not longer not null and default set,
no need for this
DB\Extended\ArrayIO:
add sql_read for datetime fields to change amount of data (eg only up
to minute) with to_char() method. sample: YYYY-MM-DD HH24:MI
Add date/datetime/emptynull for setting empty fields to null and not
empty string
Output\From\Generate:
Remove all fill for spacer and change them to placeholder html types.
Add datetime check next to date, time only checks
edit_user Admin Form:
add all new columns there
loginUserId parameter in _GET or _POST for direct login without username
and password.
This can be secured by:
- must login after x days from set loginUserId on
- can only login with loginUserId in given time range
- flag lock loginUserId
previous named Get\ReadEnvFile is no Get\DotEnv, static method is the
same.
Update for not parsing comments at the end of a line if the line was not
in quotes. Strips everything after comment mark and also right trims any
trailing spaces
Old:
FOO=Test # Comment -> $_ENV['FOO'] = "Test # Comment"
New:
FOO=Test # Comment -> $_ENV['FOO'] = "Test"
Add phpUnit tests for DotEnv class.
Update config.php with new class name
The old class name exists and is markted as deprecated until next major
release
Move logic from constructor to separate function
Add more public access methods for internal variable access (password
min length settings, error login code, error login string error)
All error messages are declared in constructor with wrapper function to
create html error string for template creation
Add wrapper function for exit/abort and page name read for easier mocking
in testing
Fixes for multi login main function caller and cached query problem: do
not cache query for login
Add reverse default access list SESSION variable and public readers
Update logout with unset of full SESSION array to empty, use external
session class for all session calls. Also unset euid on logout
Switch the code point for these below for logic reasons
CLEAR_CACHE 1 => 2 (clear cache AFTER END read)
READ_NEW 2 => 1 (clear cache BEFORE first read)
in dbReturn cursor ext array:
remove firstcall entry because it is not needed
add new:
- cache_flag: $cache method call number
- assoc_flag: the assoc read flag from the method call
- cached: if there is data cached in the cursor ext array this is true
- finished: true if the last read was false
- db_read_finished: if true the db read has fiinished (read_rows =
num_rows)
- read_finished: if true the current read (cache or db) via pos =
num_rows is done
- log_pos: sequential number for each call with the same query hash
- log: array with current actions done in the last read
Update DB IO class test with all cursor, cursor ext, read single step,
read in loop, read again, etc tests
in the Debug\Support add printBool to print out bool as string.
Same as printAsString with bool alone but you can control prefix name,
and true/false string names
Add printArray alias to prAr
Instead of ending with the second hr timer call, we print out difference
to the last one.
Add new method to print out from start time difference and add a reset
method
- import script with write to file option
- fix file names for functions
- add generic (non edit tables) for only set date, set uid or combine
- fix edit table edit_language insert data
- all trigger create remove the drop on exists, as in the flow the trigger will never exists
DB\IO Tester now has correct testing for pgVersion string compare. Uses
mocked pgVersion return for this
Session class update with full magic set/get or method set/get for
_SESSION var. Also added full testing for this
All static Session:: calls (except for checking valid session name) are
converted to object type. This Object is passed on to Login, Admin
Backend and any other class that needs basic session checking
Update edit_access_data table and set unique check for edit_access_id +
name so we do not have two identical keys for one edit access set
Update config host and add more test domains for various access tests
Update Session and move cli check to Get\System class. Some other minor
session info updates
New method \Get\System::checkCLI() returns true if the sapi name has
cli inside, else false
Add a write close session call to end a session for AJAX calls
Add error strings to session start method
Add check call for session names that they are valid
- edit base used useless regex for getting filename and dir from folder
list. Changed to pathinfo() call to fix this
- edit_base.php and DB\Extended\ArrayIO fixes
On page order in edit we got errors because pk_name in ArrayIO class was
not init as empty string as it should be (is defined as string only)
- ACL\Login updates
Move all public functions to the public block.
Add public functions for base check Page/Base level to min level name
get acl array as is for now (will be extended with other calls for more
detail query)
Also clean ups in PHPdoc layout, long lines, etc
The actual locale name of the folder where the mo file is located can be
queried with getLocaleSet()
This is used in smarty extended to set the smarty translation template
for javascript strings
That change is done to be compatible with the phpmyadmin translator
class so this can be a drop in replacement or other way around.
Update smarty block.t to only check for _* functions and not any pre
loaded language class
__pn for context plural has now correct name __np
Update smarty plugin block.t.php to use __* named gettext methods for
all calls, for __n/__np/__/__p calls we fallback to check internal set
class on l10n object variable.
This will be removed in future calls
BASE constant setting: moved all to same base folder in 4dev/tests
check all other CONSTANT settings if they are already set and skip (used
only in Language default set)
Add missing phpunit check for array merge recursive
new Langauge\GetLocale::setLocale() for getting new type lang info from
session, etc
L10n class call chnage of parameters:
NEW: locale, domain, path
OLD: locale, path, domain, legacy(bool)
Temporary auto detect for possible path/domain switch if domain value
has slash inside
Rename all local files to names matching locale folder
en_US -> en
Delete lang folders with symlinks as they are no longer used
Update all header files and class Backend\Admin, ACL\Login,
Output\Form\Generate, Template\SmartyExtend with new language order:
call ::setLocale() afer login class
Update missing test translation strings in all po files
Update phpUnit tests to match all new changes
Update the Core Language classes to have all method parameter type
declaration.
GetTextReader has gettext as alias to translate.
GetTextReader public methods to get cache enable status and short
circuit (no translation loaded) status
Main language:
Add new methods for plural and plural in context (__n, __p, __pn)
Deprecate gettext, ngettext, _e
Add new translation loader in gettext standard
<locale>/LC_MESSAGES/<domain> style
Including locales checker, auto detect on enviroment variables, return
self as class (for functions type) return translator class after
loading, etc
New LoadFunctions to run all like functions. Names like php but with two
underscores prefixed. eg gettext -> __gettext
Language\Encoding::__mbMimeEncode -> Convert\MimeEncode::__mbMimeEncode
Langauge\Encoding::checkConvertEncoding -> Check\Encoding::checkConvertEncoding
Langauge\Encoding::setErrorChar -> Check\Encoding::setErrorChar
Langauge\Encoding::getErrorChar -> Encoding::getErrorChar
Langauge\Encoding::convertEncoding -> Convert\Encoding::convertEncoding
Also fixed encoding check that not only a code point but a string can
also be used as a parameter.
Update phpunit tests and split them out for each class
Normal test page is still combined for all classes but updated to
correctly use each class
Fix missing replace char settings for conversion check call.
The php replace char method was never called. Also add standard type
settings next to char settings.
Return (get) call can either class set or current set in php
Fix mime encode with trailing space problem if length is on split
length. Mime encode uses \r\n for all line breaks now, can be controlled
via parameter
next to the current lang/encoding add locale that is a combination of
both.
Also add a locale folder constant
the default LANG variables (DEFAULT_LANG, SITE_LANG) change from en_utf8
to en_US
new DEFAULT_LOCALE with en_US.UTF-8
Add locale global variable in the format
<lang>_<country>.<encoding>@<suffix>
Default set to en_US.UTF-8
Also remove nested if callse and do early abort/method return for
flatten code:
loginUser
logoutUser
setAcl
printLogin
passwordChange
There was a bug in ther SQL interface class where the folder was just
called "Interface" which is not an allowed Namespace name. Renamed to
SqlInterface
Moved the detect lang/etc function used in Form/Generate,
Template/SmartyExtend and Admin/Backend to Language/GetSettings.
Fixed some test class calls
DB\IO dbReturn also sets internal num_rows, num_fields, field_names so
the normal dbGet* calls can be used after dbReturn call
JAVASCRIPT/STYLESHEET in config.master is now override able from .env
file. Others will follow
ACL\Login and Admin\Backend do not extend DB\IO anymore which was a hold
over from old extend Class\Basic usage.
The old DB_CONFIG parameter has been replaced with DB\IO Object.
Also Admin\Backend has a language class overide loder like ACL\Login
dbVersion only returns nn.n version without any additional info
added new dbVersionNumeric that follows the nnNNnn type of format, eg
90605 or 130006
Added new dbVersionInfo where all the pg_version returned array elements
can be checked. Has a strip override for 'server' version to no strip
additional info
dbVersionInfoParameters returns an array of all possible parameters that
can be called.
Not that if the whole info block is needed pg_version($db->dbGetDbh) is
recommended for now.
Also dbCompareVersion does not call the dbVersion but calls the
functions __dbVersion
There is only open for complex query write calls which are not much
used.
all data dumps from current data in cursor
all the deprecated methods, which we won't test anymore
Async query calls have some additional error checks.
Same for prepared calls (eg missing statement name is now error)
Prepared call also inits cursor to avoid unset array key errors
schema/encoding settings checks more strict with proper error returns.
schema checks in database if schema exists.
encoding just throws error if encoding setting failes. future plan is to
check if given encoding is actually valid
Note that the (string) for pg_escape_string and pg_escape_literal are
forced for phpstan because it thinks this might return false even
thought both function only return string ever
Output\Form\Generate and ACL\Login have DB\IO method call name changes
for pos/num rows methods. Use proper methods and not use the cursor full
return check method
DB\IO:
Switched to new conenction busy check with sockt and timeout loop. So
short blocked and psql error blocked ones are not blocking other calls.
Moved the dbReturn cache read to a separte private method and cleaned up
code for more clear view
Moved all query hash creations to method to simple change hash creatio
if needed. This method can be used for external correct query hash
creation if needed.
Variable name and code block clean up in dbReturn
No data return (dbReturn or dbFetchArray) will change returned data row.
Return as is.
Moved methods around in code to group them together for next stage in
sub class creation (planned)
Renamed dbCursorPos to dbGetCursorPos
and dbCursorNumRows to dbGetCursorNumRows
Work on phpunit tests for DB\IO
uniq id short and long without parametersare pure uid creations so they
have moved over and have been deprecated in the Hash class.
Update Logging class for this.
Update Form\Generate for cursor ext access
DB/SQL/Pgsql:
add __dbConnectionBusySocketWait for testing with loop type and socket
check wait loop for async queries. (TODO)
add parameter query method to supplement current normal query only
function
DB/IO:
Make all class variables private and add needed methods to read them.
Also add method for reset query in case for new calls.
db error/warnings are written to proper history file with timestamp,
source, etc.
Update source (where called) to show the whole method stack.
Move connection OK to method to easy switch to different connection open
for queries check type.
Never use method variable query, instead only use method parameter and
error out on not set.
All core calls reset errors and set error hash id for history.
Bug fix for insert data return array and reset said array every time a
query execution is started and not only if we have some return data to
avoid having wrong (previous query) data for a new query.
Add more error info to all erros where a separate db logging call was
done.:
ACL/Login:
Do not access DB IO cursor variable directly but use method to read
data. Fixes change for hash type
DateTime::dateStringFormat
Add new flag after show microtime to add microtime with . as a float
type instead of string with ms
Uids creation with alder32 and ripedm160 for 8 and 40 char long uids
Support class with new method getCallerMethodList to return an array of
all methods and not only one point reference
Also various clean ups for DB::IO
- fix PGSQL array to PHP
- add bool/literal escape to SQL
- fix literal escape to call correct php array
- move functions to correct place
Add a new long hash type and uniq id long hash.
Also set the default hash (short) and hash long to a public constant
Switch all DB IO from md5 to long hash type so we can easy update
hashing of queries
Move autolaoder loading from config.master.php to config.php and before
we read config.master.php
The read env function has moved into a class and is launched after the
auto loader has been loaded
DB IO class update with better error reporting with last error set and
error history of all errors in order.
TODO: per query or per action error grouping
Move methods around so they are grouped more logically. This is for a
future split out for function groups into sub classes to the main DB IO
class (private classes).
Also add a global variable $DB_CONFIG because setting this as constant
prevents us from override the debug config.
But for this add a third parameter to set debug flag override
Move all session_id and check calls function calls that we have to Session class
In Login class use new false return for session set check
Be sure all session set variables are unset, do extra unset call and
destroy call on close session
Login class does not set GLOBALS anymore (DEBUG_ALL, DB_DEBUG)
Update Logging to check for DEBUG_ALL from SESSION and set DEBUG_ALL on
and PRINT_ALL on.
All logging setting vars are primary via options and only if not set
there fallback to SESSION/GLOBALS and then defaults
DB:IO code for debug flag check has been updated for primary check in
config, then session/globals
Debug update for logging tester for first step to remove Basic class
call.
NOTE: after basic php unit tests are written the clean up for no longer
using Basic class has to start.
Switch to logging class for logging only needs
Various fixes in the logging class for more clear internal flags setting
and clearn up of complex type checks and debug validation checks.
Add basic debugger logging class phpunit checker (based on debug/print
and only very basic for echo)
Other minor fixes and updates (phpunit with inital dead code check)
Because we do not have double byte characters in there we use a string
so we don't have to do any array work. Return is also a string and not
an array that is then converted to string.
Add info to Colors Class for oklab code that we should use as basic for
all conversions
phpstan will throw an error because pg_* methods have changed from
resource to object in php 8.1
So current var has object|resource dual type and this will fail
Added ignore for phpstan in the config file.
Also added conditional config file for phpstan where we can set based on
current active PHP version
baseline file created with --generate-baseline is added for error check
PHP version check now works with only max too, if called with (null,
'1.2.3') then php version will be checked <= 1.2.3
Debug Support has a to string print method printToString which tries to
print all types of var content as string (bool, int, float, resource,
object, etc)
Debug Support printAr supports ##HTMLPRE## style too (flag true)
DB/IO + PgSQL is changed from is_resource check to "false" check to be
compatible with new PHP 8.1 pgsql connect interface where all resources
are changed to objects PgSql\Connect|Resource|...
If not created Logger class will be auto created in \DB\IO
Recommended to run a CoreLibs\Debug\Logging([...]); and use this class
for all ACL\Login, Admin\Backend, DB\IO, Output\Form\Generate calls.
Last parameter after DB CONFIG is the log parameter
Session create has been moved to a new Create\Session class from the
\Basic class and MUST be started before using ACL\Login. Currently
ACL\Login will fallback and start it if no session is yet started.
See the Readme.md file for which classes use _SESSION data
In future the _SESSION settings should be moved to some wrapper class
for this so we can unit test sessions
Only Output\Form\Generate class call has the new changed with the second
parameter no longer beeing the table width setting but the class
setting.
But as this is a semi retired class and only used for edit_base this is
not 100% breaking.
All other classes can be used as is and have internal fallback to run as
before.
Deprecation messages will be added later.
Add note that on change in lib/ folder (add/name/delete) 'composer
dump-autoload' must be run to update the composer auto loader as this is
currently on testing to not use internal autoloader
update all composer/vender autoload configs
Check\Basic: just apply updates in deprecated method calls
Check\Jason: has been deprecaged and moved to Convert\Json. Primary issue
was wrong name "Jason" instead of "Json"
Check\Password: only
Check\PhpVersion: fix version check for >9 numbers
Combined\Array: variable name change to be more clear, all searches are
strict for recoursive search, new option for recoursive search many to
return only found array data and no control array info. for backwards
compatible this is default set to ($old = true) and needs to be set to
false to get the new format,
array search normal has a new strict flag for forcing strict compare on
search.
remove some unneeded is_array checks,
fixed the flatten array to key to not only use leave elements, but all
array keys, if only leaves are wanted the new method
flattenArrayKeyLeavesOnly only returns key from leaves
Combined\DateTime: checkDateTime got more correct error checks on
invalid data
compareDate uses strtotimestamp for more easier compare like
compareDateTime does, both to a check on inalid timestamp now
calcDaysInterval also aborts on invalid data now
Convert\Byte: str to bytes does not drop the minus sign anymore
Convert\Colors: any error will now return false and not set to some
neutral gray. also fix missing round on hsb/hsl special return groups
Convert\Html: add constants for CHECKED/SELECTED options, fix remove
linebreak to not add two spaces if \r\n was found
Convert\Json: moved from Check\Jason and add two new error types
Convert\MimeAppName: do not set if mime type or app name is empty
Create\Hash: add crc32b to hash allows types so we can create a normal
not reversed crc32b
Create\Uids: move default hash type to var in class, fix defined
constant check
Debug\FileWriter: add log folder setting to override config constant
settings and also check if we can actually write to the folder and if
BASE and LOG constants are not empty
Get\System: add constant for getPageName and fix getHostName to be more
shorter and faster
Language\L10n: remove \Basic class extends because we don't need it
there at all
Template\SmartyExtend: fix constant check
Add test host soba-dev.tequila.jp, others will be added
config.other had errors with double define a constant
Supress phan/phpstan errors for ...array calls in methods
Smarty extended class is now included in checks and is fixed.
Add the lib/ folder to the composer.json autoloader block so we can use
the composer autoloader and not the one from CoreLibs
Added an autoloader load test backend file
Dropped old insert_id and insert_id_ext and only kepy insert_id_arr.
Added insert_id_pk_name to get the inserted pk name.
Insert RETURNING also works on non set pk name with RETURNING set
Moved the get insert (RETURNING) into method so it can be called from
both dbExec and dbExecute flow.
Error code 31 is only thrown if no returning is set and insert flow
cannot find a primary key for this table
Update all old insert_id calls from other classes
Will check if there is a read_env_file.php and then run it to load .env
file in /configs folder
This file can hold secrets that are not to be checked into git
Updated edit.js file to be eslint compatible
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
Added more tests to debug, form, system class tests
IO: max calls check return variable name was wrong
Logging: changed from preg to str replace for HTMLPRE tag clean up
Debug: empty string debug, returns filled string with dummy text if
string is empty()
System: return base name as is array
Updated Array IO check for loading control array not only from file, but
from direct variable if set or from an array filled with control array
Some code clean up in smarty class (check if $cms object is actually
set)
Logger/Support Debug clean up for some minor logic with debug prefixes
DB IO update debug prefix for log line so we can have a HTML formatted
prefix for echo output
add a prAr that is a new wrapper around print_r, but it does not use
<pre> for layout formatting but {##HTMLPRE##} which will be removed for log
file write or replace with <pre> if printed to the web page
All strings are written to an array and not string append.
Group debug write/debug echo better to make it more simple.
Fixed bug with echo output in logging
Also set debug to be deprecated for phan testing
Add a new helper function to get current class that called the debug function.
Fix bug were log_per was not set correctly
Change all get_class calls in debug to the new helper function
Fix all other class code for calling former Basic class methods.
Also try to replace all remaining array() calls to [] type
Some docblock updates when missing or wrong set
Start moving all basic class methods into dedicated classes.
Most of them are static and can be direct called.
No need to group them into one big class that is hard to maintain and
check.
Work is ongoing
Add a new format bytes with using bytes for lowest tear instead of 0.n
kb
Add a new reverse function to convert from human readable bytes to byte
number
Big fix with IMG_PNG constant use. Switched to IMAGETYPE_*
Some code cleanup in config files (array, DEFINE->define, etc)
Code cleanup in DB:IO class, especially for consistent returning
array/single data blocks
Some javascript core lib update
Some basic json string to array with second function to check last
cought error.
Updated string to bytes convert to make it shorter and more compact
Some minor fixes in DB::IO helper methods
When logged in, the last loggedin time is stored in the edit_user table,
additional to the normal logging.
More array() to [] conversion in config files, etc
Javascript: add math.round
Basic Class: Fix key length array mapping to more efficiont loop run
DB/IO: some name fixes in get key function description/comments
SmartyExtended: add CORE CSS/JS file include if exists. Follows after
MAIN and BEFORE page and special
Basic: remove all error handling override for any class vars to avoid
exploiting private/public/protected settings
Basic: Add MIME lookup table with array. So you can return a File name
description (human understandable) to a mime handler.
See mimeInitApps for basic list
IO: Bug fix for counting prepared statment place holders. If there are
$1, $1, $2 then those are TWO and not THREE
IO: various wrappers for returning PK, Extended return set, Number for
rows
Those will be extended to all variables
It ultimate failed for the following reason.
If base class is passed on to some other class as object parameter
then accessing protected/private variables will be possible because the
__get method will interfer.
Also __set of protected/private variables is possible.
I rather run check for setting variables without defining them than
haveing open protected/private var access
DB IO return functions for inserted primary key and extended RETURNING
data
Add dev set for html options grouping addition for nested arrays/object
lists
Fix edit tables edit access uid declaration
Add password reset time/uid for a password reset flow
Add password valid regex check constants in master config
Add deep copy javascript object instead of direct copy to truly create
new element for attaching in the cel flow
Add attach array of cel elements intead of object with cel sub block
The max query call loop checker can be set to any number, or overridden
with -1
call dbSetMaxQueryCall
on set with -1 will throw warning, if not larger than 0 will throw error
if called with null or empty, it will reset to default value
get current set value with dbGetMaxQueryCall
This is jquery only update
Add new overlay and action indicator for auto any overlay boxes.
Stack with GS_OB_S and min zIndex layer 10 and raise +1 for each new
show overlay call and lower for each hide call
aelxar is like aelx but it uses an array and does not use objects
directly
fixed various possible empty array access issues in various core lib &
edit base files
- captial DEFINE is now lower case
- indicator is visible check in javascript for showing indicator
- remove not needed overlay box 100% css, this is set in the stylesheet
anway
- Fix array pad missing in date compare functions in Basic class
Remove .htaccess file with php variable settings as this will not work
on FPM calls.
Various minor fixes in core libs
Basic lib debug output check is now a sub class so we can use this
everywhere without writing the whole if statement again
Basic lib has a dummy uniq id method added. Not yet finished
- fixed all DEFINE to define in config* files
- Updates Login class with missing strict declarations
- some fixes in Login class for possible errors
- Basic class return array layout updates for all rgb sets plus correct
static update
- Basic class timestamp method fix for not full set (eg missing seconds)
- Basic class add method for getting linecount from a file
- DB IO class gets a get settings return value method
the convert constant setting for inmage magick is now in config.other as
it is no longer core
Also add the base Progress and functions perl modules for central
tagging.
We will add config.pm, import_functions.pm, layout.pm and a basic test
script later too
Before it only listed files in current directory. Because of the hard
split select from both.
Add hostname/folder input (optional) to prefix files outside the same
folder.
Note: If no hostname/folder is set and two files in admin and frontend
have the same name they will be both highlighted as the point to the
same place.
The font folder is set in the layout folder for frontend and holds web
fonts.
There is a new symlink folder in the libs directory to match the FONT
folder name for backend fonts
The old method name byteStringFormat is currently deprecated and it is
recommended to move to the new humanReadableByteFormat method.
Difference is that the new version uses a bitfield settings mask
BYTE_FORMAT_NOSPACE, BYTE_FORMAT_ADJUST, BYTE_FORMAT_SI
Lines with @phan HACK comment are added to supress phan warnings, but do
actually no additional work.
On newer phan version those lines should be checked and removed if
needed
PHP array_diff only compares missing elements in the second and existing
in the first so a full diff is only achieved if compares both ways (a,b)
and (b,a)
This function uns a full compare and returns difference in an array
Also removed the auto translate, return just string.
Is also a static method so can be called by
Basic::fileUploadErrorMessage too
Removed left over LANG settings in admin header
There are no more lang vars passed on to any class calls
The new order is the following
$OVERRIDE_LANG > _SESSION > SITE_LANG > DEFAULT_LANG
Todo: make the setLang better so we do not have the same method in
Backend/Generic/SmartyExtended
The down merge of outside class smarty vars is now an extra function
that can be called stand alone.
The smarty render function call is also a stand alone function that can
be called from outside
Move all smarty and path settings into the Smarty Extended class
the include files <admin|frontend>_set_paths.php and <admin|frontend>_smarty.php
are deprecated.
For special frontend smarty (which will be not used in future anyway) a
dedicated sub class to Smarty Extended with its own methods should be
created
- use config.other.php to include other none core settings
- fix tab intends for not used defines
- remove old ACL defines that are not needed
- move BASE_NAME out to new area
TODO: think about removing G_TITLE
TODO: think about BASE_NAME external setting
Login class checks if AJAX_PAGE is set to true and then does not print
the login html to the screen directly, but returns it in the _POST array
login_html, _POST action is set to login
It also resets _POST & _GET arrays before hand to avoid any misuese.
All _SESSION array access needs to be checked in any following class as
the _SESSION is unset in this moment
html element should be overwritten with this JS:
document.getElementsByTagName('html')[0].innerHTML =
data.content.login_html;
In master config if there is no site config for this page, bail out.
In the other config pages the strict declare header was missing.
Progress bar inits the progress array with all set to null to avoid
calls on not set index
Basic: recusrive array search has correct parameter declarations &
checks for null/empty/not string
IO: all unset are removed and null or init to array is used to reset
Update for other include pages with some missing default data
- The translation file reader did an isset on a set variable insetad of
checking if the variable is zero and so never started the translation
system
- The DB IO connection not set was wrongly set. If the connection failed
it is not TRUE and else FALSE. There is a new internal method
getConnectionStatus to query this status it returns TRUE/FALSE depending
if the connection failed
- Update the l10n test page with proper translation tests
- init OK
- show current lang/file
- translation test
- switch language test
DB\IO dbReturn method has a third parameter to set read only assoc and
not number data from the query
Install basic composer for trying out psalm
setting phpan/phpstan for basic static checking and do basic clean up on
all of the files
Because .inc style is deprecated and also dangerious as often not setup
correctly on the server all .inc files have been renamed to .php files.
All internall calls have been udpated.
language class needs to have l var set as public
db\io convert encoding function needs to work with false method
parameters as the return can be false and needs a clean pass through in
this case
The base class has now set/get class variable check handlers.
Default they are off and setting undefined variables in a class works as
before.
The flag can be set to throw an error on an unset var but let var still
be set or also surpress setting and unset var.
This can be controlled via setting for the last parameter in class init
or the global var $CLASS_VARIABLE_ERROR_MODE or in the config file the
constant CLASS_VARIABLE_ERROR_MODE (constant > global). Note that if a
global or constant is set the class constructor setting will be
overridden.
Backend/IO/Basic/Login classes are set to be type safe as much as possible if
called from a strict defined php script.
Added random key generator function to the basic class and removed the
random key definitons from the Backend class.
- randomKeyGen
- initRandomKeyLength
Updated the basic bytes to string and string to bytes functions.
Added hrRunningTime method to use the hrtime for precise running time
calculations. Default returns running time in ms. Can be set via
parameter to ns (lowest), ys, ms, s.
The old runningTime method is still there, but it is recommended to use the
hrRunningTime method instead
Removed Error Handling method in Basic, as there is no need for it
there. The is a master one in lib Folder Error.Handling.inc if needed.
Currently Generate/ArrayIO are not 100% type safe [because they are only
used in the edit_base anyway]
- reference save was not 100% correct with isset/empty checks
- more missing fixes in admin_*inc files for non edit_* pages
- non edit page menu build fix
- fix non set smart core vars
- add update SQL for fixing missing cuid in edit_* tables
- ALL classes are E_NOTICE safe as far as possible.
There might be some minor things left over which will be cleaned up in
further testing
- Added declare(strict_types=1); on all pages for trying to make all
calls strict
- Added page_content sub content to edit_page, with this some inner page
content with ACL can be set, eg for use with Ajax/JS calls with backend.
Also alias can be set so the control ajax pages can back reference to
the master page content setting. Currently only one back reference is
allowed
- Note that the PAGES array has no numeric indexes, but uses the cuid as
index
* ACR list has new list at level 10 for listing but not reading/opening
* JS update for the html options create
if select multi allow selected as array for highlight
* Basic Class
- array merge recursive implementation
proper implementation that proper merges nested arrays. With key is
always string override
- array flat per key
For multi arrays flatten down a key -> value entry to set the value to
the level up in the leaf
eg:
foo -> bar -> KEY: value
and you go by KEY as search it will change to
foo -> bar: value
in admin set paths, only call smarty sets if smarty object is initalized
Add better JS html options creation with multi block allow. Old call is
still there as wrapper to new call html_options_block
missing variable init in Class Basic
- Class Basic convert string to bytes fix
- admin edit_* pages do not need JS except pop call, moved that into the
template and do not load any other JS anymore
- changed the EDIT_STYLESHEET/JAVACSRIPT names to ADMIN_ to give them
the proper name that they are admin based functions
- paths are in an extra config file
- plan on moving edit_* css rules into a special CSS file just for this
- Bug in date/time check in Basic class. Time check was invalid
- Add calcDaysInterval to get days between two dates plus weeki days
and weekend days
- Add flatpickr to replace datepickr and move datepickr init function
into separate file (from edit.*.js)
the JS dom rel function returns the full element.
The database import script has now test and step by step with retry
import functionality
various comment typo fixe
- edit order template indent fix
- Form/Generate init had wrong check on array for load list query
- ACL for group level was still using old session name
edit_order.php is merged into includes/edit_base and changed to symlink
In the CoreLibs
Output/Form/Generate
- switch all " to ' in strings
- add not set init config_array parts if loaded with no
includes/table_arrays/ file
DB/Extended/ArrayIO
- switch all " to ' in strings
ACL/Login
- swich all missing " strings to '
- not TEMPLATE part is deprecated (but leave load in)
the old "www/layout/<admin/frontend>/<template name>/..." layout is
deprecated.
new layout:
www/layout/<admin|frontend>/<cache/css/images/javascript>/
The layout/<admin/frontend> is symlinked to www/<admin|frontend>/layout
templates and lang are moved to includes
www/includes/template/<admin/frontend>
www/includes/lang/<admin/frontend>
and no longer symlinked to any public facing folders
The language po files have already been moved to
4dev/lang/<admin|frontend>/
- update jquery to latest
- update edit.js to prototype and jquery version
- update backend admin inc scripts
- update mein body templates with better logout flow
- Update JS files and remove some not needed code
- Bug fix in Form where the sub element list was not correctly processed
because the DB insert vars got reset on each loop run
- Add return success/failure variable to the ln10 reload
- fceil: hack for float numbers that not properly round up
- floorp: roundown(number, precision): eg 48756, -2 => 48700
- initNumeric: set variable to 0 if not numeric
- Login ads auto return error for AJAX based calls (so the script
doesn't loop hang)
- Basic gets remove line break call
- DB gets minor updates with arrays set and fixes in old internal method calls
First step to clean up all files that are not mandatory for outside
access
* move all header/footer/smarty/set_paths/config files (inc) into
includes/ folder
* generate basic config.php that JUST loads the config.inc file (search)
* config.inc file has sub sections for db access arrays and host
configs, so config.inc is more static
* Also move edit base and template arrays to the include folder
* move the language po files to the 4dev folder as they do not need to
sit outside
* remove not maintained "files.php"
TODO:
split out templates and language files into external layout group
perhaps drop the whole sub template include path thing as this is
actually never really used and more annoying to maintain
eg: layout/frontend/default/ -> layout/frontend
eg: layout/fronend/default/template -> includes/frontend/template
Also check splitting out the NOT define parts of the config.inc file
G_TITLE, EDIT_STYLESHEET, EDIT_JAVASCRIPT, STYLESHEET, JAVASCRIPT
to default define?
DB IO
- Update/Select/Insert checks are sane now and not reverse
- UPDATE can now use RETURNING
- meta table check in postgresql is supressing warning for not existing
table and just returns false
JS (edit)
- update for the html element creation functions
Basic:
- SITE LANG settings added to change default lang based on vhost
- log file id is now set more lienient via globals and not with a global
constant
DB Tables/Functions:
- fix wrong general function and set uid function was missing
Also remove all inserts from the table declaration and add them in a
separate file instead
Add add/remove css to element for the element js declarations
all edit_* have CUID random alphanumeric unique id with 12 characters
length.
automatically created on INSERT and not touched on update.
but can be udpated manually on UPDATE command.
on INSERT cuid is ALWAYS overwritten with auto create
Add CSS loading style sheet
- fix DB schema edit access with missing uid varchar column
- fix login class " to ' in some parts
- set basic prep area check for password forgot (not password change)
- ACL is only set if permission_okay, just in case some previous checks
skip
- ACL method is private, this should never be called from outside
- update some inline documentation
All DB columns that had a varchar(number) are changed to varchar.
The edit_language default unique grouping has been removed because this
does not work (you cannot have unique on this when it is 1/0 flag only)
Update Output\Form\Generate and edit_base to be PHP 7.2 compatible with
removing all old while (list() ... each()) entries. Fix all undefined
counts, etc.
Login class update is long line wraps and clean up of some nested
teniary parts
DB IO: On multiple PK return it say DB_ERROR, but this is actually a
warning DB_WARNING
Login: fix long lines and make SCHEMA set better with if instead of
terinary
Basic: fix string to time with loop over array parts and not for loop
The password check flow is now dedicated method.
The password change has been updated to check for a valid password
before accepting it (default is only min 8 chars).
Success message is printed out.
On error the overlay stays visible.
Old password correct check uses normal password check method now.
No passwords in any form are logged for error or printed anywhere at
all.
PK ID return check if not set is checked correctly in normal execute
The SET_SESSION_NAME and LOG_FILE_ID get commented out in settings as
they should be rather set per file or in header
When the class name was in a namespace the \ was added into the file
name that might cause some issues. \ is replaced with -
The wrapper for db_exec was missing in the DB\IO class
- move auto loader to lib/ folder (so it doesn't exist in document root)
- Fix a lot of old method names in DB\IO and Form\General, etc
- Fix login with non existing DB set (abort -> exit)
- add getDbEncoding call to DB\IO
* move all the libs into the correct folders
* libs folder is now called lib
* Smarty update to 3.1.30
* main config update with / is now set via core variable (dynamic)
- all if/while/for/etc blocks have brackets on same line
- functions have brackets on new line
- no blocks without brackets
- all code starts on col 0 and there are no tab intends anymore
off: came case for classes and class methods
ignore: _ prefix functions (we can't change that anymore)
The session name was never set correctly because it was not checked for
the define var, but for a normal variable in the basic session name
settings flow
The l10n class has two new return methods for lang and mofile to check
if the correct ones are set
- l10n class has better mo file load check
- fix email regex for last part is now only on minimum 2 char check
- remove all @ warning surpress in the pgsql wrapper
Skip add RETURNING on auto set if 'NULL' is set as a primary key.
On return, also run if count of returned ids is > 0 (so it actually runs
the extended return flow)
In case no primary key is set and the auto detect does not return a
primary key, set the primary key variable to 'NULL' string to trigger
skip in returning insert id flow.
The data write function did not write data correctly if it was empty or
null. Especially for boolean ones when set 0 was set NULL and not 'f'.
This is fixed now.
Also filles MUST set not null fields with 0/'' but does not add missing
column to list yet
Data was not written correctly in connection with boolean field types as
the "has default" was used as if a default value, but it is just a flag
IF it has a default value
- DB IO: update the write data method to update data that is empty (aka
null) and not skip it (aka never unset data)
- Basic: add date time compare method based on strtotime
- Login: ACL for page level check if array is set before setting
anything
In basic class, do SET_SESSION_NAME check with isset to avoid notice log
entries.
Change log/error return for execute data error
base postgresql calss calls set the last run query on error if no result
is returned for prepare and execute
Because browsers buffer size increased again I centralized the buffer
clear flow.
It now sends a 1024*256 bytes empty string before it runs an ob_flush
and flush call.
This should work with most browsers out there. Tested on macOS
firefox/safari/chrome
A global define for LOG_FILE_ID before any class is initialized (or any
place later allowed too) will add a sub id to the error_msg log file
before any other (level, class, etc) id.
This can be used to easily split between frontend and backend logs or
logs for a certain page without using pagename (eg to group all ajax
logs into one)
- Basic class still had a "split" call -> change that to explode
- The prepare DB IO part missed setting pk name for the cursor to null
so no returning is assumed
- all data stored in array (size contrain needs to be checked)
- allows any returning data
- only named rows are returned (no numbers for column access)
- if multiple rows then insert_id is an array with the return data
- if single row the insert_id holds the PK, and insert_id_ext holds
extended data if exists
If an INSERT had multiple inserts (values) the returning only returned
the first one and never the other ones.
This is fxed now.
If only ONE. then insert_id is scalar, else it is an array with all the
data in a flat array
The date part is not set external, but internal via a flag.
The file name extension cannot be set anymore and the file_name_ext has
been removed and is now log_file_name_ext and privte.
This is a drop in solution and can be used with previous settings.
Changes that should be done:
Class.Login: remove the file name ext and replace it with log_per_class
= 1
Remove all file_name_ext entries as they area not needed anymore
class basic has a simple date string format method. returns Y-m-d h:i:s
for a trimestring, optional microseconds too
bug fix for unit/edit access id check in login class
An edit page can have a new type of reference data type that is not a
link between table A and main table, but a sub table to main table with
several text fields + enable field.
This sub field list can have a max set, that adds empty rows to keep max
empty list available.
The sub table filed does not need a read_data element as the read is
directly connected to the master table (uses the elemen list key name
for table and the elements as read fields).
This sub elements need to have at least one as type = text and can have
error check addded (currently unique and alphanumeric work).
Also fix all old addslashes to correct db_escape_string
Read in for reference list also can have multiple elements (read data ->
name | seperated)
All sub reads have element prefixes
Inline documentation update
edit access data is read and put into the unit (edit access) array
the base acl method is adjusted to the current simple flat array one
- base acl only
- no max anymore (never needed)
- page acl
- unit (edit access) acl list + detail data
Form class has new check part for alpha numeric with spaces called
"alphanumericspace".
edit access table array gets update for making color no longer mandatory
(almost never used).
And adds alpha numeric with spaces and unique check for the name.
Trigger that gets called when edit access table is insert or update
called.
UID is set by removing all white spaces.
Original name set is already checked for Alphanumeric with spaces and
unique check.
On Insert always set UID.
On Update only set if UID is not set yet.
Class.Basic
add general 8 char hash wrapper function (for adler32, fnv, jooa)
Edit Users
add first/last name to the basic user info
Config template
Update config template from current working template
Any include or require call is removed and now we use only _spl_autoload
in any class external file include call.
There are three new _DIR vars: LIBDIR, SMARTYDIR, TABLEARRAYDIR that are
based on the __DIR__ and not current working directory.
Add autoload function to main config file.
Add better DIR declarations in config file based on __DIR__ for libs &
smarty classes.
Load all class files with the new autoload function in header & direct
file calls.
- config.inc: add define for show/not show all errors when parsning
through Error.Handling.inc with SHOW_ALL_ERRORS
- Error.Handling.inc: check php error level and do not show ones that
are not flagged unless SHOW_ALL_ERRORS is set to true
- db_pgsql.inc for fetch array, call the internal wrapper method, not
the pg method directly
- db_pgsql_pdo.inc: test insert for alternative with pdo lib instead of
php internal postgresql interface
- Class.DB.IO.inc: on prepared check if cursor exist before returing
inserted id in INSERT queries. fail if no insert id could be aquired
if there was no cursor (or other error)
- Class.Basic.inc: rewrite Time to string method for speed up and
removal of old php microtime format
For the host name set, if there is no data in the HTTP_HOST var, then
set it to NA instead. Also default set to port 80 if no port info could
be found.
2014-12-11 11:56:18 +09:00
1466 changed files with 151533 additions and 74336 deletions
symlink_file[0]=$(echo${template_file_stump}| sed -e "s/##SUFFIX##/${suffix}_/"| sed -e "s/##LANGUAGE##/${LANG}/"| sed -e 's/\.TMP//g');
# create second one with lang (no country) + encoding
symlink_file[1]=$(echo${template_file_stump}| sed -e "s/##SUFFIX##/${suffix}_/"| sed -e "s/##LANGUAGE##/${LANGUAGE}\.${ENCODING}/"| sed -e 's/\.TMP//g');
for template_file in "${symlink_file[@]}";do
# if this is not symlink, create them
if[ ! -h "${template_file}"];then
echo"Create symlink: ${template_file}";
# symlik to original
cd"${target_folder}"|| exit;
ln -sf "${original_file}""${template_file}";
cd - >/dev/null || exit;
fi;
done;
done;
done;
if["${FILE_MOVE}" -eq 0];then
echo"";
echo"-- IN FOLDER: ${target_folder}";
echo"-- START: copy lines below to copy created over original --";
echo"${quick_copy}";
echo"-- END ----------------------------------------------------";
INSERTINTOedit_page_visible_groupVALUES((SELECTedit_page_idFROMedit_pageWHEREname='Edit Menu Groups'),(SELECTedit_visible_group_idFROMedit_visible_groupWHEREflag='main'));
-- INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Order'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
INSERTINTOedit_page_menu_groupVALUES((SELECTedit_page_idFROMedit_pageWHEREname='Edit Menu Groups'),(SELECTedit_menu_group_idFROMedit_menu_groupWHEREflag='admin'));
-- INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Order'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
-- auto creates table if missing, if failure writes to overflow table
-- HISTORY:
CREATEORREPLACEFUNCTIONedit_log_insert_trigger()
RETURNSTRIGGERAS
$$
DECLARE
start_dateDATE:='2010-01-01';
end_dateDATE;
timeformatTEXT:='YYYY';
selectorTEXT:='year';
base_tableTEXT:='edit_log';
_intervalINTERVAL:='1 '||selector;
_interval_nextINTERVAL:='2 '||selector;
table_nameTEXT;
-- compare date column
compare_dateDATE:=NEW.event_date;
compare_date_nameTEXT:='event_date';
-- the create commands
command_create_tableTEXT:='CREATE TABLE IF NOT EXISTS {TABLE_NAME} (CHECK({COMPARE_DATE_NAME} >= {START_DATE} AND {COMPARE_DATE_NAME} < {END_DATE})) INHERITS ({BASE_NAME})';
command_create_foreign_key_1TEXT:='ALTER TABLE {TABLE_NAME} ADD CONSTRAINT {TABLE_NAME}_euid_fkey FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE SET NULL';
command_create_trigger_1TEXT='CREATE TRIGGER trg_{TABLE_NAME} BEFORE INSERT OR UPDATE ON {TABLE_NAME} FOR EACH ROW EXECUTE PROCEDURE set_edit_generic()';
COMMENTONCOLUMNedit_user.login_error_date_firstIS'First login error date, reset on successfull login';
COMMENTONCOLUMNedit_user.lock_untilIS'Account is locked until this date, <';
COMMENTONCOLUMNedit_user.lock_afterIS'Account is locked after this date, >';
COMMENTONCOLUMNedit_user.password_change_dateIS'Password was changed on';
COMMENTONCOLUMNedit_user.password_change_intervalIS'After how many days the password has to be changed';
COMMENTONCOLUMNedit_user.password_reset_timeIS'When the password reset was requested. For reset page uid valid check';
COMMENTONCOLUMNedit_user.password_reset_uidIS'Password reset page uid, one time, invalid after reset successful or time out';
COMMENTONCOLUMNedit_user.login_user_idIS'Min 32 character UID to be used to login without password. Via GET/POST parameter';
COMMENTONCOLUMNedit_user.login_user_id_set_dateIS'loginUserId was set at what date';
COMMENTONCOLUMNedit_user.login_user_id_last_revalidateIS'set when username/password login is done and loginUserId is set';
COMMENTONCOLUMNedit_user.login_user_id_valid_fromIS'loginUserId is valid from this date, >=';
COMMENTONCOLUMNedit_user.login_user_id_valid_untilIS'loginUserId is valid until this date, <=';
COMMENTONCOLUMNedit_user.login_user_id_revalidate_afterIS'If set to a number greater 0 then user must login after given amount of days to revalidate the loginUserId, set to 0 for valid forver';
COMMENTONCOLUMNedit_user.login_user_id_lockedIS'A separte lock flag for loginUserId, user can still login normal';
COMMENTONCOLUMNedit_user.additional_aclIS'Additional Access Control List stored in JSON format';
* @testdox humanReadableByteFormat $input will be $expected, $expected_si SI, $expected_no_space no space, $expected_adjust adjust, $expected_si_no_space SI/no space [$_dataName]
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.