Last active
August 17, 2021 18:59
-
-
Save Kevinlearynet/2f3d327d6c3c32e42a9f221822726761 to your computer and use it in GitHub Desktop.
Folderwave server setup related files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * FW Connector Config | |
| * | |
| * Add this to: /wordpress/wp-content/mu-plugins/fw-config.php | |
| */ | |
| $host = $_SERVER['SERVER_NAME']; | |
| $api_host = ($host === 'student.student-1.com') ? 'https://www17.student-1.com' : 'https://www46.student-1.com'; | |
| if (!defined('FW_ENV')) { | |
| if ($host === 'student.student-1.com') { | |
| define('FW_ENV', 'prod'); | |
| } elseif ($host === 'studenttest.student-1.com') { | |
| define('FW_ENV', 'test'); | |
| } else { | |
| define('FW_ENV', 'local'); | |
| } | |
| } | |
| if (!defined('APIHOST')) { | |
| define('APIHOST', $api_host); | |
| } | |
| if (!defined('APIPATH')) { | |
| $namespace = FW_ENV === 'prod' ? '_Live' : '_Test'; | |
| define('APINAMESPACE', APIHOST . "/VBRestServiceFWPath$namespace"); | |
| define('APIPATH', APINAMESPACE . "/RestServiceImpl.svc/"); | |
| } | |
| if (!defined('CALL_FW')) { | |
| define('CALL_FW', 'RldBVkVcTUVGQVN0dWRlbnRTZXJ2aWNlc1U6ODR4NFY3'); | |
| } | |
| if (!defined('PORTAL_DIR')) { | |
| if (FW_ENV === 'prod') { | |
| define('PORTAL_DIR', "E:/Program Files/Folderwave/FWPathPortal_Live"); | |
| } elseif (FW_ENV === 'test') { | |
| define('PORTAL_DIR', "E:/Program Files/Folderwave/FWPathPortal_Test"); | |
| } else { | |
| define('PORTAL_DIR', WP_CONTENT_DIR . '/uploads/tmp'); | |
| } | |
| } | |
| if (!defined('PORTAL_URL')) { | |
| if (FW_ENV === 'prod') { | |
| define('PORTAL_URL', "$api_host/FWPathPortal"); | |
| } else { | |
| define('PORTAL_URL', str_replace('https://', 'http://', "$api_host/FWPathPortal_Test")); | |
| } | |
| } | |
| // Debugging | |
| if (isset($_GET['config-test'])) { | |
| echo '<h2>Configuration Test</h2>'; | |
| echo '<pre>'; | |
| echo 'APIHOST: ' . APIHOST . PHP_EOL; | |
| echo 'APIPATH: ' . APIPATH . PHP_EOL; | |
| echo 'FW_ENV: ' . FW_ENV . PHP_EOL; | |
| echo 'CALL_FW: ' . CALL_FW; | |
| echo '</pre>'; | |
| exit; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment