------------------------------------------------------------
revno: 1027
committer: Jon Phillips <[email protected]>
branch nick: public
timestamp: Mon 2012-01-16 14:30:12 +0800
message:
  Added get_authors() to code to get it, and a test for it
modified:
  libs/Util.php
  tests/libs/UtilTest.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/Util.php'
--- libs/Util.php	2012-01-16 04:17:04 +0000
+++ libs/Util.php	2012-01-16 06:30:12 +0000
@@ -49,4 +49,18 @@
 
         return $last_revision;
     }
+
+
+    public static function get_authors() {
+        global $AIKI_ROOT_DIR;
+        $authors_file = $AIKI_ROOT_DIR . "/AUTHORS";
+        // $authors = _('See AUTHORS file.');
+        $authors_array = array(_('See AUTHORS file.'));
+        if ( file_exists($authors_file) )
+            $authors_array = 
+                explode("\n", file_get_contents($authors_file));
+
+        return join(', ', $authors_array);
+
+    }
 }

=== modified file 'tests/libs/UtilTest.php'
--- tests/libs/UtilTest.php	2012-01-16 04:17:04 +0000
+++ tests/libs/UtilTest.php	2012-01-16 06:30:12 +0000
@@ -31,4 +31,12 @@
         // make sure not empty
         $this->assertNotEmpty($last_revision);
     }
+
+    public function testGetAuthors () {
+        $authors = Util::get_authors();
+
+        $this->assertNotEmpty($authors);
+
+        $this->assertInternalType('string', $authors);
+    }
 }

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to