APP_URL_APPEND must contain "/" at the beggining if is not empty

pull/2837/head
Julio Montoya 7 years ago
parent e512023f6f
commit bdff43374b
  1. 2
      .env.dist
  2. 3
      README.md
  3. 12
      assets/js/app.js
  4. 27
      composer.json
  5. 3
      config/packages/fos_js_routing.yaml
  6. 2
      config/routes/fos_js_routing.yaml
  7. 1
      config/services.yaml
  8. 1
      main/document/create_document.php
  9. 5
      main/inc/global.inc.php
  10. 2
      src/CoreBundle/Controller/IndexController.php
  11. 3660
      yarn.lock

@ -31,7 +31,7 @@ APP_SECRET=141af65f23c7935a37b504c422f113b0
APP_INSTALLED={{APP_INSTALLED}} APP_INSTALLED={{APP_INSTALLED}}
APP_ENCRYPT_METHOD={{APP_ENCRYPT_METHOD}} APP_ENCRYPT_METHOD={{APP_ENCRYPT_METHOD}}
APP_LOCALE=en APP_LOCALE=en
APP_URL_APPEND='{{APP_URL_APPEND}}' APP_URL_APPEND='{{APP_URL_APPEND}}' ## Example: '/chamilo2'
APP_MULTIPLE_ACCESS_URL='' APP_MULTIPLE_ACCESS_URL=''
###< chamilo ### ###< chamilo ###

@ -20,7 +20,6 @@ not in a sub folder inside a domain.
git clone https://github.com/chamilo/chamilo-lms.git chamilo2 git clone https://github.com/chamilo/chamilo-lms.git chamilo2
cd chamilo2 cd chamilo2
composer install (If composer asks to accept recipes, just press enter or "n") composer install (If composer asks to accept recipes, just press enter or "n")
php bin/console assets:install
php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
yarn install yarn install
yarn run encore dev yarn run encore dev
@ -40,6 +39,8 @@ chown -R www-data: public/ var/
If you have already installed it and just want to update it from Git, do: If you have already installed it and just want to update it from Git, do:
~~~~ ~~~~
git pull origin master git pull origin master
php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
yarn upgrade yarn upgrade
yarn encore dev yarn encore dev
composer update composer update

@ -8,15 +8,15 @@ require('./vendor');
require('./main'); require('./main');
// @todo rework url naming // @todo rework url naming
var homePublicUrl = Routing.generate('home') + 'public/'; const homePublicUrl = Routing.generate('home') + 'public/';
var legacyIndex = Routing.generate('legacy_index'); const legacyIndex = Routing.generate('legacy_index');
var mainUrl = Routing.generate('web.main'); const mainUrl = Routing.generate('web.main');
var webAjax = Routing.generate('web.ajax'); const webAjax = Routing.generate('web.ajax');
console.log(homePublicUrl); /*console.log(homePublicUrl);
console.log(legacyIndex); console.log(legacyIndex);
console.log(mainUrl); console.log(mainUrl);
console.log(webAjax); console.log(webAjax);*/
var ajax_url = webAjax + 'chat.ajax.php'; var ajax_url = webAjax + 'chat.ajax.php';
var online_button = '<img src="' + homePublicUrl + 'img/statusonline.png">'; var online_button = '<img src="' + homePublicUrl + 'img/statusonline.png">';

@ -183,25 +183,24 @@
"behat/mink-selenium2-driver": "@stable" "behat/mink-selenium2-driver": "@stable"
}, },
"scripts": { "scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script",
"requirements-checker": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
],
"pre-install-cmd": [ "pre-install-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x" "Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x"
], ],
"pre-update-cmd": [ "pre-update-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x" "Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x"
], ]
"post-install-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles"
],
"post-update-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles"
],
"auto-scripts": {
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script",
"requirements-checker": "script",
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
}
}, },
"repositories": [ "repositories": [
{ {

@ -1,3 +1,2 @@
fos_js_routing: fos_js_routing:
request_context_base_url: '/%url_append%' request_context_base_url: '%url_append%'
routes_to_expose: [home]

@ -1,2 +1,2 @@
fos_js_routing: fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" resource: "@FOSJsRoutingBundle/Resources/config/routing/routing-sf4.xml"

@ -97,6 +97,5 @@ parameters:
course_info_is_not_editable: false course_info_is_not_editable: false
sonata_media.cdn.host: '/%env(APP_URL_APPEND)%/public/resource' sonata_media.cdn.host: '/%env(APP_URL_APPEND)%/public/resource'
sonata_page.varnish.command: 'if [ ! -r "/etc/varnish/secret" ]; then echo "VALID ERROR :/"; else varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 {{ COMMAND }} "{{ EXPRESSION }}"; fi;' sonata_page.varnish.command: 'if [ ! -r "/etc/varnish/secret" ]; then echo "VALID ERROR :/"; else varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 {{ COMMAND }} "{{ EXPRESSION }}"; fi;'
# router.request_context.base_url: '%url_append%'
router.request_context.base_url: '%url_append%' router.request_context.base_url: '%url_append%'
asset.request_context.base_path: '%url_append%' asset.request_context.base_path: '%url_append%'

@ -515,6 +515,7 @@ if ($form->validate()) {
api_get_configuration_value('url_append').api_get_path(REL_COURSE_PATH), api_get_configuration_value('url_append').api_get_path(REL_COURSE_PATH),
$content $content
); );
$save_file_path = $dir.$filename.'.'.$extension; $save_file_path = $dir.$filename.'.'.$extension;
$document = DocumentManager::addDocument( $document = DocumentManager::addDocument(

@ -58,7 +58,10 @@ try {
$request->setBaseUrl($request->getRequestUri()); $request->setBaseUrl($request->getRequestUri());
$kernel->boot(); $kernel->boot();
if (!empty($append)) { if (!empty($append)) {
$append = "/$append/"; if (substr($append, 0, 1) !== '/') {
throw new Exception('APP_URL_APPEND must start with "/"');
}
$append = "$append/";
} }
$container = $kernel->getContainer(); $container = $kernel->getContainer();

@ -23,7 +23,7 @@ class IndexController extends BaseController
* *
* @return Response * @return Response
*/ */
public function indexAction(Request $request): Response public function indexAction(): Response
{ {
return $this->render( return $this->render(
'@ChamiloTheme/Index/index.html.twig', '@ChamiloTheme/Index/index.html.twig',

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save