Author: rick
Date: 2010-03-16 14:09:39 +0100 (Tue, 16 Mar 2010)
New Revision: 28550

Added:
   plugins/sfCouchPlugin/trunk/lib/task/
   plugins/sfCouchPlugin/trunk/lib/task/sfCouchRefreshViewsTask.class.php
Modified:
   plugins/sfCouchPlugin/trunk/lib/sfCouchDocument.class.php
Log:
Added a task

Modified: plugins/sfCouchPlugin/trunk/lib/sfCouchDocument.class.php
===================================================================
--- plugins/sfCouchPlugin/trunk/lib/sfCouchDocument.class.php   2010-03-16 
12:09:34 UTC (rev 28549)
+++ plugins/sfCouchPlugin/trunk/lib/sfCouchDocument.class.php   2010-03-16 
13:09:39 UTC (rev 28550)
@@ -25,13 +25,6 @@
     protected $requiredProperties = array();
 
     /**
-     * Indicates wheather to keep old revisions of this document or not.
-     *
-     * @var bool
-     */
-    protected $versioned = false;
-
-    /**
      * Flag, indicating if current document has already been modified
      *
      * @var bool
@@ -54,8 +47,7 @@
     protected static $specialProperties = array(
         '_id',
         '_rev',
-        '_attachments',
-        'revisions',
+        '_attachments'
     );
 
     /**
@@ -82,7 +74,6 @@
     public function __construct($id = null)
     {
         $this->storage = new StdClass();
-        $this->storage->revisions = array();
         $this->storage->_id = null;
         $this->storage->_attachments = array();
 
@@ -168,30 +159,6 @@
             $revision->$property = $v;
         }
 
-        /*
-        // Set special properties from response object
-        $this->storage->_rev = $response->_rev;
-        $this->storage->_id  = $response->_id;
-
-        // Set attachements array, if the response object contains 
attachements.
-        if ( isset( $response->_attachments ) )
-        {
-            $this->storage->_attachments = $response->_attachments;
-        }
-        */
-
-        // Check if the source document already contains a revision history and
-        // store it in this case in the document object, if the object should
-        // be versioned at all.
-        if ( $this->versioned )
-        {
-            if ( isset( $response->revisions ) )
-            {
-                $this->storage->revisions = $response->revisions;
-            }
-            // Add current revision to revision history
-            $this->storage->revisions[] = (array) $revision;
-        }
         // Document freshly loaded, so it is not modified, and not a new
         // document...
         $this->modified = false;

Added: plugins/sfCouchPlugin/trunk/lib/task/sfCouchRefreshViewsTask.class.php
===================================================================
--- plugins/sfCouchPlugin/trunk/lib/task/sfCouchRefreshViewsTask.class.php      
                        (rev 0)
+++ plugins/sfCouchPlugin/trunk/lib/task/sfCouchRefreshViewsTask.class.php      
2010-03-16 13:09:39 UTC (rev 28550)
@@ -0,0 +1,31 @@
+<?php
+
+class createViewsTask extends sfBaseTask
+{
+  protected function configure()
+  {
+
+    $this->addOptions(array(
+      new sfCommandOption('application', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The application name'),
+      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 
'The environment', 'dev'),
+      new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
+      // add your own options here
+    ));
+
+    $this->namespace        = 'couch';
+    $this->name             = 'refreshViews';
+    $this->briefDescription = 'Refreshes the couchdb views';
+    $this->detailedDescription = <<<EOF
+The [couch:createViews|INFO] task refreshes the couchdb views.
+Call it with:
+
+  [php symfony couch:createViews|INFO]
+EOF;
+  }
+
+  protected function execute($arguments = array(), $options = array())
+  {
+    sfCouchView::checkDesignDoc();
+    $this->logSection('couch', 'Refreshing the views');
+  }
+}

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to