jacksleight/coast 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jacksleight/coast

Composer 安装命令:

composer require jacksleight/coast

包简介

Web application framework for PHP

README 文档

README

Packagist Travis Coverage Status License

Coast is a web application framework. The goal of Coast is to provide a simple, lightweight and flexible framework for building high-performance, modern web apps. Some parts of the API were inspired by the Connect and Express node.js frameworks.

Components

All components are designed to be as standalone as possible and can generally be used independently. Many implement App\Executable for use as middleware in applications, these are marked with a ★.

  • Acl
    • Access control list
  • App, Request, Response
    • Simple Express inspired application logic
    • HTTP request and response data handling
    • Lazy loading of application dependencies
    • Sub-applications
  • Config
    • Load and merge config files into config object
  • Controller
    • Request controller
  • Csp
    • Content security policy header generation
    • Generation of nonce values
  • Csrf
    • Cross site request forgery protection
  • Feed
    • ATOM feed generation
  • Filter
    • Data filtering
  • Http
    • HTTP client (based on cURL)
  • Image
  • Lazy
    • Lazy load files/closures on demand
  • Model, Collection
    • Base entity and entity collection classs
    • Works with Filter, Transformer, Validator
  • Path, Dir, File
    • Path, directory and file manipulation
  • Resolver
    • Resolves strings, files, routes etc. into URLs
  • Router
    • Path and method routing
  • Session
    • Session management and data wrapper
  • Sitemap
    • XML sitemap generation
  • Transformer
    • Data transformation
  • Url
    • URL manipulation
  • Validator
    • Data validation
  • View
    • Powerfull view component
    • Child and parent (wrapper) views
    • Extensible views
    • Output capture
  • Xml
    • SimpleXML extensions

Installation

The easiest way to install Coast is through Composer, by creating a file called composer.json containing:

{
    "require": {
        "jacksleight/coast": "dev-master"
    }
}

And then running:

composer.phar install

Hello World

Create a new file called app.php containing:

<?php
use Coast\App;
use Coast\Request;
use Coast\Response;

require __DIR__ . '/vendor/autoload.php';

$app = new App(__DIR__);
$app->executable(function(Request $req, Response $res) {
    return $res->text('Hello World');
});

$app->execute();

Then run:

php -S localhost:8000 app.php

And load it up in the browser at: http://localhost:8000/.

What's happening here?

  1. Include the Composer autoloader.
  2. Initialise a Coast\App object.
  3. Add middleware to handle the request.
  4. Call execute to run the application.

Documentation

Requirements

  • PHP 5.6+
  • mod_rewrite (if using Apache)

Licence

The MIT License

Copyright 2019 Jack Sleight http://jacksleight.com/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

统计信息

  • 总下载量: 963
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固