prestaClickHeatPlugin - 1.0.0

Allows an easy integration of the clickheat script on a Symfony project

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

prestaClickHeatPlugin

The prestaClickHeatPlugin allows an easy integration of the clickheat script on a Symfony project.

Features

  • An easy way to configure clickheat script by Symfony configuration way
  • The ability to change the configuration from the action code
  • An automated integration of the clickheat tag

License

The prestaClickHeatPlugin is licensed under the MIT License.

Installation

  • Install the plugin

    $ symfony plugin:install prestaClickHeatPlugin
    $ symfony cc
  • Be sure that the plugin is activated in config/ProjectConfiguration.class.php

  • Install clickheat script (see below, clickHeat installation section).

Clickheat installation

The prestaClickHeatPlugin give an easy way to use the clickHeat script, but it does not install the clickheat script.

Why ? Because clickheat stores its configuration and its logs inside the source code. So, to avoid plugin upgrade problem, the clickheat installation must be separated from plugin source code.

Install script

In this section, the example show how to install the plugin bundled clickheat (1.9-revE) installation.

  • copy the plugin bundled installation into the web/directory

    $ cp -r plugins/prestaClickHeatPlugin/vendor/clickheat/ web/
  • Change access right to cache/, config/ and logs/ directories

    $ chmod 777 web/clickheat/config web/clickheat/cache web/clickheat/logs
  • If you use an SCM software, like SVN or GIT, you have to ignore cache/ and logs/ directories content.

    • With SVN, add "svn:ignore *" property on these directories

      $ svn propset svn:ignore '*' web/clickheat/cache
      $ svn propset svn:ignore '*' web/clickheat/logs
    • With GIT, create an ".gitignore" file who contain "*" on these directories

      $ echo "*" > web/clickheat/cache/.gitignore
      $ echo "*" > web/clickheat/logs/.gitignore

If you want to use a different version, you can download it here and use this installation instead of plugin bundled one.

In case you choose to install your own version, please note we recommend some modification in the clickheat source code :

  • To avoid direct access to clickheat libraries, place an .htaccess file who contain "Deny From All" in the following directories :

    • clickheat/classes
    • clickheat/examples
    • clickheat/languages
    • clickheat/scripts
  • Log and cache directories are hard configured and do not adapt to the execution environment. To allow that, there is some modification to do on the clickheat/config.php file

    • execute the prestaClickHeatPlugin/lib/misc/clickheat.config.patch on your clickheat installation

      $ patch web/clickheat/config.php plugins/prestaClickHeatPlugin/lib/misc/clickheat.config.patch

The bundled installation already contain these files.

Clickheat configuration

After installation, clickheat need a little step of configuration.

  • Go to the clickheat configuration script

    http://www.ndd.ext/clickheat/
  • Follow instructions
  • /!\ Don't configure and include the javascript tag (it's plugin work)

Use

/!\ clickheat use some notions, like "site" and "group" who are not explained in this README. Please go to the official clickheat site to obtain more informations.

As long as you not configure some action, the plugin doesn't include the clickheat tag in any page. This way, you control all stats you obtain.

Configuration files

The default way to use the plugin is by using the configuration files.

Configuring application-level

If you want to configure an unique site and group for your whole application, you just have to update your application app.yml file and put this code in :

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      site:     'My site'
      group:    'My group'

By this way, each page of your application will be analysed by clickheat, using the "My site" and "My group" configuration

Configuring module-level

If you want to configure only a module actions to be analysed, you just have to put a "module.yml" file in your module config/ directory (apps/[APP_NAME]/modules/[MODULE_NAME]/config/module.yml) and put the same code.

// apps/[APP_NAME]/module/[MODULE_NAME]/config/module.yml
all:
  prestaclickheatplugin:
    clickheat:
      site:     'My site'
      group:    'My group'

Multi level configuration

You can also configure the site for the whole application, but the group by module like this :

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      site:     'My site'
 
 
// apps/[APP_NAME]/module/[MODULE_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      group:    'My group'

Action configuration

It's possible to configure the clickheat script into the controller code.

To define a group for a specific action, you can write a code like this :

// apps/[APP_NAME]/modules/[MODULE_NAME]/actions/actions.class.php
class MyActionActions extends sfActions
{
  /**
   * Executes index action
   *
   * @param sfRequest $request A request object
   */
  public function executeIndex(sfWebRequest $request)
  {
    prestaClickHeatManager::setSite('My other site');
    prestaClickHeatManager::setGroup('My other group');
  } 
}

Use the code configuration way allow to define dynamic site/group. What is not allowed in configuration file, which is static.

Configuration

The prestaClickHeatPlugin allows few plugin configuration. These configurations can be found in the default plugin app.yml file (plugins/prestaClickHeatPlugin/config/app.yml)

enable

You can completely disabled the plugin action by changing the 'enable' setting.

This setting can be defined at any app.yml level (project, application)

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      enable:     false

server

This setting allow to configure the clickheat installation directory.

By default, with the installation explained before, the server is in the web/clickheat directory. The default configuration is for this kind of installation.

If you want to install the clickheat server in another directory, you move the directory and change this configuration settings to the new directory name

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      server:   /another_dir

Its also possible to use multi-level directory

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      server:   /vendor/clickheat

If you want to put your clickheat server on another server, you can use an url

// apps/[APP_NAME]/config/app.yml
all:
  prestaclickheatplugin:
    clickheat:
      server:   http://www.domain.ext/clickheat

Changelog

2012-03-09 | 1.0.0

  • [bugfix] Fixed PHP error occurring on the screens of exception in debug mode (D10446)

2010-08-09 | 0.1.1-beta

    *

2010-08-09 | 0.1.0-beta

  • First bete release