[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class DivinerArticleAtomizer extends DivinerAtomizer { 4 5 protected function executeAtomize($file_name, $file_data) { 6 $atom = $this->newAtom(DivinerAtom::TYPE_ARTICLE) 7 ->setLine(1) 8 ->setLength(count(explode("\n", $file_data))) 9 ->setLanguage('human'); 10 11 $block = "/**\n".str_replace("\n", "\n * ", $file_data)."\n */"; 12 $atom->setDocblockRaw($block); 13 14 $meta = $atom->getDocblockMeta(); 15 16 $title = idx($meta, 'title'); 17 if (!strlen($title)) { 18 $title = pht('Untitled Article "%s"', basename($file_name)); 19 $atom->addWarning('Article has no @title!'); 20 $atom->setDocblockMetaValue('title', $title); 21 } 22 23 // If the article has no @name, use the filename after stripping any 24 // extension. 25 $name = idx($meta, 'name'); 26 if (!$name) { 27 $name = basename($file_name); 28 $name = preg_replace('/\\.[^.]+$/', '', $name); 29 } 30 $atom->setName($name); 31 32 return array($atom); 33 } 34 35 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |