abtzco / seed-php
The stupidly easy to learn and use PHP micro framework. ;)
Installs: 475
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 4
Forks: 2
Open Issues: 3
Type:package
Requires
- php: >=5.6.0
- erusev/parsedown: ^1.7
- twig/twig: ^2.0
- dev-master
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.5.3
- 1.5.2
- 1.5.1
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.1
- 0.6.0
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-refactoring
This package is auto-updated.
Last update: 2023-12-12 19:06:56 UTC
README
The stupidly easy to learn and use PHP microframework!
A microframework
is a term used to refer to minimalistic web
application frameworks. It lacks most of the functionality which
is common to expect in a full-fledged web application framework.
Seed-PHP is a microframework that offers you a really simple way
to implement powerfull RESTfull APIs
or even simple websites that could support pretty much all needed methods and responses in JSON
or XML
formats.
Check the complete documentation.
NOTE OF BREAKING CHANGES: The namespace was modified, so if you're updating from previous versions (prior to 1.0.0), you'll be required to update your code, replacing namespace from
Seed\
toSeedPHP\
. E.g:
# Deprecated use Seed\App; use Seed\Helper\Http; # Correct use SeedPHP\App; use SeedPHP\Helper\Http; $app = new App( ... );
Get started
Using composer
it's really simple get started!
If you have a project on going with composer, use:
$ php composer require rogeriotaques/seed-php
or, to start a project from scratch, use:
$ php composer create-project rogeriotaques/seed-php
Your application should have a index.php
which may looks like the
following example. Or simply create a new index.php
file as follows:
Example: (index.php
)
<?php // include composer autoloader include __DIR__ . '/vendor/autoload.php'; // initilise the Seed-PHP App class $app = \SeedPHP\App::getInstance(); // Define a initial route $app->route('GET /', function () { echo 'Hello Word!'; }); // Let's rock ... $app->run();
If you have forked or cloned the repository from Github, then instead of include the 'autoload.php' from composer, include the package loader:
// include composer autoloader // include __DIR__ . '/vendor/autoload.php'; // include package loader include __DIR__ . '/seed-php/loader.php';
Now, as a final step, we must create the .htaccess
file (in the same folder of the index.php
) which will contain the necessary settings for Apache properly use the mod_rewrite
and route all the traffic thru our index.php
.
Example:
# SeedPHP # © 2018, Abtz Labs. By Rogerio Taques. # @see http://github.com/rogeriotaques/seed-php <FilesMatch "^(\.|\_)"> # Deny access to filenames starting # with dot(.) or underline(_) Order allow,deny Deny from all </FilesMatch> <FilesMatch ".(yml|yaml|log|sh)$"> # Deny access to filenames with # especific extensions Order allow,deny Deny from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L] </IfModule>
Done! Now, do access your project on any browser. ;)
Get involved
This is an open-source project, which means you can also freely contribute to improve it and make it better. To do your contributions, fork this repository, do your changes or improvements and create a pull request.
Get support
Found an issue or would like to suggest something? Just go to this page and open a ticket. Learn more about us.
Be a sponsor
Sponsoring this project will help and motivate me to keep improving it and making it even better for you (and the whole open-source community) who is using this package.