Commit graph

18 commits

Author SHA1 Message Date
Yury Pikhtarev
bf9100fbfa
feat: implement centralized Config class to replace global $bb_cfg array ()
* feat: implement centralized Config class to replace global $bb_cfg array

- Add singleton Config class with dot notation support for nested configuration
- Implement thread-safe configuration access with magic methods (__get, __set, __isset)
- Add global config() helper function for convenient access
- Support for getSection(), merge(), has(), all() methods with type safety

BREAKING CHANGE: While $bb_cfg global array still works for backward compatibility,
new code should use config()->get() method with dot notation

Updated files:
- src/Config.php: New Config singleton class implementation
- common.php: Initialize Config singleton and add global helper
- src/Emailer.php: Replace $bb_cfg with config()->get()
- src/Ajax.php: Replace $bb_cfg with config()->get()
- src/Censor.php: Replace $bb_cfg with config()->get()
- src/Validate.php: Replace $bb_cfg with config()->get()
- src/Dev.php: Replace $bb_cfg with config()->get()
- src/Sitemap.php: Replace $bb_cfg with config()->get()
- src/TorrServerAPI.php: Replace $bb_cfg with config()->get()
- src/Sessions.php: Replace $bb_cfg with config()->get()
- src/Legacy/TorrentFileList.php: Replace $bb_cfg with config()->get()
- src/Legacy/Poll.php: Replace $bb_cfg with config()->get()
- src/Legacy/Torrent.php: Replace $bb_cfg with config()->get()
- src/Legacy/Common/User.php: Replace $bb_cfg with config()->get()
- src/Legacy/Template.php: Replace $bb_cfg with config()->get()
- src/Legacy/Atom.php: Replace $bb_cfg with config()->get()
- src/Legacy/Admin/Common.php: Replace $bb_cfg with config()->get()
- viewforum.php: Replace $bb_cfg with config()->get()
- posting.php: Replace $bb_cfg with config()->get()
- dl.php: Replace $bb_cfg with config()->get()
- feed.php: Replace $bb_cfg with config()->get()
- filelist.php: Replace $bb_cfg with config()->get()
- group_edit.php: Replace $bb_cfg with config()->get()
- group.php: Replace $bb_cfg with config()->get()
- index.php: Replace $bb_cfg with config()->get()
- login.php: Replace $bb_cfg with config()->get()
- memberlist.php: Replace $bb_cfg with config()->get()
- modcp.php: Replace $bb_cfg with config()->get()
- playback_m3u.php: Replace $bb_cfg with config()->get()
- poll.php: Replace $bb_cfg with config()->get()

* refactor: replace $bb_cfg with config() in various admin files

- Updated multiple admin files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- common.php
- index.php
- admin_attach_cp.php
- admin_log.php
- admin_mass_email.php
- admin_sitemap.php
- admin_smilies.php
- admin_terms.php
- admin_user_search.php
- admin_words.php
- admin/index.php
- admin/stats/tracker.php

* refactor: update init_bb.php to use config() for configuration management

- Replaced the merging of $bb_cfg with a call to config()->merge() for improved clarity and maintainability.
- Updated the retrieval of all configuration settings to use config()->all().

This change continues the transition towards a centralized configuration system.

* refactor: replace $bb_cfg with config() in various files

- Updated multiple files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- privmsg.php
- search.php
- terms.php
- tracker.php
- viewtopic.php
- bt/announce.php
- bt/scrape.php
- bt/includes/init_tr.php
- library/ajax/*.php
- src/Config.php

* refactor: replace $bb_cfg with config() in attachment and display files

- Updated multiple files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- attachment_mod.php
- displaying_torrent.php
- functions_delete.php
- bbcode.php
- functions.php
- init_bb.php
- online_userlist.php
- page_footer.php
- page_header.php
- torrent_show_dl_list.php
- cron jobs (various files)
- datastore build files (various files)

* refactor: replace $bb_cfg with config() in user control panel files

- Updated multiple user control panel files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- bonus.php
- email.php
- register.php
- sendpasswd.php
- topic_watch.php
- viewprofile.php

* refactor: replace $bb_cfg with config() in various legacy files

- Updated multiple legacy files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- sidebar2.html
- BBCode.php
- LogAction.php
- Post.php
- Template.php
- Torrent.php
- Common/User.php
- Common/Select.php
- Common/Upload.php
- Admin/Common.php
- tpl_config.php

* refactor: remove legacy DOCUMENTATION.md and add UPGRADE_GUIDE.md

- Deleted the outdated DOCUMENTATION.md file, which contained legacy configuration information.
- Introduced a new UPGRADE_GUIDE.md to assist users in migrating to the new configuration system.
- The upgrade guide includes migration strategies, breaking changes, and best practices for using the new Config class.

Files modified:
- DOCUMENTATION.md (deleted)
- UPGRADE_GUIDE.md (new)

* refactor: update legacy files to maintain compatibility with bb_cfg deprecation

- Added comments in init_bb.php, Template.php, and Cron.php to indicate that bb_cfg is deprecated but retained for compatibility with non-adapted code.
- Ensured clarity in documentation for future reference while transitioning to the new configuration system.

Files modified:
- init_bb.php
- Template.php
- Cron.php
2025-06-18 01:19:49 +04:00
Roman Kelesidis
6697410c1d
misc(copyright): Updated copyright year () 2025-01-15 15:25:04 +03:00
Roman Kelesidis
2472608c6d
Code refactoring ()
* Code refactoring

* Update viewtopic.php

* Update viewforum.php

* Update posting.php

* Update viewtopic.php

* Revert "Code refactoring"

This reverts commit e4ac08e377.

* Revert "Update viewforum.php"

This reverts commit 1ee6321385.

* Update viewforum.php

* Update viewtopic.php

* Update viewtopic.php

* Update viewtopic.php

* Update viewtopic.php

* Update dl_list.php

* Update posting.php

* Update posting.php

* Update posting.php

* Update viewprofile.php

* Update email.php

* Update viewtopic.php

* Update functions.php

* Update posting.php

* Update viewtopic.php

* Update CHANGELOG.md
2024-04-10 18:35:55 +07:00
Roman Kelesidis
fad09cf0eb
Updated copyright year ()
* Updated copyright year

* Updated
2023-12-12 22:14:01 +07:00
Roman Kelesidis
3f835e30e6
Removed useless "Subject:" from email templates ()
* Removed useless "Subject:" from email templates

* Updated

* Updated
2023-10-26 15:53:48 +07:00
Roman Kelesidis
8fa4758ebe
Minor improvements () 2023-10-25 23:31:39 +07:00
Roman Kelesidis
10b56ecdef
Replace all double quotes with single quotes () 2023-09-05 21:59:03 +07:00
Roman Kelesidis
4b453de64a
Minor improvements ()
* Minor improvements

* Updated

* Updated

* Updated

* Update privmsg.php

* Updated

* Update admin_attach_cp.php
2023-09-04 01:01:01 +07:00
Yury Pikhtarev
faf2306862
Switching to Symfony Mailer ()
* Switching to Symfony Mailer

Additionally, support for all versions of PHP below 7.4 has been withdrawn

* Language variable for reply to

* Update to PHP 7.4
2023-03-20 01:26:26 +07:00
Roman Kelesidis
261e8b6e27 Updated copyright year 2023-01-27 18:30:34 +07:00
Yuriy Pikhtarev
2f9cef0a39
Update copyright to the short syntax. 2018-06-23 21:50:13 +03:00
Yuriy Pikhtarev
ee544cc507
IP detect subsystem replace. Trash cleanup. Defines. 2017-05-30 00:57:57 +03:00
Yuriy Pikhtarev
b2fdf0b2a9
Replace own emailer to SwiftMailer. 2017-05-21 15:00:01 +03:00
Yuriy Pikhtarev
21c8e7d48a
Type casting can be used.
(cherry picked from commit b5065ae)
2017-05-07 21:05:18 +03:00
Yuriy Pikhtarev
6abd9babc9
Alias functions usage.
(cherry picked from commit 4a79c08)
2017-05-07 21:03:32 +03:00
Vasily Komrakov
064175c67d
Change paths to absolute pathname 2017-02-08 21:34:48 +03:00
Yuriy Pikhtarev
3730bed000
Реформат в PSR-2 + добавление заголовков лицензии MIT в файлы 2017-01-14 04:08:14 +03:00
Exile
f94c0dd2ee Перенос файлов движка в корень 2014-10-28 21:35:42 +03:00
Renamed from upload/library/includes/ucp/email.php (Browse further)