xref: /plugin/combo/contrib.md (revision 91f20ee45197298be776d6046a62fc936a74cbed)
1f47bee6bSNicolas GERARD# Contrib
2f47bee6bSNicolas GERARD
3*91f20ee4SNicolas GERARD## Info
4*91f20ee4SNicolas GERARD
5*91f20ee4SNicolas GERARD### Main Class
6f47bee6bSNicolas GERARD
7f47bee6bSNicolas GERARDThe main entrypoint is the [docustom.php action script](action/docustom.php). ie
8f47bee6bSNicolas GERARD(ie a `do` custom action) that takes over action such as `show` (default).
9f47bee6bSNicolas GERARD
10*91f20ee4SNicolas GERARD### Dependencies Declaration
11*91f20ee4SNicolas GERARD
12*91f20ee4SNicolas GERARDThe dependencies are not in [plugins info](plugin.info.txt) but online in the `dependents`
13*91f20ee4SNicolas GERARDproperty of the [Combo Plugin page](https://www.dokuwiki.org/plugin:combo)
14*91f20ee4SNicolas GERARD
15*91f20ee4SNicolas GERARDIt's used by the [new installer](https://www.patreon.com/posts/new-extension-116501986)
16*91f20ee4SNicolas GERARD
17*91f20ee4SNicolas GERARD## How To
18*91f20ee4SNicolas GERARD### How to install a new Laptop Dev Environment
19f01167beSNicolas GERARD
20d8add9b6SNicolas GERARD* Install php7.4 on debian with
21d8add9b6SNicolas GERARD  the [sury repo](https://github.com/oerdnj/deb.sury.org/wiki/Frequently-Asked-Questions#how-to-enable-the-debsuryorg-repository)
22b9ba2b0cSNicolas GERARD* https://packages.sury.org/php/pool/main/p/php7.4/
23d8add9b6SNicolas GERARD
24b9ba2b0cSNicolas GERARD```bash
25b9ba2b0cSNicolas GERARDcurl -sSL https://packages.sury.org/php/README.txt | sudo bash -x
26b9ba2b0cSNicolas GERARDsudo apt update
27b9ba2b0cSNicolas GERARDsudo apt install -y php7.4 \
28b9ba2b0cSNicolas GERARD  php7.4-mbstring \
29b9ba2b0cSNicolas GERARD  php7.4-xml \
30b9ba2b0cSNicolas GERARD  php7.4-gd \
31b9ba2b0cSNicolas GERARD  php7.4-intl \
32d8add9b6SNicolas GERARD  php7.4-curl \
33d8add9b6SNicolas GERARD  php7.4-xdebug
34b9ba2b0cSNicolas GERARD# openssl not found
35d8add9b6SNicolas GERARD# curl is needed for snapshot
36d8add9b6SNicolas GERARD# pdo-sqlite seems to be installed with php7.4
37d8add9b6SNicolas GERARDwhich php7.4 # /usr/bin/php7.4
38b9ba2b0cSNicolas GERARD# ini
39b9ba2b0cSNicolas GERARDcat /etc/php/7.4/cli/php.ini
40b9ba2b0cSNicolas GERARDcat /etc/php/7.4/mods-available/xdebug.ini
41b9ba2b0cSNicolas GERARD```
42f01167beSNicolas GERARD
43f01167beSNicolas GERARD* Clone Dokuwiki to get:
44f01167beSNicolas GERARD    * the base DokuWikiTest class
45f01167beSNicolas GERARD    * and `_test\phpunit.xml`
46d8add9b6SNicolas GERARD
47f01167beSNicolas GERARD```bash
48f01167beSNicolas GERARDgit clone https://github.com/dokuwiki/dokuwiki combo
49f01167beSNicolas GERARDcd combo
50f01167beSNicolas GERARD```
51d8add9b6SNicolas GERARD
52f01167beSNicolas GERARD* Clone Combo
53d8add9b6SNicolas GERARD
54f01167beSNicolas GERARD```bash
55d8add9b6SNicolas GERARDcd dokuwiki_home/lib/plugins/
56f01167beSNicolas GERARDgit clone git@github.com:ComboStrap/combo
57f01167beSNicolas GERARD```
58d8add9b6SNicolas GERARD
59d8add9b6SNicolas GERARD* Clone the dependent plugins found in [requirements](requirements.txt)
60d8add9b6SNicolas GERARD
61d8add9b6SNicolas GERARD```bash
62d8add9b6SNicolas GERARDcd dokuwiki_home/lib/plugins/
63d8add9b6SNicolas GERARDgit clone https://github.com/cosmocode/sqlite sqlite
64d8add9b6SNicolas GERARDgit clone https://github.com/michitux/dokuwiki-plugin-move/ move
65d8add9b6SNicolas GERARDgit clone https://github.com/dokufreaks/plugin-include include
66d8add9b6SNicolas GERARDgit clone https://github.com/tatewake/dokuwiki-plugin-googleanalytics googleanalytics
67d8add9b6SNicolas GERARDgit clone https://github.com/alexlehm/dokuwiki-plugin-gtm googletagmanager
68d8add9b6SNicolas GERARD```
69d8add9b6SNicolas GERARD
70f01167beSNicolas GERARD* Clone the tests
71f01167beSNicolas GERARD```bash
72d8add9b6SNicolas GERARDcd dokuwiki_home/lib/plugins/combo
73f01167beSNicolas GERARDgit clone git@github.com:ComboStrap/combo_test.git _test
74f01167beSNicolas GERARD```
75d8add9b6SNicolas GERARD
76d8add9b6SNicolas GERARD* Install Node dependency
77f01167beSNicolas GERARD```bash
78d8add9b6SNicolas GERARDcd dokuwiki_home/lib/plugins/combo
79d8add9b6SNicolas GERARDnpm install
80d8add9b6SNicolas GERARD```
81d8add9b6SNicolas GERARD
82d8add9b6SNicolas GERARD* Install phpunit
83d8add9b6SNicolas GERARD
84d8add9b6SNicolas GERARD```bash
85d8add9b6SNicolas GERARDcd dokuwiki_home/_test
86f01167beSNicolas GERARDcomposer install
87f01167beSNicolas GERARD```
88f01167beSNicolas GERARD
89d8add9b6SNicolas GERARD
90d8add9b6SNicolas GERARD
91f01167beSNicolas GERARD### Intellij Php WSL
92f01167beSNicolas GERARD
93d8add9b6SNicolas GERARD* Git
94d8add9b6SNicolas GERARD    * add lib/plugins/combo as a registered root (Intellij> Version Control > Directory Mapping)
95d8add9b6SNicolas GERARD    * Check that Set it as a source root
96f01167beSNicolas GERARD
97f01167beSNicolas GERARDFollowing [](https://www.jetbrains.com/help/phpstorm/how-to-use-wsl-development-environment-in-product.html#open-a-project-in-wsl)
98f01167beSNicolas GERARD
99f01167beSNicolas GERARD* Install the plugin PHP WSL Support
100f01167beSNicolas GERARD* Add Php Cli Interpreter on WSL. Intellij > Settings > Php > Cli Interpreter
101f01167beSNicolas GERARD* Firewall from an elevated PowerShell
102d8add9b6SNicolas GERARD
103f01167beSNicolas GERARD```powershell
104f01167beSNicolas GERARDNew-NetFirewallRule -DisplayName "WSL" -Direction Inbound  -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))"  -Action Allow
105f01167beSNicolas GERARDGet-NetFirewallProfile -Name Public | Get-NetFirewallRule | where DisplayName -ILike "IntelliJ IDEA*" | Disable-NetFirewallRule
106f01167beSNicolas GERARD```
107d8add9b6SNicolas GERARD
108f01167beSNicolas GERARD* Intellij > Settings > Php > Test Framework
109d8add9b6SNicolas GERARD
110f01167beSNicolas GERARD```yaml
111b9ba2b0cSNicolas GERARDUse_autoloader: combo\_test\vendor\autoload.php
112f01167beSNicolas GERARDUse_default_configuration_file: combo/_test/phpunit.xml
113f01167beSNicolas GERARDUse_default_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php
114f01167beSNicolas GERARD```
115d8add9b6SNicolas GERARD
116f01167beSNicolas GERARD* Intellij Test Runner Configuration
117d8add9b6SNicolas GERARD
118f01167beSNicolas GERARD```yaml
119f01167beSNicolas GERARDUse_alternative_configuration_file: combo/_test/phpunit.xml
120f01167beSNicolas GERARDUse_alternative_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php
121b9ba2b0cSNicolas GERARDInterpreter_cli: use wsl
122b9ba2b0cSNicolas GERARDInterpreter_options: |
123b9ba2b0cSNicolas GERARD    # put this ip if you are not in mirrored mode and intellij keep using 127.0.0.1
124b9ba2b0cSNicolas GERARD    -dxdebug.client_host=$(echo $(ip route list default | awk '{print $3}'))
125f01167beSNicolas GERARD```
126