PHPackages                             lean/lean - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lean/lean

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lean/lean
=========

Lean PHP, a micro Framework PHP really simple.

1.1.22(10y ago)145325MITPHPPHP &gt;=5.3.0

Since Jun 23Pushed 10y ago3 watchersCompare

[ Source](https://github.com/dyorg/Lean)[ Packagist](https://packagist.org/packages/lean/lean)[ Docs](https://github.com/dyorg/Lean)[ RSS](/packages/lean-lean/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (22)Used By (0)

Lean PHP Framework
==================

[](#lean-php-framework)

Lean PHP Framework is a micro framework PHP (~40KB). Modern frameworks are powerfull but so much complicated, the mostly of resources you never gonna use, some functionality sounds good but if you don't really need it's a only waste of time. With Lean you can construct fast e lightweight softwares, with follows resources:

- Structure MVC, REST or both;
- Requests;
- Routes (automatic or custom);
- Namespaces;
- Class autoload;
- PHP code hidden;
- Basic template engine;
- Date and Time manipulation;
- Easy configuration;

### Requirement

[](#requirement)

PHP 5.3+

### Basic structure

[](#basic-structure)

```
-- rootdir
    -- app
        -- main (module)
            -- controllers
                -- HomeController.php
            -- models
            -- views
                -- home
                    -- index.phtml
        -- Bootstrap.php
        -- Routes.php
    -- public_html
        -- css
        -- js
        -- img
        -- index.php
        -- .htaccess
    -- vendor
        -- composer
        -- lean
        -- autoload.php
```

Create into your rootdir teh follows directories:

- `app`: You will write all your application php into app directory (controllers, models, views and configs), this way your application not stay exposed.
- `public_html`: Into public\_html directory we have only **index.php** as file .php. You can put all yours public files, like css, javascripts, images, fonts, etc.
- `vendor`: Composer will create it and copy our lib to lean directory.

Getting started
---------------

[](#getting-started)

### Instalation

[](#instalation)

Install via [Composer](http://getcomposer.org "Composer")

```
composer require lean/lean
```

### Easy configuration

[](#easy-configuration)

create file `index.php` into **public\_html** directory

> Into index.php we have only one line, all of rest application php keep safe into app directory.

```

```

create file `.htaccess` into **public\_html** directory to custom urls works

> Don't forget enable mod\_rewrite on apache

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
```

Create file `Bootstrap.php` into **app** directory

```
