Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
346 changes: 346 additions & 0 deletions .git-hooks-matomo/pre-push

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Plugins CI

on:
pull_request:
types: [opened, synchronize, reopened, edited]
push:
branches:
- '**.x-dev'
workflow_dispatch:

permissions:
actions: read
contents: read
pull-requests: read

jobs:
ci:
uses: matomo-org/plugin-ci-workflows/.github/workflows/plugin-ci.yml@main
with:
plugin-name: EnvironmentVariables
verify-hook: true
32 changes: 0 additions & 32 deletions .github/workflows/matomo-ai-checklist.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/weekly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Releases this plugin from its dev branch once a week when plugin.json carries an untagged version
# whose CHANGELOG.md entry is undated. The logic lives in matomo-org/plugin-ci-workflows; see the
# "Weekly release" section of its README.md.

name: Weekly release

on:
schedule:
# Monday, so the release is dated that Monday. Keeps the minute and hour of matomo-tests.yml's
# cron, so the fleet stays staggered across the window.
- cron: '25 5 * * 1'
workflow_dispatch:
inputs:
all-branches:
description: "Also release the other maintained branches, as the schedule does"
type: boolean
default: false

permissions: {}

jobs:
release:
# Granted here because permissions can only be reduced down a call chain, never elevated.
permissions:
actions: write
contents: write
pull-requests: write
uses: matomo-org/plugin-ci-workflows/.github/workflows/plugin-dev-release.yml@main

# A dispatched run must not dispatch again, or the branches would keep dispatching each other.
other-branches:
if: github.event_name == 'schedule' || inputs.all-branches
permissions:
actions: write
contents: read
uses: matomo-org/plugin-ci-workflows/.github/workflows/plugin-branch-sweep.yml@main
with:
workflow-file: weekly-release.yml
2 changes: 2 additions & 0 deletions EnvironmentVariables.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/

namespace Piwik\Plugins\EnvironmentVariables;

class EnvironmentVariables extends \Piwik\Plugin
Expand Down
13 changes: 13 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<ruleset name="environmentVariables" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">

<description>Matomo Coding Standard for EnvironmentVariables plugin</description>

<arg name="extensions" value="php" />

<file>.</file>

<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="Matomo"></rule>
</ruleset>
20 changes: 20 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
parameters:
level: 5
phpVersion: 70200
tmpDir: /tmp/phpstan/EnvironmentVariables/main
paths:
- .
excludePaths:
analyseAndScan:
- tests/*
# The shared workflow leaves this helper checkout in the workspace, and `paths: .`
# would otherwise analyse it as if it were plugin code.
- github-action-tests/*
bootstrapFiles:
- ../../bootstrap-phpstan.php
universalObjectCratesClasses:
- Piwik\Config
- Piwik\View
- Piwik\ViewDataTable\Config
scanDirectories:
- ../../
6 changes: 6 additions & 0 deletions phpstan/phpstan.created.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
includes:
- ../phpstan.neon
parameters:
# new files carry no pre-existing debt, so hold them to the strictest level
level: 9
tmpDir: /tmp/phpstan/EnvironmentVariables/created
5 changes: 5 additions & 0 deletions phpstan/phpstan.modified.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
includes:
- ../phpstan.neon
parameters:
level: 5
tmpDir: /tmp/phpstan/EnvironmentVariables/modified
Loading