Set up a development environment with the latest Cerb build #12
Closed
jstanden
started this conversation in
Guides and Tutorials
Replies: 1 comment
-
We now recommend using our preconfigured Docker container instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
You can test the latest build of Cerb (or any former version) in a development environment.
This is currently the best way to help test Cerb 10.0.
Requirements
You'll need:
When possible, use a package manager like Homebrew on macOS, or apt/yum on Linux.
Installation
Database
Log in to the MySQL console (or use a tool like phpMyAdmin).
Create a new database
Create a new user
Grant permissions
Filesystem
Create a directory
Choose a location on your filesystem to install Cerb. This doesn't need to be in a web server path since we'll be using the built-in PHP webserver.
mkdir -p /path/to/cerb/ cd /path/to/cerb/
Download the files from GitHub
The
jstanden/cerb
GitHub repository is for development builds, whilecerb/cerb-release
has stable releases.Install Cerb using Git:
git clone https://github.com/jstanden/cerb.git cerb cd cerb
Install dependencies
The
cerb/cerb-release
repository includes dependencies, but withjstanden/cerb
you'll need to install them yourself.Use Composer to install the dependencies:
Run the unit tests
You can run the unit tests to verify your environment is configured properly.
composer test
Start the built-in PHP webserver
You don't need Nginx, Apache, or IIS in a development environment. You can use the built-in PHP webserver.
Run the guided installer
Open a web browser and navigate to: http://localhost:8080/
Run through the guided installer.
Database
When prompted for the database details:
localhost
(or your external hostname)cerb_dev
cerb_dev
s3cr3t
(or whatever password you set up earlier)Outgoing mail
When prompted for outgoing mail details, you can select None for Mail Transport. This will prevent your development environment from sending live email.
Packages
When prompted for a package, select Demo.
Log in
At the end of the installer you'll be redirected to the login form. Use the new user you created during installation.
You're now ready to start testing and development! You can run through the guides and tutorials for ideas.
Sharing access to development with ngrok
During development and testing you may need to share access to your development environment.
For instance, you may need to test single sign-on (SSO) functionality, use an OAuth2-based connected service, or test webhooks.
We recommend using ngrok in these situations.
Once ngrok is installed, you can create a temporary URL with SSL support to share with this command:
Your URL will look like
https://a1b2c3d4e5f6.ngrok.io/
and you can use it like normal in place oflocalhost
. Keep in mind it's a temporary URL meant to be used briefly for testing. The next time you start ngrok you'll get a different random URL.Recommendations
If you decide to work with the code, we highly recommend using phpStorm as your editor.
Beta Was this translation helpful? Give feedback.
All reactions