Source for file LinkClasses.inc

Documentation is available at LinkClasses.inc

  1. <?php
  2. /**
  3.  * Linking to element documentation is performed by the classes in this file.
  4.  *
  5.  * abstractLink descendants contain enough information to differentiate every
  6.  * documentable element, and so can be converted to a link string by
  7.  * {@link Converter::returnSee()}
  8.  * 
  9.  * phpDocumentor :: automatic documentation generator
  10.  * 
  11.  * PHP versions 4 and 5
  12.  *
  13.  * Copyright (c) 2002-2008 Gregory Beaver
  14.  * 
  15.  * LICENSE:
  16.  * 
  17.  * This library is free software; you can redistribute it
  18.  * and/or modify it under the terms of the GNU Lesser General
  19.  * Public License as published by the Free Software Foundation;
  20.  * either version 2.1 of the License, or (at your option) any
  21.  * later version.
  22.  * 
  23.  * This library is distributed in the hope that it will be useful,
  24.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26.  * Lesser General Public License for more details.
  27.  * 
  28.  * You should have received a copy of the GNU Lesser General Public
  29.  * License along with this library; if not, write to the Free Software
  30.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  31.  *
  32.  * @category   ToolsAndUtilities
  33.  * @package    phpDocumentor
  34.  * @subpackage Links
  35.  * @author     Gregory Beaver <[email protected]>
  36.  * @copyright  2002-2008 Gregory Beaver
  37.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  38.  * @version    CVS: $Id: LinkClasses.inc 253641 2008-02-24 02:35:44Z ashnazg $
  39.  * @filesource
  40.  * @link       http://www.phpdoc.org
  41.  * @link       http://pear.php.net/PhpDocumentor
  42.  * @since      1.2.0
  43.  * @todo       CS cleanup - change package to PhpDocumentor
  44.  */
  45.  
  46. /**
  47.  * linking classes parent
  48.  *
  49.  * @category   ToolsAndUtilities
  50.  * @package    phpDocumentor
  51.  * @subpackage Links
  52.  * @author     Gregory Beaver <[email protected]>
  53.  * @copyright  2002-2008 Gregory Beaver
  54.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  55.  * @version    Release: @VER@
  56.  * @link       http://www.phpdoc.org
  57.  * @link       http://pear.php.net/PhpDocumentor
  58.  * @todo       CS cleanup - change package to PhpDocumentor
  59.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  60.  */
  61. {
  62.     /**#@+
  63.      * @var string
  64.      */
  65.     var $path;
  66.     /**
  67.      * phpdoc alias _phpdoc_inc for phpdoc.inc
  68.      */
  69.     var $fileAlias = '';
  70.     /**
  71.      * element type linked to.
  72.      * can only be a documentable element
  73.      */
  74.     var $type = '';
  75.     var $name = '';
  76.     var $category = '';
  77.     var $package = '';
  78.     var $subpackage = '';
  79.     /**#@-*/
  80.  
  81.     /**
  82.      * sets up the link
  83.      *
  84.      * @param string $path       full path to file containing element
  85.      * @param string $fileAlias  page name, as configured by {@link Parser::parse}
  86.      * @param string $name       element name
  87.      * @param string $package    package element is in
  88.      * @param string $subpackage subpackage element is in
  89.      * @param string $category   optional category that documentation is in
  90.      *
  91.      * @return void 
  92.      */
  93.     function addLink($path$fileAlias$name$package$subpackage,
  94.         $category false)
  95.     {
  96.         $this->path       = $path;
  97.         $this->fileAlias  = $fileAlias;
  98.         $this->name       = $name;
  99.         $this->category   = $category;
  100.         $this->package    = $package;
  101.         $this->subpackage = $subpackage;
  102.     }
  103. }
  104.  
  105. /**
  106.  * procedural page link
  107.  *
  108.  * @category   ToolsAndUtilities
  109.  * @package    phpDocumentor
  110.  * @subpackage Links
  111.  * @author     Gregory Beaver <[email protected]>
  112.  * @copyright  2002-2008 Gregory Beaver
  113.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  114.  * @version    Release: @VER@
  115.  * @link       http://www.phpdoc.org
  116.  * @link       http://pear.php.net/PhpDocumentor
  117.  * @todo       CS cleanup - change package to PhpDocumentor
  118.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  119.  */
  120. class pageLink extends abstractLink
  121. {
  122.     /**
  123.      * @var string 
  124.      */
  125.     var $type = 'page';
  126. }
  127.  
  128. /**
  129.  * function link
  130.  *
  131.  * @category   ToolsAndUtilities
  132.  * @package    phpDocumentor
  133.  * @subpackage Links
  134.  * @author     Gregory Beaver <[email protected]>
  135.  * @copyright  2002-2008 Gregory Beaver
  136.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  137.  * @version    Release: @VER@
  138.  * @link       http://www.phpdoc.org
  139.  * @link       http://pear.php.net/PhpDocumentor
  140.  * @todo       CS cleanup - change package to PhpDocumentor
  141.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  142.  */
  143. class functionLink extends abstractLink
  144. {
  145.     /** 
  146.      * @var string 
  147.      */
  148.     var $type = 'function';
  149. }
  150.  
  151. /**
  152.  * define link
  153.  *
  154.  * @category   ToolsAndUtilities
  155.  * @package    phpDocumentor
  156.  * @subpackage Links
  157.  * @author     Gregory Beaver <[email protected]>
  158.  * @copyright  2002-2008 Gregory Beaver
  159.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  160.  * @version    Release: @VER@
  161.  * @link       http://www.phpdoc.org
  162.  * @link       http://pear.php.net/PhpDocumentor
  163.  * @todo       CS cleanup - change package to PhpDocumentor
  164.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  165.  */
  166. class defineLink extends abstractLink
  167. {
  168.     /** 
  169.      * @var string 
  170.      */
  171.     var $type = 'define';
  172. }
  173.  
  174. /**
  175.  * global variable link
  176.  *
  177.  * @category   ToolsAndUtilities
  178.  * @package    phpDocumentor
  179.  * @subpackage Links
  180.  * @author     Gregory Beaver <[email protected]>
  181.  * @copyright  2002-2008 Gregory Beaver
  182.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  183.  * @version    Release: @VER@
  184.  * @link       http://www.phpdoc.org
  185.  * @link       http://pear.php.net/PhpDocumentor
  186.  * @todo       CS cleanup - change package to PhpDocumentor
  187.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  188.  */
  189. class globalLink extends abstractLink
  190. {
  191.     /**
  192.      * @var string 
  193.      */
  194.     var $type = 'global';
  195. }
  196.  
  197. /**
  198.  * class link
  199.  *
  200.  * @category   ToolsAndUtilities
  201.  * @package    phpDocumentor
  202.  * @subpackage Links
  203.  * @author     Gregory Beaver <[email protected]>
  204.  * @copyright  2002-2008 Gregory Beaver
  205.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  206.  * @version    Release: @VER@
  207.  * @link       http://www.phpdoc.org
  208.  * @link       http://pear.php.net/PhpDocumentor
  209.  * @todo       CS cleanup - change package to PhpDocumentor
  210.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  211.  */
  212. class classLink extends abstractLink
  213. {
  214.     /**
  215.      * @var string 
  216.      */
  217.     var $type = 'class';
  218. }
  219.  
  220. /**
  221.  * method link
  222.  *
  223.  * @category   ToolsAndUtilities
  224.  * @package    phpDocumentor
  225.  * @subpackage Links
  226.  * @author     Gregory Beaver <[email protected]>
  227.  * @copyright  2002-2008 Gregory Beaver
  228.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  229.  * @version    Release: @VER@
  230.  * @link       http://www.phpdoc.org
  231.  * @link       http://pear.php.net/PhpDocumentor
  232.  * @todo       CS cleanup - change package to PhpDocumentor
  233.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  234.  */
  235. class methodLink extends abstractLink
  236. {
  237.     /**
  238.      * @var string 
  239.      */
  240.     var $type = 'method';
  241.     /**
  242.      * @var string 
  243.      */
  244.     var $class = '';
  245.     
  246.     /**
  247.      * sets up the link
  248.      *
  249.      * @param string $class      class name
  250.      * @param string $path       full path to file containing element
  251.      * @param string $fileAlias  page name, as configured by {@link Parser::parse}
  252.      * @param string $name       element name
  253.      * @param string $package    package element is in
  254.      * @param string $subpackage subpackage element is in
  255.      * @param string $category   optional category that documentation is in
  256.      *
  257.      * @return void 
  258.      */
  259.     function addLink($class$path $fileAlias$name$package$subpackage
  260.         $category false)
  261.     {
  262.         $this->class = $class;
  263.         abstractLink::addLink($path$fileAlias$name$package$subpackage
  264.             $category);
  265.     }
  266. }
  267.  
  268. /**
  269.  * class variable link
  270.  *
  271.  * @category   ToolsAndUtilities
  272.  * @package    phpDocumentor
  273.  * @subpackage Links
  274.  * @author     Gregory Beaver <[email protected]>
  275.  * @copyright  2002-2008 Gregory Beaver
  276.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  277.  * @version    Release: @VER@
  278.  * @link       http://www.phpdoc.org
  279.  * @link       http://pear.php.net/PhpDocumentor
  280.  * @todo       CS cleanup - change package to PhpDocumentor
  281.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  282.  */
  283. class varLink extends methodLink
  284. {
  285.     /**
  286.      * @var string 
  287.      */
  288.     var $type = 'var';
  289. }
  290.  
  291. /**
  292.  * class constant link
  293.  *
  294.  * @category   ToolsAndUtilities
  295.  * @package    phpDocumentor
  296.  * @subpackage Links
  297.  * @author     Gregory Beaver <[email protected]>
  298.  * @copyright  2002-2008 Gregory Beaver
  299.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  300.  * @version    Release: @VER@
  301.  * @link       http://www.phpdoc.org
  302.  * @link       http://pear.php.net/PhpDocumentor
  303.  * @todo       CS cleanup - change package to PhpDocumentor
  304.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  305.  */
  306. class constLink extends methodLink
  307. {
  308.     /**
  309.      * @var string 
  310.      */
  311.     var $type = 'const';
  312. }
  313.  
  314. /**
  315.  * tutorial link
  316.  *
  317.  * @category   ToolsAndUtilities
  318.  * @package    phpDocumentor
  319.  * @subpackage Links
  320.  * @author     Gregory Beaver <[email protected]>
  321.  * @copyright  2002-2008 Gregory Beaver
  322.  * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
  323.  * @version    Release: @VER@
  324.  * @link       http://www.phpdoc.org
  325.  * @link       http://pear.php.net/PhpDocumentor
  326.  * @todo       CS cleanup - change package to PhpDocumentor
  327.  * @todo       CS cleanup - change classname to PhpDocumentor_*
  328.  */
  329. class tutorialLink extends abstractLink
  330. {
  331.     /**#@+
  332.      * @var string
  333.      */
  334.     var $type    = 'tutorial';
  335.     var $section = '';
  336.     var $title   = false;
  337.     /**#@-*/
  338.     
  339.     /**
  340.      * sets up the link
  341.      *
  342.      * @param string $section    section/subsection name
  343.      * @param string $path       full path to file containing element
  344.      * @param string $name       page name, as configured by {@link Parser::parse}
  345.      * @param string $package    package element is in
  346.      * @param string $subpackage subpackage element is in
  347.      * @param string $title      title of tutorial
  348.      * @param string $category   optional category that documentation is in
  349.      *
  350.      * @return void 
  351.      */
  352.     function addLink($section$path$name$package$subpackage$title false
  353.         $category false)
  354.     {
  355.         $this->section = $section;
  356.         $this->title   = $title;
  357.         parent::addLink($path''$name$package$subpackage$category);
  358.     }
  359. }
  360. ?>

Documentation generated on Mon, 05 Dec 2011 21:06:11 -0600 by phpDocumentor 1.4.4