Cleaned up files for 0.3 milestone.
authorJustin J. Novack <jnovack@gmail.com>
Wed, 19 Sep 2012 00:11:11 +0000 (20:11 -0400)
committerJustin J. Novack <jnovack@gmail.com>
Wed, 19 Sep 2012 17:32:27 +0000 (13:32 -0400)
README.rst
src/phorkie/File.php
src/phorkie/Repository.php
src/phorkie/Repository/Post.php
src/phorkie/SetupCheck.php
src/phorkie/Tool/Info.php
src/phorkie/Tools.php

index d41d89bf61f9f5e9e7878d50802b1405473adf3f..e7e1625b6a3685421e3143078606c939999ed554 100644 (file)
@@ -20,9 +20,10 @@ Features
   - add new files
   - delete existing files
   - replace file with upload
+- OpenID authentication
 - multiple files in one paste
 - syntax highlighting with GeSHi
-- rST rendering
+- rST and Markdown rendering
 - image upload + display
 - external tool support
 
@@ -41,7 +42,7 @@ Installation
 ============
 1. Unzip the phorkie release file::
 
-   $ tar xjvf phorkie-0.2.0.tar.bz2
+   $ tar xjvf phorkie-0.3.0.tar.bz2
 
 2. Create the git directories::
 
@@ -58,7 +59,7 @@ Installation
 
    Look at ``config.default.php`` for values that you may adjust.
 
-5. Set your web server's document root to ``/path/to/phorkie-0.2.0/www/``
+5. Set your web server's document root to ``/path/to/phorkie/www/``
 
 6. Open phorkie in your web browser
 
@@ -67,6 +68,10 @@ Dependencies
 ============
 phorkie stands on the shoulders of giants.
 
+- git v1.7.5
+- php v5.3.0
+- pear v1.9.2
+
 ::
 
   $ pear install versioncontrol_git-alpha
@@ -86,16 +91,16 @@ phorkie stands on the shoulders of giants.
 
   $ pear channel-discover pear.michelf.ca
   $ pear install michelf/Markdown
-
+  
 Note that this version of GeSHi is a bit outdated, but it's the fastest
-way to install it.
-
+way to install it.  If you install it manually be sure to update the
+path in ``data/config.default.php``.
 
 ======
 Search
 ======
 
-phorkie makes use of an Elasticsearch__ installation if you have one.
+phorkie makes use of an Elasticsearch__ installation, if you have one.
 
 It is used to provide search capabilities and the list of recent pastes.
 
@@ -137,7 +142,7 @@ Make git repositories clonable
 To make git repositories clonable, you need to install ``git-daemon``
 (``git-daemon-run`` package on Debian/Ubuntu).
 
-Now make the repositories available by symlinking the paste repository
+Make the repositories available by symlinking the paste repository
 directory (``$GLOBALS['phorkie']['cfg']['repos']`` setting) into
 ``/var/cache/git``, e.g.::
 
@@ -147,9 +152,21 @@ Edit your ``config.php`` and set the ``$GLOBALS['phorkie']['cfg']['git']['public
 setting to ``git://$yourhostname/git/paste/``.
 The rest will be appended automatically.
 
-
 You're on your own to setup writable repositories.
 
+Protect your site with OpenID
+=============================
+You have the option of enabling OpenID authentication to help secure your
+pastes on phorkie.  Set the ``$GLOBALS['phorkie']['auth']`` values in the
+``data/config.php`` file as desired.  
+
+There are two different types of security you can apply.  First, you can
+restrict to one of three ``securityLevels``; completely open (``0``), protection
+of write-enabled functions such as add, edit, etc. (``1``), and full site
+protection (``2``).  Additionally, you can restrict your site to ``listedUsersOnly``.
+You will need to add the individual OpenIDs identity urls to the
+``$GLOBALS['phorkie']['auth']['users']`` variable.
+
 
 =================
 Technical details
@@ -157,7 +174,6 @@ Technical details
 
 TODO
 ====
-- OpenID-Login to get username+email as authorship information
 - filters (``xmllint --format``, ``rapper``)
 - document how to keep disk usage low (block size)
 - comments
index f378f60a75f58614003e39b913d702f9fbd3a763..7f5b5b407df44747c9d67f6f34f6f1eff7b025e9 100644 (file)
@@ -118,6 +118,9 @@ class File
         throw new Exception('Unknown type');
     }
 
+    /**
+     * @return string Mime type of file
+     */
     public function getMimeType()
     {
         $ext = $this->getExt();
index 43f2b23dddf0be98f7ac56626cd1cc506be35541..4ac5ae71e7cd5c1930d003e8f75db525f160dd55 100644 (file)
@@ -104,7 +104,7 @@ class Repository
         $this->hash = $output;
     }
 
-       /**
+    /**
      * Populates $this->message
      *
      * @return void
index 9119e06c2ce0f1484351dc63ce688060898cbecf..b181b5a2b198ef6e52ebe83856c338ec86598b90 100644 (file)
@@ -130,7 +130,8 @@ class Repository_Post
                 ->setOption('message', $commitmsg)
                 ->setOption('author', $sessionData['name'].' <'.$sessionData['email'].'>')
                 ->execute();
-            //FIXME: git needs ref BEFORE add. ideally VersionControl_Git needs to be updated
+            //FIXME: git needs ref BEFORE add
+            //quick hack until http://pear.php.net/bugs/bug.php?id=19605 is fixed
             $vc->getCommand('notes --ref=identity add')
                                ->setOption('force')
                 ->setOption('message', "$notes")
index b1107b51b15b66c26a6b982cc0146ac45024b400..24f7009e62f59656e56ca0eaa9646ac9e2cf65df 100644 (file)
@@ -11,6 +11,7 @@ class SetupCheck
         'pear.php.net/Pager'               => 'Pager',
         'pear.php.net/Services_Libravatar' => 'Services_Libravatar',
         'zustellzentrum.cweiske.de/MIME_Type_PlainDetect' => 'MIME_Type_PlainDetect',
+        'pear.michelf.ca/Markdown'         => 'Markdown',
     );
 
     protected $writableDirs;
index c1c3c696b30bb3ff6b9e580ecdf8fafb6214b84f..2e95a9f0364a3dd6ba1dd14c0fdb82bb0debda80 100644 (file)
@@ -10,16 +10,35 @@ class Tool_Info
         $this->class = $class;
     }
 
+    /**
+     * Format the tool path
+     *
+     * @param File $file
+     *
+     * @return string
+     */
     public function getLink(File $file)
     {
         return $file->getLink('tool', $this->stripPrefix($this->class));
     }
 
+    /**
+     * Clean namespace from class
+     *
+     * @return string
+     */
     public function getTitle()
     {
         return $this->stripPrefix($this->class);
     }
 
+    /**
+     * Removes custom namespace prefix
+     *
+     * @param string $class Class of object
+     *
+     * @return string
+     */
     protected function stripPrefix($class)
     {
         $prefix = '\\phorkie\\Tool_';
index e4aab634583887e98b4e4985673bd4b092a00f19..9435dc047d560624036e464ccf76851c5b49ad2c 100644 (file)
@@ -4,6 +4,13 @@ namespace phorkie;
 
 class Tools
 {
+    /**
+     * Delete an entire directory structure
+     *
+     * @param string $path Path to delete
+     *
+     * @return bool
+     */
     public static function recursiveDelete($path)
     {
         if (!is_dir($path) || is_link($path)) {