|
| 1 | +# Standalone PHP Solid PubSub Server |
| 2 | + |
| 3 | +[![PDS Interop][pdsinterop-shield]][pdsinterop-site] |
| 4 | +[![Project stage: Development][project-stage-badge: Development]][project-stage-page] |
| 5 | +[![License][license-shield]][license-link] |
| 6 | +[![Latest Version][version-shield]][version-link] |
| 7 | +[![standard-readme compliant][standard-readme-shield]][standard-readme-link] |
| 8 | +![Maintained][maintained-shield] |
| 9 | + |
| 10 | +_Standalone Solid PubSub Server written in PHP by PDS Interop_ |
| 11 | + |
| 12 | +## Table of Contents |
| 13 | + |
| 14 | +<!-- toc --> |
| 15 | +<!-- tocstop --> |
| 16 | + |
| 17 | +## Background |
| 18 | + |
| 19 | +The Solid specifications defines what makes a "Solid Server". Parts of |
| 20 | +those specifications are still likely to change, but at the time of this writing, |
| 21 | +they define: |
| 22 | + |
| 23 | +- Authentication |
| 24 | +- Authorization (and access control) |
| 25 | +- Content representation |
| 26 | +- Identity |
| 27 | +- Profiles |
| 28 | +- Resource (reading and writing) API |
| 29 | +- Social Web App Protocols (Notifications, Friends Lists, Followers and Following) |
| 30 | + |
| 31 | +<!-- |
| 32 | +To read more about Solid, and which IETF and W3C specifications are used, visit: https://pdsinterop.org/solid-specs-overview/ |
| 33 | +--> |
| 34 | + |
| 35 | +### Installation |
| 36 | + |
| 37 | +To install the project, clone it from GitHub and install the PHP dependencies |
| 38 | +using Composer: |
| 39 | + |
| 40 | +```sh |
| 41 | +git clone git://github.com/pdsinterop/php-solid-pubsub-server.git \ |
| 42 | + && cd php-solid-pubsub-server \ |
| 43 | + && composer install --no-dev --prefer-dist |
| 44 | +``` |
| 45 | +At this point, the application is ready to run. |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +The PHP Solid PubSub server can be run in several different ways. |
| 50 | + |
| 51 | +<!-- @TODO: Add local Dockerfile --> |
| 52 | + |
| 53 | +<!-- |
| 54 | + @TODO: Add single-button deploy scripts/config for Heroku, Glitch, and other |
| 55 | + popular playgrounds/developer oriented service providers. |
| 56 | +--> |
| 57 | + |
| 58 | +### Docker images |
| 59 | + |
| 60 | +When running with your own Docker image, make sure to mount the project folder |
| 61 | +to wherever the image expects it to be, e.g. `/app` or `/var/www`. |
| 62 | + |
| 63 | +For instance: |
| 64 | + |
| 65 | +``` |
| 66 | +export PORT=8080 && \ |
| 67 | +docker run \ |
| 68 | + --env "PORT=${PORT}" \ |
| 69 | + --expose "${PORT}" \ |
| 70 | + --network host \ |
| 71 | + --rm \ |
| 72 | + --volume "$PWD:/app" \ |
| 73 | + -it \ |
| 74 | + php:7.1 \ |
| 75 | + php --docroot /app/web/ --server "localhost:${PORT}" /app/web/index.php |
| 76 | +``` |
| 77 | +Or on Mac: |
| 78 | +``` |
| 79 | +export PORT=8080 && \ |
| 80 | +docker run \ |
| 81 | + --env "PORT=${PORT}" \ |
| 82 | + --expose "${PORT}" \ |
| 83 | + -p "${PORT}:${PORT}" \ |
| 84 | + --rm \ |
| 85 | + --volume "$PWD:/app" \ |
| 86 | + -it \ |
| 87 | + php:7.1 \ |
| 88 | + php --docroot /app/web/ --server "localhost:${PORT}" /app/web/index.php |
| 89 | +``` |
| 90 | + |
| 91 | + |
| 92 | +## Security |
| 93 | + |
| 94 | +If you discover any security related issues, please email <security@pdsinterop.org> instead of using the issue tracker. |
| 95 | + |
| 96 | +--> |
| 97 | + |
| 98 | +## Development |
| 99 | + |
| 100 | +### Project structure |
| 101 | + |
| 102 | +This project is structured as follows: |
| 103 | + |
| 104 | +<!-- |
| 105 | + . |
| 106 | + ├── build <- Artifacts created by CI and CLI scripts |
| 107 | + ├── cli <- CLI scripts |
| 108 | + ├── docs <- Documentation, hosted at https://pdsinterop.org/solid-server-php/ |
| 109 | + ├── src <- Source code |
| 110 | + ├── tests <- Unit- and integration-tests |
| 111 | + ├── vendor <- Third-party and vendor code |
| 112 | + ├── web <- Web content |
| 113 | + ├── composer.json <- PHP package and dependency configuration |
| 114 | + └── README.md <- You are now here |
| 115 | +--> |
| 116 | +``` |
| 117 | + . |
| 118 | + ├── src <- Source code |
| 119 | + ├── vendor <- Third-party and vendor code |
| 120 | + ├── web <- Web content |
| 121 | + ├── composer.json <- PHP package and dependency configuration |
| 122 | + └── README.md <- You are now here |
| 123 | +``` |
| 124 | + |
| 125 | +<!-- |
| 126 | +### Coding conventions |
| 127 | +
|
| 128 | +You can also run [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with the configuration file that can be found in the project root directory. |
| 129 | +
|
| 130 | +This project comes with a configuration file and an executable for [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) (`.php_cs`) that you can use to (re)format your sourcecode for compliance with this project's coding guidelines: |
| 131 | +
|
| 132 | +```sh |
| 133 | +$ composer php-cs-fixer fix |
| 134 | +``` |
| 135 | +
|
| 136 | +### Testing |
| 137 | +
|
| 138 | +The PHPUnit version to be used is the one installed as a `dev-` dependency via composer. It can be run using `composer test` or by calling it directly: |
| 139 | +
|
| 140 | +```sh |
| 141 | +$ ./vendor/bin/phpunit |
| 142 | +``` |
| 143 | +--> |
| 144 | + |
| 145 | +## Contributing |
| 146 | + |
| 147 | +Questions or feedback can be given by [opening an issue on GitHub](https://github.com/pdsinterop/php-solid-pubsub-server/issues). |
| 148 | + |
| 149 | +All PDS Interop projects are open source and community-friendly. |
| 150 | +Any contribution is welcome! |
| 151 | +For more details read the [contribution guidelines](contributing.md). |
| 152 | + |
| 153 | +All PDS Interop projects adhere to [the Code Manifesto](http://codemanifesto.com) |
| 154 | +as its [code-of-conduct](CODE_OF_CONDUCT.md). Contributors are expected to abide by its terms. |
| 155 | + |
| 156 | +There is [a list of all contributors on GitHub][contributors-page]. |
| 157 | + |
| 158 | +For a list of changes see the [CHANGELOG](CHANGELOG.md) or the GitHub releases page. |
| 159 | + |
| 160 | +## License |
| 161 | + |
| 162 | +All code created by PDS Interop is licensed under the [MIT License][license-link]. |
| 163 | + |
| 164 | +[contributors-page]: https://github.com/pdsinterop/php-solid-pubsub-server/contributors |
| 165 | +[license-link]: ./LICENSE |
| 166 | +[license-shield]: https://img.shields.io/github/license/pdsinterop/php-solid-pubsub-server.svg |
| 167 | +[maintained-shield]: https://img.shields.io/maintenance/yes/2020 |
| 168 | +[pdsinterop-shield]: https://img.shields.io/badge/-PDS%20Interop-gray.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii01IC01IDExMCAxMTAiIGZpbGw9IiNGRkYiIHN0cm9rZS13aWR0aD0iMCI+CiAgICA8cGF0aCBkPSJNLTEgNTJoMTdhMzcuNSAzNC41IDAgMDAyNS41IDMxLjE1di0xMy43NWEyMC43NSAyMSAwIDAxOC41LTQwLjI1IDIwLjc1IDIxIDAgMDE4LjUgNDAuMjV2MTMuNzVhMzcgMzQuNSAwIDAwMjUuNS0zMS4xNWgxN2EyMiAyMS4xNSAwIDAxLTEwMiAweiIvPgogICAgPHBhdGggZD0iTSAxMDEgNDhhMi43NyAyLjY3IDAgMDAtMTAyIDBoIDE3YTIuOTcgMi44IDAgMDE2OCAweiIvPgo8L3N2Zz4K |
| 169 | +[pdsinterop-site]: https://pdsinterop.org/ |
| 170 | +[project-stage-badge: Development]: https://img.shields.io/badge/Project%20Stage-Development-yellowgreen.svg |
| 171 | +[project-stage-page]: https://blog.pother.ca/project-stages/ |
| 172 | +[standard-readme-link]: https://github.com/RichardLitt/standard-readme |
| 173 | +[standard-readme-shield]: https://img.shields.io/badge/readme%20style-standard-brightgreen.svg |
| 174 | +[version-link]: https://packagist.org/packages/pdsinterop/php-solid-pubsub-server |
| 175 | +[version-shield]: https://img.shields.io/github/v/release/pdsinterop/php-solid-pubsub-server?sort=semver |
0 commit comments