From 9d43c00fee1e7cc05a96b1e7bf517aeffbeaebe8 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 12 May 2023 06:27:35 -0700 Subject: [PATCH] Trivial Updates Signed-off-by: Matt Friedman --- .github/workflows/tests.yml | 52 +++++++++++++++++---------- config/location.yml | 3 +- controller/visual_demo_controller.php | 6 ++-- 3 files changed, 38 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1bb991c6..ebebc646 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,11 +21,11 @@ on: jobs: # START Basic Checks Job (EPV, code sniffer, images check, etc.) basic-checks: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: include: - - php: '7.1' + - php: '7.2' db: "none" NOTESTS: 1 @@ -33,14 +33,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -89,7 +89,7 @@ jobs: # START MySQL and MariaDB Job mysql-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: include: @@ -125,6 +125,8 @@ jobs: db: "mysql:5.7" - php: '8.1' db: "mysql:5.7" + - php: '8.2' + db: "mysql:5.7" name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} @@ -154,14 +156,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -170,7 +172,7 @@ jobs: MATRIX_DB: ${{ matrix.db }} run: | db=$(echo "${MATRIX_DB%%:*}") - echo "::set-output name=db::$db" + echo "db=$db" >> $GITHUB_OUTPUT - name: Setup PHP if: ${{ matrix.COVERAGE != 1 }} @@ -231,14 +233,14 @@ jobs: - name: Send code coverage if: ${{ matrix.COVERAGE == 1 }} - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: - file: ./phpBB3/build/logs/clover.xml + files: ./phpBB3/build/logs/clover.xml # END MySQL and MariaDB Job # START PostgreSQL Job postgres-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: include: @@ -254,6 +256,20 @@ jobs: db: "postgres:12" - php: '7.1' db: "postgres:13" + - php: '7.2' + db: "postgres:13" + - php: '7.3' + db: "postgres:13" + - php: '7.4' + db: "postgres:13" + - php: '8.0' + db: "postgres:12" + - php: '8.0' + db: "postgres:13" + - php: '8.1' + db: "postgres:14" + - php: '8.2' + db: "postgres:14" name: PHP ${{ matrix.php }} - ${{ matrix.db }} @@ -285,14 +301,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -301,7 +317,7 @@ jobs: MATRIX_DB: ${{ matrix.db }} run: | db=$(echo "${MATRIX_DB%%:*}") - echo "::set-output name=db::$db" + echo "db=$db" >> $GITHUB_OUTPUT - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -338,7 +354,7 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: include: @@ -380,14 +396,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -401,7 +417,7 @@ jobs: else db=$(echo "${MATRIX_DB%%:*}") fi - echo "::set-output name=db::$db" + echo "db=$db" >> $GITHUB_OUTPUT - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/config/location.yml b/config/location.yml index 7dd05e98..c714b749 100644 --- a/config/location.yml +++ b/config/location.yml @@ -105,9 +105,8 @@ services: phpbb.ads.location.type.pop_up: class: phpbb\ads\location\type\pop_up + parent: phpbb.ads.location.type.base arguments: - - '@user' - - '@language' - '@request' - '@config' - '@template' diff --git a/controller/visual_demo_controller.php b/controller/visual_demo_controller.php index 491abe27..dfc0ea00 100644 --- a/controller/visual_demo_controller.php +++ b/controller/visual_demo_controller.php @@ -61,7 +61,7 @@ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config * * @param string $action enable|disable * @return \Symfony\Component\HttpFoundation\JsonResponse - * @throws \phpbb\exception\http_exception An http exception + * @throws \phpbb\exception\http_exception http exception */ public function handle($action) { @@ -81,7 +81,7 @@ public function handle($action) { // Create our cookie and send user to the index page. $this->user->set_cookie('phpbb_ads_visual_demo', time(), 0); - $redirect = "{$this->root_path}index.{$this->php_ext}"; + $redirect = "{$this->root_path}index.$this->php_ext"; } // Send a JSON response if an AJAX request was used @@ -96,7 +96,7 @@ public function handle($action) $redirect = reapply_sid($redirect); redirect($redirect); - // We shouldn't get here, but throw an http exception just in case + // We shouldn't get here, but throw http exception just in case throw new \phpbb\exception\http_exception(500, 'GENERAL_ERROR'); } }