webi.rst 2.32 KB
Newer Older
1 2 3 4
*************
Web Interface
*************

5 6 7 8 9
Configuration for development
=============================

Default error level for XiVO web interface is E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_RECOVERABLE_ERROR & ~E_STRICT

Sebastien Duthil's avatar
Sebastien Duthil committed
10
If you want to display warning or other error in your browser, edit the :file:`/etc/xivo/web-interface/xivo.ini`
Etienne Lessard's avatar
Etienne Lessard committed
11
and replace report_type level to 3::
12

Etienne Lessard's avatar
Etienne Lessard committed
13
   [error]
14
   level = E_ALL
Etienne Lessard's avatar
Etienne Lessard committed
15 16 17 18 19
   report_type = 3
   report_mode = 1
   report_func = 1
   email = john.doe@example.com
   file = /var/log/xivo-web-interface/error.log
20

Sebastien Duthil's avatar
Sebastien Duthil committed
21
You may also edit :file:`/etc/xivo/web-interface/php.ini` and change the error level, but you will need to restart the cgi::
Etienne Lessard's avatar
Etienne Lessard committed
22

23
   service spawn-fcgi restart
Etienne Lessard's avatar
Etienne Lessard committed
24 25


26 27 28
Interactive debugging in Eclipse
================================

29
Instructions for Eclipse 4.5.
30

31 32 33 34
On your XiVO:

#. Install php5-xdebug::

35
      apt-get install php5-xdebug
36

37 38
#. Edit the :file:`/etc/php5/cgi/conf.d/20-xdebug.ini` (or :file:`/etc/php5/conf.d/20-xdebug.ini` on
   wheezy) and add these lines at the end::
39

40
      xdebug.remote_enable=1
Etienne Lessard's avatar
Etienne Lessard committed
41
      xdebug.remote_host="<dev_host_ip>"
42

43
   where ``<dev_host_ip>`` is the IP address of your machine where Eclipse is installed.
44 45 46

#. Restart spawn-fcgi::

47
      service spawn-fcgi restart
48 49 50

On your machine where Eclipse is installed:

51 52 53
#. Make sure you have Eclipse PDT installed
#. Create a PHP project named ``xivo-web-interface``:

54
   * Choose "Create project at existing location", using the :file:`xivo-web-interface` directory
55

56
#. In the Window / Preferences / PHP menu:
57 58 59 60 61

   * Add a new PHP server with the following information:

      * Name: anything you want
      * Base URL: ``https://<xivo_ip>``
62 63 64
      * Path Mapping:

        * Path on Server: :file:`/usr/share/xivo-web-interface`
65
        * Path in Workspace: :file:`/xivo-web-interface/src`
66 67 68

#. Create a new ``PHP Web Application`` debug configuration:

69
   * Choose the PHP server you created in last step
70 71 72 73 74 75 76
   * Pick some file, which can be anything if you don't "break at first line"
   * Uncheck "Auto Generate", and set the path you want your browser to open when you'll
     launch this debug configuration.

Then, to start a debugging session, set some breakpoints in the code and launch your debug configuration.
This will open the page in your browser, and when the code will hit your breakpoints, you'll be able to go
through the code step by step, etc.