Журнал изменений

Журнал изменений

Фильтр и поиск

Всего: 1091 Доступных коммитов | Отфильтровано: 1091 Коммиты | Страница: 3 / 110
28.07.2026
Refactor: the activity feed and the target deletions move into the Comment class
Автор: Eduard Laas | Дата: 17:58 28.07.2026

Stage 1, batch 5 of docs/COMMENTS-REDESIGN-2026.md. The profile feed, the profile hub and the eight module delete handlers stop reaching the comment table themselves, which leaves one runtime consumer outside the class and removes the last statement that pasted an id list into IN (...).

Core changes:

  1. Target deletion and the profile count (core/classes/comment.php):
  2. deleteTarget() removes the comments of target rows a module admin has just deleted

    • one placeholder per id, so a bulk selection reaches the statement as
bound values and the single case needs no second method
  • no counter is moved: a target that is gone has no row left to hold
one, which is what the eight handlers did before the move
  • getUserCount() answers the published comment count of one account, the number the profile hub shows beside its other module counters

  • Profile reads (core/user.php, modules/account/index.php):
  • getProfileLastView() drops the comment branch of its UNION and fills the comment tab from getUserList()

  • the profile hub drops the same branch and takes its count from getUserCount(), keeping the rating and favourites values it wrote before

  • the unreachable "no parts" guard of the feed moved to the query itself, so a comment-only feed still renders and the empty case is unchanged

  • Module delete handlers (eight admin modules):
  • faq, files, links, media, news, pages, shop and voting call deleteTarget() and hold no comment statement any more

  • Bulk id list (modules/shop/admin/index.php):
  • productops() builds $keys/$pars the way the news and pages handlers already did

    • all six IN (...) clauses bind, closing the interpolation the plan
lists as an acceptance criterion of this stage
  1. Parity probe and guard (tests/):
  2. contract_probe.php gains three modes: the pre-move feed function beside the migrated one, deleteTarget() driven inside a rolled-back transaction, and the hub values of both versions

  3. CommentTargetTest.php asserts the migrated call sites and the measured behaviour, and pins the comment entry out of both UNION branches

Benefits:

  • every runtime comment read and write goes through one class, except the admin sidebar chip recorded as open in the plan

  • a target delete can no longer reach past the module it names
  • the shop handler stops assembling SQL from a joined id list

Technical notes:

  • no table or column changes; no behaviour change intended, and none measured

  • the feed renders byte for byte against the UNION it replaces: 10 accounts, six with comments, one without, plus a missing, a zero and a negative id

  • deleteTarget() measured on all eight modules, on a bulk selection, on a target id shared by five modules, and against crafted id lists and a crafted module name, all inside a transaction that is rolled back

  • the eight routes exercised over real HTTP with a signed-in administrator: each removed only its own module's rows, a wrong token removed none, a repeated delete was a no-op, every per-module total returned to the value it started from

  • core/admin.php:319 still counts pending comments through getAdminCountRow(), which assembles the table name from a variable; it is left for a batch that owns the admin sidebar

Docs: record stage 1 batch 4 of the comment plan
Автор: Eduard Laas | Дата: 15:42 28.07.2026

The Progress section is the only place decisions of a finished batch survive into the next chat, so batch 4 writes down what it moved, what it measured and where it had to change behaviour.

Core changes:

  1. Progress and decisions (docs/COMMENTS-REDESIGN-2026.md):
  2. batch 4 row: what moved, the 42-URL and 16-scenario parity measurement, and the checks that ran

  3. decisions: why setStatus() took the moderation guard, why the body save is its own method, why updateBody() checks no moderator, and how the admin list lost its second description of itself

  4. deviations: the page clamp, the "LIMIT -25, 25" it removes, and the delete() redirect that no longer follows the deleted row's status

  5. two runtime log entries found and deliberately left alone, because neither is comment SQL and both behave alike in either version

  6. Re-measured facts (docs/COMMENTS-REDESIGN-2026.md):
  7. the frontend handlers and the admin module are struck from the list of direct comment-table consumers

  8. numcom() is called from the Comment class alone
  9. the class and admin line numbers cited across the plan are refreshed
  10. the concurrency section states what the new guard does and does not close, so stage 2 still owes the conditional update

  11. Table rendering (docs/COMMENTS-REDESIGN-2026.md):
  12. blank lines had split the Progress table into three, the last two without a header; the table is one again

Benefits:

  • a new chat reading only this file sees why each deviation exists
  • the public method list matches the class that actually exists

Technical notes:

  • no code changes in this commit
Refactor: the comment moderation module moves into the Comment class
Автор: Eduard Laas | Дата: 15:42 28.07.2026

Stage 1, batch 4 of docs/COMMENTS-REDESIGN-2026.md. The admin comment module no longer touches the comment table: every read and write it performed now goes through the Comment class, which leaves the class as the only place that knows how a comment is stored, permitted and counted.

Core changes:

  1. Moderation write methods (core/classes/comment.php):
  2. deleteComment() removes one comment and takes the target counter and the author points back when the removed row was published

    • the module and the target come from the stored row, never from the
request, so the stage 0 trust boundary holds for deletion too
  • updateBody() stores the body a moderator typed, verbatim

    • the moderation form is not the author edit path and applies neither
checkEditRules() nor filterHtml() nor the edit window
  • setStatus() takes the read-then-compare guard the moderation module always had

    • a comment already carrying the wanted status is answered as done
without writing, so a repeated click cannot count its target twice
  • the frontend path inherits the guard and loses a double count it
never intended; the rendered fragment is unchanged
  1. Moderation module (admin/modules/comments.php):
  2. the module selector reads getModuleList(), the list and its count read getAdminList(), the edit form reads getComment()

  3. the four write handlers call setStatus(), deleteComment() and updateBody(); no handler takes $db any more

  4. the pager renders through getTplPagerView() from the total the list itself counted, replacing getTplPager() and its separate COUNT

    • the $where/$wcnt pair is gone, and with it the second, differently
spelled description of one list
  • the rewritten list loop drops its snake_case names per .rules/global.md
  • Trust boundary guard (tests/Unit/CommentTrustBoundaryTest.php):
  • deleteComment() joined the methods asserted to read module and target from the stored row

  • the numcom() assertion follows the $cid the new status guard needs

Benefits:

  • the moderation list can no longer count one thing and show another
  • a repeated approve or delete leaves counters and points untouched
  • the admin panel gains prepared statements everywhere it had them by hand, and loses one hand-built subquery

Technical notes:

  • no table or column changes; the current sort is untouched
  • three measured behaviour changes, each a consequence of the move: an out-of-range page now clamps instead of answering "no information", &num=0 no longer builds "LIMIT -25, 25", and delete() redirects by the tab the request came from instead of by the deleted row's status

  • parity measured over real HTTP with a signed-in administrator: 42 URLs in two rounds, 39 byte-identical in the module content region, the three others being the page clamp above; 16 write scenarios left identical rows, bodies, target counters, points and row count

Docs: record stage 1 batch 3 of the comment plan
Автор: Eduard Laas | Дата: 14:50 28.07.2026

A new chat starts from this file rather than from the working tree, so the batch that moved the frontend writes has to leave behind what it decided, what it measured and which defects it found and deliberately did not touch.

Core changes:

  1. Comment plan progress (docs/COMMENTS-REDESIGN-2026.md):
  2. Batch 3 recorded with what landed, which checks ran and what they reported
  3. Decisions written down: why the class still calls numcom() and getCommentMode() as globals, why both validation copies moved unmerged, why the falsy body test was kept, why CommentStatus is applied and CommentMode is not, and why the captcha rule moved with the others

  4. The write parity method recorded: a rolled-back transaction against the live rows, which is what makes a real published add checkable on the stand the markup baseline is captured from

  5. Three defects recorded with file:line and left untouched: the anchor query that matches without modul, the edit alert that index.php discards, and is_moder('') deciding rights for a row that is gone

  6. The clock skew of this installation recorded: MySQL at Etc/GMT-1 against PHP at Europe/Berlin, which keeps the flood window from ever firing and closes the edit window before the author sees their own comment

  7. Verification gaps named: the moderator paths and the ajax textarea branch need a browser session no CLI probe can hold

  8. Line references re-measured after the move: the resolver, numcom() and its dead branches, the flood query, the anchor query, the word length defect, the render sites and the callers of ashowcom()

  9. The render sites are three, not four: batch 3 merged the two inside updateComment(), and the fourth sits in the unreachable admin branch that batch 6 deletes with the function

Benefits:

  • The stage keeps one place where every decision of every batch survives
  • Stage 2 inherits a measured list of what it has to fix rather than a guess

Technical notes:

  • Documentation only; no code, schema or behaviour is touched by this commit
Refactor: frontend comment writes move into the Comment class
Автор: Eduard Laas | Дата: 14:49 28.07.2026

Stage 1 batch 3 of docs/COMMENTS-REDESIGN-2026.md: adding, editing and moderating a comment no longer happen in the request handlers. The subsystem owns the rules, the permissions and the state changes, and the handlers read the request and render the answer, which is what lets stage 2 make the write transactional in one place instead of at three call sites.

Core changes:

  1. Comment write path (core/classes/comment.php):
  2. addComment(), updateComment() and setStatus() carry the frontend writes

    • the target mode, the author, the address and the moderation state are
resolved from the server context, never taken from the request
  • checkAddRules() answers the single message the submit path shows,
checkEditRules() the list the edit path shows; both are merged into
checkRules() in stage 2, not here
  • getLinkFlag(), getLastTime() and getLastId() carry the auto-link rule,
the flood window and the anchor id of a fresh row
  • CommentStatus names the value written to the status column; the acomm
comparisons stay bare because CommentMode belongs to stage 2
  • the counters still run through the global numcom(), and the target still resolves through the global getCommentMode(), as the batch table requires; batch 6 absorbs both

  • Request handlers (core/user.php, core/system.php):
  • addComment() shrank from 48 lines to 16, updateComment() from 43 to 22 and updateCommentStatus() from 15 to 7

  • none of the three holds comment SQL any more; the alerts, the ajax textarea, filterContent(), ashowcom() and addAdminMail() stay with the handler

  • Write parity checks (tests/):
  • CommentWriteTest drives the class against the live rows of the installation inside a transaction that is always rolled back

    • all eight modules store the row they resolved, increment their own target
counter and award their own points slot
  • an anonymous comment lands pending and moves neither
  • every refusal answers the message the submit path answered
  • the author edits inside the window and is refused after it; a visitor
edits and moderates nothing
  • CommentTrustBoundaryTest follows the code it guards: the stage 0 contract is now read off the class, and the handlers are asserted to carry neither a request module nor comment SQL

Benefits:

  • one description of what may be written, shared by the three routes
  • the counter and the points slot of every module are measured, not assumed
  • the write path is ready for the transaction and the reqkey of stage 2

Technical notes:

  • no schema and no markup change; behaviour is preserved down to the falsy body test that keeps a body of "0" from being saved, and to the edit length rule that still measures the last word in bytes

  • the six POSTs that reach the three routes answer byte for byte the same as before the move, with the comment count and the target counter unchanged

  • comment-baseline verify stays OK on all eight modules
  • the moderator paths need a browser session and are not covered by this batch
Docs: record stage 1 batch 2 of the comment plan
Автор: Eduard Laas | Дата: 12:42 28.07.2026

A new chat starts from this file rather than from the working tree, so the batch that moved the frontend reads has to leave behind what it decided, what it measured and what it deliberately did not touch.

Core changes:

  1. Comment plan progress (docs/COMMENTS-REDESIGN-2026.md):
  2. Batch 2 recorded with what landed, which checks ran and what they reported
  3. Decisions written down: the unreachable admin read branch left with the read it built, the page size no longer dividing by zero, the two single-letter locals renamed, and why the no-direct-SQL guard belongs to batch 6

  4. The setting invariant recorded: the class snapshots $conf['comments'] while the render function still reads sort and nump live, which is safe only because nothing writes that section at runtime

  5. Deviation recorded: the batch inherits the unmeasured moderator branch, since the signed-in views need a session no CLI probe can hold

  6. Function size re-measured after the move: 186 lines instead of 253, with the new line range

Benefits:

  • The stage keeps one place where every decision of every batch survives
  • The next batch knows which verification gaps it inherits instead of rediscovering them

Technical notes:

  • Documentation only; no code, schema or behaviour is touched by this commit
Refactor: frontend comment reads move into the Comment class
Автор: Eduard Laas | Дата: 12:42 28.07.2026

Stage 1 batch 2 of docs/COMMENTS-REDESIGN-2026.md: the render function no longer queries the comment table itself. It asks the subsystem for one page and assembles markup, which is what lets the later stages change storage and sorting in one place instead of at every call site.

Core changes:

  1. Comment list rendering (core/system.php):
  2. ashowcom() reads through $com->getList() instead of its own SQL

    • the count query, the page query and the author group join are gone
    • pagination, the visibility scope and the running comment number now come
from the class, so a count can no longer disagree with the page it counts
  • the unreachable ADMIN_FILE read branch left with the read it built; the
admin render branches stay until the function itself is removed
  • local names follow the naming rules of .rules/global.md

    • the running number $a became $numb, the checkbox flag $b became $mark

Benefits:

  • 253 lines down to 186, and no direct comment SQL left in the render path
  • one description of what a viewer may see, shared by the count and the page
  • a broken comments.num setting falls back to 15 instead of dividing by zero

Technical notes:

  • no schema, template or markup change; the rendered output is byte for byte the same

  • verified against the pre-move file over 26 URLs in both sort directions: first, middle, last, out-of-range and zero pages, a target with no comments, a target spilling one row onto a second page, one holding exactly the page size, garbage and negative page parameters, and a missing target id

  • comment-baseline verify stays OK on all eight modules
  • the signed-in and moderator views need a browser session and are not covered by this batch

Docs: record stage 1 batch 1 and the eight-module comment baseline
Автор: Eduard Laas | Дата: 12:02 28.07.2026

The markup baseline the comment stage checks its parity against covered six of the eight modules, which would have let two of them drift unnoticed through the whole refactor. Both fixtures are restored and the plan now carries what batch 1 decided, so the next chat starts from a record of the work rather than from the code alone.

Core changes:

  1. Comment plan progress (docs/COMMENTS-REDESIGN-2026.md):
  2. Batch 1 recorded with what landed, which checks ran and what they reported
  3. Decisions written down: the third constructor argument, the parser kept unused until it is needed, the pager and scope helpers, status = 1 for public reads, the two placeholders of the author search, and the name shared with the global getUserList()
  4. Deviations recorded: six read methods instead of the four the plan named, and the moderator branch written but not measured because the probe is a guest
  5. The baseline blocker is closed, since capture now records all eight modules
  6. Comment table facts re-measured: 7357 rows, media back in the distribution with its two fixture rows
  7. Baseline fixture procedure (docs/TESTS.md):
  8. The preparation SQL is recorded beside the revert it already carried, so a lost fixture can be rebuilt rather than guessed
  9. note and links are named explicitly because both are TEXT NOT NULL without a default and the server runs STRICT_TRANS_TABLES; the documented statements were proven executable against the live schema
  10. The category permission values are explained, because catmids() filters the view by them and the schema default is not an open state
  11. Unit test inventory brought up to date with the comment and mail test files

Benefits:

  • The parity claim of the stage covers all eight commenting modules instead of six
  • A stand that lost a fixture can be repaired from the document instead of from memory
  • Every decision of the batch survives into the next chat, which starts without its context

Technical notes:

  • Documentation only; no code, schema or behaviour is touched by this commit
  • The fixture rows themselves live in the local database and are not part of the repository, as storage/baseline is ignored by git
Feature: Comment class carrying the read half of the comment engine
Автор: Eduard Laas | Дата: 12:01 28.07.2026

Stage 1, batch 1 of docs/COMMENTS-REDESIGN-2026.md opens the move of the comment engine out of the 253-line ashowcom() monolith into one class. This batch adds the class and its reads only; nothing calls them yet, so the running system is untouched and every later batch migrates call sites against a surface already proven equal to the queries it replaces.

Core changes:

  1. Comment subsystem (core/classes/comment.php):
  2. New class owning every read of the comment table

    • getCount() and getList() serve the frontend list with its pagination
    • getAdminList() serves the moderation list across state, module and the five search fields
    • getComment(), getUserList() and getModuleList() serve the admin edit form, the profile activity feed and the module selector
  3. CommentStatus and CommentMode enums replace the bare 0/1/2 literals of status and acomm
  4. getScope() and getAdminScope() build a visibility scope once and getTotal() counts against that same source, so a list and its count cannot describe different rows
  5. getAuthors() resolves the author records of one page in a single round trip, keeping the group-join precedence the current rendering relies on
  6. getPager() holds the page arithmetic the frontend and the moderation list currently spell out twice
  7. Request wiring (core/system.php):
  8. The class loads beside the other services and is constructed after the parser as $com
  9. The constructor takes $conf as a third argument because no class in core/classes reaches for a global and the reads need the comments section for their pagination
  10. Read parity harness (tests/Support/contract_probe.php, tests/Unit/CommentReadTest.php):
  11. New commentread probe mode puts every legacy statement beside the method replacing it, against the live rows of the installation
  12. 8 test cases cover the count, the first and last list page, the author record, the activity feed, the module list, a single read, a missing id and all five moderation filters
  13. The list case was proven to fail by flipping the sort direction, so the parity claim is measured rather than asserted

Benefits:

  • Byte parity of the rendered comment list becomes checkable per batch instead of at the end of a twenty-site diff
  • One visibility predicate per list removes the class of defect the hand-built where/count pair of the admin module still carries
  • The read surface is settled before any call site moves, so the migration batches change callers only

Technical notes:

  • No table, column or index changes; no behaviour change, because nothing calls the class yet
  • Public reads select status = 1 rather than status != 0 per the design query rule; the column holds 0 and 1 only across all 7357 rows and the probe proves the results identical
  • The author search keeps two placeholders for one term because emulated prepares are off and a native statement refuses a repeated named placeholder
  • getUserList() shares its name with the unrelated global function at core/system.php:4792, which no stage removes; a method and a function of one name coexist without ambiguity
Refactor: migrate every mail call site to the Mail service
Автор: Eduard Laas | Дата: 11:35 28.07.2026

Stage 1 of docs/MAIL-2026.md ends here: all 26 outgoing-mail call sites now go through $mailer->addQueue() and the global addMail() is deleted, so the transport choice added in batches 1-5 becomes the only way a message leaves the system. Stage 2 can then turn the same call into a queue row without touching a single caller.

Core changes:

  1. Call site migration (26 sites in 16 files):
  2. every caller passes a named array instead of six positional arguments

    • kind names the originating feature: account, admins, contact, forum,
help, money, order, privat, recommend, security, shop, newsletter
  • addAdminMail() passes comment or content depending on its own $iscmt,
so a comment notice stays distinguishable from a new-content notice
  • the six sites that passed $id = 1 now pass client => true
  • recipient, sender and priority keep their existing meaning everywhere
  1. Legacy surface removal (core/security.php):
  2. addMail() deleted; no wrapper, alias or transitional signature remains
  3. with it go the self-written Return-Path header, the hand-built =?CHARSET?b?..?= subject and the error handler that discarded warnings

  4. Service construction moved (core/security.php, core/system.php):
  5. $mailer is created at core/security.php:54, right after $db and PREFIX_DB

    • addHackReport() and addWarnReport() are reached from the request scan
inside that same file, long before the previous construction point
  • a migrated security notice would otherwise have called a method on null
  • the require_once stays in core/system.php, ahead of the file that uses it
  • Documentation (CONTRIBUTING.md, docs/PERFORMANCE.md, docs/MAIL-2026.md):
  • the verb-prefix table illustrates add with addHackReport(), a function that still exists

  • the Outgoing Mail section describes the current entry point
  • the plan records the batch, four decisions and the remaining blockers

Benefits:

  • one entry point for outgoing mail, so the transport and later the queue are introduced behind a boundary no caller can bypass

  • a refused delivery is now recorded through Logger::addSite() with the transport and a masked recipient instead of being silently discarded

  • kind gives stage 2 the retention, priority and admin filter it needs without re-deriving anything at the call site

  • the newsletter body is parsed once per batch instead of once per recipient

Technical notes:

  • Breaking change: addMail() no longer exists. Any third-party module or local patch calling it must move to $mailer->addQueue().

  • An unresolvable sender now aborts the send rather than emitting an empty From, per the plan's validation rule.

  • Behaviour on the default transport is unchanged for an installation that configures nothing: an unset mail.transport still delivers through PHP mail().

  • Verified: php -l on all touched files, phpunit 306 tests / 3 skipped, phpstan clean, php-cs-fixer clean, front page and admin.php both 200, and a crafted request drove addHackReport() through the migrated path over real HTTP. Live delivery for the remaining call sites needs a host with a working MTA and is tracked in the plan.

Всего: 1091 на 110 страницах по 10 на каждой странице

1 2 3 4 5 6 7 8 9 10 11 12 110
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

Поделиться
QR-код