Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/atomizer/DivinerArticleAtomizer.php
| Show All 14 Lines | protected function executeAtomize($file_name, $file_data) { | ||||
| $title = idx($meta, 'title'); | $title = idx($meta, 'title'); | ||||
| if (!strlen($title)) { | if (!strlen($title)) { | ||||
| $title = pht('Untitled Article "%s"', basename($file_name)); | $title = pht('Untitled Article "%s"', basename($file_name)); | ||||
| $atom->addWarning(pht('Article has no %s!', '@title')); | $atom->addWarning(pht('Article has no %s!', '@title')); | ||||
| $atom->setDocblockMetaValue('title', $title); | $atom->setDocblockMetaValue('title', $title); | ||||
| } | } | ||||
| // If the article has no @name, use the filename after stripping any | // If the article has no `@name`, use the filename after stripping any | ||||
| // extension. | // extension. | ||||
| $name = idx($meta, 'name'); | $name = idx($meta, 'name'); | ||||
| if (!$name) { | if (!$name) { | ||||
| $name = basename($file_name); | $name = basename($file_name); | ||||
| $name = preg_replace('/\\.[^.]+$/', '', $name); | $name = preg_replace('/\\.[^.]+$/', '', $name); | ||||
| } | } | ||||
| $atom->setName($name); | $atom->setName($name); | ||||
| return array($atom); | return array($atom); | ||||
| } | } | ||||
| } | } | ||||