DistributedProofreaders / ppwb

Post Processor's Workbench
GNU General Public License v3.0
5 stars 6 forks source link

Use a config file to specify local settings #5

Closed cpeel closed 3 years ago

cpeel commented 3 years ago

Allow the working directory, and URL, to be defined in a config file. Provide documentation on how to specify the python instance used to run the python tooling, including info on using a virtualenv.

This does a couple of very useful things from a site deployment perspective:

  1. allows the use of a python virtualenv to run the python commands so that python packages don't need to be installed in the system python instance
  2. allows the working directory to be located outside of the code-space

In the config-dir sandbox, the following config.php file is used:

<?php
global $python_runner;
$python_runner = "./pyvenv-proxy.sh";

global $base_workdir;
$base_workdir = "/data/htdocs/d/ppwb";

global $base_workurl;
$base_workurl = "/d/ppwb";

This places the results on TEST in the /d directory with other dynamically-generated files.

asylumcs commented 3 years ago

I really like separating the working directory out. Always wanted to do that. Looks good to me.

cpeel commented 3 years ago

This was merged in manually. Not sure why github thinks there is a merge conflict.