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將培根連接到它。