Download the PHP package coreyolson/framework without Composer

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

Framework

A Minimalist PHP Framework

Designed to be lightweight, fast and easy to use. Provides the bare essentials for a modern website; e.g., simple request routing to controllers which can then go on to invoke models or views as required. A minimalist PHP 7.0+ framework.

Getting Started

All requests routed through index.php to a controller. Application and framework logic is in the application folder. Sub-folders are labeled: controllers, helpers, libraries, models and views within the same main application folder.

Quick Installation

No setup required. mod_rewrite optional, but ideally enabled. All requests go through public/index.php. Modify public/index.php as needed. Without mod_rewrite URLS are: /index.php/controller/method/param1/param2/

Installation using PHP Composer:
composer create-project coreyolson/framework folder
Suggested Rewrite Rules:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond \$1 !^(.*\..*) [NC]
RewriteRule ^(.*)$ ./index.php/\$1 [L]

Structuring a Website or Web Application

Routing logic goes in controllers, application logic in models, and views contain templates. Alternative routing (i.e., including Framework.php via another file is possible, and) still allows access to libraries, helpers and views.

Routing

The framework routes URLs via {controller}/{action}/{param1}/{param2}. Printing internal the method f::info() offers more insights. The default controller is home.php with index as the default action/method, and can be changed. The framework looks for before_{method}() and after_{method}() respectively. These can be changed by passing your desired preferences to framework::index('home/index', 'before/after'); within public/index.php.

GET example.com/project/list

Routes to the project.php controller, or 404 error if controller does not exist.

Get internal Framework and routing information by printing f::info().

Basic Usage

Using f::method() has a slight performance penalty, and is provided for convenience during development. For the best performance, access classes and methods using fully qualified names; e.g., \helpers\arr::keys(); for the Array Helper.

Auto-load any helper or library
f::class()->method();                  // f::arr(), f::benchmark(), f::page(), f::file()
Using a Controller, Model, Helper or Library
f::controller('home')->get_index();    // controllers\home::get_index();
f::model('template')->demo();          // models\template::demo();
f::helpers('arr')->keys();             // helpers\arr::keys();
f::library('benchmark')->mark();       // libraries\benchmark::mark();
Using a view
echo f::view('filename');              // view::echo('filename');
Using a dynamic view
f::view('filename', ['var' => 'val']);  // view::return('filename', ['var' => 'val']);

Advanced Usage

Add custom routes in public/index.php as needed; e.g., route::verb('/{pattern}', function () { //code }); Any HTTP verb may be used, even non-standard verbs. Two framework-specific verbs route::any and route::port have unique functionality for matching any HTTP verb, and immediately running framework routing upon matching port requests.

GET request to example.com/users/

route::get('/users/', function () {
    //code
});                                             // Continues processing

POST request to example.com/users/edit/

route::post('/users/edit/', function () {
    //code
}, true);                                       // Stops processing on TRUE

PORT request to example.com/internals/

route::port('/internals/', function () {});     // Switches to framework:index() routing

Cron Configuration

The framework can function as a cron dispatcher; however, a cronjob still needs to be configured on the web server. The following runs the framework cron dispatcher every minute; which looks in the _application/controllers/cron folder for scheduled controllers to run. Use the framework's scheduling options to configure the desired time and frequency.

(crontab -l 2>/dev/null; echo "# * * * * * wget https://localhost/?_cron -O /dev/null") | crontab -

Note: Framework must be able to write to the storage/ folder for Crons to work; or, you can manually create a writeable file at _storage/.cron.json ; adjust if using a different _cron configuration/folder.

An example Cron task / controller within Framework
<?php

namespace controllers\_cron;

class example
{
    public static $options = [
        'dayOfWeek' => 'friday',
        'frequency' => 'everyFiveMinutes',
        'between'   => ['1:00 am', '2:30 am'],
    ];

    public static function index()
    {
        // Code here
    }
}

License

Released under the MIT License. All contributions released under the MIT License.


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 coreyolson/framework contains the following files

Loading the files please wait ....