Merge branch 'milestone' of github.com:jnovack/phorkie into milestone
authorChristian Weiske <cweiske@cweiske.de>
Fri, 21 Sep 2012 08:32:47 +0000 (10:32 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 21 Sep 2012 08:32:47 +0000 (10:32 +0200)
Conflicts:
README.rst

README.rst
src/phorkie/File.php
src/phorkie/Repository/Post.php
src/phorkie/Tool/Info.php

index 087b92c59ed11f7e0622be0632b1b7d144bd6936..831c2f9ffcb6d7f2f9165f2b3950b7925619ba72 100644 (file)
@@ -11,24 +11,29 @@ Project page: http://sourceforge.net/p/phorkie/
 ========
 Features
 ========
-  - every paste is a git repository
+- every paste is a git repository
+
   - repositories can be cloned
   - clone url can be displayed
-  - openid authentication
-  - paste editing
+- paste editing
+
   - add new files
   - delete existing files
   - replace file with upload
-  - multiple files in one paste
-  - syntax highlighting with GeSHi
-  - rST and Markdown rendering
-  - image upload + display
-  - external tool support
+- OpenID authentication
+- multiple files in one paste
+- syntax highlighting with GeSHi
+- rST and Markdown rendering
+- image upload + display
+- external tool support
+
   - xmllint
   - php syntax check
-  - history in the sidebar
+- history in the sidebar
+
   - old files can be downloaded easily
-  - search across pastes: description, file names and file content
+- search across pastes: description, file names and file content
+
   - options: quoting, logical and, or, not, partial words
 
 
@@ -37,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::
 
@@ -61,10 +66,17 @@ Installation
 
 Dependencies
 ============
-phorkie stands on the shoulders of giants.  Git will need to be a
-minimum version of v1.7.5.
+phorkie stands on the shoulders of giants.
+
+It requires the following programs to be installed
+on your machine:
+
+- Git v1.7.5 or later
+- PHP v5.3.0 or later
+- PEAR v1.9.2 or later
 
 ::
+
   $ pear install versioncontrol_git-alpha
   $ pear install services_libravatar-alpha
   $ pear install http_request2
@@ -82,10 +94,11 @@ minimum version of v1.7.5.
 
   $ 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.  If you install it manually be sure to update the
-path in ``data/config.default.php``.
+way to install it.
+If you install it manually be sure to update the
+path from ``data/config.default.php``.
 
 ======
 Search
@@ -133,7 +146,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.::
 
@@ -143,19 +156,26 @@ 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
+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.  Additionally, you can restrict your site to ``listedUsersOnly``.
-You will need to add the individual OpenIDs identity urls to the
+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``)
+- full site protection (``2``)
+
+Additionally, you can restrict your site to ``listedUsersOnly``.
+You will need to add the individual OpenID urls to the
 ``$GLOBALS['phorkie']['auth']['users']`` variable.
 
 
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 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 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_';