php-symfony2.json 3.7 KB

123456
  1. {
  2. "html": "<div class=\"section\" id=\"installation\">\n<h2>Installation</h2>\n<p>There are various ways to install the PHP integration for Sentry. The\nrecommended way is to use <a class=\"reference external\" href=\"http://getcomposer.org/\">Composer</a>:</p>\n<div class=\"highlight-python\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span>$ composer require &quot;sentry/sentry&quot;\n</pre></div>\n</div>\n<p>Alternatively you can manually install it:</p>\n<ol class=\"arabic\">\n<li><p class=\"first\">Download and extract the latest <a class=\"reference external\" href=\"https://github.com/getsentry/sentry-php/archive/master.zip\">sentry-php</a> archive\nto your PHP project.</p>\n</li>\n<li><p class=\"first\">Require the autoloader in your application:</p>\n<div class=\"highlight-php\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #2eb0f7\">require_once</span> <span style=\"color: #e8535a\">&#39;/path/to/Raven/library/Raven/Autoloader.php&#39;</span><span style=\"color: #111111\">;</span>\n<span style=\"color: #111111\">Raven_Autoloader</span><span style=\"color: #4b4f5c\">::</span><span style=\"color: #a47ac6\">register</span><span style=\"color: #111111\">();</span>\n</pre></div>\n</div>\n</li>\n</ol>\n</div>\n\n\n<div class=\"section\" id=\"symfony-2\">\n<h2>Symfony 2+</h2>\n<p>Install the <code class=\"docutils literal\"><span class=\"pre\">sentry/sentry-symfony</span></code> package:</p>\n<div class=\"highlight-bash\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span>$ composer require sentry/sentry-symfony\n</pre></div>\n</div>\n<p>Enable the bundle in <code class=\"docutils literal\"><span class=\"pre\">app/AppKernel.php</span></code>:</p>\n<div class=\"highlight-php\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #4b4f5c\">&lt;?</span><span style=\"color: #111111\">php</span>\n<span style=\"color: #2eb0f7\">class</span> <span style=\"color: #111111\">AppKernel</span> <span style=\"color: #2eb0f7\">extends</span> <span style=\"color: #111111\">Kernel</span>\n<span style=\"color: #111111\">{</span>\n <span style=\"color: #2eb0f7\">public</span> <span style=\"color: #2eb0f7\">function</span> <span style=\"color: #111111\">registerBundles()</span>\n <span style=\"color: #111111\">{</span>\n <span style=\"color: #111111\">$bundles</span> <span style=\"color: #4b4f5c\">=</span> <span style=\"color: #2eb0f7\">array</span><span style=\"color: #111111\">(</span>\n <span style=\"color: #34c08b; font-style: italic\">// ...</span>\n\n <span style=\"color: #2eb0f7\">new</span> <span style=\"color: #111111\">Sentry\\SentryBundle\\SentryBundle(),</span>\n <span style=\"color: #111111\">);</span>\n\n <span style=\"color: #34c08b; font-style: italic\">// ...</span>\n <span style=\"color: #111111\">}</span>\n\n <span style=\"color: #34c08b; font-style: italic\">// ...</span>\n<span style=\"color: #111111\">}</span>\n</pre></div>\n</div>\n<p>Add your DSN to <code class=\"docutils literal\"><span class=\"pre\">app/config/config.yml</span></code>:</p>\n<div class=\"highlight-yaml\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">sentry:</span>\n <span style=\"color: #111111\">dsn:</span> <span style=\"color: #e8535a\">&quot;___DSN___&quot;</span>\n</pre></div>\n</div>\n</div>\n",
  3. "link": "https://docs.getsentry.com/clients/php/integrations/symfony2/",
  4. "id": "php-symfony2",
  5. "name": "Symfony2"
  6. }