1f47bee6bSNicolas GERARD# Contrib 2f47bee6bSNicolas GERARD 3f47bee6bSNicolas GERARD 4f47bee6bSNicolas GERARD 5f47bee6bSNicolas GERARD## Main 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 10f47bee6bSNicolas GERARD 11f47bee6bSNicolas GERARD 12f01167beSNicolas GERARD 13f01167beSNicolas GERARD## Laptop Dev Installation Steps 14f01167beSNicolas GERARD 15*b9ba2b0cSNicolas GERARD* Install php7.4 on debian with the [sury repo](https://github.com/oerdnj/deb.sury.org/wiki/Frequently-Asked-Questions#how-to-enable-the-debsuryorg-repository) 16*b9ba2b0cSNicolas GERARD* https://packages.sury.org/php/pool/main/p/php7.4/ 17*b9ba2b0cSNicolas GERARD```bash 18*b9ba2b0cSNicolas GERARDcurl -sSL https://packages.sury.org/php/README.txt | sudo bash -x 19*b9ba2b0cSNicolas GERARDsudo apt update 20*b9ba2b0cSNicolas GERARDsudo apt install -y php7.4 \ 21*b9ba2b0cSNicolas GERARD php7.4-mbstring \ 22*b9ba2b0cSNicolas GERARD php7.4-xml \ 23*b9ba2b0cSNicolas GERARD php7.4-gd \ 24*b9ba2b0cSNicolas GERARD php7.4-intl \ 25*b9ba2b0cSNicolas GERARD php7.4-xdebug \ 26*b9ba2b0cSNicolas GERARD php7.4-sqlite3 27*b9ba2b0cSNicolas GERARD# openssl not found 28*b9ba2b0cSNicolas GERARDwhich php7.4 29*b9ba2b0cSNicolas GERARD# ini 30*b9ba2b0cSNicolas GERARDcat /etc/php/7.4/cli/php.ini 31*b9ba2b0cSNicolas GERARDcat /etc/php/7.4/mods-available/xdebug.ini 32*b9ba2b0cSNicolas GERARD``` 33f01167beSNicolas GERARD 34f01167beSNicolas GERARD* Clone Dokuwiki to get: 35f01167beSNicolas GERARD * the base DokuWikiTest class 36f01167beSNicolas GERARD * and `_test\phpunit.xml` 37f01167beSNicolas GERARD```bash 38f01167beSNicolas GERARDgit clone https://github.com/dokuwiki/dokuwiki combo 39f01167beSNicolas GERARDcd combo 40f01167beSNicolas GERARD``` 41f01167beSNicolas GERARD* Clone Combo 42f01167beSNicolas GERARD```bash 43f01167beSNicolas GERARDcd lib/plugins/ 44f01167beSNicolas GERARDgit clone git@github.com:ComboStrap/combo 45f01167beSNicolas GERARD``` 46f01167beSNicolas GERARD* Intellij 47f01167beSNicolas GERARD * add it as registered root (Intellij> Version Control > Directory Mapping) 48f01167beSNicolas GERARD * Set it as source root 49f01167beSNicolas GERARD* Clone the tests 50f01167beSNicolas GERARD```bash 51f01167beSNicolas GERARDcd combo 52f01167beSNicolas GERARDgit clone git@github.com:ComboStrap/combo_test.git _test 53f01167beSNicolas GERARD``` 54f01167beSNicolas GERARD* Install phpunit 55f01167beSNicolas GERARD```bash 56f01167beSNicolas GERARDcd dokuwiki/_test 57f01167beSNicolas GERARDcomposer install 58f01167beSNicolas GERARD``` 59f01167beSNicolas GERARD 60f01167beSNicolas GERARD### Intellij Php WSL 61f01167beSNicolas GERARD 62f01167beSNicolas GERARD 63f01167beSNicolas GERARDFollowing [](https://www.jetbrains.com/help/phpstorm/how-to-use-wsl-development-environment-in-product.html#open-a-project-in-wsl) 64f01167beSNicolas GERARD 65f01167beSNicolas GERARD* Install the plugin PHP WSL Support 66f01167beSNicolas GERARD* Add Php Cli Interpreter on WSL. Intellij > Settings > Php > Cli Interpreter 67f01167beSNicolas GERARD* Firewall from an elevated PowerShell 68f01167beSNicolas GERARD```powershell 69f01167beSNicolas GERARDNew-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))" -Action Allow 70f01167beSNicolas GERARDGet-NetFirewallProfile -Name Public | Get-NetFirewallRule | where DisplayName -ILike "IntelliJ IDEA*" | Disable-NetFirewallRule 71f01167beSNicolas GERARD``` 72f01167beSNicolas GERARD* Intellij > Settings > Php > Test Framework 73f01167beSNicolas GERARD```yaml 74*b9ba2b0cSNicolas GERARDUse_autoloader: combo\_test\vendor\autoload.php 75f01167beSNicolas GERARDUse_default_configuration_file: combo/_test/phpunit.xml 76f01167beSNicolas GERARDUse_default_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php 77f01167beSNicolas GERARD``` 78f01167beSNicolas GERARD* Intellij Test Runner Configuration 79f01167beSNicolas GERARD```yaml 80f01167beSNicolas GERARDUse_alternative_configuration_file: combo/_test/phpunit.xml 81f01167beSNicolas GERARDUse_alternative_bootstrap_file: combo/lib/plugins/combo/_test/bootstrap.php 82*b9ba2b0cSNicolas GERARDInterpreter_cli: use wsl 83*b9ba2b0cSNicolas GERARDInterpreter_options: | 84*b9ba2b0cSNicolas GERARD # put this ip if you are not in mirrored mode and intellij keep using 127.0.0.1 85*b9ba2b0cSNicolas GERARD -dxdebug.client_host=$(echo $(ip route list default | awk '{print $3}')) 86f01167beSNicolas GERARD``` 87