svn: /phd/trunk/phpdotnet/phd/Package/ Generic/TocFeed.php PEAR/TocFeed.php
| From: | Christian Weiske | Date: | Tue, 13 Oct 2009 05:30:20 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/Package/ Generic/TocFeed.php PEAR/TocFeed.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5134@lists.php.net to get a copy of this message | ||
cweiske Tue, 13 Oct 2009 05:30:20 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=289606
Log:
Fix TocFeed CS
Changed paths:
U phd/trunk/phpdotnet/phd/Package/Generic/TocFeed.php
U phd/trunk/phpdotnet/phd/Package/PEAR/TocFeed.php
Modified: phd/trunk/phpdotnet/phd/Package/Generic/TocFeed.php
===================================================================
--- phd/trunk/phpdotnet/phd/Package/Generic/TocFeed.php 2009-10-13 05:18:37 UTC (rev 289605)
+++ phd/trunk/phpdotnet/phd/Package/Generic/TocFeed.php 2009-10-13 05:30:20 UTC (rev 289606)
@@ -6,7 +6,11 @@
* Generates Atom feed of Table of Contents for
* each chunk.
*
- * @author Christian Weiske <cweiske@php.net>
+ * @category PhD
+ * @package PhD_Generic
+ * @author Christian Weiske <cweiske@php.net>
+ * @license http://www.opensource.org/licenses/bsd-license.php
BSD Style
+ * @link http://doc.php.net/phd/
*/
abstract class Package_Generic_TocFeed extends Format
{
@@ -92,8 +96,21 @@
*/
protected $idprefix = 'phd-atom-id-';
+ /**
+ * Date used in feed <updated> tags.
+ * ISO 8601 format (2004-02-12T15:19:21+00:00)
+ *
+ * @internal
+ * Set in __construct to be as fast as possible
+ * and don't waste time on re-generating the same
+ * data again and again.
+ *
+ * @var string
+ */
+ protected $date = null;
+
/**
* Creates a new instance.
*/
@@ -104,6 +121,7 @@
$this->setTitle('Index');
$this->setChunked(true);
$this->setExt('atom');
+ $this->date = date('c');
}
@@ -194,11 +212,11 @@
break;
case Render::VERBOSE:
- v(
+ v(
'Starting %s rendering',
$this->getFormatName(), VERBOSE_FORMAT_RENDERING
);
- break;
+ break;
}
}
@@ -307,13 +325,13 @@
*/
protected function createAtomToc($id)
{
- $chunks = static::getChildrens($id);
+ $chunks = static::getChildren($id);
if (count($chunks) == 0) {
return '';
}
$toc = '';
- $date = date('c');
+ $date = $this->date;
foreach ($chunks as $junk => $chunkid) {
$long = $this->getLongDescription($chunkid);
$short = $this->getShortDescription($chunkid);
@@ -321,7 +339,7 @@
if ($long && $short && $long != $short) {
$title = $short . ' -- ' . $long;
} else {
- $title = ($long ? $long : $short);
+ $title = ($long ?: $short);
}
$link = $this->createTargetLink($chunkid);
$toc .= <<<ATM
@@ -351,9 +369,8 @@
public function header($id)
{
$title = htmlspecialchars($this->getLongDescription($id));
- $date = date('c');
+ $date = $this->date;
$lang = Config::language();
- $root = Format::getRootIndex();
$link = $this->createLink($id);
$author = htmlspecialchars($this->author);
Modified: phd/trunk/phpdotnet/phd/Package/PEAR/TocFeed.php
===================================================================
--- phd/trunk/phpdotnet/phd/Package/PEAR/TocFeed.php 2009-10-13 05:18:37 UTC (rev 289605)
+++ phd/trunk/phpdotnet/phd/Package/PEAR/TocFeed.php 2009-10-13 05:30:20 UTC (rev 289606)
@@ -6,7 +6,11 @@
* Generates Atom feed of Table of Contents for
* each chunk.
*
- * @author Christian Weiske <cweiske@php.net>
+ * @category PhD
+ * @package PhD_PEAR
+ * @author Christian Weiske <cweiske@php.net>
+ * @license http://www.opensource.org/licenses/bsd-license.php
BSD Style
+ * @link http://doc.php.net/phd/
*/
class Package_PEAR_TocFeed extends Package_Generic_TocFeed
{