72 Commits
Author SHA1 Message Date
Adam DaleyandClaude Sonnet 4.6 17b121ca51 fix(Servicedomain): require_once registrar adapter file before class_exists check (#3832)
* fix(Servicedomain): require_once registrar adapter file before class_exists check

Third-party registrar adapters uploaded after installation are absent from
Composer's static class map (generated with --optimize-autoloader), causing
class_exists() to return false even when the file is present on disk.

Mirror the pattern used by Payment adapters in ServicePayGateway: require_once
the adapter file when the class is not yet loaded, then re-check class_exists
to keep a clear error for adapters that define no class.

Fixes #3828

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mCNdqXfyuD2n1bjFK5zsv

* fix: require_once adapter/manager files before class_exists checks

Payment adapters, server managers, and the server_manager DI factory all
relied on Composer's classmap for dynamic class resolution. With
--optimize-autoloader the classmap is static, so third-party files dropped
into src/library/ after installation are invisible to class_exists().

AntLoader (removed in #3776) previously discovered these files on the fly;
this commit restores equivalent behaviour by requiring files explicitly:

- ServicePayGateway::getAdapterClassName() now checks both nested-dir and
  flat file formats before falling back, replacing the blind `include`
- Servicehosting/Service::getServerManagerConfig() require_onces the
  manager file before calling is_callable() so the class is guaranteed
  present; Server_ has no PSR-0 entry so this also fixes non-optimised builds
- di.php server_manager factory require_oncess the manager file when the
  class is absent from the classmap (adds Path import accordingly)

Registrar adapter loading was fixed separately in the prior commit.

Related to #3828

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mCNdqXfyuD2n1bjFK5zsv

* fix: address code-review findings on adapter/manager class loading

- Servicehosting getServerManagerConfig: wrap require_once in try/catch
  so a PHP parse error in a manager file returns [] instead of fataling
  the entire manager-list API call (restores old is_callable() behaviour)

- di.php server_manager factory: replace file_exists() with Symfony
  Filesystem::exists() per CLAUDE.md convention; extract the repeated
  ucfirst((string) $manager) call to a local $managerName variable; add
  Filesystem use-import alongside the existing Path import

- composer.json: add Server_ to the psr-0 autoload entries alongside
  Payment_ and Registrar_, giving server managers the same architectural
  treatment and making the require_once guards defensive fallbacks rather
  than the only load path

- ServicePayGateway getAdapterConfig: remove the redundant filesystem
  existence re-checks (lines 386-390) that duplicated what
  getAdapterClassName() just did; collapse into a single class_exists()
  guard with the user-facing :adapter placeholder message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mCNdqXfyuD2n1bjFK5zsv

* fix(tests): update ServicePayGateway tests to match refactored getAdapterConfig

After refactoring getAdapterConfig() to delegate filesystem lookups to
getAdapterClassName(), the tests were failing because:
- Three tests had atLeast()->once() expectations on filesystem->exists()
  that the method no longer calls directly
- One test expected an error message with the full class name, but the
  refactored code uses $pg->gateway (the gateway code) in the message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mCNdqXfyuD2n1bjFK5zsv

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-24 00:16:11 +02:00
Adam Daley d6c2b718ea Refactor API handling and switch to Composer autoload (#3776)
* Remove AntLoader and switch to Composer autoload

* Use DI-provided http_client and remove include_path

* Introduce Api_Dispatcher and refactor Api_Handler

* Add FOSSBilling\Api\Proxy and refactor API dispatcher

* Replace Api_Handler with FOSSBilling\Api\Identity

* Move/rename API base class and update DI key

* Fix Docker Composer autoload build

* Fix Docker runtime autoload paths

* Preserve vendor autoload in Docker runtime

* Fix cron task calls without params

* Fix update autoload fallbacks
2026-06-14 19:28:11 +01:00
Adam Daley dd3dcbfd52 Enhance type safety, authentication checks, and testing framework (#3701)
* Improve type safety, auth checks and PHPStan fixes (#3250)

* Improve type safety, auth checks and PHPStan fixes

* Remove @phpstan-ignore annotations

* Improve type safety, auth checks and PHPStan fixes

* Remove @phpstan-ignore annotations

* Remove redundant @phpstan-ignore comment

* Improve code robustness and reliability (#3248)

* Harden code against null/undefined values

* Update dependency lockfiles

* Sanitize ticket input and use IDs in email list

* Restructure tests and add test utilities

* Move E2E tests to `Library\E2E` namespace

* Update `php-build` action ref in workflows

* Switch tests to Pest and add test scaffolding

* Refactor E2E tests to Pest-style tests

m

Skip E2E tests when env not configured

* Refactor Unit tests and update test config

Add test datasets and refine test helpers

* Add DEBUG guard, fix API JSON decode, update tests

* Refactor tests: add types and Mockery expectations

* Adjust tests, phpstan config, and composer script

* Instantiate test APIs locally, remove beforeEach

* Refactor runtime checks, types & logging

* Apply PHP Code Styling Changes

m

* Add PHPStan ignores, test renames & small fixes

* Enable Pest tests in CI workflow

* Remove legacy tests; add new unit tests/config

* Avoid undefined index in fingerprint comparison

* Ignore properties absent in both fingerprints

* Remove public_ticket_create API method

* Add Fingerprint unit tests

* Remove em dash from fingerprint test name

* Switch to Pest; assorted bug fixes & refactors

* Prefer getDi() and guard DEBUG define

* Refactor tests: DBAL, Antispam rename, helpers

* Refactor email tests to use Doctrine entities

* Update tests, use DBAL mocks & improve Formbuilder admin

* Validate plan_id and update unit tests

* Replace error_log with DI logger and update tests

* Expect db->store in Invoice Service test

* Use DI logger instead of error_log; fix tests

* Fix typo in Hook Service test

* Fix Staff test spelling fixture

* Complete Pest test migration

* Fix Product test spelling fixtures

* Fix Product test spelling fixtures

* Run live tests with Pest and load helpers

* Migrate tests to ApiClient; remove legacy APIHelper

* Fix Email test spelling

* Remove unused PHPUnit bridge

* Organize Cypress end-to-end tests

* Document Pest test directory root

* Remove noisy Pest comments
2026-06-02 07:43:01 +01:00
Adam DaleyandCopilot Autofix powered by AI b085de6809 Remove unused dependencies and update DDEV config for MariaDB (#3634)
* Remove theme/module images and asset copy logic

* Remove unused deps and copyAssets helper

* Update DDEV config: MariaDB 11.8 & hooks

* Switch DB to MariaDB in compose and installer

* Update theme screenshots for two themes

* Fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Set Node.js version to 24 in DDEV config

Add nodejs_version: 24 to .ddev/config.yaml to ensure DDEV uses Node.js 24 for project containers and build tooling.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-28 20:37:56 +01:00
581664029d Update dependency @dicebear/core to v10 (#3621)
* Update dependency @dicebear/core to v10

* Add server-side avatars via DiceBear

* Initialize locale selector with saved/default

* Add 'dicebear' to cspell word list

* Fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-28 09:45:10 +01:00
a7ef873368 Revamp admin UI and improve dashboard layout and functionality (#3596)
* Adjust admin alerts and installer warning

* Make dashboard cards full-height and align badges

* Split dashboard cards into partials and add AJAX

* Replace status badges with ribbon elements

* Revamp activity panel layout and responsiveness

* Adjust dashboard card spacing and styles

* Style dashboard links and adjust chart heights

* Back-to-top: update classes and styles

* Fix client admin UI labels and flags

* Improve API response parsing and errors

* Mark action columns no-sort, add table-hover

* Update table classes for hover and wrapping

* Refactor admin templates to card-header layout

* Update admin templates layout and semantics

* Tidy admin templates; remove tabs, update notice

* Standardize admin alert styles and messages

* Handle null/empty status in status_name macro

* Validate resolved renewal price before invoicing

* Keep IP actions inline in activity table

* Right-align activity pagination controls

* Align pagination and export buttons in admin lists

* Improve admin pagination & per-page defaults

* Extract record selector into partial

* Add tab deep-linking and URL hash persistence

* Refactor search controls & capitalize 'One Time'

* Refactor client search filters and toggle state

* Refactor activity filters UI and tomselect styling

* Redesign admin filters; capitalize 'On Hold'

* Revamp admin filter panels (Invoice & Support)

* Group search clause in Massmailer query

* Add filters and expanded search for pages/gateways

* Add filter panels, refine search logic, tests

* Add advanced search filters for activity modules

* Add structured filters, date/ip search & tests

* Add Email queue filters and admin tab

* Add collapsible filter panel to Staff settings

* Refactor badges to use shared macros

* Add massmailer statuses & boolean badges

* Add search icon and refine search input layout

* Update admin templates layout and markup

* Use modals for creating clients/groups

* Centralize tab header action buttons

* Centralize toolbar actions; add Order modal

* Bump Composer dependencies (lockfile)

* Capitalize 'One Time' payment label

* Return raw API body; use button for search

* Wrap search button in input-group-text

* Make search max width configurable

* Fix malformed aria-label Twig expression in layout_default.html.twig

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/c8db6ba9-bda4-413a-989f-e4777e06bd12

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Fix XSS risk in updateExternalIP: append IP via createTextNode instead of innerHTML concat

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/0c435e52-1784-4466-a8dc-c41e12443a6f

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Refactor New Client modal layout and styles

* Limit and style phone country code field

* Use `country_names` helper and `country_name` filter

* Use Symfony Intl for currencies & locales

* Use Symfony Intl for currencies; drop built-in country lists

* Refactor Currency module API, entity and service

* Remove system checkLimits usages from modules and tests

* Remove `currency.title` column and update APIs

* Add inputmode and maxlength to cspell dictionary

* Fix dropdown toggle accessibility: use button instead of anchor

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/b7f9474b-1988-4c08-aec0-f8991edfea71

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Improve multi-currency handling and installer

* Log currency code when changing cart currency

* Use removeCurrency in Admin API and update tests

* Use Intl currency symbols and fraction digits

* Use currency filters in templates

* Rename currency title to name and update schema

* Remove deprecated Service::getLanguages

* Capitalize system permission labels and fix messages

* Use Symfony Countries and remove phone codes list

* Validate country codes; use country select

* Set fb_locale cookie and fix admin locale display

* Validate locales and add default locale selector

* Use Locales::getNames; tweak language selector CSS

* Tweak header spacing and make nav links icon-only

* Localize client login texts

* Add phone country-code attrs and styles

* Center .modal-dialog in two themes

* Add phone_codes API to list calling codes

* Make form the modal-content wrapper

* Move create forms to Bootstrap modals

* Convert new-item tabs to modals in admin UI

* Revamp admin UI, embed snippets & modal

* Revamp admin settings UI and templates

* Revamp Formbuilder & Redirect admin UIs

* Add 'Segoe' and 'minmax' to cspell dictionary

* Rename warning() to warn() in test logger

* Refactor admin templates to card-based layout

* Expose initAvatars globally and scoped init

* Add 'view' permissions and enforce checks

* Refactor Servicehosting admin UI and scripts

* Add staff permission checks and module permissions

* Refactor admin templates layout and forms

* Add staff permission checks and module perms

* Add staff permission checks and module perms

* Refactor admin Twig templates and UI

* Refactor client admin UI to use summary/form cards

* Refactor admin invoice/subscription/transaction templates

* Refactor Order admin UI; fix country labels

* Refactor admin templates and add IP country filter

* Add 'view' permissions and checks to admin APIs

* Use detail/related partials in admin templates

* Refactor admin product templates to use partials

* Add endembed to cspell ignoreWords to fix spellcheck CI failure

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/e8973bef-7364-4b30-8dd8-13701ca15c5d

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Refactor admin templates to use common partials

* Validate order status, add permission checks

* Center form buttons and add horizontal padding

* Introduce createAdminApi and BBTestCaseContainer

* Refactor admin UI templates and forms

* Run intl compression after composer install

* Disable provenance in buildx outputs

* Revamp admin templates for UI and previews

* Refactor admin templates, pricing UI & styles

* Refactor admin invoice sidebar and SEO settings UI

* Use minor currency units, country list & API fixes

* Rename language selector class to locale-selector

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-05-24 23:10:28 +01:00
4a9d44ff06 Refactor currency formatting and enhance admin UI features (#3539)
* Remove currency format fields & refactor formatting

* Handle missing currency and remove bold

* Adjust column widths in redirect settings form

* Add unified filter panel & request globals

* Normalize admin path and revamp activity UI

* Fix ADMIN_PREFIX check and ignore search filter

* Point docs links to docs.fossbilling.org

* ci: make live installer step retry before phpunit-live

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/3c14643b-8b1c-441d-8592-c3ba09df048f

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* ci: avoid duplicate install attempt in live test retries

Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/3c14643b-8b1c-441d-8592-c3ba09df048f

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>

* Remove currency_format and simplify request handling

* Ensure request exists in DI for Twig tests

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
2026-05-14 18:55:36 +01:00
Adam Daley 53eb4f2fca Refactor Twig environments and extensions (#2752)
* Replace Custom Twig components

Replace custom Twig components with native Twig components, remove unused custom Twig components, and move functionality to macros where appropriate.

m

Update partial_extensions.html.twig

* Update Twig components and migrate to FOSSBilling namespace

* Update Currency module...

* Refactor Twig environment config and loading

* Switch CSRF to cookie-based double-submit

* Add Api Twig extension and restore widget/svg helpers

* Cast language flags; improve JSON parsing

* Add markdown DI service and use in Admin API

* Refactor Twig extensions and markdown, simplify APIs

* Add sandboxed email Twig env, update render APIs

* Fix pagination URL usage and menu class

* Fix HTML markup in email templates

* Use macro for avatars and status badges

* Fix Twig spacing and pagination URL filter order

* Replace Custom Twig components

Replace custom Twig components with native Twig components, remove unused custom Twig components, and move functionality to macros where appropriate.

m

Update partial_extensions.html.twig

* Update Twig components and migrate to FOSSBilling namespace

* Refactor Twig environment config and loading

* Add Api Twig extension and restore widget/svg helpers

* Cast language flags; improve JSON parsing

* Add markdown DI service and use in Admin API

* Refactor Twig extensions and markdown, simplify APIs

* Fix pagination URL usage and menu class

* Fix Twig spacing and pagination URL filter order

* Use `current_theme` global and refactor `period_title`

* Allow markdown and date in email Twig sandbox

* Update email template examples

* Fix Twig URLs, quoting, and logo alt text

* Fix Twig templates: URLs, i18n, search params

* Use `templates/*` directories for module templates

* Tighten Twig sandbox and add tests

* Add Twig environment and template docs to `AGENTS.md`

* Use Symfony Filesystem/Finder and assorted fixes

* Fix ticket reply link fragment concatenation

* Close missing divs in dashboard template

* Use detailed `toApiArray` for client

* Fix module name resolution for email templates

* Regenerate `composer.lock`

* Use `markdown_to_html` filter in admin macro

* Handle null price/quantity and rename test method

* Use `Tools::isHTTPS()` for HTTPS checks

* Add 'area' param to `url` filter and update templates

* Use client area URLs in admin templates

* Use client area and guest API URLs in templates

* Remove client-side invoice delete feature

* Create Twig env via `TwigFactory` for PDF rendering

* Add embedded orderbutton JS and update render

* Add 'srclink' to cspell allowlist

* Use `renderEmailTplString` for email rendering

* Bump twig/markdown-extra to v3.24

* Use `markdown_to_html` for privacy policy

* Escape API JSON, handle null IP, client URLs

* Remove initial admin creation flow

* Handle HTTP failures and make tests robust

* Use `api_url` helper in admin templates

* Use `url` filter for footer link 5

* Add patch53 to remove legacy html templates

* Bump setting last_patch to 53

* Add patch54 to restore legacy email templates

* Use renderEmailTplString for email templating

* Remove redundant else/endif in order template

* Add file-hash cache buster for asset URLs

* Remove raw Twig filter and handle missing modules dir

* Return '-' for future timestamps

* Register and reuse TwigFactory and add CSRF cookie

* Adjust API URL helper and add Twig error handling

* Update composer.lock and package-lock.json

* Add twig_factory to ServiceTest DI

* Use url filter for link_page in template

* Composer - update deps and add markdown-extra

* Remove docblocks and inline comments in `TwigFactory`

* Add patches 53-55 and update `last_patch`

* Add `has_permission` Twig function; exclude `href`

* Remove duplicate network interface form

* Guard removal of legacy dirs; add network input

* Handle null category descriptions in template

* Add Twig adapter env and sandbox policy

* Add 'striptags' to cspell word list

* Update composer.lock (deps updated/removed)

* Sanitize custom payment adapter templates

* Remove redundant legacy API tests

* Bump `last_patch` setting to 56

* Coalesce null before `markdown_to_html`

* Move update patcher to system CLI command

* Remove stray `endif` from recaptcha macro

* Update composer.lock

* Fix extra closing brace in Api ServiceTest

* Fix test errors from main merge

- Remove testGetRequestCount tests (method moved to RateLimiter)
- Remove testGetDi from Staff and System GuestTest (protected method)
- Fix IP error message in testLoginCheckIpException
- Add rate_limiter mock to Staff GuestTest tests that need it

* Fix remaining Staff GuestTest issues

- Add extension service mock for captcha check
- Fix error message from 'User not found' to 'Admin not found'

* Fix Staff GuestTest: update query and add logger mock

* Fix Staff GuestTest: set admin status to active for password reset flow

* Fix stale API calls and inverted required condition

- Notification: replace removed system_string_render with direct output
- Antispam settings: replace |alink/|link with |url/|api_url filters
- build_form macro: fix inverted required condition for non-textarea inputs

* Sanitize JS/data URIs and disable buttons by permission

* Use client login/profile links in support emails

* Encode fb-api JSON and tighten URL sanitization

* Prefer session auth for API key methods

* Remove stray endif and fix template formatting

* Add CSRF token to CSV exports; fix template

* Remove stray endif in currency template

* Make invoice PDF generation return Response

* Fix Twig filters, templates, and form handling

* Remove readonly from anonymous class in test

* Inline DebugBar CSS/JS in renderHead

* Add Bootstrap Tab to global bootstrap

* Capitalize template UI strings

* Use CKEditor API for reply quotes

* Remove WYSIWYG module and move CKEditor to themes

* Bump `last_patch` in install SQL to 59

* Remove Spamchecker module

* Run domain management script only for active orders

* Standardize UI text capitalization & minor fixes

* Remove Spamchecker legacy tests; fix period test

* Rename Spamchecker tests to Antispam

* Restore antispam config in tests; remove fixture

* Refactor Antispam Guest tests for config checks

* Update theme build docs; remove Wysiwyg module

* Remove spamchecker from cspell and tweak comment

* Add spamchecker to cspell word list

* Capitalize 'Update Graphs' button label
2026-05-06 21:02:16 +01:00
Yağızhan Burak Yakar e05ce7a7e2 Rate limit system improvements (#3461) 2026-05-04 16:53:28 +01:00
renovate[bot] 1c5d89833a Update dependency stripe/stripe-php to v20 (#3377)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-24 07:27:52 +01:00
renovate[bot] 085b23f414 fix(deps): update dependency mattketmo/email-checker to v3 (#3215)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-27 07:22:42 +00:00
renovate[bot]andAdam Daley 064b89c15d fix(deps): update dependency php-debugbar/php-debugbar to v3 (#3141)
* fix(deps): update dependency php-debugbar/php-debugbar to v3

* Add `php-debugbar/twig-bridge` and update dependencies

Added `php-debugbar/twig-bridge` to `composer.json` and updated several dependencies to their latest versions, including doctrine/collections, doctrine/orm, dompdf/php-svg-lib, monolog/monolog, php-debugbar/php-debugbar, pimple/pimple, prinsfrank/standards, sabberworm/php-css-parser, symfony/* packages, and others. These updates improve compatibility, security, and feature support.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2026-01-13 09:31:26 +00:00
renovate[bot]andAdam Daley 2ae6d2ad42 chore(deps): update dependency phpunit/phpunit to v12 (#3128)
* chore(deps): update dependency phpunit/phpunit to v12

* Update PHPUnit and related dependencies

Upgraded PHPUnit and several related packages (such as php-code-coverage, php-file-iterator, php-invoker, php-text-template, php-timer, and various sebastian/* libraries) to their latest major versions, requiring PHP >=8.3. This ensures compatibility with the latest testing tools and brings in new features, improvements, and security updates.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2025-12-30 08:41:18 +00:00
Adam Daley 136480860b Raise minimum PHP version requirement to 8.3 (#3125)
* Raise minimum PHP version requirement to 8.3

Update all documentation, configuration, Composer requirements, and CI workflows to require PHP 8.3 or higher. Remove `symfony/polyfill-php83` and add `symfony/polyfill-php85`. Adjust installer and requirements checks accordingly.

* Update PHP version and dependencies

Remove PHP 8.5 from CI and workflows, standardizing on PHP 8.3 and 8.4. Update Composer dependencies in composer.json to latest compatible versions for both required and dev packages.
2025-12-30 08:13:04 +00:00
01612b9146 Dropped Paidsupport and Servicemembership (#3066)
* Dropped the "Paidsupport" module

* Patch to migrate existing orders and products to "custom"

* Dropped the "Servicemembership" module

* Update src/library/FOSSBilling/UpdatePatcher.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/library/FOSSBilling/UpdatePatcher.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improve PHPStan compatibility and static analysis

Added a PHPStan ignore pattern for polyfilled ctype function parameter count errors. Updated Extension Service to explicitly check variable type before calling ctype_alnum, aiding static analysis tools like PHPStan.

* Remove polyfill-php72 and update dependencies

Removed 'symfony/polyfill-php72' from composer.json replace section. Updated composer.lock with new versions of league/csv, php-debugbar/php-debugbar, phpunit/php-code-coverage, and rector/rector.

* Update `last_patch` setting to version 47

Incremented the 'last_patch' value in the settings table from 46 to 47 to reflect the latest patch version.

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-27 22:42:37 +00:00
renovate[bot] 28947b010d fix(deps): update dependency stripe/stripe-php to v19 (#3033)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-24 02:00:57 +00:00
Yağızhan Burak YakarandAdam Daley 58956422c7 Support module improvements (#2997)
* Use Monolog instead

* Method types

* Use Symfony's HTML Sanitizer to actually sanitize content

* Fixed tests

* Types and sanitization

* Make sanitizeContent a static method instead

* Updated composer.lock

* Update lockfiles

* Copilot suggestions

* Fixed method signatures

* Fixed tests

* Added basic sanitizeContent tests

* Fixed SQL query

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2025-12-14 18:52:58 +03:00
renovate[bot] d0b6086b6f fix(deps): update dependency stripe/stripe-php to v18 (#2935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-13 11:40:15 +00:00
renovate[bot] 9c7c3909cd fix(deps): update dependency phpmyadmin/motranslator to v6 (#3006)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 11:32:16 +00:00
Yağızhan 11ef945341 Minor developer experience improvements (#2967)
Composer scripts
2025-10-14 11:06:11 +03:00
Adam Daley a9b903c222 Codebase modernisation, configuration cleanup, and improved type safety (#2957)
* Refactor tests to replace depreciated functions

* Update Rector config and dependencies

* Rector: Add explicit string casting for stricter type safety

* Rector: Add return type hints to methods across codebase

* Rector: Increase dead code level and refactor invoice item logic

* Remove unnecessary `willReturn` from test mocks

Eliminate redundant `willReturn(null)` and similar calls from PHPUnit mock setups in legacy module tests, leaving only method expectations. Also update some test values to use floats for consistency.

* Refactor API controller and email adapter return values

* Update formatting and guidelines in `AGENTS.md`
2025-10-11 23:39:44 +01:00
YağızhanandAdam Daley 06d2746017 Initial Doctrine setup and News rewrite (#2915)
* +Initial Doctrine EntityManager setup

* Doctrine support for Pagination

* Removed doctrine/migrations. Won't be using that yet.

* Reworked the News module using Doctrine

* Strict types

* A couple of fixes

* Add 'ONLYDIR' to cspell.json dictionary

* Removed the old Post model

* Typing

* Dev mode support

* +TimestampableInterface

* +Proxy settings

* Add missing `datetime` fields to `Post` entity

* Update Guest.php

* Add `doctrine/orm` and related dependencies

* Add Symfony serializer, property-access, and property-info

* Update Service.php

* Update cspell.json

* Adam's suggestions

* Update AGENTS.md to include Doctrine directives

* Reuse the post content

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2025-10-09 15:58:31 +03:00
Yağızhan 48bb35386d Replace ramsey/uuid with symfony/uid (#2917)
* Replace ramsey/uuid with symfony/uid

* Use the imported class for class_exists
2025-09-18 00:42:41 +01:00
Adam DaleyandCopilot 315f9f3944 Refactor Filesystem and Path handling (#2836)
* Removed legacy files

* Refactor Filesystem and Path handling

* Removed `FOSSBilling\Tools` legacy functions

* Update live-tests to include file check for `php_error.log`

* Update Extension module tables to fix wrapping issue

* Apply suggestions from @Copilot

Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Extension module icon URL handling

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-09 21:50:11 +01:00
renovate[bot] 4257653f22 fix(deps): update dependency stripe/stripe-php to v17 (#2654)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-17 12:53:51 -07:00
Belle Aerni 6b300265c8 Replace maximebf/debugbar with php-debugbar/php-debugbar (#2647) 2025-03-23 12:24:21 -07:00
Adam Daley 43d1969f68 Refactor initial application loading (#2626)
* Refactor initial application loading

Refactor `load.php` to simplify loading, clarify loading, and to use available Symfony components. Additionally, update `index.php` as appropriate.

Add Symfony HttpFoundation as supporting dependency and for future functionality.

* Remove or disable problematic and unused functions

* Restore required FOSSBilling\Event function

* Remove / disable problematic unused functions

* Restore required FOSSBilling\Event function

* Refactor initial application loading

Refactor `load.php` to simplify loading, clarify loading, and to use available Symfony components. Additionally, update `index.php` as appropriate.

Add Symfony HttpFoundation as supporting dependency and for future functionality.

* Remove or disable problematic and unused functions

* Restore required FOSSBilling\Event function

* Remove / disable problematic unused functions

* Restore required FOSSBilling\Event function
2025-03-06 00:55:20 +00:00
renovate[bot] f25915fee5 fix(deps): update dependency maximebf/debugbar to v2 (#2590)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 10:33:22 -08:00
renovate[bot] d282491fea fix(deps): update symfony packages to v7 (major) (#2582)
fix(deps): update symfony packages to v7

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-24 13:12:47 -08:00
renovate[bot]andBelle Aerni 96fa36b3e3 chore(deps): update dependency rector/rector to v2 (#2545)
* chore(deps): update dependency rector/rector to v2

* Updated PHPStan and related deps

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2024-12-17 12:20:41 -08:00
Belle Aerni 45db4910a7 PHP 8.4 prep (#2464)
* Update CI for PHP 8.4

* Update composer deps for PHP 8.4

* Updates

* This is the default mode and this constant causes test failutes

* Explicily install the PDO extensions

* Temporarily downgrade the live tests to PHP 8.3

It would seem that there is some kind of problem with PHP 8.4 in regards to these tests. I believe it is outside of our control however as it installs fine for me with PHP 8.4 under DirectAdmin

* Update to address deprecations

* Make that nullable

* Fixed my typo

* Bump PHPunit to v11

* Also take care of two minor things

* Formatting fix
2024-11-21 23:16:29 -08:00
Belle Aerni a5d15c2a99 Upgrade GeoIP functionality & replace the databases (#2471)
* Replaced Maxmind's IP database

* Began rebuilding GeoIP reader functionality

The GeoIP2 package does not worth with DB's that aren't built by maxmind themselves, making it rather unhelpful for us.

Since my long-term goal is for someone to be able to bring in their own DB, making a custom implementation seems like the reasonable choice.

(Plus my aim is already to replace the MaxMind DB due to it's licencing)

* Created an IP address lookup page

* + ASN info

* Bump last patch

* Make PHPStan happy

* Very minor refactor + PHPDocs
2024-10-31 19:31:50 +01:00
renovate[bot] acdcdfca96 fix(deps): update dependency stripe/stripe-php to v16 (#2450)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-21 22:18:38 -07:00
Belle Aerni 32315e2ddb Remove additional hardcoded lists (#2346)
* Remove additional hardcoded lists (countries & phone codes)

Also fixed a few UI oddities I noticed

* Bugfixes

* Removed the old reference to the polyfill

* Fixed a typo
2024-07-12 00:46:03 +01:00
Yağızhan d1904145eb Introducing the FOSSBilling CLI (#1021)
+CLI

Die when accessed through a browser

Move the commands under the modules

Added system:version

Added system:releasenotes

Added theme:list

Styling
2024-07-03 05:02:28 +01:00
Belle Aerni 945a201572 Small Currency Improvements (#2311)
* Removed the hardcoded currencies list

Also streamlined the process of adding new currencies by allowing the title & exchange rate to automatically be determined.

* Use an existing translatable string

* Update the test workflows

* Dropped the legacy test, wrote two new ones

* Fixed a typo in my assert

* Whooooops
2024-06-27 09:48:37 -07:00
renovate[bot] e6555658af fix(deps): update dependency stripe/stripe-php to v15 (#2309)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 19:35:57 -07:00
renovate[bot] 85c80b32f0 fix(deps): update dependency stripe/stripe-php to v14 (#2231)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-14 21:33:59 -07:00
renovate[bot] 41694d7835 fix(deps): update dependency dompdf/dompdf to v3 (#2270)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-14 22:21:43 +01:00
Belle Aerni 35db2b9377 Reduce the final size of our vendor folder (#2227)
* Reduce the final size of our vendor folder

* Updated our lockfile
2024-04-10 15:14:26 -07:00
Belle Aerni 924a5d478b Be explicit about requiring PHP version polyfills (#2156) 2024-02-17 17:13:29 -08:00
Belle Aerni b5a4bd4d9e Various minor improvements (#2132)
- Removed unused twig extension, May a tiny bit of ram and reduce memory usage.
- Switch to the filesystem `touch` function VS PHP's native. Also corrected the time used for touch.
- Wrapped our call to monolog's `write` function in a try-catch. These don't need to be fatal. Instead logs to the PHP error log.
- Ensured the SSL redirect won't be triggered if needed headers weren't provided. Prevents logged errors
- Removed unused composer deps.
- Moved cURL to being a required extension in our composer.json file
- Replaced a a case where the death star version constraint was being used.
2024-02-10 21:39:25 -08:00
renovate[bot] e36f0ea8ca Update dependency rector/rector to v1 (#2124)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-06 17:06:24 -08:00
renovate[bot] e3af8d98f3 Update dependency rector/rector to ^0.19.0 (#2056)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-09 07:34:40 -08:00
Adam Daley 948ac8e74c Bump lcharette/webpack-encore-twig to v1.2 (#1933)
Bump lcharette/webpack-encore-twig

Bump lcharette/webpack-encore-twig to ^1.2 and remove symfony/webpack-encore-bundle override as now fixed upstream.
2023-12-07 09:36:46 +00:00
renovate[bot] 510a1336dd Update dependency geoip2/geoip2 to v3 (#1921)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-04 15:44:50 -08:00
Adam Daley 4bd81431a4 Bump symfony dependencies to v6.4 2023-11-29 14:43:37 +00:00
Belle Aerni ff05f672dc Upgrade symfony/webpack-encore-bundle to v2.1.1 (#1891) 2023-11-28 16:41:51 -08:00
Belle AerniandYağızhan 865b0b6159 Implemented PHP DebugBar (#1825)
* Brought in the debugbar extension

Co-Authored-By: Yağızhan <hi@yagiz.dev>

* Completely restructured

Redid the previous work to allow us to pass around a single instance of the debug bar, allowing us to leverage more types of data collection.

* Added some more time measurements

* Enabled HTML var dumper, added config collector

* Fix

---------

Co-authored-by: Yağızhan <hi@yagiz.dev>
2023-11-16 23:21:14 +00:00
Belle Aerni 50cc54ed4e Improved email validation & spam prevention (#1806)
* Improved email validation

* Fixed spelling & PHPDoc, updated module description

* Removed accidental leftovers from debugging

* Rremoved PHP 81 pollyfil, assume email valid if there's an error
2023-11-11 21:44:08 +02:00