Download the PHP package firelit/framework without Composer

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

Firelit-Framework

Build Status

Firelit's standard PHP framework provides a set of helpful classes for developing a website. They are created and namespaced so that they can easily be used with an auto-loader, following the PSR-4 standard.

Requirements

External PHP Extensions:

How to Use

The easiest way to use this library is to use Composer which automatically handles dependencies and auto-loading.

Here is an example of how you'd add this package to your composer.json under the require key:

You could also add it from the command line as follows:

Alternatively, you could go the manual way and setup your own autoloader and copy the project files from lib/ into your project directory.

MVC Architecture

This framework comes with classes to support building apps with the MVC architecture.

An example implementation using these classes in a single entry web app:

Note that this setup is considered single-entry so there must be a slight modification to web server to force it to use the main script (e.g., index.php) for all HTTP requests. Here's an example .htaccess (from the WordPress project) that will configure Apache to route all requests to a single entry script.

Classes Included

ApiResponse

A response-handling class for API end-points. Can handle all HTTP response codes and JSON & limited XML. Set a template to ensure some fields are always sent back with the response.

Example usage:

Cache

A caching class. First uses php-memory cache (a global PHP variable) and configurable to use memcached second. The static variables $cacheHit and $cacheMiss are set after each cache check.

Example usage:

Controller

A minimal class to wrap controller logic. Extend to add additional controller-common methods and static data. It also has a "handoff" function call to simplify invocations to Controller objects.

Handoff syntax: Firelit\Controller::handoff(ControllerClassName [, OptionalMethodName [, MethodParamater1 [, ... ]]])

Crypto Classes

Crypto, CryptoKey and CryptoPackage are encryption/decryption helper classes using OpenSSL (used in lieu of mcrypt based on this article). These classes can generate cryptographically secure secure keys and encrypt and decrypt using industry-standard symmetric encryption (RSA) and private key encryption (AES) schemes.

Note that AES encryption will not work for large strings (80 characters or more, depending on key bit size) due to the amount of processing power it takes -- it quickly becomes inefficient. For larger strings, the plain text should be encrypted with RSA and the encryption key should be encrypted with AES. This is exactly what CryptoPackage does for you on top of serializing/unserializing the subject to quickly store and retrieve variables of any type (string, object, array, etc) in an encrypted store.

Example encryption/decryption usage:

DatabaseObject

This class is a schema-less, active record-like class for creating, retrieving and manipulating a database row as an object. To set it up, extend the class for each table, specifing the primary key row and other special-value rows (e.g., serialized rows, date/time rows, etc.) to enable built-in pre-store and post-retrieval value manipulation.

HttpRequest

A class to manage new HTTP requests to external web services and websites. Includes file-based cookie support.

Example usage:

Query

A database interaction class and SQL query creator. Makes database connection management and SQL authoring slightly easier.

Example usage:

Use the config method to setup the database connection:

Available methods for building and executing queries:

Available methods for getting the status and/or results of a query:

QueryIterator

A PHP iterator that allows for a Query result set to be passed around without actually pre-retrieving all results. The QueryIterator object can then be used in a foreach loop, where it fetches the next row needed on-demand.

Example usage:

The QueryIterator constructor takes two parameters, the second optional: The Query object and the object into which the table row should be fetched.

Request

A class that captures the incoming HTTP request in a single object and performs any necessary preliminary work. Provides a nice class wrapper around all the important parameters within the request and allows for easy sanitization.

Example usage:

Example usage:

Available properties:

Response

A class that manages the server's response to an incoming requests. Defaults to buffering output. Includes helper functions which make changing the HTTP response code and performing a redirect much easier. Note that the ApiResponse class inherits from this class to make use of its response management.

Available methods:

Session

Session management class which can use PHP's native session features (and an optional database store). You can get and set any property name to the session object and it is dynamically saved (using magic getter and setter methods). Implement the PHP-native SessionHandlerInterface to create your own session handler or session storage engine. This library provides database implementation called Firelit\DatabaseSessionHandler. Roll your own by implementing SessionHandlerInterface and use a class of this object when instantiating the Session object. Or, leave this parameter off to simply use PHP's built-in cookie- & file-based session handling.

Note that if you are using Firelit\DatabaseSessionHandler, the expiration of a session is NOT controlled by the session.gc_maxlifetime as it is if you use the Session class without the session handler.

Example usage:

Strings

A set of string helper functions wrapped into a class.

Example usage:

Vars

A class for managing application-level, persistent variables. Vars is implemented through magic setters and getters so you can use any name you want for your vars and any type of persistant data store. The store can be custom defined by creating custom getter and setter functions (e.g., for reading/writing the values to a file) or you can leave it to the default (which stores the values in a database).

Example usage:

View

A class for managing views: View templates, view layouts (which wraps around a view template), partials (part of a view that is extracted for use elsewhere) and asset management (auto-inserting of required assets into the HTML ).

Layouts are like view templates in which view templates reside. They typically contain the repeating HTML wrappers around the more view-specific elements. Layouts are an optional component. If no layout is specified, the view template is rendered on its own.

An example layout, saved to views\layouts\main.php:

Now an example view file, saved to views\templates\dashboard.php:

When the view is invoked, the data used in the view (see $name above as an example) is specified using an associative array.


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-mbstring Version *
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 firelit/framework contains the following files

Loading the files please wait ....