Jump to content

Working with multiple projects


kaz
 Share

Recommended Posts

A question for the developers who work on multiple projects at the same time:

When working localhost on several projects at the same time, must the /wire folder be placed in the project folder for each project? Or is there a solution for developers that works by with a single /wire folder? Maybe a link in the config to a fixed /wire folder outside a respective project folder?
If the environment has anything in common with it: I use the MAMP PRO macOS development solution.

Link to comment
Share on other sites

99.9% of the time I use option #1 as detailed here, i.e. multiple sites with multiple databases AND ONE wire folder. Each site has its own database and /site/ directory (templates, modules, etc.). If I need a site (project) to be stand alone, I create the site separately with its own wire folder.

  • Like 1
Link to comment
Share on other sites

Another approach I use on my local dev environment, for completely unrelated projects on different hosts, is to simply symlink the 'wire' folder.

My Setup/Structure:

  • /www  <-- my localhost root (I'm using Laragon).
    • /processwire  <-- folder dedicated to ProcessWire projects.
      • /wire  <-- the ACTUAL location of the wire folder that the symlinks point to.
      • /project_a  <-- each separate project (treat this folder as the web root: http://project_a.localhost/ )
        • /site  <-- the project's ProcessWire /site folder
        • /wire  <--- this is a SYMLINK to the /www/processwire/wire folder
        • /.htaccess  <-- the ProcessWire .htaccess file.
        • /index.php  <-- the ProcessWire index.php file.
        • /...etc  <-- any other files that you'd put in the web root of a project (robots.txt etc).
      • /project_b  <-- same folder/file structure as above

When I want to update the ProcessWire version, I just download it and copy the 'wire' folder over into /www/processwire (I actually rename the old folder, copy over the new and check everything works before deleting the old folder).

Adding a New Project

My process for adding a new project, we'll call it 'project_c', is then:

  1. Create the project in the ProcessWire projects folder: /www/processwire/project_c
  2. Create a local url for the project (http://project_c.localhost/) and point it to the newly created folder above.
  3. In the 'project_c' folder, unpack a copy of ProcessWire (the same version as the current shared wire folder for simplicity).
  4. In the browser visit http://project_c.localhost/ and run the installer as usual (& create the DB).
  5. Once installed successfully, delete the /www/processwire/project_c/wire folder (or rename it and delete later if it all works ok) and create a symlink to the shared 'wire' folder.

The advantage of this for me, is that it does away with the need for naming the site folders 'site-project_a', 'site-project_b' etc.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...