2017 © Pedro Peláez
 

project quickphp

quick start a php project

image

wangkaibo/quickphp

quick start a php project

  • Friday, June 2, 2017
  • by wangkaibo
  • Repository
  • 1 Watchers
  • 7 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Quick Start

安装

composer create-project wangkaibo/quickphp your-project-name, (*1)

安装依赖, (*2)

composer install, (*3)

启动配置

数据库配置文件 config/database.php, (*4)

return [
    'default' => [
        'driver'    => 'mysql',
        'host'      => HOST,
        'database'  => DATABASE,
        'username'  => USER,
        'password'  => '',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
    ],
    // 如需连接多个数据库
    'conection2' => [
        'driver'    => 'mysql',
        'host'      => HOST,
        'database'  => DATABASE,
        'username'  => USER,
        'password'  => '',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
    ],
];

数据库驱动使用 illuminate/database,详细使用方法参见 Laravel 文档:eloquent, (*5)

路由配置

路由文件 app/routes.php, (*6)

// GET 请求
Router::get('/get', function () {
    echo 'get';
});

// POST 请求
Router::post('/post', function () {
    $post_data = file_get_contents('php://input);
    var_dump($post_data);
});

Router::get(":all", function () {
    view('welcome', compact('name'));
});

使用 PHP 内置 Server:, (*7)

php -S 127.0.0.1:8080 public/index.php

访问:http://127.0.0.1:8080, (*8)

The Versions

02/06 2017

dev-master

9999999-dev

quick start a php project

  Sources   Download

MIT License

The Requires

 

by Avatar wangkaibo

02/06 2017
30/03 2017

1.0.0

1.0.0.0

quick start a php project

  Sources   Download

MIT License

The Requires

 

by Avatar wangkaibo