Download the PHP package vikkio88/nicu without Composer

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

nicu

developing micro rest api in seconds, shared hosting friendly This is a simple startup project for a nicu restful api.

Create a project

Run locally

to run this app locally using the php server just type

This will use the to simulate a simple URLRewrite

To change the default port edit the config/app.json

Or pass it as a parameter to the start.php script

Run via docker

you can edit the file docker-compose.yml in order to change the name of the image.

The app will be reachable at the port you specified in the docker-compose.yml file.

How To

Add a new route

Just go to config/routes.php and add a new route following the syntax:

There are three parameter to specify per each route:

  1. Route The syntax for the routes is the one specified in here.
  2. Method This is the HTTP verb and can be any HTTP request type (options,post,get).
  3. Action this is the Action that will be invoked when the route is matched, as long as it extends ApiAction and implements action() method returning an array it will work fine.

Add new / read Config from action

Config lib is provided by hassankhan/config, here you can find some example of config files that are supported.

Set

To add a config, add a file or a simple array key to the one specified:

to get it

Get

if Config will be injected in the constructor, you will have access to all the configs in the 'config/ folder'

Setup the Di Container

This small framework integrated PhpDi instead of Pimple, as autowiring makes everything a bit easier to read.

To link the interface to the implementation, you need to specify a provider into config/providers.

The provider body, will work a bit like the Laravel Providers, you will need to specify, using php-di syntax the bind between interface and implementation.

The php-di injection will autowire whatever is configured in those providers, and will inject the implementation on whatever you are creating injecting it into the Action constructor.

Example

config/providers.php

SampleProvider.php

Middlewares

Slim (so PSR) Middlewares are supported by nicu. To find out more read this.

To add a new one you need to specify it into the file config/app.php under the config key app.middlewares:

As ↑ shows, the config can be provided in two ways, either as a Middleware class, specifying a config as value in the array (config being an array too), or as a simple \Callable.

DotEnv

You can specify a config as environment variable in a .env file.

those will be loaded on the index.php on the bootstrap phase.

And you can inject it into a config like this.

For more info about this check out vlucas/phpdotenv docs.

Build

This framework allows you to create a build version of your rest api, and it will cleanup the vendor folder in order to have less file to upload.

To run the build just type

This will create a cleaned up/production ready version of the app in the subfolder ./dist/ ready to be uploaded to your Apache or Nginx server.


All versions of nicu with dependencies

PHP Build Version
Package Version
Requires vikkio88/nicu-framework Version 0.0.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 vikkio88/nicu contains the following files

Loading the files please wait ....