title: Joomla get plugin id
body: <p>I wrote a Joomla plugin which will eventually load a library.</p>
  
  <p>The path to library is a plugin parameter, as such when the path is incorrect, a message pops up in the backend, together with a link to edit the plugin parameters:</p>
  
  <blockquote>
    <p>/administrator/index.php?option=com_plugins&amp;view=plugin&amp;client=site&amp;task=edit&amp;cid[]=36</p>
  </blockquote>
  
  <p>See the 36 at the end? That's my plugin's id in the database (table jos_plugins).</p>
  
  <p>My issue is that this id changes on installation, ie, on different installs, it would be something else.
  So I need to find this id programmatically.</p>
  
  <p>The problem is that I couldn't find this id from the plugin object itself (as to why not, that would be joomla's arguably short-sighted design decision).</p>
  
  <p>So unless you know about some neat trick, (I've checked and double checked JPlugin and JPluginHelper classes), I'll be using the DB.</p>
  
  <p><strong>Edit; Some useful links:</strong></p>
  
  <ul>
  <li><a href="http://docs.joomla.org/Plugin_Developer_Overview" rel="nofollow">http://docs.joomla.org/Plugin_Developer_Overview</a></li>
  <li><a href="http://api.joomla.org/Joomla-Framework/Plugin/JPlugin.html" rel="nofollow">http://api.joomla.org/Joomla-Framework/Plugin/JPlugin.html</a></li>
  <li><a href="http://api.joomla.org/Joomla-Framework/Plugin/JPluginHelper.html" rel="nofollow">http://api.joomla.org/Joomla-Framework/Plugin/JPluginHelper.html</a></li>
  <li><a href="http://forum.joomla.org/viewtopic.php?p=2227737" rel="nofollow">http://forum.joomla.org/viewtopic.php?p=2227737</a></li>
  </ul>
  
  <p>Guess I'll be using the wisdom from that last link...</p>