alenkasun/yii2-github-browser

我的 Yii2 GitHub 浏览器

dev-master 2015-07-13 14:46 UTC

This package is not auto-updated.

Last update: 2024-10-02 09:08:01 UTC


README

Yii2 GitHub 浏览器应用程序是在 Yii 2 基本项目模板上构建的,这是一个用于快速创建小型项目的骨架 Yii 2 应用程序。

需求

此项目模板的最低要求是您的 Web 服务器支持 PHP 5.4.0。

虚拟主机配置

  1. 在 C:\Windows\System32\drivers\etc\hosts 文件中添加以下行
    127.0.0.1       your-name-site.local
    127.0.0.1       www.your-name-site.local
  1. 对于您的本地服务器,您必须更改 httpd-vhosts.conf。例如,在我的情况下,找到 C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf 并添加以下行
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/your-name-site/web/"
    ServerName your-name-site.local
	SetEnv APPLICATION_ENV "development"
	<Directory "c:/wamp/www/your-name-site/web/">
		DirectoryIndex index.php
		AllowOverride All
		Order allow,deny
		Allow from all
    </Directory>
</VirtualHost>

安装

步骤 1 - 从存档文件安装 APP

点击 https://github.com/alenkasun/yii2-github-browser 上的“下载 ZIP”,并在本地站点 …\your-name-site 中解压,因此您必须在本地站点根目录中收到以下结构:

  assets/             contains assets definition
  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  mail/               contains view files for e-mails
  models/             contains model classes
  runtime/            contains files generated during runtime
  tests/              contains various tests for the basic application
  vendor/             contains dependent 3rd-party packages
  views/              contains view files for the Web application
  web/                contains the entry script and Web resources
  ....

步骤 2 - 通过 Composer 安装依赖库

如果您没有 Composer,您可以通过在 getcomposer.org 上找到的说明进行安装。

通过 Composer 在站点根目录中安装 VENDOR 文件夹中的所有依赖库:在站点根目录中打开 cmd.exe(右键点击从上下文菜单中按 shift + command)并执行

  - if composer was installed globally:
        composer self-update
        composer install
  - else:
        php composer.phar self-update
        php composer.phar install

结果,在站点根目录中有一个 VENDOR 文件夹。

数据库配置

数据库安装

通过方便的数据库客户端(例如:通过 phpMyAdmin 或 HeidiSql)创建新数据库并导入 github_browser.sql。

数据库配置

使用实际数据编辑文件 config/db.php,例如

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=github_browser',
    'username' => 'git',
    'password' => 'git',
    'charset' => 'utf8',
];

现在您应该可以通过以下 URL 访问应用程序

http://your-name-site.local/