summaryrefslogtreecommitdiff
path: root/modules_v4
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-03-09 13:52:42 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-03-09 13:52:42 +0000
commita582139fd575cfa132a7dd67177bea3928130f5c (patch)
tree7cd86d488ddf5ad4dd1211565dab6358c5755088 /modules_v4
parentbb308685a9a187caef9fc8f0731a4569ea1a3f22 (diff)
downloadwebtrees-a582139fd575cfa132a7dd67177bea3928130f5c.tar.gz
webtrees-a582139fd575cfa132a7dd67177bea3928130f5c.tar.bz2
webtrees-a582139fd575cfa132a7dd67177bea3928130f5c.zip
Add more fixes to server-config example module
Diffstat (limited to 'modules_v4')
-rw-r--r--modules_v4/example-server-configuration.disable/module.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules_v4/example-server-configuration.disable/module.php b/modules_v4/example-server-configuration.disable/module.php
index d8e8a21eaf..1649480480 100644
--- a/modules_v4/example-server-configuration.disable/module.php
+++ b/modules_v4/example-server-configuration.disable/module.php
@@ -7,6 +7,7 @@ use Fisharebest\Webtrees\Module\ModuleCustomInterface;
use Fisharebest\Webtrees\Module\ModuleCustomTrait;
use Fisharebest\Webtrees\Services\ServerCheckService;
use Illuminate\Database\Capsule\Manager as DB;
+use function realpath;
/**
* An example module to modify PHP and database configuration.
@@ -70,6 +71,10 @@ return new class extends AbstractModule implements ModuleCustomInterface {
$this->phpTimeLimit();
}
+ if (!$this->server_check_service->isFunctionDisabled('putenv')) {
+ $this->phpEnvironment();
+ }
+
if (DB::connection()->getDriverName() === 'mysql') {
$this->mysql();
}
@@ -91,6 +96,21 @@ return new class extends AbstractModule implements ModuleCustomInterface {
}
/**
+ * Modify the PHP environment variables.
+ */
+ private function phpEnvironment(): void
+ {
+ // Some servers block access to the system temporary folder using open_basedir...
+ //
+ // Create a temporary folder somewhere we have read/write access, and tell PHP to use it.
+ //$tmp = __DIR__ . '/../../data/tmp';
+ //if (!is_dir($tmp)) {
+ // mkdir($tmp);
+ //}
+ //putenv('TMPDIR=' . $tmp);
+ }
+
+ /**
* Modify the PHP.INI settings.
*/
private function phpIni(): void