1 Star 0 Fork 0

李秀杰 / XJPHP RESTful

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

XJPHP RESTful : 是一个超轻量的快速开发框架。Light and Fast。

Encode : UTF-8

特色

  • 基于 MVC 体系;
  • 超轻量级,小巧的框架;
  • 出色的性能;
  • 广泛兼容标准主机上的各种 PHP 版本和配置;
  • 实现简单,快速扩展;
  • 清晰的应用分层,可以帮助您构建大型的应用;
  • 支持路由分层,灵活的 URL 路由;
  • PHP PDO 数据库的支持;

控制器

<?php
class Index{
    private $data;
	// 初始化
	public function Init($IDs)
	{
		$this->data = array();
		$this->data["id"] = $IDs[0];
		$this->data["class"] = __CLASS__;
		$this->data["page_content"] = "index.php";
	}
	public function Get($IDs){
		$this->data["title"] = "Welcome to ".$_ENV['XJ_PHP'];
		$this->data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
		$queryData = $this->input->value('queryData');
		$this->load->view("index.php", $this->data);
	}
	public function Post($IDs){
		$data = array();
		$data["title"] = "Welcome to XJPHP";
		$data["id"] = $IDs[0];
		$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
		$this->output->append('Hello World!');
	}
	public function Head($IDs){
		$data = array();
		$data["title"] = "Welcome to XJPHP";
		$data["id"] = $IDs[0];
		$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
		xj_load_view("index.php", $data);
	}
	public function Put($IDs){
		$data = array();
		$data["title"] = "Welcome to XJPHP";
		$data["id"] = $IDs[0];
		$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
		xj_load_view("index.php", $data);
	}	
	public function Delete($IDs){
		$data = array();
		$data["title"] = "Welcome to XJPHP";
		$data["id"] = $IDs[0];
		$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
		xj_load_view("index.php", $data);
	}
}

NGINX 配置

    server {
		listen	   8088; # 端口
		server_name  localhost; # 域名
		root   html_sldy; # 代码目录
		location / {
			index  index.php index.html index.htm;
			#-e和!-e判断是否存在文件或目录, 如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
			if (!-e $request_filename)
			{
				#地址作为将参数rewrite到index.php上。
				rewrite ^/(.*)$ /index.php/$1 last;
				#若是子目录则使用下面这句,将subdir改成目录名称即可。
				#rewrite ^/subdir/(.*)$ /subdir/index.php/$1 last;
				break;
			}
		}
		location ~ \.php {
			fastcgi_pass 127.0.0.1:9000;
			#fastcgi_index index.php;
			include fastcgi_params;
			set $fastcgi_script_name2 $fastcgi_script_name;
			if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
				set $fastcgi_script_name2 $1;
				set $path_info $2;
			}
			fastcgi_param   PATH_INFO $path_info;
			fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name2;
			fastcgi_param   SCRIPT_NAME   $fastcgi_script_name2;
		}
	}

空文件

简介

XJPHP RESTful : 是一个超轻量的快速开发框架。Light and Fast。 展开 收起
PHP
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/UtilityClass/XJPHP-RESTful.git
git@gitee.com:UtilityClass/XJPHP-RESTful.git
UtilityClass
XJPHP-RESTful
XJPHP RESTful
master

搜索帮助