Download the PHP package deathbeam/fwphp without Composer

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

{ fw.php } code less, create more

Hello World

To create your first hello world fw.php application, create index.php and add below to it

Installation

Copy this repo into a public accessible folder on your server (or to public_html folder of your FTP if you are using shared hosting). There are muliple ways to get fw.php:

a) download and extract .zip /.tgz by hand

b) cloning the repo with git

c) getting the repo via Composer

Now, we need to install mod_rewrite becouse it is required for .htaccess.

Configuration

fw.php can be configured in 2 ways. First one is using only php and second one is loading configuration from json file. In examples below, we will:

Using php only

This is basic configuration from index.php.

Using json configuration file

Below is example on how to configure fw from .json file

And here is content of config.json

Templates

fw.php have super simple templating system using PHP as templating language.

Drawing template is simple:

Templates can read global variables set by $fw->set method.

Example template

Below, we will create simple template logic.

Code what will go into routed function in index.php

We will save code below as default.php to /public directory

Routes

In fw.php I implemented routing very similar to F3 routing. Features:

Example routing

API

Name Usage Description
__set(plugin, value) $fw->{plugin} = 'file' Loads specified plugin from plugin directory
__get(plugin) $plug = $fw->{plugin} Gets specified already loaded plugin
set(key, value) $fw->set('key', 'value') Adds specified key to fw.ph stack
get(key) $key = $fw->get('key') Gets specified key from fw.ph stack
exists(key) $exists = $fw->exists('key') Checks if specified key exists
clear(key) $fw->clear('key') Removes specified key from fw.php stack
stack() $stack = $fw->stack() Publish stack contents
hook(name, callable) $fw->hook('hook_name') = function() Adds a new hook to fw.php
invoke(hook, [opt] args) $fw->invoke('hook_name') Invokes specified hook
config(file) $fw->config('config.json') Configure fw.php from json configuration file
draw(template) $fw->draw('template.php') Renders specified template
route(pattern, callable) $fw->route('GET /', function()) Adds route with specified pattern and callback to routing array
reroute(pattern, [opt] params) $fw->reroute('/') Redirects user to specified route

License


All versions of fwphp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 deathbeam/fwphp contains the following files

Loading the files please wait ....