Download the PHP package nearbycreative/light-framework without Composer

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

Light is a micro-framework for quickly spinning up powerful APIs. It can be used both as a standalone framework or embedded into an existing application.

Frameworks like Laravel and Symfony are powerful, but when you need to build out an API, a web framework with the whole kitchen sink can over complicate with option overload.

Light aims to use familiar open source technologies like Eloquent and Phinx, with simple paradigms like MVC to make building out APIs lightning fast.

Requirements

Quickstart a Fresh Project

If you're starting your project from scratch, the following commands will get you up and running quickly!

mkdir myproject && cd myproject

composer require nearbycreative/light-framework

./vendor/bin/light init   
php light serve

That's it! You can visit http://localhost:8080 to see Light in action!

Directory structure

light init creates the following directory structure:

app/
    controller/
        Welcome.php
    model/
database/
    migrations/
    seeds/
public/
    .htaccess
    index.php
resources/
    js/
    sass/
    views/
.env
light

Note, this is the default scaffolding to get a new application up and running quickly. If you're including Light into an existing project, you probably don't want to run light init, but rather embed it. Learn how to embed Light in an existing application.

Using route closures:

If you look at the generated public/index.php, you'll see it provided a few simple routes to start you off. If you wanted to, you could create your entire application in a single file using just route closures, ie:

An example index.php:

Spin up a test server with php light serve command.

Visit: http://localhost:8080/test

You'll see the following output:

Visit: http://localhost:8080/test/this-is-cool

You'll see the following output:

Using controllers

Putting all your API endpoints in route closures works fine for small APIs. Though, this can get pretty narly, pretty quickly. Another way to organize your API code is using Light Controllers.

You can create a controller in your application that extends Light\Controller manually, or use the php light make:controller command.

Ie: php light make:controller Test will generate the following controller in _app/Controller/Test.php:

Inside index.php add the following route that points to the controller action you just created:

Use php light serve to test out your new API endpoint:

Visit: http://localhost:8080/foo

Command Line Utility

Try running php light help to learn about more things you can do with the command line script.

Learning more:

The following docs are coming soon!


All versions of light-framework with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
ext-xmlrpc Version *
php Version >=7.2
nikic/fast-route Version ^1.3
illuminate/http Version *
illuminate/database Version *
robmorgan/phinx Version ^0.11.4
twig/twig Version ^3.0
psy/psysh Version @stable
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 nearbycreative/light-framework contains the following files

Loading the files please wait ....