defra91 / levecchiecredenze.it
餐厅后端网站开发
dev-master
2014-06-01 10:53 UTC
Requires
This package is not auto-updated.
Last update: 2020-01-06 08:37:09 UTC
README
此仓库为网站 levecchiecredenze.it 提供版本控制系统。
- 公共领域参考: http://www.levecchiecredenze.it(尚未部署,旧版本)
状态
开发中。有关更多信息,请参阅 发布 部分;
当前功能
- 静态主页,包含餐厅信息;
- 静态页面,包含餐厅历史信息;
- 动态页面,包含餐厅菜单(未实现);
- 动态页面,包含新闻列表;
- 动态页面,包含活动列表(未实现);
- 动态页面,包含相册(未实现);
- 静态页面,包含驾驶信息和 Google 地图框架;
- 静态页面,包含联系表单;
- 静态页面,包含信用信息;
- 静态页面,包含登录表单;
- 标准错误页面视图;
标准和参考
- XHtml 标准: http://www.w3.org/TR/xhtml1/
- CSS2 标准: http://www.w3.org/TR/CSS2/
- Javascript 参考: https://w3schools.org.cn/jsref/
项目结构
项目严格遵守 MVC 设计模式。公开页面位于 public_html
目录中,其中包含以下目录
images/
,存储内容图片;css/
,存储 CSS 样式表;js/
,存储客户端 JavaScript 脚本;data/
,存储文档和其他二进制文件;
resources
目录包含所有后端。它包含 library
目录,其中存储 PHP 脚本。下面是 library
目录的结构
model/
,包含数据库管理脚本;controller/
,包含生成页面部分并与模型通信的脚本;utils/
,包含其他 PHP 类;vendor/
,包含包管理器 composer 的外部库;composer.json
文件,其中包含包的描述;
在 resources
文件夹内还可以找到 backup/
目录。它包含所有备份文件,如 mysql 备份。
需求
首次使用
为了使网站工作,您需要遵循以下步骤
- 首先,您需要创建一个PHP配置文件类。打开终端并进入项目目录。您需要在路径
./resources/
内创建一个名为Configuration.php
的文件。您可以运行以下命令:
touch ./resources/Configuration.php
- 在
Configuration.php
文件中编写类代码。您可以根据自己的喜好设置文件,但为了让项目运行,您需要按照以下模板进行操作:
<?php /** * This class provides to describe a series of configuration in a static way * @author Luca De Franceschi <luca.defranceschi.91@gmail.com> */ class Configuration { /** * Returns hash with developer information * @return hash developer info * @access public */ public static function getDeveloperConfiguration() { return array( "name" => "yourName", "surname" => "yourSurname", "email" => "yourEmail" ); } /** * Returns hash with project configuration * @return hash project configuration info * @access public */ public static function getProjectConfiguration() { return array( // notice: github configuration is optional "githubUrl" => "yourGithubUrl", "githubRepositoryName" => "yourRepositoryName", // your forked project "githubUsername" => "yourGithubUsername", "githubPassword" => "yourGithubPassword", // need to automatically create issues "publicDomain" => "(optional) yourSitePublicDomain", "documentRoot" => $_SERVER['DOCUMENT_ROOT']; ); } /** * Returns description of mysql database configuration * @return hash mysql configuration info */ public static function getMysqlConfiguration() { return array( "dbHost" => "dbHost", "dbUser" => "dbUser", "dbPassword" => "dbPass", "dbName" => "dbName", "dbPort" => "dbPort" // usually 3606 ); } /** * Public class constructor * @access private */ private function __construct() {} } ?>
- 通过文件上传导入数据库表结构。备份文件可以在以下路径找到:
./resources/backup/mysqlBackup.sql
。
使用的程序和工具
- 操作系统:Ubuntu 14.04;
- 文本编辑器:sublime Text 3;
- Web服务器:Apache 2.*;
- MySQL管理:MySql Workbench;