1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

88 Commits

Author SHA1 Message Date
camer0n
218d0a5afc Issue #5490 Incorrect ALTER query created on index. Indexes added to admin_log for speed. 2025-05-06 18:08:52 -07:00
camer0n
e5edbf665c Issue #5382 - Fix history table creation. 2025-04-08 17:29:10 -07:00
camer0n
52041d406f Issue #5443 - PHP 8.4 fixes. 2025-03-16 12:48:18 -07:00
camer0n
0b89d5d301 Issue #5209 - Partial fix. Currently does not support FULLTEXT on a field that already has an INDEX. 2025-01-03 16:02:38 -08:00
camer0n
b970aec7aa Issue #4501 Reinitialize db_verify after plugin installation. 2023-12-07 14:11:23 -08:00
camer0n
3d000c8dc3 Issue #4501 - Improve verification and cron table engine. 2023-12-05 16:05:56 -08:00
camer0n
84fe29cf12 Issue #4501 - PHP 8.3 compatibility. 2023-12-05 07:56:56 -08:00
camer0n
939a149ed0 Issue $4501 Fix fatal error PHP 8.3 2023-11-28 16:47:40 -08:00
Nick Liu
d790faa049 Convert and run e107 using the MySQL/MariaDB utf8mb4 character set and
InnoDB storage engine

Components affected:
* `db_verify` now checks and corrects the table storage engine
* `db_verify` now checks and corrects the table default character set
  * Note: Field character sets can still be overridden
  * Note: When correcting, the entire table is converted to the target
    charset.
* The alt_auth plugin now connects via PDO using the e107 default
  charset, utf8mb4
* `e_db_pdo` now sets the charset to utf8mb4. This is currently not
  customizable because it was previously not customizable.
* `install.php` now generates an `e107_config.php` file with
  `$mySQLcharset = 'utf8mb4';`, though this option is not actually used.
* `install.php` now removes plugin tables before installing plugins.
* `e_db_mysql` now only accepts the `utf8mb4` charset. Previously, it
  only accepted the `utf8` charset.
* `e_db_mysql` now configures `mysqli_real_escape_string` to match the
  new default charset, `utf8mb4`.
* Plugin installations now use the preferred MySQL table storage engines
  and charsets.

The preferred MySQL table storage engines are now mapped like so:
* If `ENGINE=MyISAM` is specified, the actual storage engine set will be
  the first available of: InnoDB, Aria, Maria, MyISAM
* If `ENGINE=Aria` is specified, the actual storage engine set will be
  the first available of: Aria, Maria, MyISAM
* If `ENGINE=InnoDB` is specified, the actual storage engine set will be
  the first available of: InnoDB, XtraDB
* If `ENGINE=XtraDB` is specified, the actual storage engine set will be
  the first available of: XtraDB, InnoDB

The preferred MySQL character set is now aliased like so:
* `utf8`    => `utf8mb4`
* `utf8mb3` => `utf8mb3`
* `utf8mb4` => `utf8mb4`

Fixes: #4501
2021-05-22 00:46:35 -05:00
Nick Liu
b623868756 db_verify::getIndex(): Support index_col_name optional parts
In the MariaDB `CREATE TABLE` [`index_definition`](https://mariadb.com/kb/en/create-table/#index-definitions),
 the `index_col_name` could have an optional length and a sort order:

```
index_definition:
    {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option] ...
  {{{|}}} {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...) [index_option] ...
  {{{|}}} [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...) [index_option] ...
  {{{|}}} [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type] (index_col_name,...) [index_option] ...
  {{{|}}} [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...) reference_definition

index_col_name:
    col_name [(length)] [ASC | DESC]

index_type:
    USING {BTREE | HASH | RTREE}

index_option:
    [ KEY_BLOCK_SIZE [=] value
  {{{|}}} index_type
  {{{|}}} WITH PARSER parser_name
  {{{|}}} COMMENT 'string'
  {{{|}}} CLUSTERING={YES| NO} ]
  [ IGNORED | NOT IGNORED ]

reference_definition:
    REFERENCES tbl_name (index_col_name,...)
      [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]
      [ON DELETE reference_option]
      [ON UPDATE reference_option]

reference_option:
    RESTRICT | CASCADE | SET NULL | NO ACTION
```

`db_verify::getIndex()` didn't handle this possibility, leading to a
database validity check failure despite the index actually existing.

Fixes: https://github.com/e107inc/e107/issues/5054
2023-08-17 17:27:26 +02:00
Cameron
83d29f3114 Issue #4907 - tweaked cursor style, removed row hover. 2022-11-12 11:19:20 -08:00
Cameron
4c2ff6c37e Closes #4907 - Improved interface on database table verification form. 2022-11-12 11:14:37 -08:00
Cameron
55980a29a8 Generated PHPDoc for all classes in e107_handlers where one was missing. toNumber() updated to always return int or float. 2022-04-04 10:54:24 -07:00
Cameron
025ff07aab Fixes #4737 Removal of type="text/javascript" and type="text/css" 2022-03-31 08:24:34 -07:00
Cameron
4c10212d47 Debug info styling fix. 2021-02-27 06:52:07 -08:00
Cameron
3f8e043998 Replaced e107::getAdminLog() with e107::getLog(). e107::getAdminLog() will continue as a deprecated alias. 2020-12-22 09:36:02 -08:00
Cameron
9880a68d4b Code cleanup 2020-12-20 19:42:09 -08:00
Cameron
601df26d51 Code optimization for speed and reduced memory usage. 2020-12-20 11:50:10 -08:00
Cameron
5b82c292b1 Code cleanup 2020-12-18 19:55:12 -08:00
Cameron
44e260b121 Code cleanup and optimization 2020-12-14 16:21:48 -08:00
Nick Liu
aee67c1399 MySQL 8.0.17+ support: INT types no longer return a width specification
Fixes: #4216
2020-07-16 17:30:57 -05:00
Cameron
450b35f017 Removed redundant closing tags. 2020-06-05 11:34:17 -07:00
Cameron
1f502ce459 Fixes #4155 - database verification was failing when field name ended in a digit. 2020-05-16 13:14:29 -07:00
Nick Liu
1d72d48a35 Type checks for db_verify::prepareResults() 2020-01-18 11:38:36 +01:00
Deltik
0ade7bdc50 Improved portability of db_verify::getPrevious()
Now works in PHP 7 as it used to work in PHP 5

Fixes: #3768
2019-03-29 18:25:05 -05:00
Cameron
8e5fd33494 Merge pull request #3697 from SimSync/fix_current_timestamp
fixes e107inc/vstore#99: Difference between MariaDB and MySQL table def
2019-03-01 08:47:11 -08:00
Achim Ennenbach
dc675c66e4 fixes e107org/vstore#99: Difference between MariaDB and MySQL on
command TABLE CREATE returns CURRENT_TIMESTAMP w/o brackets
Updated method db_verify::diffStructurePermissive() to correct
the given sql table definition.
2019-02-26 18:52:32 +01:00
Cameron
08004d56a7 db-verify make sure the correct ENGINE is used when fixing a missing table. 2019-02-24 12:17:03 -08:00
Cameron
d994785e63 Removed false-positive when an SQL file uses type JSON
Moved comparison processing into separate method. prepareResults()
2019-02-24 11:35:32 -08:00
Cameron
f77d44ee3b Added method to db_verify to improve testing. 2019-02-03 15:41:19 -08:00
Cameron
5d27229183 Database verification now runs again directly after applying fixes. Compatibility fix for core_functions.php 2018-11-22 13:43:02 -08:00
Cameron
4dbaa76284 Fixes #3406 - db verify was not adding Primary Indices correctly when running fixes. 2018-09-16 16:27:14 -07:00
Cameron
744a71f785 Fixes #3373 Improved db_verify table parsing for languages other than English. 2018-08-17 13:55:34 -07:00
Achim Ennenbach
e1920c740a toMySQL() added keyname to index if available
getIndex() now supports also the INDEX keyword
2018-06-15 19:05:15 +02:00
Nick Liu
1c75486642 Permissive numeric field validation in db_verify
db_verify::diffStructurePermissive() now checks for all MySQL/MariaDB numeric
types and permissively allows the expected and actual default values to be
strings rather than numerical.

Fixes: #3011
Related: #2998
2018-01-28 05:59:51 -06:00
Nick Liu
a397b80640 Fixed regression: db_verify distinguish results
Regression in #2999 prevents db_verify from distinguishing fields from indices

This prevents database migrations where both the fields and the indices of a
field need to be updated in one migration.

This commit fixes that.

Fixes: #3001
2018-01-23 14:09:48 -06:00
Nick Liu
3e2cdd5c9e Refactored away duplicate code in db_verify
Hopefully Code Climate likes this one better
2018-01-23 10:46:39 -06:00
Nick Liu
c959610f7d Fixed regression from 9a5ac5b
Regression fixed: Diff wasn't being set
2018-01-23 08:59:39 -06:00
Nick Liu
9a5ac5b21a Permissive field validation in db_verify
Even if it's a new installation of e107, `db_verify` will be too strict in
validating database field defaults that are equivalent to each other.

This can happen on some MySQL or MariaDB servers that correct the field
definitions, which were not strictly correct in the table structures built into
e107 in the first place.

This commit introduces db_verify::validateFieldPermissive(), a
backwards-compatible way to validate database field defaults.  It works
regardless of whether the MySQL server stores a corrected representation of the
schema and does not require fixing the schema in any existing table structure
files.

Fixes: #2998
2018-01-23 07:48:24 -06:00
Cameron
cd123977bd Fixed #2909 - SQL Index validation issue. 2017-12-10 12:54:14 -08:00
Cameron
af959b0c00 Issue #1936 Fix for the 'stuck' database update button on core update page. Temporarily modify core_sql.php to test. 2017-11-15 14:48:12 -08:00
Cameron
caee889b7f Fixes Plugin Database structure update detection. 2017-04-21 14:21:29 -07:00
Cameron
645bc2a791 Renamed methods. 2017-02-03 13:02:08 -08:00
Cameron
612f16127c Cache DBVerify table info for 15 mins (unless debug is active) - speed up admin dashboard. 2017-02-03 11:34:14 -08:00
Cameron
630fd5fb57 Clear theme meta cache after installation. 2017-01-30 07:52:25 -08:00
OTroccaz
0008d6b0ab Just a missing parenthesis 2017-01-30 10:18:04 +01:00
Cameron
b6d9507aca Optimization 2017-01-29 18:43:52 -08:00
Cameron
43d0211590 Code cleanup: deprecated include_lan() 2017-01-23 09:41:23 -08:00
Cameron
bd8c42e4b3 Reduce queries while using db_verify. 2017-01-07 11:18:32 -08:00
Cameron
2a14308600 Fixes #1762 - Media-Manager Youtube thumbnail should use https. Removed debug info on db_verify. Hide carousel navigation when only 1 slide present. 2016-07-06 09:58:17 -07:00