bacon
1.1.0
培根PHP框架是一个精简,干净,简单且快速的MVC框架,而没有太多的模糊。
服务器要求:
设置PHP和作曲家后,您可以创建一个骨架项目,其中以下内容:
% 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
培根使用PHP文件存储其所有配置。
我们提供的骨架项目带有一个简介控制器,该介绍器设置为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. (http://www.php.net/manual/en/pdo.drivers.php)
'username' => 'blogDBuser', # The username you want to connect to your database with
'password' => 'VryScrPswd', # The password.
培根不为这些选项提供默认值。如果您的应用程序需要数据库,则必须创建它并通过Config/Database.php将培根连接到它。