From ef91e6a9dfd23ff86a723aec93e8a8df906dda15 Mon Sep 17 00:00:00 2001 From: BudsieBuds Date: Tue, 12 May 2026 15:55:36 +0200 Subject: [PATCH] chore: sync project files to match upstream templates (#4537) - updated some files to match the official CodeIgniter 4 skeleton. - rebuilt package.json from a clean init and modernized metadata and formatting - rebuilt composer.json with modernized metadata and formatting - replaced code of conduct text with markdown - updated Dockerfile to replace deprecated instruction --- CODE_OF_CONDUCT.md | 159 +++++++++++++---------------- app/Config/Mimes.php | 9 +- app/Controllers/BaseController.php | 5 +- app/Database/Dockerfile | 2 +- app/Views/errors/html/debug.css | 6 +- composer.json | 23 ++--- composer.lock | 8 +- package.json | 36 ++++--- public/index.php | 9 +- spark | 9 +- 10 files changed, 128 insertions(+), 138 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 10e1acd6c..302dae0b9 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,98 +1,85 @@ -Contributor Covenant Code of Conduct -Our Pledge -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. -Our Standards -Examples of behavior that contributes to a positive environment for our -community include: +[comment]: # (Contributor Covenant 2.1 - from https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, -and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall -community +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of -any kind +* The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others’ private information, such as a physical or email address, -without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a -professional setting +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting -Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. -Scope -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official email address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. -Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[INSERT CONTACT METHOD]. -All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. -Enforcement Guidelines -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: -1. Correction -Community Impact: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. -Consequence: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. -2. Warning -Community Impact: A violation through a single incident or series of -actions. -Consequence: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. -3. Temporary Ban -Community Impact: A serious violation of community standards, including -sustained inappropriate behavior. -Consequence: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. -4. Permanent Ban -Community Impact: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. -Consequence: A permanent ban from any sort of public interaction within the -community. -Attribution -This Code of Conduct is adapted from the Contributor Covenant, -version 2.1, available at -https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. -Community Impact Guidelines were inspired by -Mozilla’s code of conduct enforcement ladder. -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +## Enforcement Responsibilities +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/app/Config/Mimes.php b/app/Config/Mimes.php index 2bd51d475..c2db7340c 100644 --- a/app/Config/Mimes.php +++ b/app/Config/Mimes.php @@ -486,10 +486,9 @@ class Mimes /** * Attempts to determine the best mime type for the given file extension. * - * @param string $extension - * @return array|string|null The mime type found, or none if unable to determine. + * @return string|null The mime type found, or none if unable to determine. */ - public static function guessTypeFromExtension(string $extension): array|string|null + public static function guessTypeFromExtension(string $extension) { $extension = trim(strtolower($extension), '. '); @@ -507,7 +506,7 @@ class Mimes * * @return string|null The extension determined, or null if unable to match. */ - public static function guessExtensionFromType(string $type, ?string $proposedExtension = null): ?string + public static function guessExtensionFromType(string $type, ?string $proposedExtension = null) { $type = trim(strtolower($type), '. '); @@ -523,7 +522,7 @@ class Mimes } // Reverse check the mime type list if no extension was proposed. - // This search is order-sensitive! + // This search is order sensitive! foreach (static::$mimes as $ext => $types) { if (in_array($type, (array) $types, true)) { return $ext; diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 705b3e7cf..ab45a7710 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -28,12 +28,9 @@ abstract class BaseController extends Controller // protected $session; /** - * @param RequestInterface $request - * @param ResponseInterface $response - * @param LoggerInterface $logger * @return void */ - public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger): void + public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { // Load here all helpers you want to be available in your controllers that extend BaseController. // Caution: Do not put the this below the parent::initController() call below. diff --git a/app/Database/Dockerfile b/app/Database/Dockerfile index f9e8332b9..43cbc3c0b 100644 --- a/app/Database/Dockerfile +++ b/app/Database/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.14 -MAINTAINER jekkos +LABEL maintainer="jekkos" ADD database.sql /docker-entrypoint-initdb.d/database.sql VOLUME /docker-entrypoint-initdb.d diff --git a/app/Views/errors/html/debug.css b/app/Views/errors/html/debug.css index 85544bc15..b8539a420 100644 --- a/app/Views/errors/html/debug.css +++ b/app/Views/errors/html/debug.css @@ -101,9 +101,11 @@ p.lead { } .tabs { - list-style: none inside none; + list-style: none; + list-style-position: inside; + margin: 0; padding: 0; - margin: 0 0 -1px; + margin-bottom: -1px; } .tabs li { display: inline; diff --git a/composer.json b/composer.json index 9b782a7a8..4a457d250 100644 --- a/composer.json +++ b/composer.json @@ -2,25 +2,19 @@ "name": "opensourcepos/opensourcepos", "description": "Open Source Point of Sale is a web based POS system written in the PHP language. It uses MySQL as backend and has a simple user interface", "license": "MIT", + "type": "project", + "keywords": [ + "point-of-sale", + "POS" + ], "authors": [ { "name": "jekkos" }, - { - "name": "FrancescoUK" - }, { "name": "objecttothis" - }, - { - "name": "steveireland" } ], - "type": "project", - "keywords": [ - "point-of-sale", - "POS" - ], "homepage": "https://opensourcepos.org", "support": { "issues": "https://github.com/opensourcepos/opensourcepos/issues", @@ -31,8 +25,8 @@ "matrix": "https://matrix.to/#/#opensourcepos_Lobby:gitter.im" }, "require": { - "ext-intl": "*", "php": "^8.2", + "ext-intl": "*", "codeigniter4/framework": "4.7.2", "dompdf/dompdf": "^2.0.3", "ezyang/htmlpurifier": "^4.17", @@ -56,7 +50,7 @@ }, "autoload": { "psr-4": { - "App\\": "app/", + "App\\": "app/", "CodeIgniter\\": "vendor/codeigniter4/framework/system/" }, "exclude-from-classmap": [ @@ -73,5 +67,8 @@ }, "scripts": { "test": "phpunit" + }, + "scripts-descriptions": { + "test": "Run unit tests" } } diff --git a/composer.lock b/composer.lock index 8a9a1d69a..8df1b7ea5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e95f6e5e86d323370ddb0df57c4d3fb3", + "content-hash": "eabbc14aefdea4c933869069d6eadadb", "packages": [ { "name": "codeigniter4/framework", @@ -5382,9 +5382,9 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "ext-intl": "*", - "php": "^8.1" + "php": "^8.2", + "ext-intl": "*" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/package.json b/package.json index 305f80dd5..c58c231fc 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,33 @@ { "name": "@opensourcepos/opensourcepos", "version": "3.4.2", - "description": "pen Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.", - "main": "index.php", - "license": "MIT", - "authors": [ - "jekkos ", - "FrancescoUK ", - "objecttothis ", - "SteveIreland " - ], - "files": [ - "dist/opensourcepos.$version.tgz" - ], - "publishConfig": { - "registry": "https://npm.pkg.github.com/" - }, + "description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.", "keywords": [ "point-of-sale", "POS" ], + "homepage": "https://opensourcepos.org", + "bugs": { + "url": "https://github.com/opensourcepos/opensourcepos/issues" + }, "repository": { "type": "git", - "url": "https://github.com/opensourcepos/opensourcepos" + "url": "git+https://github.com/opensourcepos/opensourcepos.git" }, + "license": "MIT", + "contributors": [ + "jekkos ", + "objecttothis " + ], + "files": [ + "dist/opensourcepos.$version.tgz" + ], + "type": "module", + "main": "index.php", "scripts": { "build": "gulp default", "gulp": "gulp" }, - "type": "module", "dependencies": { "bootstrap": "^3.4.1", "bootstrap-daterangepicker": "^2.1.27", @@ -82,5 +81,8 @@ "npm-check-updates": "^22.1.1", "readable-stream": "^4.4.2", "stream-series": "^0.1.1" + }, + "publishConfig": { + "registry": "https://npm.pkg.github.com/" } } diff --git a/public/index.php b/public/index.php index eb7f5c988..8e834f2c8 100644 --- a/public/index.php +++ b/public/index.php @@ -1,12 +1,15 @@ systemDirectory . '/Boot.php'; -exit(CodeIgniter\Boot::bootWeb($paths)); +exit(Boot::bootWeb($paths)); diff --git a/spark b/spark index 856dc3f8a..61bc572b9 100644 --- a/spark +++ b/spark @@ -10,6 +10,9 @@ * the LICENSE file that was distributed with this source code. */ +use CodeIgniter\Boot; +use Config\Paths; + /* * -------------------------------------------------------------------- * CODEIGNITER COMMAND-LINE TOOLS @@ -35,7 +38,7 @@ if (str_starts_with(PHP_SAPI, 'cgi')) { *--------------------------------------------------------------- */ -$minPhpVersion = '8.1'; // If you update this, don't forget to update `public/index.php`. +$minPhpVersion = '8.2'; // If you update this, don't forget to update `public/index.php`. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { $message = sprintf( 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', @@ -76,9 +79,9 @@ chdir(FCPATH); require FCPATH . '../app/Config/Paths.php'; // ^^^ Change this line if you move your application folder -$paths = new Config\Paths(); +$paths = new Paths(); // LOAD THE FRAMEWORK BOOTSTRAP FILE require $paths->systemDirectory . '/Boot.php'; -exit(CodeIgniter\Boot::bootSpark($paths)); +exit(Boot::bootSpark($paths));