1# Contrib
2
3## Info
4
5### Main Class
6
7The main entrypoint is the [docustom.php action script](action/docustom.php). ie
8(ie a `do` custom action) that takes over action such as `show` (default).
9
10### Dependencies Declaration
11
12The dependencies are not in [plugins info](plugin.info.txt) but online in the `dependents`
13property of the [Combo Plugin page](https://www.dokuwiki.org/plugin:combo)
14
15It's used by the [new installer](https://www.patreon.com/posts/new-extension-116501986)
16
17## How To
18### How to install a new Laptop Dev Environment
19
20* Install php7.4 on debian with
21  the [sury repo](https://github.com/oerdnj/deb.sury.org/wiki/Frequently-Asked-Questions#how-to-enable-the-debsuryorg-repository)
22* https://packages.sury.org/php/pool/main/p/php7.4/
23
24```bash
25curl -sSL https://packages.sury.org/php/README.txt | sudo bash -x
26sudo apt update
27sudo apt install -y php7.4 \
28  php7.4-mbstring \
29  php7.4-xml \
30  php7.4-gd \
31  php7.4-intl \
32  php7.4-curl \
33  php7.4-xdebug
34# openssl not found
35# curl is needed for snapshot
36# pdo-sqlite seems to be installed with php7.4
37which php7.4 # /usr/bin/php7.4
38# ini
39cat /etc/php/7.4/cli/php.ini
40cat /etc/php/7.4/mods-available/xdebug.ini
41```
42
43* Clone Dokuwiki to get:
44    * the base `_test\core\DokuWikiTest` class
45    * and `_test\phpunit.xml`
46
47```bash
48git clone https://github.com/dokuwiki/dokuwiki combo
49cd combo
50```
51
52* Clone Combo
53
54```bash
55cd dokuwiki_home/lib/plugins/
56git clone git@github.com:ComboStrap/combo
57```
58
59* Clone the dependent plugins found in [requirements](requirements.txt)
60
61```bash
62cd dokuwiki_home/lib/plugins/
63git clone https://github.com/cosmocode/sqlite sqlite
64git clone https://github.com/michitux/dokuwiki-plugin-move/ move
65git clone https://github.com/dokufreaks/plugin-include include
66git clone https://github.com/tatewake/dokuwiki-plugin-googleanalytics googleanalytics
67git clone https://github.com/alexlehm/dokuwiki-plugin-gtm googletagmanager
68```
69
70* Clone the tests
71```bash
72cd dokuwiki_home/lib/plugins/combo
73git clone git@github.com:ComboStrap/combo_test.git _test
74```
75
76* Install Node dependency
77```bash
78cd dokuwiki_home/lib/plugins/combo
79npm install
80```
81
82* Install phpunit
83
84```bash
85cd dokuwiki_home/_test
86composer install
87```
88
89
90
91### Intellij Php WSL
92
93* Git
94    * add lib/plugins/combo as a registered root (Intellij> Version Control > Directory Mapping)
95    * Check that Set it as a source root
96
97Following [](https://www.jetbrains.com/help/phpstorm/how-to-use-wsl-development-environment-in-product.html#open-a-project-in-wsl)
98
99* Install the plugin PHP WSL Support
100* Add Php Cli Interpreter on WSL. Intellij > Settings > Php > Cli Interpreter
101* Firewall from an elevated PowerShell
102
103```powershell
104New-NetFirewallRule -DisplayName "WSL" -Direction Inbound  -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))"  -Action Allow
105Get-NetFirewallProfile -Name Public | Get-NetFirewallRule | where DisplayName -ILike "IntelliJ IDEA*" | Disable-NetFirewallRule
106```
107
108* Intellij > Settings > Php > Test Framework
109
110```yaml
111Use_autoloader: combo\_test\vendor\autoload.php
112Use_default_configuration_file: combo/_test/phpunit.xml
113Use_default_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php
114```
115
116* Intellij Test Runner Configuration
117
118```yaml
119Use_alternative_configuration_file: combo/_test/phpunit.xml
120Use_alternative_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php
121Interpreter_cli: use wsl
122Interpreter_options: |
123    # put this ip if you are not in mirrored mode and intellij keep using 127.0.0.1
124    -dxdebug.client_host=$(echo $(ip route list default | awk '{print $3}'))
125```
126
127
128## Start it
129
130```bash
131docker run \
132  --name combo \
133  -d \
134  -p 8082:80 \
135  --user 1000:1000 \
136  -e DOKU_DOCKER_ENV=dev \
137  -e DOKU_DOCKER_ACL_POLICY='public' \
138  -e DOKU_DOCKER_ADMIN_NAME='admin' \
139  -e DOKU_DOCKER_ADMIN_PASSWORD='welcome' \
140  -v $PWD:/var/www/html \
141  ghcr.io/combostrap/dokuwiki:php8.3-latest
142```
143
144
145## Release
146
147* Change the date in the [plugin.info](plugin.info.txt)
148* Commit
149* Create a Release on [GitHub](https://github.com/combostrap/combo/releases) that points to the release page of https://combostrap.com
150* Modify the pages
151  * https://www.dokuwiki.org/plugin:combo
152  * https://www.dokuwiki.org/template:strap
153
154