Skip to content

EN:Development Setup

Philipp Schüle edited this page Nov 9, 2018 · 8 revisions

Tine 2.0 Development Setup

Docker Development Setup

See https://github.com/tine20/docker and follow the README instructions.

Install node 8+

see https://nodejs.org/en/download/package-manager/

Install webpack

Beginning in June 2016, webpack (webpack.github.io) is mandatory to run your development installation. To start the webpack-dev-server run the following commands:

cd Tinebase/js
npm install
npm start

You can change the webpack configuration in the file Tinebase/js/webpack.dev.js. The script npm start is defined in the Tinebase/js/package.json

If your dev host is different from localhost (e.g. a virtual machine) you need to add the interface webpack-dev-server should bind to (0.0.0.0 binds to all):

--host 0.0.0.0 --public <hostname you access your dev install>

If you use ssl, you need to to add your cert and key files:

--https --cert <your.cert.file> --key <your.key.file>

If your Filesystem doesn't support events (vagrantfs/nfs) --watch won't work. Use:

--watch-poll

If you don't want to develop javascript, you can speed up webpack-dev-server by leaving out development mode (-d) and dynamic reloads (--inline) and fs watching (--watch)

IMPORTANT: Starting end of 2016 webpack-dev-server is configured to act as a proxy for the application services (aka web server with PHP). Therefore you need to access your dev instance via the webpack-dev-server on port 10443

https://<yourdevurl>:10443/

For debugging webpack-dev-server the internal url might be useful:

https://<yourdevurl>:10443/webpack-dev-server

It maybe worth mentioning that webpack-dev-server binds to localhost interface by default, even by setting a host explicitly the internal interface is used. If your Tine 2.0 development system is a virtual machine you can bind to 0.0.0.0 to be reachable from outside (and configure your firewall for port 10443). Also the wiki shows an global installation therefore you need to set the library path correctly.

export NODE_PATH=/usr/lib/node_modules/
webpack-dev-server --inline --host 0.0.0.0

In case somebody needs it.

EDIT: Johannes Weberhofer wrote an little startscript. You can start webpack-dev-server with "./start-webpack.sh" and stop it by "./start-webpack.sh stop". It may be useful to others.

#!/bin/bash

export NODE_PATH=/usr/lib/node_modules/

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TINE_JS="$DIR/Tinebase/js"

if [ "$1" == "stop" ]; then
  echo Stopping webpack.
  kill $( cat $TINE_JS/webpack.pid )
  rm -f $TINE_JS/webpack.pid
  exit
fi

# START COMMAND MISSING!
# TODO: add "npm start" and save PID in $TINE_JS/webpack.pid

Run Unittests

Before you push your changes or to test a new environment, you might want to run the PHP unit test suite. This is how it's done:

  cd /your/tine20/dir
  vendor/bin/phing -logger phing.listener.DefaultLogger -Dconfigdir=/etc/tine20 phpunit-prepare phpunit-exec

you need a login user for the tests. it can be defined in the config.inc.php:

  'login' =>
    array (
        'username' => 'user',
        'password' => 'pass',
  ),
You can’t perform that action at this time.