Author: sevein
Date: Tue Jul 10 21:17:28 2012
New Revision: 11899

Log:
Add simple task to get db version

Added:
   trunk/lib/task/getVersionTask.class.php

Added: trunk/lib/task/getVersionTask.class.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/lib/task/getVersionTask.class.php     Tue Jul 10 21:17:28 2012        
(r11899)
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of Qubit Toolkit.
+ *
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class getVersionTask extends sfBaseTask
+{
+  protected function configure()
+  {
+    $this->addOptions(array(
+      new sfCommandOption('application', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
+      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 
'The environment', 'cli'),
+      new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel')
+    ));
+
+    $this->namespace = 'tools';
+    $this->name = 'get-version';
+    $this->briefDescription = 'Get version';
+    $this->detailedDescription = <<<EOF
+FIXME
+EOF;
+  }
+
+  protected function execute($arguments = array(), $options = array())
+  {
+    $databaseManager = new sfDatabaseManager($this->configuration);
+    $conn = $databaseManager->getDatabase('propel')->getConnection();
+
+    $setting = 
QubitSetting::getSettingByName('version')->getValue(array('sourceCulture' => 
true));
+
+    $this->log(qubitConfiguration::VERSION.' v'.$setting);
+  }
+}

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" 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/qubit-commits?hl=en.

Reply via email to