Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hetao29/slightphp into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao29 committed Dec 18, 2022
2 parents 7bffc32 + 11bd792 commit d4143b0
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
# SlightPHP 高效的PHP敏捷开发框架

### 支持composer,同时需要php5.3及以上
- 安装方法一 ,执行下面的命令
### 安装方法
- 方法一 ,执行下面的命令
```bash
//使用中国镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
//下载安装最新
composer require "hetao29/slightphp:dev-master"
```

- 安装方法二 ,新增 composer.json,然后 composer install就可以了
- 方法二 ,新增 composer.json,然后 composer install就可以了
```json
{
"require": {
"hetao29/slightphp": "dev-master"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://mirrors.aliyun.com/composer/"
}
}
}
```

- 优化,默认我们已经做了加载优化,你也可以手动执行一次
```bash
composer dump-autoload --optimize
```

- v2.0升级方法 ,加载SlightPHP.php改成如下方法就可以了,自定义slightphp_path的路径
```php
<?php
//require_once($slightphp_path."/SlightPHP.php"); #不用这个方法了
require_once($slightphp_path."/vendor/autoload.php");
```

- v2.0版本支持php4,php5,php7等主要版本

### pecl 模块支持php7
- 最新更新,支持php7模块
Expand Down Expand Up @@ -58,15 +50,15 @@ require_once($slightphp_path."/vendor/autoload.php");
```php
<?php
//加载方式1,直接加载框架
require_once("SlightPHP.php");
//require_once("SlightPHP.php");

//加载方式2,使用扩展,或者直接编译进PHP也可以
//dl("slightphp.so");
//或者在php.ini里增加(如果不支持dl的话)
//extension = slightphp.so

//加载方式3,使用composer的autoload
//require_once("vendor/autoload.php");
require_once("vendor/autoload.php");

SlightPHP::run();
?>
Expand Down

0 comments on commit d4143b0

Please sign in to comment.