Download the PHP package gustav-php/starter without Composer

On this page you can find all versions of the php package gustav-php/starter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package starter

Starter project

Installation

Before creating your first GustavPHP project, you should ensure that your local machine has PHP and Composer installed.

After you have installed PHP and Composer, you may create a new GustavPHP project via the create-project command:

Usage

After the project has been created, start GustavPHP's local development server using the dev command:

The starter marks its in-memory Jokes implementation with #[Service(as: JokeProvider::class)] and maps APP_NAME into the immutable ApplicationConfig class. Gustav discovers both, so the application entrypoint contains no service bindings or instance setup.

Application commands work the same way. Classes under src/Commands are discovered automatically and receive constructor dependencies from the service container. Try the included typed command:

Both the HTTP worker and php gustav load app/bootstrap.php, so project configuration has a single source of truth.

Jokes also dispatches a typed JokeTold event through the injected PSR-14 dispatcher. Gustav discovers the invokable #[Listener] class in src/Events and injects its logger without an event registry or static dispatch call.

Safe local defaults live in .env. Put machine-specific overrides in the ignored .env.local file; real process environment variables take precedence over both. Typed configuration classes under src/Config can be injected into controllers and services like any other dependency.

Controllers are discovered through #[Controller]. Use a class-level path prefix with concise #[Get], #[Post], and other HTTP method attributes. The included Api controller is a plain immutable class; extending Controller\Base is only useful when you want its view and response helpers.

Conventional projects also get lazy server-side sessions in storage/sessions. Inject GustavPHP\Gustav\Session instead of configuring the application instance. The /session example demonstrates persistent values, one-request flash data, session invalidation, and a form protected with #[Csrf].

Use deployment environment variables for production credentials. The included .dockerignore prevents a developer's .env.local from being copied into an image.

Production

Start the production server with:

The included .rr.prod.yaml keeps Gustav's newline-delimited JSON application logs intact on RoadRunner's server channel. Gustav reports every 5xx once and includes the response's X-Request-ID in that record. Inject Psr\Log\LoggerInterface for application logs and GustavPHP\Gustav\Http\RequestId when they need request correlation.


All versions of starter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
gustav-php/gustav Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gustav-php/starter contains the following files

Loading the files please wait ...