brainsware / bacon
快速且可扩展的PHP MVC框架
1.2.3
2019-01-14 16:42 UTC
Requires
- php: >= 7.0
- brainsware/sauce: @dev
- defuse/php-encryption: 2.*
- twig/extensions: *
- twig/twig: 2.*
Requires (Dev)
- brainsware/grease: @dev
README
bacon PHP框架是一个简洁、清晰、简单且快速的MVC框架,没有太多繁琐的功能。
服务器要求
- 一个Web服务器
- PHP 7.0或更高版本 (php.net)
- Composer (getcomposer.org)
安装
一旦您已经设置好PHP和composer,您可以使用以下命令创建一个骨架项目:
% composer create-project brainsware/bacon-dist project-name
这将下载所有必要的软件,并为您的项目创建所有重要的目录和示例配置文件。
Installing brainsware/bacon-dist (1.0)
- Installing brainsware/bacon-dist (1.0)
Loading from cache
Created project in project-name
Loading composer repositories with package information
Installing dependencies
- Installing brainsware/php-markdown-extra-extended (dev-master 1.0)
Cloning 1.0
- Installing brainsware/sauce (1.0)
Loading from cache
- Installing minmb/phpmailer (dev-master df44323)
Cloning df443234ad0ca10cbf91a0c0a728b256afcab1d1
- Installing twig/twig (dev-master ba67e2c)
Cloning ba67e2cf8e2ca6cada1de5a316a724df648c52ac
- Installing brainsware/bacon (1.0)
Loading from cache
Writing lock file
Generating autoload files
配置
Bacon使用PHP文件来存储所有配置。
我们提供的骨架项目包含一个Intro控制器,该控制器在Config/Base.php
中设置为默认的回退控制器。
您接下来想要查看的第二个配置文件是Config/Database.php
。以下是您需要为数据库设置的基本选项:
'server' => 'db.dbznet', # Enter your server host here
'name' => 'blogDB', # The name of your database
'type' => 'mysql', # Anything your PDO Installation supports. (https://php.ac.cn/manual/en/pdo.drivers.php)
'username' => 'blogDBuser', # The username you want to connect to your database with
'password' => 'VryScrPswd', # The password.
Bacon不提供这些选项的默认值。如果您的应用程序需要数据库,您必须创建它并通过Config/Database.php
将Bacon连接到它。