Download the PHP package jerfeson/slim4-skeleton without Composer

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

Slim Framework 4 Skeleton Application (http + cli)

Latest Version on Packagist Build Status Total Downloads

Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application (Tested with slim 4.5). This application handles http and command line requests. This application ships with a few service providers and a Session middleware out of the box. Supports container resolution and auto-wiring.

To remove a service provider comment it on config/app.php file and remove it from composer.json, update composer.

Available service providers:

Requirements

Install the Application

Run this command from the directory in which you want to install your new Slim Framework application.

php composer.phar create-project jerfeson/slim4-skeleton [my-app-name]

Replace [my-app-name] with the desired directory name for your new application. You'll want to:

Set permissions (Linux only)

sudo chown -R www-data storage/
sudo chmod -R ug+w storage/

sudo chmod -R 760 storage/

chmod +x bin/console.php

Database setup

Create a new database for development

mysql -e 'CREATE DATABASE IF NOT EXISTS slim_skeleton'

Copy the file: config/env.example.php to config/development.php

cp config/env.exemplo.php config/development.php

Change the connection configuration in config/development.php:

'settings' => [
    'database' => [
        'default' => [
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => 'default',
            'username'  => '',
            'password'  => '',

Migrations

Use the command for create initial tables, used in oAuth2

php bin/console.php migrations or composer console:migration

Go to the data/keys/oauth folder and create your project's public and private keys

Generating public and private keys

The public/private key pair is used to sign and verify JWTs transmitted. The Authorization Server possesses the private key to sign tokens and the Resource Server possesses the corresponding public key to verify the signatures. To generate the private key run this command on the terminal:

openssl genrsa -out private.key 2048

If you want to provide a passphrase for your private key run this command instead:

 openssl genrsa -passout pass:_passphrase_ -out private.key 2048

then extract the public key from the private key:

openssl rsa -in private.key -pubout -out public.key

or use your passphrase if provided on private key generation:

openssl rsa -in private.key -passin pass:_passphrase_ -pubout -out public.key

The private key must be kept secret (i.e. out of the web-root of the authorization server). The authorization server also requires the public key.

If a passphrase has been used to generate private key it must be provided to the authorization server.

The public key should be distributed to any services (for example resource servers) that validate access tokens.

Generating encryption keys

Encryption keys are used to encrypt authorization and refresh codes. The AuthorizationServer accepts two kinds of encryption keys, a string password or a \Defuse\Crypto\Key object from the Secure PHP Encryption Library.

string password

A string password can vary in strength depending on the password chosen. To turn it into a strong encryption key the PBKDF2 key derivation function is used. This function derives an encryption key from a password and is slow by design. It uses a lot of CPU resources for a fraction of a second, applying key stretching to the password to reduce vulnerability to brute force attacks.

To generate a string password for the AuthorizationServer, you can run the following command in the terminal:

php -r 'echo base64_encode(random_bytes(32)), PHP_EOL;'

Replace the value of OAuthServer::ENCRYPTION_KEY

Key object

A \Defuse\Crypto\Key is a strong encryption key. This removes the need to use a slow key derivation function, reducing encryption and decryption times compared to using a string password.

A Key can be generated with the generate-defuse-key script. To generate a Key for the AuthorizationServer run the following command in the terminal:

vendor/bin/generate-defuse-key

Replace the value of OAuthServer::ENCRYPTION_KEY

The string can be loaded as a Key with Key::loadFromAsciiSafeString(self::ENCRYPTION_KEY).

Run it:

  1. $ cd [my-app-name]\public
  2. $ php -S localhost:8080
  3. Browse to http://localhost:8080

Key directories

Console usage

Example:

Command class:

Execute the class:method from command line:

Code examples

Get application instance

Codeception test examples

Have the version 79 of chrome installed. otherwise, download your version driver

go to the test folder and run the following command. (Windows)

go to the test folder and run the following command. (linux)

go to project folder and run the following command.

or

Roadmap

Contributing

License

jerfeson/slim4-skeleton is release under the MIT license.

Thanks

This project is based on the project in jupitern/slim3-skeleton feel free to contribute to this and the other project.


All versions of slim4-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-json Version *
illuminate/contracts Version 7.9.*
illuminate/database Version 7.9.*
illuminate/pagination Version 7.9.*
illuminate/support Version 7.9.*
jerfeson/slim-validation Version ^1.0
league/flysystem Version 1.0.*
league/oauth2-server Version 8.2.*
monolog/monolog Version 2.0.*
naroga/redis-cache Version 1.0.*
php-di/slim-bridge Version 3.0.*
phpmailer/phpmailer Version 6.1.*
slashtrace/slashtrace Version 1.1.*
slim/csrf Version 1.0.0
slim/flash Version 0.4.*
slim/psr7 Version 1.0.*
slim/slim Version 4.5.*
slim/twig-view Version 3.1.*
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 jerfeson/slim4-skeleton contains the following files

Loading the files please wait ....