Download the PHP package iamshobe/flight without Composer

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

Flight - Simplified PHP Framework

This framework is used for simple web navigation. Originally I wanted something similar to Python Django framework but simpler, and I wanted to experience development of a web framework - just for a fun side project.

The first basic dispatcher I came across was https://github.com/noodlehaus/dispatch/blob/master/dispatch.php, but I wanted something a little more complicated (with support of nested uris and regex!), so part of the code is taken from that repo and got wrapped with classes.

How to Install?

in your project:

Documentation

\Flight
class Dispatcher($base_dir, $urls, $use_static=true)

$base_dir - is the directory of the application root. $urls - the root urls array using URL class objects. $use_static - true/false if the app uses static folder.

Dispatcher::dispatch(...$args) - the dispatch method - call at the end of the main file.

\Flight\URLS
class URL($regex, $handler, $methods = ["GET", "POST", "PUT", "DELETE", "PATCH"])

$regex - the regex of the uri. $handler - an handler view that will be called. $methods - which methods should the url be active on.

class IncludeURLS($urls)

$urls - the expanded sub urls that should be included from a different location.

\Flight\Views
class View()

View::__invoke($vars) - this method should be overrided by inheriting views. the return value should be a response function that will be activated once the view is on.

static View::response($data, $status_code = 200, $headers = []) - a response function. $data - the data to send $status_code - response status code. $headers - the headers of the response.

View::static_file($path) - serve a static file. $path - the path of the file.

View::page($path, $vars) - render a phtml file. $path - the path of the file. $vars - the vars that should be passed to the template file.

class StaticFile()

static file serve view.

How to Use Example

.htaccess file:

your project working tree:

src/Views/Index.php:

src/Views/File.php:

src/URLS/URLS.php:

index.php:

templates/index.phtml:

Nested URLS

URLS2.php

URLS.php


All versions of flight with dependencies

PHP Build Version
Package Version
No informations.
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 iamshobe/flight contains the following files

Loading the files please wait ....