Ratchetio Component is the way to integrate ratchet.io service with your Yii application. Ratchet.io aggregates and analyzes your application errors and deploys.
-
Download ratchetio.php and put it in the same directory where
RatchetioComponent.php
andRatchetioErrorHandler.php
are. For example,protected/extensions/yiiext/components/RatchetioComponent
. -
Add
ratchetio
component to themain.php
config:// ... 'components' => array( // ... 'ratchetio'=>array( 'class' => 'ext.yiiext.components.RatchetioComponent', // adjust path if needed 'accessToken' => 'your_serverside_ratchetio_token', ), ),
-
Adjust
main.php
config to preload the component:'preload'=>array('log', 'ratchetio'),
-
Set
RatchetioErrorHandler
as error handler:'components' => array( // ... 'errorHandler'=>array( 'class'=>'ext.yiiext.components.ratchetio.RatchetioErrorHandler', // ... ), ),
You can also pass some additional ratchet.io options in the component config:
environment
,branch
,maxErrno
,baseApiUrl
etc.A good idea is to specify
environment
as:'environment' => isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'cli_'.php_uname("n"),
You can specify alias of your project root directory for linking stack traces (
'application'
by default):'rootAlias' => 'root',