コード例 #1
0
 public function __construct($database, $tag)
 {
     $this->db = $database;
     $sql = $this->db->prepare("SELECT tag, creation_date, creation_commit, modification_date, modification_commit, label, position FROM tags WHERE tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->tag = $sql->fetch();
     }
     // phantom is actually a chapter
     if (isPhantom($this->tag["label"])) {
         $this->tag["type"] = "chapter";
     }
     $sql = $this->db->prepare("SELECT tag, node_count, edge_count, total_edge_count, chapter_count, section_count, use_count, indirect_use_count FROM graphs WHERE tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->graphs = $sql->fetch();
     }
 }
コード例 #2
0
 public function __construct($database, $tag)
 {
     $this->db = $database;
     $sql = $this->db->prepare("SELECT tag, creation_date, creation_commit, modification_date, modification_commit, label, position, type FROM tags WHERE tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->tag = $sql->fetch();
     }
     $sql = $this->db->prepare("SELECT changes.tag, changes.hash, changes.file, changes.type, changes.begin, changes.end, changes.label, commits.time FROM changes, commits WHERE commits.hash = changes.hash AND tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->changes = $sql->fetchAll();
     }
     // remove the ghost "change in proof" that occurs after tag assignment
     $index = -1;
     for ($i = 0; $i < sizeof($this->changes); $i++) {
         if ($this->changes[$i]["type"] == "tag") {
             $index = $i;
         }
     }
     if ($index != -1) {
         array_splice($this->changes, $index + 1, 1);
     }
     // phantom is actually a chapter
     if (isPhantom($this->tag["label"])) {
         $this->tag["type"] = "chapter";
     }
     $sql = $this->db->prepare("SELECT tag, node_count, edge_count, total_edge_count, chapter_count, section_count, use_count, indirect_use_count FROM graphs WHERE tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->graphs = $sql->fetch();
     }
 }
コード例 #3
0
 public function __construct($database, $tag)
 {
     $this->db = $database;
     $sql = $this->db->prepare("SELECT tag, name, position, reference, type, book_id, chapter_page, book_page, label, file, value, begin, end, slogan, history FROM tags WHERE tag = :tag");
     $sql->bindParam(":tag", $tag);
     if ($sql->execute()) {
         $this->tag = $sql->fetch();
     }
     // phantom is actually a chapter
     if (isPhantom($this->tag["label"])) {
         $this->tag["type"] = "chapter";
     }
 }