craftcms / cloud
Requires
- php: ^8.1
- 99designs/http-signatures: ^4.0
- bref/bref: 2.1.21
- bref/extra-php-extensions: 1.3.2
- craftcms/cms: ^5
- craftcms/flysystem: ^2.0.0
- league/flysystem-aws-s3-v3: ^3.15
- league/uri: ^7
- league/uri-components: ^7
- phlak/semver: ^4.1
- symfony/process: ^6
- yiisoft/yii2-queue: ^2.3.7
- yiisoft/yii2-redis: ^2.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- 2.x-dev
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.61.2
- 1.61.1
- 1.61.0
- 1.60.0
- 1.50.2
- 1.50.1
- 1.50.0
- 1.49.2
- 1.49.1
- 1.49.0
- 1.48.2
- 1.48.1
- 1.48.0
- 1.47.0
- 1.46.8
- 1.46.7
- 1.46.6
- 1.46.5
- 1.46.4
- 1.46.3
- 1.46.2
- 1.46.1
- 1.46.0
- 1.45.1
- 1.45.0
- 1.44.1
- 1.44.0
- 1.43.5
- 1.43.4
- 1.43.3
- 1.43.2
- 1.43.1
- 1.43.0
- 1.42.0
- 1.41.2
- 1.41.1
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.1
- 1.37.0
- 1.36.0
- 1.35.3
- 1.35.2
- 1.35.1
- 1.35.0
- 1.34.1
- 1.34.0
- 1.33.0
- 1.32.1
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.3
- 1.29.2
- 1.29.1
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.1
- 1.25
- 1.24.2
- 1.24.1
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.2
- 1.21.1
- 1.21.0
- 1.20.2
- 1.20.1
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.6
- 1.17.5
- 1.17.4
- 1.17.3
- 1.17.2
- 1.17.1
- 1.17.0
- 1.16.5
- 1.16.4
- 1.16.3
- 1.16.2
- 1.16.1
- 1.16.0
- 1.15.2
- 1.15.1
- 1.15.0
- 1.14.1
- 1.14.0
- 1.13.1
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-feature/pt-2118-better-support-for-quotes-in-commands
- dev-escape-command-args-v1
- dev-escape-command-args
- dev-bugfix/s-maxage
- dev-feature/test-controller
- dev-bugfix/dev-mode-crashes
- dev-bugfix/fix-rebrand
- dev-feature/pt-1716-update-the-extension-to-have-build-command
- dev-feature/purge-pending-expired
- dev-feature/better-invalidation
- dev-feature/remove-response-behavior
- dev-feature/craft_cloud_build
- dev-feature/remove-build-command
- dev-bugfix/local-cdn
- dev-dependabot/composer/composer/composer-2.7.0
- dev-dependabot/composer/bref/bref-2.1.13
- dev-dependabot/composer/craftcms/cms-4.7.0
- dev-dependabot/npm_and_yarn/follow-redirects-1.15.4
- dev-gzip-response
- dev-fix-upload-validation
- dev-fix-upload-errors
- dev-redis-mutex
- dev-remove-timeout-retry
- dev-better-table-exists
- dev-dependabot/npm_and_yarn/babel/traverse-7.23.5
- dev-momento-mutex
- dev-fix-queue
- dev-signatures
- dev-artifactBaseUrl
- dev-no-mutex
- dev-feature/cld-369-add-static-cache-clearing-utility
- dev-set-aliases
- dev-static-caching
- dev-feature/utility
- dev-craft-cloud-yaml
- dev-check-db-table
- dev-bugfix/local-artifact-url
- dev-db-storage
- dev-craftcom
- dev-single-redis-db
- dev-feature/handle-sqs-events
This package is auto-updated.
Last update: 2024-09-16 19:43:06 UTC
README
Craft Cloud 扩展
欢迎来到 Craft Cloud!
此存储库包含 craftcms/cloud
Composer 包的源代码,该包是运行我们的第一方托管平台 Craft Cloud 上的 Craft 项目所必需的。
安装后,扩展会自动 引导 自身,并根据检测到的环境进行必要的 应用配置 更改。
- 🌩️ 云: 无需担心基础设施设置——数据库、队列、缓存和会话配置将由您处理。
- 💻 本地开发: Craft 在您最喜欢的 开发环境 中正常运行。
✨ 想了解更多关于 Cloud 的信息,请查看 我们的网站——或者直接通过 Craft Console 开始。想了解扩展如何使您的应用为 Cloud 准备就绪?请阅读知识库中的 Cloud 扩展深入探讨。
安装
您可以通过运行 php craft setup/cloud
在任何现有的 Craft 4.6+ 项目中安装 Cloud 扩展。Craft 将添加 craftcms/cloud
包并运行扩展的设置向导。
提示
此过程包括创建一个 craft-cloud.yaml
配置文件,该文件有助于 Cloud 理解您项目的结构,并确定您的项目在构建和运行时将使用哪些 PHP 和 Node 版本。
当您将项目部署到 Cloud 时,将运行 cloud/up
命令,该命令将包装 Craft 内置的 up
命令 并添加缓存和会话表(如果尚未存在)。
文件系统
设置项目资产时,请使用提供的 Craft Cloud 文件系统类型。有关在 Cloud 项目中管理资产的信息,请参阅管理 Cloud 项目中的资产。
开发者功能
模板助手
cloud.artifactUrl()
生成在构建和部署过程中上传到 CDN 的资源的 URL。
{# Output a script tag with a build-specific URL: #} <script src="{{ cloud.artifactUrl('dist/js/app.js') }}"></script> {# You can also use the extension-provided alias: #} {% js '@artifactBaseUrl/dist/js/app.js' %}
有关如何使用 artifact URLs 的更多信息,请参阅 使用 artifact URLs。
cloud.isCraftCloud
当应用检测到它在 Cloud 基础设施上运行时为 true
,否则为 false
。
{% if cloud.isCraftCloud %} Welcome to Cloud! {% endif %}
别名
除了 Craft 提供的 别名 之外,还提供了以下别名。
@web
在云上,@web
别名确保是每个 HTTP 上下文的正确环境 URL,无论是 预览域名 还是 自定义域名。
@artifactBaseUrl
等同于 cloud.artifactUrl()
,这允许 项目配置 设置利用动态的、构建特定的 CDN URL。
配置
大多数配置(针对 Craft 和扩展本身)都直接通过云基础设施通过 环境覆盖 来处理。这些选项仅提供参考,并在平台外部的实用性有限。
这些选项也可以通过以 CRAFT_CLOUD_
开头的环境覆盖来设置。