Skip to content

pdsinterop/php-solid-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Standalone PHP Solid Server

Standalone Solid Server written in PHP by PDS Interop

Solid Server

The Solid specifications defines what makes a "Solid Server". Parts of those specifications are still likely to change, but at the time of this writing, they define:

  • Authentication
  • Authorization (and access control)
  • Content representation
  • Identity
  • Profiles
  • Resource (reading and writing) API
  • Social Web App Protocols (Notifications, Friends Lists, Followers and Following)

Available Features

Based on the specifications, the following features are available:

  1. User
    • Authentication
    • Identity
    • Profiles
  2. Data storage
    • Content representation
    • Resource API
      • HTTP REST API
      • Websocket API
  3. Web Acces Control List
    • Authorization (and Access Control)
  4. Social web apps
    • Calendar
    • Contacts
    • Friends Lists (Followers, Following)
    • Notifications

The checkboxes show which features are available, and which ones are not.

Installation

To install the project, clone it from GitHub and install the PHP dependencies using Composer:

git clone git://github.com/pdsinerop/solid-server-php.git solid-server-php \
    && cd $ \
    && composer install --no-dev --prefer-dist

At this point, the application is ready to run.

Usage

The PHP Solid server can be run in several different ways.

The application can be run with a Docker image of your choice or on a local environment, using Apache, NginX, or PHP's internal HTTP server. The latter is only advised in development.

Docker images

When running with your own Docker image, make sure to mount the project folder to wherever it will be hosted by the Docker container.

For instance:

PORT=80                    \
docker run                 \
   --env "PORT=${PORT}"    \
   --expose "${PORT}"      \
   --network host          \
   --rm                    \
   --volume "$PWD:/app"    \
   -it                     \
   php:7.1                 \
   php -S "localhost:${PORT}" -t /app/web/ /app/web/index.php

Local environment

How to run this application in an Apache, NginX, or other popular HTTP servers falls outside the scope of this project.

For development purposes, the internal PHP HTTP server is explained below.

Build-in PHP HTTP server

For development purposes a Composer serve command has been provided. This will run the application using PHP internal HTTP server.

To use it, run composer serve in the project root.

!!! FOR SECURITY REASONS, DO NOT USE THIS METHOD IN PRODUCTION !!!

By default, the application is hosted on localhost port 80.

Both the HOST and PORT can be configured before running the command by setting them in the environment, for instance:

HOST='solid.local' PORT=8080 composer serve

This command can also be run through a docker container, for instance:

PORT=8080               \
docker run              \
   --env "PORT=${PORT}" \
   --expose "${PORT}"   \
   --network host       \
   --rm                 \
   --volume "$PWD:/app" \
   -it                  \
   composer:latest      \
   serve

Contributing

Contributions are welcomed. Read the contribution guidelines for details.

Change Log

Please see CHANGELOG for details.

License

All code created by PDS Interop is licensed under the [MIT License][LICENSE].

Development

Project structure

This project is structured as follows:

  .
  ├── src           <- Source code
  ├── vendor        <- Third-party and vendor code
  ├── web           <- Web content
  ├── composer.json <- PHP package and dependency configuration
  └── README.md     <- You are now here