craftcms / cloud
Installs: 3 477
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 6
Type:yii2-extension
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.5
- 2.6.4
- 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.62.1
- 1.62.0
- 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/log-command-time
- dev-bugfix/special-chars-in-path
- dev-bugfix/special-chars-in-path-2x
- dev-bugfix/support-webp
- 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-10-03 17:29:14 UTC
README
Craft Cloud Extension
Welcome to Craft Cloud!
This repository contains source code for the craftcms/cloud
Composer package, which is required to run a Craft project on our first-party hosting platform, Craft Cloud.
When installed, the extension automatically bootstraps itself and makes necessary application configuration changes for the detected environment:
- 🌩️ Cloud: There’s no infrastructure settings to worry about—database, queue, cache, and session configuration is handled for you.
- đź’» Local development: Craft runs normally, in your favorite development environment.
✨ To learn more about Cloud, check out our website—or dive right in with Craft Console. Interested in everything the extension does to get your app ready for Cloud? Read our Cloud extension deep-dive, in the knowledge base.
Installation
The Cloud extension can be installed in any existing Craft 4.6+ project by running php craft setup/cloud
. Craft will add the craftcms/cloud
package and run the extension’s own setup wizard.
Tip
This process includes the creation of a craft-cloud.yaml
configuration file which helps Cloud understand your project’s structure and determines which versions of PHP and Node your project will use during builds and at runtime.
When you deploy a project to Cloud, the cloud/up
command will run, wrapping Craft’s built-in up
command and adding the cache and session tables (if they’re not already present).
Filesystem
When setting up your project’s assets, use the provided Craft Cloud filesystem type. Read more about managing assets in Cloud projects.
Developer Features
Template Helpers
cloud.artifactUrl()
Generates a URL to a resource that was uploaded to the CDN during the build and deployment process.
{# 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' %}
Read more about how to use artifact URLs.
cloud.isCraftCloud
true
when the app detects it is running on Cloud infrastructure, false
otherwise.
{% if cloud.isCraftCloud %} Welcome to Cloud! {% endif %}
Aliases
The following aliases are available, in addition to those provided by Craft.
@web
On Cloud, the @web
alias is guaranteed to be the correct environment URL for each HTTP context, whether that be a preview domain or custom domain.
@artifactBaseUrl
Equivalent to cloud.artifactUrl()
, this allows Project Config settings to take advantage of dynamic, build-specific CDN URLs.
Configuration
Most configuration (to Craft and the extension itself) is handled directly by Cloud infrastructure, through environment overrides. These options are provided strictly for reference, and have limited utility outside the platform.
These options can also be set via environment overrides beginning with CRAFT_CLOUD_
.