eric404 / droplara
PHP/DropLet/ The PHP Framework
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Type:project
Requires
- php: >=5.6.30
- filp/whoops: *
- illuminate/database: *
- nette/mail: *
- noahbuscher/macaw: dev-master
- predis/predis: *
This package is auto-updated.
Last update: 2024-10-27 00:26:27 UTC
README
DropLara is a Simple PHP Framework powered by Composer, looks like a Tiny Laravel.
Start
Download:
git clone https://github.com/EricLi404/DropLet.git
cd DropLet
OR:
Download in releases page.
Install dependencies:
composer update
Databases import:
- import
DropLara.sql
; - Rename
config/database_demo.php
toconfig/database.php
; - Modify
config/database.php
Run:
cd public
php -S 127.0.0.1:2333
Then visit http://127.0.0.1:2333.
It works!
URL Rewrite:
Apache
# .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Nginx
# nginx.conf
autoindex off;
location / {
try_files $uri $uri/ /index.php?/$uri;
}
Plug-in
Modify config/mail.php
return [
'host'=>'smtp.xxxx.com',
'username'=>'xxx@xxxx.com',
'password'=>'password'
];
Modify app/controllers/xxxxController.php
$this->mail = Mail::to('test@gmail.com')
->subject('Hello World')
->htmlBody('<h1>Hello World from DropLet</h1>');
Redis
Modify config/redis.php
return [
'host' => '127.0.0.1',
'port' => 6379
];
Modify app/controllers/xxxxController.php
Redis::set('key','value',3000,'ms');
echo Redis::get('key');
Features:
- MVC architecture
- Redis ready in Laravel-style
- Handy SMTP mailer
- One of the Most powerful PHP ORM on Earth: Laravel Eloquent
- RouteModule powered by fast and sexy codingbean/macaw
License
The DropLara framework is open-sourced software licensed under the MIT license