kimihub/nemesis-framework
最新稳定版本:0.7.6
Composer 安装命令:
composer require kimihub/nemesis-framework
包简介
Small PHP5 Framework
关键字:
README 文档
README
Nemesis is a small PHP Framework that I've started to sustain when I realized I needed a lightweight, native, minimalistic and flexible tool to quickly develop MVC web app or REST api for testing and specific requests which require to work on a basic shared web hosting with few hardware resources.
Features
The architecture is built on well known patterns (Model Controller or Model View Controller) with a basic bootstraper / class autoloader and some procedural functions, so, what PHP can do properly without any extra-dependencies.
Core components
The core is customizable according to the components needed and their dependencies
Classes
Loader : autoloader
Hook : trigger a hook, depends to Loader
Session : manage a secure session, depends to Loader
Plugin : DEPRECATED
URL : get headers received, hash and output URLs, depends to Loader
Router : create routes, depends to Loader, URL
Api : manage a simple JSON Web Api with a class controller, depends to Loader, URL, Router
MVC : add all components to build a MVC app like a view builder, depends to Loader, Hook, URL, Routes
App : manage a web app built on a MVC pattern with a class controller, depends to Loader, Hook, URL, Routes, MVC
HTMLhelpers : helpers to build html forms, no dependencies
CSSmin : minify CSS, depends to Loader, Hook, MVC
Functions
String parser : strip_accents, strip_specialchars, beautify, minimize, excerpt, is_email, is_phone_fr, is_date, datetime, sanitize_output
File manager / Shorcuts : getperms, filename, extension, upload, download
CURL : url_get_contents
key : Key_Generator
Required PHP version and modules
-
PHP v5.3 or higher installed on your server or web hosting
-
htaccess (for Apache) and url_rewriting PHP modules
Installation
Composer
Nemesis-Framework is now on packagist, so it can be required as a dependency with Composer :
https://packagist.org/packages/kimihub/nemesis-framework
URL Rewriting Configuration
For Apache Servers the content of the .htaccess file located to the server root directory is :
<IfModule mod_rewrite.c>
#Symlinks maybe needed for URL rewriting
Options +FollowSymLinks
RewriteEngine On
#if you want to exclude some directories from url rewriting
#RewriteCond %{REQUEST_URI} !^/(site2|site3/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
And for Lighttpd Servers the content of Lighttpd.conf :
$HTTP["host"] =~ "www\.mydomain\.com"{
server.document-root = "/PathToServerRoot/"
accesslog.filename = "/PathToLogs/access.log"
url.rewrite = (
"^/(.+)/?$" => "/index.php/$1"
)
}
index.php instructions
Require bootstraper
require_once 'nemesis.php';
To log php errors
get_errors(); // to view errors.log : http://mydomain.com/errors.log
To display php errors
display_errors();
If the core functions are required
core_functions();
If the autoloader is required
core_autoloader();
Router initialization
$loader = Loader::getInstance();
$loader->initClass('Router');
Example of a web app initialization
$blogApp = App::getInstance('blog', '1.0'); // the version is not required
$blogApp->run();
echo $blogApp;
More examples
For more examples, check the others repositories prefixed with "nemesis-"
-
REST Newsletter Api : https://github.com/kimihub/nemesis-api-example
-
MVC Blog App : https://github.com/kimihub/nemesis-app-example
Changelog
0.7
- Add Api::RESTMethods()
- Implements HTMLhelpers old plugin to class.HTMLhelpers.php core
- Implements CSSmin old plugin to class.CSSmin.php core
- Cleans App and MVC to implement NEMESIS_PROCESS_PATH
0.6
- Move the bootstraper core/bootstrap.php to ./nemesis.php for more simplicity with Composer
- Move core/errors.log to ./errors.log
- Add ./nemesis.dev.php to write logs in the errors file when included
- Add NEMESIS_PROCESS_PATH to ./nemesis.php and core/class.App.php
- Change behaviour of App system, an app can now be in the root server directory
- Deprecated App::setAsDefault() and App::$url
- Deprecated class.Plugin.php
- Defines composer.json
0.5
- New function in functions.php : key_generator($length=8)
- Removed hash/token generator and new secure ($_SESSION[$sessionName] = $expirationDate)
- Add Cross-Origin Resource Sharing (CORS) headers in class.Api.php with Api::CORS()
0.4
- New class : class.Api.php to manage a JSON Web Api
- New class : class.Session.php to manage a secure session
0.3
- Simplification, re-organization of classes dependencies
- init.php replaced with bootstrap.php, it is now clean and
- new way to instance plugins and apps independently from Loader Class
- Routes configuration has now its own class with URL Class dependence
- Loader class can initialize a class with a initClass method
- errors.log changes its path to /core/errors.log
- core_functions() and core_loader() appears in bootstrap to include the required libraries
0.2
- Test on Lighttpd / Fixed url rewriting
0.1
- Initial Release
kimihub/nemesis-framework 适用场景与选型建议
kimihub/nemesis-framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 65 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「rest」 「mvc」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kimihub/nemesis-framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kimihub/nemesis-framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kimihub/nemesis-framework 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Kinikit - PHP Application development framework MVC component
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
Small extensible framework in PHP
统计信息
- 总下载量: 65
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-04-07