Download the PHP package dszczer/minion without Composer

On this page you can find all versions of the php package dszczer/minion. 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 minion

Minion - Silex framework wrapper

Powerful wrapper extending Silex, merging simplicity of Silex and usability of Symfony 2.

Table of Contents

  1. Main features
  2. Installation
  3. Usage
    • Project directory tree
    • Custom project directory structure
    • Bootstrap
    • Application environments
    • Initial configuration
    • Routing
    • Services
    • Error pages
    • Console
  4. API Documentation

Main features

Installation

NOTE: Minion require PHP version 5.6.x or greater.

Using Composer

Type in console composer require dszczer/minion.

Usage

Project directory tree

Legend:

Custom project directory structure

If you want to use other directory structure or you have no choice (e.g. shared hosting), you can define custom paths as third __construct Application's method:

Bootstrap

All you need to bootstrap Minion is include Composer autoloader, provide application namespace (not required, but recommended), instantiate Minion\Application and call run() method on it.

You will need to configure your server to point ./web directory as the only one with public access, and index.php as directory index. Look here for more information.

Application environments

Avaliable environments:

Initial configuration

You can pass several options into second __construct() argument Application's method:

Routing

Routing map

Routing map file is based on Symfony 2 routing files component.

Controllers

Minion provides helpful controller basic class. To extend this class and use actions, write your controller like this:

IMPORTANT: action shall always return an Symfony\HttpFoundation\Response object (exactly like in Symfony 2). For more information about avaliable methods, look into API documentation.

Services

Services in Minion are something between Silex and Symfony 2. They are expandable, flexible and easy in use.

Writing own service

First, you must write a new Service class:

Then, you should write provider class:

CustomServiceProvider shall extend Minion\Service\ServiceProvider basic class or implement Minion\Service\ServiceProviderInterface interface. Of course, instead of sharing a new service, you are fully able to extend an exisitng one. Example below is extending Twig with Twig_Extension class:

Finally, you can define your custom service in app/config.yml file:

And Voile'a! You have registered your new service. You can use it for e.g. inside controller's action:

HINT: Minion has it's own Twig extension service provider expander, so you don't have to write your own one. Read more below.

Service configuration

Inside service provider's register method you have full access to service configuration, thanks to Minion\Service\ServiceConfigInterface:

Service tags

Service tags are marks for Minion to use build-in service provider and are special case use. Avaliable tags:

Tag twig.extension is defined in app/config.yml like below:

Build-in Twig extensions, ready to use

List of build-in twig extensions:

Error pages

Minion allows you to customize error pages for 403, 404 and 500 HTTP status codes. Inside your template scope only thrown exception would be avaliable under (Twig) exception or (PHP) $exception variable name. Template file can be standalone or extending other template file.

Twig template

Place Twig template under src/Resources/views/Static/<code>.html.twig name, where <code> is a status code generated by Application.

PHP template

If you are not using Twig, place your PHP template under src/Static/<code>.html.php name, where <code> is a status code generated by Application.

Console

Minion provides easy in use CLI mode. All project specific commands should be stored in src/Command directory and should extend Knp\Command\Command class. More about Knp Command avaliable [here]().

Naming conventions

Command file must have name with suffix Command.php. Class name also must contain Command suffix. Files that do not fulfill those conditions are ignored. Example command:

Bootstrap

Minion already has bootstrap file for CLI mode, so it should be accessible in your bin directory, after installing dependencies with Composer.

Usage

To run Minion in CLI mode, go to your project directory (bash, windows command, etc.) and type bin/console command:name.

Minion provides autoloader for Propel commands. If you want to use propel commands, type in project root directory bin/console propel:namespace:command, for e.g. bin/console propel:model:build, or just use aliases bin/console build.

Registering

Minion has command autoloader, so you just need to place Command class in the right directory src/Command. That's all! Of course, you can load commands from anywhere, just call $app->loadCommands($path, $prefix) before $app->run(). Required $path argument is an absolute path to directory containing command files. Optional $prefix argument is a namespace for them. So, if you enter prefix, your command for e.g. command:exec will be avaliable under prefix:command:exec.

API Documentation

Click here to see detailed API documentation.


All versions of minion with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6 || ~7.0
silex/silex Version 1.3.*
twig/twig Version ~2.0-dev
symfony/twig-bridge Version 3.*
monolog/monolog Version 1.*
knplabs/console-service-provider Version ~1.0
symfony/console Version 2.8.*
propel/propel Version 2.*@dev
propel/propel-service-provider Version 2.*@dev
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 dszczer/minion contains the following files

Loading the files please wait ....