Skip to content

Commit

Permalink
Check PHP format only for PHP formatted strings (#85)
Browse files Browse the repository at this point in the history
* Allow debugging Vue components by setting COMTRA_VUE_DEBUG env var

* Check PHP format only for PHP formatted strings

* Require PHP 8.1+

* Test for PHP syntax
  • Loading branch information
mlocati authored Sep 26, 2024
1 parent 5f1c2f2 commit 34b304e
Show file tree
Hide file tree
Showing 9 changed files with 12,050 additions and 24 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,38 @@ on:
- push

jobs:

check-php-syntax:
name: Check PHP Syntax
runs-on: ubuntu-latest
steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: opcache
coverage: none
tools: none
-
name: Checkout
uses: actions/checkout@v4
-
name: Check syntax
uses: mlocati/check-php-syntax@v1

docker:
name: Tests in docker
runs-on: ubuntu-latest
container: ghcr.io/concrete5-community/docker5:9
steps:
-
name: Prepare enviro
run: switch-composer 2
run: |
switch-composer 2
composer --version
switch-php 8.1
php --version
-
name: Checkout
uses: actions/checkout@v4
Expand All @@ -31,7 +55,7 @@ jobs:
run: ccm-service start db web
-
name: Check PHP Coding style
run: /app/concrete/bin/concrete5 --ansi --no-interaction -v c5:phpcs check --no-cache --php=7.4 /app/packages/community_translation
run: /app/concrete/bin/concrete5 --ansi --no-interaction -v c5:phpcs check --no-cache --php=8.1 /app/packages/community_translation
-
name: Install package
run: sudo -u www-data /app/concrete/bin/concrete5 --ansi --no-interaction c5:package:install community_translation
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"source" : "https://github.com/concretecms/addon_community_translation"
},
"require": {
"php": "^7.4 || ^8",
"php": "^8.1",
"concrete5/core": "^9.0.3a1"
},
"config": {
Expand Down
3 changes: 3 additions & 0 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ private function registerCLICommands(): void
private function registerAssets(): void
{
$al = AssetList::getInstance();
if (!empty($_ENV['COMTRA_VUE_DEBUG'])) {
$al->register('javascript', 'vue', 'js/vue.unminified.js', ['minify' => false, 'combine' => false, 'version' => '2.999.999'], $this);
}
$al->registerMultiple([
'community_translation/table-sortable' => [
['css', 'css/table-sortable.css', ['minify' => false, 'combine' => true], $this],
Expand Down
2 changes: 1 addition & 1 deletion controllers/frontend/online_translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function load_translation($localeID): Response
}

return $rf->json(
$this->app->make(Editor::class)->getTranslatableData($locale, $translatable, $packageVersion, true)
$this->app->make(Editor::class)->getTranslatableData($locale, $translatable, $packageVersion)
);
} catch (UserMessageException $x) {
return $rf->json(
Expand Down
Loading

0 comments on commit 34b304e

Please sign in to comment.