price2performance / sandbox
沙箱,Price2Performance的默认项目结构
Requires
- php: >= 8.2
- beberlei/doctrineextensions: ^1.3
- contributte/console: ^0.9.3
- latte/latte: ^3.0
- nette/application: ^3.1
- nette/bootstrap: ^3.2
- nette/caching: ^3.2
- nette/database: ^3.1
- nette/di: ^3.1
- nette/forms: ^3.1
- nette/http: ^3.2
- nette/mail: ^4.0
- nette/robot-loader: ^4.0
- nette/security: ^3.1
- nette/utils: ^4.0
- nettrine/annotations: ^0.8.1
- nettrine/cache: ^0.4.1
- nettrine/dbal: ^0.9.0@dev
- nettrine/extensions-atlantic18: ^0.6.0
- nettrine/fixtures: ^0.7.1
- nettrine/migrations: ^0.9.1
- nettrine/orm: ^0.9.0@dev
- phpseclib/phpseclib: ^3.0
- tracy/tracy: ^2.9
Requires (Dev)
- nette/tester: ^2.4
This package is auto-updated.
Last update: 2024-09-05 09:54:31 UTC
README
这是一个为我们所有项目提供的简单骨架应用程序。
需求
- 需要PHP 8.2和Docker
安装
安装沙箱的最佳方式是使用Composer。要在当前文件夹中安装,请使用以下命令
composer create-project price2performance/sandbox .
使目录 temp/
和 log/
可写。
然后,将所有 sandbox
出现的实例替换为您项目的名称。在PhpStorm中,您可以使用 CTRL
+SHIFT
+R
来重命名所有出现
sandbox
在composer.json
中的project
Sandbox\\
在composer.json
中的Project\\
sandbox
在.docker
文件夹中的project
Price2Performance\Sandbox
和Price2Performance\Project
在所有app/
、tests/
、bin/
和config/
文件夹中的所有文件Sandbox
在app/Model/ORM/Entity/xml/Price2Performance.Sandbox.Model.ORM.Entity.User.dcm.xml
文件名中替换Project
使用您项目的真实名称,而不是 project
。
Web服务器设置
在终端中运行 .docker/up.bat
。在Linux或Mac上,在终端中手动运行 .docker/up.bat
中的每一行,或者创建您自己的 .docker/up.sh
。
如果发生端口冲突,则可以终止阻止应用程序(通常是Apache)或者修改 .docker/docker-composer.yml
中的这些行
ports: - 8085:80 - 4435:443
选择合适的端口。
在localhost上设置安全连接
打开浏览器并输入 https://
(或者如果您修改了上面的端口设置,则输入 https://:4435
)。
如果您的浏览器对不安全的连接提出抗议,您有两个选择
- 或者绕过此错误消息并告诉他继续(具体方法因浏览器而异)
- 或者根据以下文章将根CA证书(位于
config/rootCA.pem
)设置为受信任:https://phpfashion.com/jak-zprovoznit-https-na-localhost#toc-uverime-certifikatu
Mac的详细说明:https://tosbourn.com/getting-os-x-to-trust-self-signed-ssl-certificates/,Windows:https://www.thewindowsclub.com/manage-trusted-root-certificates-windows
运行测试
要运行测试,请在命令行中输入
docker exec project vendor/bin/tester tests -C
分支更改时的Composer update
每次您更改git分支(例如,从 stage2
更改为 master
或反向)时,您都必须通过以下命令更新Composer的vendor目录
docker exec project composer update
PHPMyAdmin
PHPMyAdmin可在 https://:8080
访问。