Commit Graph
38 Commits
Author SHA1 Message Date
Isaac ConnorandClaude Opus 5 ddb5c93211 fix: drive the database with DBD::MariaDB when it is installed fixes #5008
DBD::mysql 5 refuses to connect to a MariaDB server and upstream does not
consider that a bug, so a MariaDB system needs DBD::MariaDB. Prefer it when
present; it drives both servers. ZM_DB_TYPE cannot select it, which is why
setting it to MariaDB does not work: the same value builds the PHP PDO dsn,
where the only valid driver is mysql whichever server is in use.

Swapping the dsn scheme is not enough on its own. DBD::MariaDB spells
DBD::mysql's mysql_* parameters mariadb_* and ignores parameters it does not
recognise, so a dsn built with the wrong prefix does not fail: it drops the
socket path and the TLS settings and connects over plain TCP. Build the dsn in
one place from the chosen driver, renaming caller supplied options too, since
zmupdate.pl asks for mysql_multi_statements.

Read the id of an inserted row through DBI's last_insert_id rather than the
mysql_insertid handle attribute, which DBD::MariaDB does not have and would
answer undef for, leaving events and objects with no Id.

DBD::MariaDB is always utf8mb4, so it takes no mysql_enable_utf8mb4 attribute.

Let cmake accept either driver instead of requiring DBD::mysql, checking in the
same order, and warn when neither is installed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019URmtYqza6Rzi6F7cmabSm
2026-08-20 08:12:25 -04:00
SteveGilvarryandClaude Opus 4.8 d05eece5a0 docs: resolve conflicting license statements in Perl modules
The ZoneMinder Perl modules carried a GPL-2-or-later notice in their file
header but ended with an h2xs-scaffolding POD footer stating the code could
be used "under the same terms as Perl itself" (Artistic-1.0-or-GPL-1+). The
two statements contradict each other.

Every affected file has the same copyright holder in both the header and the
footer, and was contributed to ZoneMinder under the GPL-2+ header; the
Perl-terms line is inherited boilerplate that was never the intended license.
The project as a whole is GPL-2+ (see COPYING).

Replace the contradictory POD paragraph with a one-line pointer to the GPL so
each file states a single, consistent license without duplicating the full
notice already present in the header. Copyright and author attribution lines
are left unchanged.

Affects 60 .pm and .pm.in files under scripts/ZoneMinder/lib/ZoneMinder.

fixes #817

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 14:48:47 +10:00
Isaac Connor da7ec8a082 Improve error message to tell us what type the object was 2026-01-06 08:44:21 -05:00
Isaac Connor d5aa5bfa46 Add Object_Types table and perl code to use it. 2024-03-29 18:42:46 -04:00
Isaac Connor 39e2c9a5a6 Move array_diff down to where it is used 2024-03-21 12:43:01 -04:00
Isaac Connor 7f03a84b35 When instantiating an object, and given the data, refresh the cache instead of using an old cached object. This should fix issues with Events where cached properties like Storage and Path use an old value. 2024-01-08 10:02:56 -05:00
Isaac Connor 582245cdaf Rework new and find to properly handle multi-column primary keys 2023-10-04 17:07:50 -04:00
Isaac Connor 82a7dca63b SELECTING auto_increment value doesn't work. Must use mysql_insertid 2023-09-18 17:05:10 -04:00
Alejandro Criado-Pérez 871bf1772f fix: messages 2023-07-05 01:03:48 +02:00
Isaac Connor e52a77f206 Slightly betr clone 2022-11-17 14:53:19 -05:00
Isaac Connor 2e23aedbbc Add in clone function 2022-11-17 14:41:41 -05:00
Isaac Connor 9d9b363536 Add backtrace when no primary key 2022-03-31 19:32:34 -04:00
Isaac Connor addfdcd330 Remove sets::isin references 2022-02-28 15:41:57 -05:00
Isaac Connor e4693c251c add backticks around field names because some like Function are reserved 2022-01-12 23:08:29 -05:00
Isaac Connor 9169da6963 Only start a transaction if we are not already in a transaction 2021-10-25 11:09:06 -04:00
Isaac Connor 202c4ef28c copy array_diff sub into Object so we don't have the dependency 2021-04-29 19:00:36 -04:00
Isaac Connor 69098ccdcb Implement changes() in Object 2021-04-29 14:49:30 -04:00
Isaac Connor a0f733615c allow empty string as a default value 2020-10-22 11:26:34 -04:00
Isaac Connor 40c57b4b23 Improve logic in set, improve logging 2020-10-22 10:43:53 -04:00
Isaac Connor 796b99cd5b When no results from Object->load, clear the id in the object 2019-08-27 13:52:52 -04:00
Isaac Connor 5f5d5f691a Add backticks for mysql 8 2019-08-25 12:30:06 -04:00
Isaac Connor 3cd1887d54 Cleanup POSIX use. Fix conflict between POSIX and Date::Format. 2018-11-06 12:14:42 -05:00
Isaac Connor 18b327b4ac Turn off massive debugging 2018-11-06 09:55:53 -05:00
Isaac Connor 451c42ddf5 Implement rmrecover script. Flush out Object code to support find, find_one, find_sql, improve to_string, etc. 2018-11-05 16:52:34 -05:00
Isaac Connor 62f6e4a78a Cleanup lock_and_load add some debug 2018-05-03 09:30:44 -07:00
Isaac Connor 9d5dcd7b0c return to indicate success of load 2018-03-28 08:56:03 -07:00
Isaac Connor 2068a5c684 Add object caching 2018-01-22 15:25:51 -05:00
Isaac c5332a255b Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas 2018-01-21 21:11:28 +01:00
Isaac fedd67a7f6 add to_string 2018-01-21 21:11:05 +01:00
Isaac Connor 43d72decac Turn off extra debugging 2018-01-19 18:24:59 -05:00
Isaac Connor 715adb5acb add locking to Event moving and diskspace updating. 2018-01-18 11:38:08 -05:00
Isaac Connor 1ccd344bf5 implement Storage Area move 2017-12-04 11:05:50 -05:00
Isaac Connor cb01b96dc0 fixes 2017-11-01 12:01:11 -07:00
Isaac Connor 2003798e64 copy in start and end transaction 2017-10-27 21:06:11 -07:00
Isaac Connor 2d6998ad25 fix debug_all 2017-10-27 20:54:54 -07:00
Isaac Connor 2d8a4794de add save, set, transform, and some globals pointing to dbh and log 2017-10-27 20:54:29 -07:00
Andrew Bauer 89bcfc4e28 fix incorrect gpl license text mailing address 2017-07-14 10:39:50 -05:00
Isaac Connor ed12dab648 fixup docs, cleanup 2017-05-26 13:13:34 -04:00