All Downloads are FREE. Search and download functionalities are using the official Maven repository.

php-slim-server.README.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
# {{packageName}} - PHP Slim Server library for {{appName}}

[Slim Framework Documentation](https://www.slimframework.com/docs/)

## Requirements

* Web server with URL rewriting
* PHP 5.5 or newer

This package contains `.htaccess` for Apache configuration.
If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc.

## Installation via [Composer](https://getcomposer.org/)

Navigate into your project's root directory and execute the bash command shown below.
This command downloads the Slim Framework and its third-party dependencies into your project's `vendor/` directory.
```bash
$ composer install
```

## Start devserver

Run the following command in terminal to start localhost web server, assuming `./php-slim-server/` is public-accessible directory with `index.php` file:
```bash
$ php -S localhost:8888 -t php-slim-server
```
> **Warning** This web server was designed to aid application development.
> It may also be useful for testing purposes or for application demonstrations that are run in controlled environments.
> It is not intended to be a full-featured web server. It should not be used on a public network.

## Run tests

This package uses PHPUnit 4.8 for unit testing.
[Test folder]({{testBasePath}}) contains templates which you can fill with real test assertions.
How to write tests read at [PHPUnit Manual - Chapter 2. Writing Tests for PHPUnit](https://phpunit.de/manual/4.8/en/writing-tests-for-phpunit.html).

Command | Tool | Target
---- | ---- | ----
`$ composer test` | PHPUnit | All tests
`$ composer run test-apis` | PHPUnit | Apis tests
`$ composer run test-models` | PHPUnit | Models tests

{{#generateApiDocs}}
## API Endpoints

All URIs are relative to *{{{basePath}}}*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | **{{operationId}}** | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
{{/generateApiDocs}}

{{#generateModelDocs}}
## Models

{{#modelPackage}}
{{#models}}{{#model}}* {{{modelPackage}}}\{{{classname}}}
{{/model}}{{/models}}
{{/modelPackage}}
{{^modelPackage}}
No model defined in this package
{{/modelPackage}}
{{/generateModelDocs}}

{{#authMethods}}
{{^hasMore}}
## Authentication

{{/hasMore}}
{{/authMethods}}
{{#authMethods}}
{{#isBasic}}
> Important! To make Basic Authentication work you need to implement `authenticator` function in [SlimRouter]({{srcBasePath}}/SlimRouter.php) class.
> Documentation [tuupola/slim-basic-auth](https://github.com/tuupola/slim-basic-auth#readme)
{{/isBasic}}
{{/authMethods}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy