Minor - fix main.js creation

pull/2624/head
Julio Montoya 7 years ago
parent 03d38db5c8
commit 178dfb9091
  1. 4
      .travis.yml
  2. 15
      main/inc/global.inc.php
  3. 4
      tests/travis/travis-apache

@ -95,7 +95,6 @@ before_install:
# Check the result of index.php and check if main.js is build in travis
- curl $VHOST_URL
- ls -la web/build
- sudo ls /var/log/apache2/
script:
- whereis google-chrome-stable
@ -108,6 +107,9 @@ script:
# - sudo cat /var/log/apache2/$VHOST_URL-access.log
after_failure:
- sudo apache2ctl -M
- sudo cat /var/log/apache2/error.log
# configure notifications (email, IRC, campfire etc)
notifications:

@ -638,14 +638,19 @@ define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
define('PCLZIP_TEMPORARY_DIR', api_get_path(SYS_ARCHIVE_PATH));
// Create web/build/main.js
if (!is_dir(api_get_path(SYS_PUBLIC_PATH).'build')) {
mkdir(api_get_path(SYS_PUBLIC_PATH).'build');
$webBuildPath = api_get_path(SYS_PUBLIC_PATH).'build/';
if (!is_dir($webBuildPath)) {
if (!mkdir($webBuildPath, api_get_permissions_for_new_directories())) {
error_log(
'Error: '.$webBuildPath.' could not be written. Please check permissions.'
);
}
}
// Load template layout/main.js.tpl and save it into web/build/main.js
$file = api_get_path(SYS_PUBLIC_PATH).'build/main.js';
$file = $webBuildPath.'main.js';
if (!empty($language_interface)) {
$file = api_get_path(SYS_PUBLIC_PATH).'build/main.'.$language_interface.'.js';
$file = $webBuildPath.'main.'.$language_interface.'.js';
}
// if portal is in test mode always generate the file
@ -654,7 +659,7 @@ if (!file_exists($file) || api_get_setting('server_type') === 'test') {
// Force use of default to avoid problems
$tpl = 'default/layout/main.js.tpl';
$contents = $template->fetch($tpl);
if (is_writable($file)) {
if (is_writable($webBuildPath)) {
file_put_contents($file, $contents);
} else {
error_log(

@ -8,9 +8,9 @@
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/%VHOST_URL%-error.log
#ErrorLog ${APACHE_LOG_DIR}/%VHOST_URL%-error.log
LogLevel notice
CustomLog ${APACHE_LOG_DIR}/%VHOST_URL%-access.log combined
#CustomLog ${APACHE_LOG_DIR}/%VHOST_URL%-access.log combined
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php

Loading…
Cancel
Save