This is an example configuration for DDEV to provide a development environment for a single TYPO3 CMS extension.
It also provides a very basic skeleton of a TYPO3 extension, which automatically gets installed in all TYPO3 versions, installed.
Currently, the following versions are supported:
- TYPO3 9.5 LTS
- TYPO3 10.4 LTS
- TYPO3 11.x
If you are looking for TYPO3 8, you can check out this old version.
- Copy the entire
.ddevfolder to your project's root - Search and replace in all files within
.ddev- search for
my_extand replace with your extension key - search for
my-extand replace with your DDEV sitename (used in URL)
- search for
- Change the package name
vendor/my-extin rootcomposer.jsonas well as in environment section in.ddev/docker-compose.web.yamlfile (variablePACKAGE_NAME).
When done with renaming, the following files have been touched:
.ddev/apache/apache-site.confto set ServerAlias in vhost.ddev/web-build/Dockerfilecreates initial index.html files.ddev/docker-compose.web.yamlto define environment variables and Docker volumes.ddev/config.yamlto set DDEV sitename and additional hostnamescomposer.jsonthe package name of your extension
You can check the final result in your version control system and share it with your collaborators, which can use it instantly.
The following software is required to be installed on the host machine:
- Docker
- Docker Compose
- DDEV
Also, an internet connection is required, to fetch containers and packages. Once the environment is installed, no internet connection is required anymore.
Check out your project, with .ddev folder in it and perform a
$ ddev start
on CLI. This will start the containers, but will not install anything automatically.
This environment offers four scripts, to provision the web container, supporting the following TYPO3 versions:
$ ddev install-v9
$ ddev install-v10
$ ddev install-v11
To install all at once, you can also use
$ ddev install-all
When the installation is done, you can access an overview here:
The TYPO3 installations are available here:
- https://v9.my-ext.ddev.site/typo3/
- https://v10.my-ext.ddev.site/typo3/
- https://v11.my-ext.ddev.site/typo3/
Note: Replace my-ext with your DDEV sitename
When you get the following error
bash: ./install-v10: /bin/bash^M: bad interpreter: No such file or directory
your host system is probably Windows based. This issue occurs, when the shell
scripts got wrong line endings (wrong: CRLF, correct: LF). On Windows, Git changes
the line-endings by default, if git config core.autocrlf is not set to false.
In this case, check the file .ddev/apache/apache-site.conf and replace
$WEBSERVER_DOCROOT with /var/www/html.
Then, perform ddev restart and it should work again.
When you check out this project now, the adjustment has been already applied.
All versions got the same credentials set:
- Username:
admin - Password:
password(also in install tool)
To access TYPO3's CLI tools you can utilize ddev exec like that:
$ ddev exec v10/vendor/bin/typo3
$ ddev exec v10/vendor/bin/typo3cms
Note: Replace v10 with the version you want to address
Every extension should have proper documentation, which can get hosted on https://docs.typo3.org. To render and view the documentation locally, you can use:
$ ddev docs
$ ddev launch-docs
When you want to reset a project, don't forget to remove the volumes, after removing the containers:
$ ddev rm -O -R
$ docker volume rm my-ext-v9-data my-ext-v10-data my-ext-v11-data
Note: Replace my-ext with your DDEV sitename
or perform this command:
$ ddev reset
and confirm with y.
Feel free to open new issues on Github:
https://github.com/a-r-m-i-n/ddev-for-typo3-extensions/issues
If you like this project, feel free to donate some funds to support further development.
If you are a developer and you want to submit improvements as code, you can fork this repo and make a pull request to the master branch.
Thanks!