yinguohai / test
project
dev-master
2019-03-20 10:18 UTC
This package is auto-updated.
Last update: 2024-04-26 18:44:48 UTC
README
框架结构
├── controller #控制器目录
│ └── Index.php
├── core
│ ├── Bootstrap.php #启动控制器
│ └── View.php #视图渲染器
├── helpers
│ └── functions.php #常用函数
|── view
| └── index.html #默认视图文件
├── index.php #项目入口文件
├── composer.json #composer 配置文件
├── LICENSE
├── README.md
├── vendor #composer 自动加载文件库
│ ├── autoload.php
│ └── composer
│ ├── autoload_classmap.php
│ ├── autoload_files.php
│ ├── autoload_namespaces.php
│ ├── autoload_psr4.php
│ ├── autoload_real.php
│ ├── autoload_static.php
│ ├── ClassLoader.php
│ └── LICENSE
composer.json
{
"name": "yinguohai/test",
"description": "project",
"type": "project",
"license": "mit",
"authors": [
{
"name": "yinguohai",
"email": "smart_apple_8@sina.com"
}
],
"minimum-stability": "dev",
"require": {},
"autoload": {
#自动加载文件
"files": [
"helpers/functions.php"
],
#自动加载的类
"psr-4": {
"core\\": "core",
"controller\\": "controller"
}
}
}
vendor > composer > autoload_psr4.php 内容
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
#composer.json中声明的psr-4 声明的其实就是一个映射
return array(
'core\\' => array($baseDir . '/core'),
'controller\\' => array($baseDir . '/controller'),
);
获取下载文件内容API说明
获取文件名
http://xxx.xxx.xxx.xxx:83/?c=product&a=list&t=20190111
参数说明:
参数 | 说明 | 必填 | 默认值 | 备注 |
---|---|---|---|---|
c | 控制器 | 是 | 无 | 取值: product,electricity |
a | 方法 | 否 | index | |
t | 时间 | 否 | date('Ymd') |
获取内容
http://xxx.xxx.xxx.xxx:83?c=product&a=select&f=product_20181220.xlsx&start=29132&length=3&t=20181220
参数说明:
参数 | 说明 | 必填 | 默认值 | 备注 |
---|---|---|---|---|
c | 控制器 | 是 | 无 | 取值:product,purcharse,inventory,electricity |
a | 方法 | 否 | index | |
start | 起始位置 | 否 | 1 | |
length | 长度 | 否 | 5000 | |
t | 时间 | 否 | date('Ymd') | |
f | 文件名 | 是 | 无 |