WordPress plugins and themes have comments like these at the top:
/**
* @package Akismet
*/
/*
Plugin Name: Akismet
Plugin URI: http://akismet.com/?return=true
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="admin.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
Version: 2.5.6
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
*/
And when you visit the plugins’ page in the admin interface, the plugins are listed like this:
screenshot-with-shadow.png http://img854.imageshack.us/img854/4526/screenshotwithshadow.png
Is that a standard syntax for documentation? I’m assuming it does a file_get_contents on the plugin files to read them, but how does WordPress parse that into manipulatable, standardized information to be used in PHP?
See
get_plugin_data()inwp-admin/includes/plugin.phpfor the WordPress parser.More specifically the extraction happens in
get_file_data()ofwp-includes/functions.php:There are similar implementations outside of WP. See How can plugin systems be designed so they don't waste so many resources? for an example.