diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b712dd6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing to CodeIgniter4 + +CodeIgniter is a community driven project and accepts contributions of +code and documentation from the community. + +If you'd like to contribute, please read [Contributing to CodeIgniter](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md) +in the [main repository](https://github.com/codeigniter4/CodeIgniter4). + +If you are going to contribute to this repository, please report bugs or send PRs +to this repository instead of the main repository. diff --git a/LICENSE b/LICENSE index 3403dc7..3cbdd9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2023 Michal Sniatala +Copyright (c) 2023 CodeIgniter Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e7af099..8ab9029 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ Queues for the CodeIgniter 4 framework. -[![PHPUnit](https://github.com/michalsn/codeigniter-queue/actions/workflows/phpunit.yml/badge.svg)](https://github.com/michalsn/codeigniter-queue/actions/workflows/phpunit.yml) -[![PHPStan](https://github.com/michalsn/codeigniter-queue/actions/workflows/phpstan.yml/badge.svg)](https://github.com/michalsn/codeigniter-queue/actions/workflows/phpstan.yml) -[![Deptrac](https://github.com/michalsn/codeigniter-queue/actions/workflows/deptrac.yml/badge.svg)](https://github.com/michalsn/codeigniter-queue/actions/workflows/deptrac.yml) -[![Coverage Status](https://coveralls.io/repos/github/michalsn/codeigniter-queue/badge.svg?branch=develop)](https://coveralls.io/github/michalsn/codeigniter-queue?branch=develop) +[![PHPUnit](https://github.com/codeigniter4/queue/actions/workflows/phpunit.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/phpunit.yml) +[![PHPStan](https://github.com/codeigniter4/queue/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/phpstan.yml) +[![Deptrac](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml) +[![Coverage Status](https://coveralls.io/repos/github/codeigniter4/queue/badge.svg?branch=develop)](https://coveralls.io/github/codeigniter4/queue?branch=develop) ![PHP](https://img.shields.io/badge/PHP-%5E8.1-blue) ![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue) ## Installation - composer require michalsn/codeigniter-queue + composer require codeigniter4/queue Migrate your database: @@ -58,4 +58,4 @@ Run the queue worker: ## Docs -https://michalsn.github.io/codeigniter-queue/ +https://codeigniter4.github.io/queue/ diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7879188 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,26 @@ +# Security Policy + +The development team and community take all security issues seriously. **Please do not make public any uncovered flaws.** + +## Reporting a Vulnerability + +Thank you for improving the security of our code! Any assistance in removing security flaws will be acknowledged. + +**Please report security flaws by emailing the development team directly: security@codeigniter.com**. + +The lead maintainer will acknowledge your email within 48 hours, and will send a more detailed response within 48 hours indicating +the next steps in handling your report. After the initial reply to your report, the security team will endeavor to keep you informed of the +progress towards a fix and full announcement, and may ask for additional information or guidance. + +## Disclosure Policy + +When the security team receives a security bug report, they will assign it to a primary handler. +This person will coordinate the fix and release process, involving the following steps: + +- Confirm the problem and determine the affected versions. +- Audit code to find any potential similar problems. +- Prepare fixes for all releases still under maintenance. These fixes will be released as fast as possible. + +## Comments on this Policy + +If you have suggestions on how this process could be improved please submit a Pull Request. diff --git a/composer.json b/composer.json index 2fff215..e6b709f 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "michalsn/codeigniter-queue", + "name": "codeigniter4/queue", "description": "Queues for CodeIgniter 4 framework", "license": "MIT", "type": "library", @@ -11,20 +11,20 @@ "role": "Developer" } ], - "homepage": "https://github.com/michalsn/codeigniter-queue", + "homepage": "https://github.com/codeigniter4/queue", "require": { "php": "^8.1" }, "require-dev": { "codeigniter4/devkit": "^1.0", - "codeigniter4/framework": "^4.4", + "codeigniter4/framework": "^4.3", "predis/predis": "^2.0" }, "minimum-stability": "dev", "prefer-stable": true, "autoload": { "psr-4": { - "Michalsn\\CodeIgniterQueue\\": "src" + "CodeIgniter\\Queue\\": "src" } }, "autoload-dev": { diff --git a/docs/assets/css/codeigniter.css b/docs/assets/css/codeigniter.css new file mode 100644 index 0000000..9895207 --- /dev/null +++ b/docs/assets/css/codeigniter.css @@ -0,0 +1,18 @@ +[data-md-color-scheme="codeigniter"] { + --md-primary-fg-color: #dd4814; + --md-primary-fg-color--light: #ECB7B7; + --md-primary-fg-color--dark: #90030C; + + --md-default-bg-color: #fcfcfc; + + --md-typeset-a-color: #e74c3c; + --md-accent-fg-color: #97310e; + + --md-accent-fg-color--transparent: #ECB7B7; + + --md-code-bg-color: #ffffff; + + .md-typeset code { + border: 1px solid #e1e4e5; + } +} diff --git a/docs/assets/css/codeigniter_dark_mode.css b/docs/assets/css/codeigniter_dark_mode.css new file mode 100644 index 0000000..3c708d3 --- /dev/null +++ b/docs/assets/css/codeigniter_dark_mode.css @@ -0,0 +1,71 @@ +[data-md-color-scheme="slate"] { + --md-primary-fg-color: #b13a10; + --md-primary-fg-color--light: #8d7474; + --md-primary-fg-color--dark: #6d554d; + + --md-default-bg-color: #1e2129; + + --md-typeset-a-color: #ed6436; + --md-accent-fg-color: #f18a67; + + --md-accent-fg-color--transparent: #625151; + + --md-code-bg-color: #282b2d; + + .hljs-title, + .hljs-title.class_, + .hljs-title.class_.inherited__, + .hljs-title.function_ { + color: #c9a69b; + } + + .hljs-meta .hljs-string, + .hljs-regexp, + .hljs-string { + color: #a3b4c7; + } + + .hljs-attr, + .hljs-attribute, + .hljs-literal, + .hljs-meta, + .hljs-number, + .hljs-operator, + .hljs-selector-attr, + .hljs-selector-class, + .hljs-selector-id, + .hljs-variable { + color: #c1b79f; + } + + .hljs-doctag, + .hljs-keyword, + .hljs-meta .hljs-keyword, + .hljs-template-tag, + .hljs-template-variable, + .hljs-type, + .hljs-variable.language_ { + color: #c97100; + } + + .hljs-subst { + color: #ddba52 + } + + .md-typeset code { + border: 1px solid #3f4547; + } + + .md-typeset .admonition.note, + .md-typeset details.note { + border-color: #2c5293; + } + + .md-typeset .note > .admonition-title:before, + .md-typeset .note > summary:before { + background-color: #2c5293; + -webkit-mask-image: var(--md-admonition-icon--note); + mask-image: var(--md-admonition-icon--note); + } + +} diff --git a/docs/assets/favicon.ico b/docs/assets/favicon.ico index 531feed..a725c10 100644 Binary files a/docs/assets/favicon.ico and b/docs/assets/favicon.ico differ diff --git a/docs/assets/github-dark-dimmed.css b/docs/assets/github-dark-dimmed.css deleted file mode 100644 index e702177..0000000 --- a/docs/assets/github-dark-dimmed.css +++ /dev/null @@ -1,15 +0,0 @@ -pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! - Theme: GitHub Dark Dimmed - Description: Dark dimmed theme as seen on github.com - Author: github.com - Maintainer: @Hirse - Updated: 2021-05-15 - Modified: 2022:12:27 by @michalsn - - Colors taken from GitHub's CSS -*/.hljs{color:#adbac7 !important;background-color:#22272e !important}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#f47067}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#dcbdfb}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#6cb6ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#96d0ff}.hljs-built_in,.hljs-symbol{color:#f69d50}.hljs-code,.hljs-comment,.hljs-formula{color:#768390}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#8ddb8c}.hljs-subst{color:#adbac7}.hljs-section{color:#316dca;font-weight:700}.hljs-bullet{color:#eac55f}.hljs-emphasis{color:#adbac7;font-style:italic}.hljs-strong{color:#adbac7;font-weight:700}.hljs-addition{color:#b4f1b4;background-color:#1b4721}.hljs-deletion{color:#ffd8d3;background-color:#78191b} - -[data-md-color-scheme="default"] { - --md-default-fg-color--lightest: #575757; - --md-default-fg-color--light: #959595; -} diff --git a/docs/assets/hljs.js b/docs/assets/hljs.js deleted file mode 100644 index 48bc360..0000000 --- a/docs/assets/hljs.js +++ /dev/null @@ -1,3 +0,0 @@ -document.addEventListener('DOMContentLoaded', (ev) => { - hljs.highlightAll(); -}); diff --git a/docs/assets/js/hljs.js b/docs/assets/js/hljs.js new file mode 100644 index 0000000..6f9098a --- /dev/null +++ b/docs/assets/js/hljs.js @@ -0,0 +1,3 @@ +document.addEventListener('DOMContentLoaded', (event) => { + hljs.highlightAll(); +}); diff --git a/docs/basic_usage.md b/docs/basic-usage.md similarity index 97% rename from docs/basic_usage.md rename to docs/basic-usage.md index 16f2f42..afe403f 100644 --- a/docs/basic_usage.md +++ b/docs/basic-usage.md @@ -47,8 +47,8 @@ One of the most popular tasks delegated to a queue is sending email messages. Th namespace App\Jobs; use Exception; -use Michalsn\CodeIgniterQueue\BaseJob; -use Michalsn\CodeIgniterQueue\Interfaces\JobInterface; +use CodeIgniter\Queue\BaseJob; +use CodeIgniter\Queue\Interfaces\JobInterface; class Email extends BaseJob implements JobInterface { diff --git a/docs/commands.md b/docs/commands.md index b539f6d..2631459 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -6,15 +6,15 @@ Here are all the commands you can use with the Queue library. Available options: -- [queue:publish](#queuePublish) -- [queue:job](#queueJob) -- [queue:work](#queueWork) -- [queue:stop](#queueStop) -- [queue:clear](#queueClear) -- [queue:failed](#queueFailed) -- [queue:retry](#queueRetry) -- [queue:forget](#queueForget) -- [queue:flush](#queueFlush) +- [queue:publish](#queuepublish) +- [queue:job](#queuejob) +- [queue:work](#queuework) +- [queue:stop](#queuestop) +- [queue:clear](#queueclear) +- [queue:failed](#queuefailed) +- [queue:retry](#queueretry) +- [queue:forget](#queueforget) +- [queue:flush](#queueflush) ### queue:publish diff --git a/docs/configuration.md b/docs/configuration.md index ea6b75a..858713e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -12,16 +12,16 @@ We will get our copy ready for modifications. Available options: -- [$defaultHandler](#defaultHandler) +- [$defaultHandler](#defaulthandler) - [$handlers](#handlers) - [$database](#database) - [$redis](#redis) - [$predis](#predis) -- [$keepDoneJobs](#keepDoneJobs) -- [$keepFailedJobs](#keepFailedJobs) -- [$queueDefaultPriority](#queueDefaultPriority) -- [$queuePriorities](#queuePriorities) -- [$jobHandlers](#jobHandlers) +- [$keepDoneJobs](#keepdonejobs) +- [$keepFailedJobs](#keepfailedjobs) +- [$queueDefaultPriority](#queuedefaultpriority) +- [$queuePriorities](#queuepriorities) +- [$jobHandlers](#jobhandlers) ### $defaultHandler diff --git a/docs/index.md b/docs/index.md index 1434981..7d3c93a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,14 +14,14 @@ Listen for queued jobs. ### Requirements -![PHP](https://img.shields.io/badge/PHP-%5E8.1-blue) -![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue) +![PHP](https://img.shields.io/badge/PHP-%5E8.1-red) +![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-red) ### Table of Contents * [Installation](installation.md) * [Configuration](configuration.md) -* [Basic usage](basic_usage.md) -* [Running queues](running_queues.md) +* [Basic usage](basic-usage) +* [Running queues](running-queues) * [Commands](commands.md) * [Troubleshooting](troubleshooting.md) diff --git a/docs/installation.md b/docs/installation.md index daf7973..fd9df7b 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -8,13 +8,13 @@ The only thing you have to do is to run this command, and you're ready to go. - composer require michalsn/codeigniter-queue + composer require codeigniter4/queue ## Manual Installation In the example below we will assume, that files from this project will be located in `app/ThirdParty/queue` directory. -Download this project and then enable it by editing the `app/Config/Autoload.php` file and adding the `Michalsn\CodeIgniterQueue` namespace to the `$psr4` array, like in the below example: +Download this project and then enable it by editing the `app/Config/Autoload.php` file and adding the `CodeIgniter\Queue` namespace to the `$psr4` array, like in the below example: ```php APPPATH, // For custom app namespace 'Config' => APPPATH . 'Config', - 'Michalsn\CodeIgniterQueue' => APPPATH . 'ThirdParty/queue/src', + 'CodeIgniter\Queue' => APPPATH . 'ThirdParty/queue/src', ]; // ... diff --git a/docs/running_queues.md b/docs/running-queues.md similarity index 100% rename from docs/running_queues.md rename to docs/running-queues.md diff --git a/mkdocs.yml b/mkdocs.yml index 774318b..15e9447 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,30 +9,51 @@ theme: repo: fontawesome/brands/github palette: - media: "(prefers-color-scheme: light)" - scheme: default - primary: indigo - accent: indigo + scheme: codeigniter + primary: custom + accent: custom toggle: icon: material/brightness-7 name: Switch to dark mode - media: "(prefers-color-scheme: dark)" scheme: slate - primary: indigo - accent: indigo + primary: custom + accent: custom toggle: icon: material/brightness-4 name: Switch to light mode + features: + - navigation.instant + - navigation.instant.prefetch + - content.code.copy + - navigation.footer + - content.action.edit + - navigation.top + - search.suggest + - search.highlight + - search.share extra: - homepage: https://michalsn.github.io/codeigniter-queue + homepage: https://codeigniter.com + generator: false social: - - icon: fontawesome/brands/github - link: https://github.com/michalsn/codeigniter-queue + - icon: material/github + link: https://github.com/codeigniter4/queue name: GitHub + - icon: material/twitter + link: https://twitter.com/CodeIgniterPhp + name: X + - icon: material/forum + link: https://forum.codeigniter.com + name: Forum Codeigniter + - icon: material/slack + link: https://join.slack.com/t/codeigniterchat/shared_invite/zt-244xrrslc-l_I69AJSi5y2a2RVN~xIdQ + name: Slack -repo_url: https://github.com/michalsn/codeigniter-queue +repo_url: https://github.com/codeigniter4/queue edit_uri: edit/develop/docs/ +copyright: Copyright © 2023 CodeIgniter Foundation. markdown_extensions: - admonition @@ -41,17 +62,19 @@ markdown_extensions: use_pygments: false extra_css: - - assets/github-dark-dimmed.css + - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/github.min.css + - assets/css/codeigniter.css + - assets/css/codeigniter_dark_mode.css extra_javascript: - - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.6.0/build/highlight.min.js - - assets/hljs.js + - https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/highlight.min.js + - assets/js/hljs.js nav: - Home: index.md - Installation: installation.md - Configuration: configuration.md - - Basic usage: basic_usage.md - - Running queues: running_queues.md + - Basic usage: basic-usage.md + - Running queues: running-queues.md - Commands: commands.md - Troubleshooting: troubleshooting.md diff --git a/src/BaseJob.php b/src/BaseJob.php index fd94582..ad67410 100644 --- a/src/BaseJob.php +++ b/src/BaseJob.php @@ -1,6 +1,6 @@ [ - 'queue:job' => 'Michalsn\CodeIgniterQueue\Commands\Generators\Views\job.tpl.php', + 'queue:job' => 'CodeIgniter\Queue\Commands\Generators\Views\job.tpl.php', ], ]; } diff --git a/src/Config/Services.php b/src/Config/Services.php index fe5e158..3624e46 100644 --- a/src/Config/Services.php +++ b/src/Config/Services.php @@ -1,11 +1,11 @@