Formulize can be run locally using Docker containers. Among other things, this makes local debugging with XDebug very easy.
Find this file in your repository: /docker/maraidb/conf.d/lower_case_table_names.cnf.windows
Copy or rename it to: /docker/maraidb/conf.d/lower_case_table_names.cnf
ie: Remove the .windows
part on the end.
make the file read-only (if it is writable, MariaDB will ignore it).
Next, you might want to look at the step-by-step instructions for setting up Formulize and Docker in VS Code on Windows.
git checkout -b my-formulize-branch monastery
docker compose up
Browse to http://localhost:8080 to access Formulize. Login with:
The official Formulize release packages, and the master
branch, are ready for installation on a web server. If you use one of those, you will need to go through the installer in order to setup Formulize.
The monastery
branch is a working Formulize system, ready to use. It has no forms or users, it is empty, but the installer has already been run. It is generally a better place to start for local development and testing.
If you have a copy of files from an existing Formulize website, you could use those too. However, you would need to have a SQL dump of the database from that website in order to load it up properly inside Docker.
Checkout the monastery
branch.
Make your own copy of the branch, if you intend to do work and keep track of changes, start a pull request, etc.
Run docker compose up
, or right click on the docker-compose.yaml file in your IDE, etc
Browse to http://localhost:8080
Login with:
Checkout the monastery
branch.
Make a new branch, if you intend to do work and keep track of changes, start a pull request, etc.
Run docker compose up
, or right click on the docker-compose.yaml file in your IDE, etc
Browse to http://localhost:8080
Follow the steps for going through the installer in order to setup Formulize.
Checkout the monastery
branch
Make a new branch, if you intend to do work and keep track of changes, start a pull request, etc.
Delete any database in docker/mariadb/data/
folder, other than the .gitignore file
. (These files will be the database from the last time you ran the monastery
branch in Docker. You may want to save a back up of these files!)
Download a dump of the entire database from the live website. Make sure it includes commands to create the tables. Make sure it is using the UTF-8 character set. Make sure it ends with a .sql
extension.
Place the database dump in the docker/mariadb/seed/
folder. Delete any other .sql
files in that folder.
mainfile.php
in the root of your website and look for code like this near the top:
define( 'XOOPS_TRUST_PATH', '/var/www/mysite.com/sadg876kjhg89' );
include_once XOOPS_TRUST_PATH . '/r87678sd908asdf48ffecfbfd223af293d.php' ;
Open the trust path file, and note the SDATA_DB_PREFIX
and SDATA_DB_SALT
values
In your local Formulize, open up the file: trust/e039c9b9cb48ffecfbfd223af293d984.php
and change the value of SDATA_DB_PREFIX
and SDATA_DB_SALT
to match the values sepecified in the trust path file in your live site.
If your site uses any custom code files or has made changes to core Formulize files, or has extra files of its own, you need to download/recreate those files and changes in the local repository.
Run docker compose up
, or right click on the docker-compose.yaml file in your IDE, etc
The webroot is the root of the repository. The full path to this folder within the Docker environment is /var/www/html
The trust path is the /trust/
folder in the root of the repository. This is the folder where the database credentials are stored. The full path to this folder within the running Docker environment is /var/www/trust
The database location is mariadb. The database is not running on localhost
The database name is formulize
The database username and password are user and password
If you’re running the monastery
branch, you can login to your local Formulize with:
There is a docker-compose.yaml
file in the root of the respository.
There is a docker
folder that contains a Dockerfile
, and a php
folder with .ini
files in it, and a mariadb
folder with the database in it. The database persists between Docker sessions.
You can delete the contents of the docker/mariadb/data
folder to erase the database and start over. (Pro tip: don’t delete the .gitignore file in there!)
The docker/mariadb/seed
folder can contain .sql
files which Docker will execute when it first sets up the database. If there is an existing database, the docker/mariadb/seed
folder is ignored. It can take a little while for the .sql
files to be processed, depending on their size and the speed of your computer!
The URL for accessing the Docker container is http://localhost:8080