| ... | ... |
@@ -1,54 +1,73 @@ |
| 1 |
-# Contao 4 skeleton bundle |
|
| 1 |
+# Contao Memberfiles Bundle |
|
| 2 | 2 |
|
| 3 |
-Contao is an Open Source PHP Content Management System for people who want a |
|
| 4 |
-professional website that is easy to maintain. Visit the [project website][1] |
|
| 5 |
-for more information. |
|
| 3 |
+A Contao bundle for managing secure member-specific file downloads with automatic file assignment and email notifications. |
|
| 6 | 4 |
|
| 7 |
-You can use the skeleton bundle as basis for your own Contao bundle. |
|
| 5 |
+## Features |
|
| 8 | 6 |
|
| 9 |
-## Install |
|
| 7 |
+- **Automatic File Import**: Files are automatically imported from source folders and assigned to members based on filename patterns |
|
| 8 |
+- **Secure Downloads**: Files are stored in member-specific directories and accessible only to the respective member |
|
| 9 |
+- **Email Notifications**: Members receive email notifications when new files are added |
|
| 10 |
+- **Flexible Configuration**: Multiple configurations with different source folders and filename patterns |
|
| 11 |
+- **Backend Integration**: Full Contao backend integration for managing member files |
|
| 12 |
+- **Frontend Module**: Content element for displaying member files in the frontend |
|
| 10 | 13 |
|
| 11 |
-Download the skeleton bundle: |
|
| 14 |
+## Requirements |
|
| 15 |
+ |
|
| 16 |
+- PHP 7.4 or 8.0+ |
|
| 17 |
+- Contao 4.13+ |
|
| 18 |
+- Symfony 5.4+ |
|
| 19 |
+- Notification Center 1.7+ |
|
| 20 |
+ |
|
| 21 |
+## Installation |
|
| 22 |
+ |
|
| 23 |
+Install the bundle via Composer: |
|
| 12 | 24 |
|
| 13 | 25 |
```bash |
| 14 |
-wget https://github.com/contao/skeleton-bundle/archive/main.zip |
|
| 15 |
-unzip main.zip |
|
| 16 |
-mv skeleton-bundle-main [package name] |
|
| 17 |
-cd [package name] |
|
| 26 |
+composer require vonrotenberg/contao-memberfiles-bundle |
|
| 18 | 27 |
``` |
| 19 | 28 |
|
| 20 |
-## Customize |
|
| 29 |
+## Configuration |
|
| 30 |
+ |
|
| 31 |
+1. Create a configuration in the backend (Memberfiles Configuration) |
|
| 32 |
+2. Define: |
|
| 33 |
+ - Source folder (where files are uploaded) |
|
| 34 |
+ - Target folder (where files are stored) |
|
| 35 |
+ - Regular expression to extract member identifier from filename |
|
| 36 |
+ - Member fields to match against |
|
| 37 |
+ - Optional: Email notification settings |
|
| 38 |
+ |
|
| 39 |
+## File Naming Convention |
|
| 21 | 40 |
|
| 22 |
-First adjust the following files: |
|
| 41 |
+Files must follow a naming pattern that includes member identifiers. For example: |
|
| 42 |
+- `invoice_12345_document.pdf` (where 12345 is the member ID) |
|
| 43 |
+- `report_smith_john.pdf` (where smith/john match member fields) |
|
| 23 | 44 |
|
| 24 |
- * `composer.json` |
|
| 25 |
- * `ecs.php` |
|
| 26 |
- * `LICENSE` |
|
| 27 |
- * `phpunit.xml.dist` |
|
| 28 |
- * `README.md` |
|
| 45 |
+The regular expression in the configuration extracts these identifiers. |
|
| 29 | 46 |
|
| 30 |
-Then rename the following files and/or the references to `SkeletonBundle` in |
|
| 31 |
-the following files: |
|
| 47 |
+## Cron Jobs |
|
| 32 | 48 |
|
| 33 |
- * `src/ContaoManager/Plugin.php` |
|
| 34 |
- * `src/DependencyInjection/ContaoSkeletonExtension.php` |
|
| 35 |
- * `src/ContaoSkeletonBundle.php` |
|
| 36 |
- * `tests/ContaoSkeletonBundleTest.php` |
|
| 49 |
+The bundle includes two cron jobs: |
|
| 50 |
+- **Import Job** (runs every minute): Imports new files from source folders |
|
| 51 |
+- **Notification Job** (runs every 10 minutes): Sends email notifications for new files |
|
| 37 | 52 |
|
| 38 |
-Finally, add your custom classes and resources. Make sure to register your services |
|
| 39 |
-within `src/Resources/config/services.yml`. Also make sure to |
|
| 40 |
-[adjust the Contao Manager Plugin][2] (and the dependencies within the `composer.json`) |
|
| 41 |
-accordingly, if your bundle makes adjustments to other bundles (e.g. adjustments |
|
| 42 |
-to a DCA of other bundles). |
|
| 53 |
+## Testing |
|
| 43 | 54 |
|
| 44 |
-## Release |
|
| 55 |
+Run code quality checks before releasing: |
|
| 45 | 56 |
|
| 46 |
-Run the PHP-CS-Fixer and the unit test before you release your bundle: |
|
| 57 |
+```bash |
|
| 58 |
+composer ecs |
|
| 59 |
+composer phpstan |
|
| 60 |
+composer unit-tests |
|
| 61 |
+``` |
|
| 62 |
+ |
|
| 63 |
+Or run all checks at once: |
|
| 47 | 64 |
|
| 48 | 65 |
```bash |
| 49 |
-vendor/bin/ecs check src/ tests/ --fix |
|
| 50 |
-vendor/bin/phpunit |
|
| 66 |
+composer all |
|
| 51 | 67 |
``` |
| 52 | 68 |
|
| 53 |
-[1]: https://contao.org |
|
| 54 |
-[2]: https://docs.contao.org/dev/framework/manager-plugin/#the-bundleplugininterface |
|
| 69 |
+## License |
|
| 70 |
+ |
|
| 71 |
+This bundle is proprietary software. All rights reserved. |
|
| 72 |
+ |
|
| 73 |
+(c) vonRotenberg |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,54 @@ |
| 1 |
+# Contao 4 skeleton bundle |
|
| 2 |
+ |
|
| 3 |
+Contao is an Open Source PHP Content Management System for people who want a |
|
| 4 |
+professional website that is easy to maintain. Visit the [project website][1] |
|
| 5 |
+for more information. |
|
| 6 |
+ |
|
| 7 |
+You can use the skeleton bundle as basis for your own Contao bundle. |
|
| 8 |
+ |
|
| 9 |
+## Install |
|
| 10 |
+ |
|
| 11 |
+Download the skeleton bundle: |
|
| 12 |
+ |
|
| 13 |
+```bash |
|
| 14 |
+wget https://github.com/contao/skeleton-bundle/archive/main.zip |
|
| 15 |
+unzip main.zip |
|
| 16 |
+mv skeleton-bundle-main [package name] |
|
| 17 |
+cd [package name] |
|
| 18 |
+``` |
|
| 19 |
+ |
|
| 20 |
+## Customize |
|
| 21 |
+ |
|
| 22 |
+First adjust the following files: |
|
| 23 |
+ |
|
| 24 |
+ * `composer.json` |
|
| 25 |
+ * `ecs.php` |
|
| 26 |
+ * `LICENSE` |
|
| 27 |
+ * `phpunit.xml.dist` |
|
| 28 |
+ * `README.md` |
|
| 29 |
+ |
|
| 30 |
+Then rename the following files and/or the references to `SkeletonBundle` in |
|
| 31 |
+the following files: |
|
| 32 |
+ |
|
| 33 |
+ * `src/ContaoManager/Plugin.php` |
|
| 34 |
+ * `src/DependencyInjection/ContaoSkeletonExtension.php` |
|
| 35 |
+ * `src/ContaoSkeletonBundle.php` |
|
| 36 |
+ * `tests/ContaoSkeletonBundleTest.php` |
|
| 37 |
+ |
|
| 38 |
+Finally, add your custom classes and resources. Make sure to register your services |
|
| 39 |
+within `src/Resources/config/services.yml`. Also make sure to |
|
| 40 |
+[adjust the Contao Manager Plugin][2] (and the dependencies within the `composer.json`) |
|
| 41 |
+accordingly, if your bundle makes adjustments to other bundles (e.g. adjustments |
|
| 42 |
+to a DCA of other bundles). |
|
| 43 |
+ |
|
| 44 |
+## Release |
|
| 45 |
+ |
|
| 46 |
+Run the PHP-CS-Fixer and the unit test before you release your bundle: |
|
| 47 |
+ |
|
| 48 |
+```bash |
|
| 49 |
+vendor/bin/ecs check src/ tests/ --fix |
|
| 50 |
+vendor/bin/phpunit |
|
| 51 |
+``` |
|
| 52 |
+ |
|
| 53 |
+[1]: https://contao.org |
|
| 54 |
+[2]: https://docs.contao.org/dev/framework/manager-plugin/#the-bundleplugininterface |