示例#1
0
 public static function get_tag_id($tag)
 {
     $sql = sprintf("SELECT tag_id FROM tag WHERE tag='%s'", $tag);
     $tag_id = db()->Get_Cell($sql);
     if (!$tag_id) {
         $new_tag = new Tag();
         $new_tag->tag($tag);
         $tag_id = $new_tag->insert();
     }
     return $tag_id;
 }
示例#2
0
 /**
  * Constructor
  *
  * @param str text The contents of the tag
  * @param str[] data Reference to doc comment data array
  * @param RootDoc root The root object
  */
 function paramTag($text, &$data, &$root)
 {
     $explode = preg_split('/[ \\t]+/', $text);
     $type = array_shift($explode);
     if ($type) {
         $this->_var = trim(array_shift($explode), '$');
         $data['parameters'][$this->_var]['type'] = $type;
         $text = join(' ', $explode);
     }
     if ($text != '') {
         parent::tag('@param', $this->_var . ' - ' . $text, $root);
     } else {
         parent::tag('@param', NULL, $root);
     }
 }
示例#3
0
 /**
  * Constructor
  *
  * @param str text The contents of the tag
  * @param str[] data Reference to doc comment data array
  * @param RootDoc root The root object
  */
 function seeTag($text, &$data, &$root)
 {
     if (preg_match('/^<a href="(.+)">(.+)<\\/a>$/', $text, $matches)) {
         $this->_link = $matches[1];
         $text = $matches[2];
     } elseif (preg_match('/^([^ ]+)([ \\t](.*))?$/', $text, $matches)) {
         $this->_link = $matches[1];
         if (isset($matches[3])) {
             $text = $matches[3];
         }
     } else {
         $this->_link = NULL;
     }
     parent::tag('@see', $text, $root);
 }
示例#4
0
 /**
  * Constructor
  *
  * @param str text The contents of the tag
  * @param str[] data Reference to doc comment data array
  * @param RootDoc root The root object
  */
 function inheritDocTag($text, &$data, &$root)
 {
     parent::tag('@inheritDoc', $text, $root);
 }
示例#5
0
 /**
  * Constructor
  *
  * @param str text The contents of the tag
  * @param str[] data Reference to doc comment data array
  * @param RootDoc root The root object
  */
 function returnTag($text, &$data, &$root)
 {
     $explode = preg_split('/[ \\t]+/', $text);
     $data['return'] = array_shift($explode);
     parent::tag('@return', join(' ', $explode), $root);
 }