21e6997d751d9bacc41e55cf3c4440208da44ea2
Author: gwoo
Date: 2009-12-14 12:59:17 -0800
diff --git a/app_controller.php b/app_controller.php
index fa19b46..d7fb3d8 100755
--- a/app_controller.php
+++ b/app_controller.php
@@ -1,25 +1,50 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class AppController extends Controller {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
+ var $theme = null;
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
+ var $view = 'Theme';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $components = array('Access', 'Auth', 'RequestHandler', /*'DebugKit.Toolbar'*/);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Html', 'Form', 'Javascript', 'Chaw');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project');
/**
@@ -36,7 +61,7 @@ class AppController extends Controller {
if (!empty($this->params['admin'])) {
$this->Auth->authorize = 'controller';
- }
+ }
}
/**
diff --git a/app_error.php b/app_error.php
index 0714bf0..0b3116a 100644
--- a/app_error.php
+++ b/app_error.php
@@ -1,33 +1,32 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
-class AppError extends ErrorHandler {
/**
- * Controller instance.
+ * undocumented class
*
- * @var object
- * @access public
+ * @package default
*/
+class AppError extends ErrorHandler {
+
+ /**
+ * Controller instance.
+ *
+ * @var object
+ * @access public
+ */
var $controller = null;
-/**
- * Class constructor.
- *
- * @param string $method Method producing the error
- * @param array $messages Error messages
- */
+
+ /**
+ * Class constructor.
+ *
+ * @param string $method Method producing the error
+ * @param array $messages Error messages
+ */
function __construct($method, $messages) {
App::import('Core', 'Sanitize');
static $__previousError = null;
@@ -73,6 +72,12 @@ class AppError extends ErrorHandler {
$this->_stop();
}
+ /**
+ * undocumented function
+ *
+ * @param string $messages
+ * @return void
+ */
function missingAction($messages = array()) {
return parent::missingAction($messages);
/*
@@ -83,6 +88,12 @@ class AppError extends ErrorHandler {
*/
}
+ /**
+ * undocumented function
+ *
+ * @param string $messages
+ * @return void
+ */
function missingController($messages = array()) {
return parent::missingController($messages);
/*
diff --git a/app_helper.php b/app_helper.php
index c494d9c..99a072e 100755
--- a/app_helper.php
+++ b/app_helper.php
@@ -1,21 +1,25 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class AppHelper extends Helper {
-
+
+ /**
+ * undocumented function
+ *
+ * @param string $url
+ * @param string $full
+ * @return void
+ */
function url($url = null, $full = false) {
if (is_array($url)) {
if (!empty($this->params['project'])) {
diff --git a/app_model.php b/app_model.php
index 0433274..fe269bf 100755
--- a/app_model.php
+++ b/app_model.php
@@ -1,21 +1,23 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class AppModel extends Model {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $addToTimeline = true;
}
?>
\ No newline at end of file
diff --git a/config/bootstrap.php b/config/bootstrap.php
index ca1497f..29d9ae2 100755
--- a/config/bootstrap.php
+++ b/config/bootstrap.php
@@ -1,19 +1,9 @@
<?php
/**
- * Short description for file.
+ * Chaw : source code and project management
*
- * Long description for file
- *
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Licensed under The MIT License
- * Redistributions of files must retain the copyright notice.
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.config
- * @since Chaw 0.1
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
diff --git a/config/core.php b/config/core.php
index d4dfd0d..135fdbe 100755
--- a/config/core.php
+++ b/config/core.php
@@ -1,31 +1,4 @@
<?php
-/* SVN FILE: $Id: core.php 6314 2008-01-02 21:33:51Z phpnut $ */
-/**
- * This is core configuration file.
- *
- * Use it to configure core behavior of Cake.
- *
- * PHP versions 4 and 5
- *
- * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright 2005-2008, Cake Software Foundation, Inc.
- * 1785 E. Sahara Avenue, Suite 490-204
- * Las Vegas, Nevada 89104
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
- * @package cake
- * @subpackage cake.app.config
- * @since CakePHP(tm) v 0.2.9
- * @version $Revision: 6314 $
- * @modifiedby $LastChangedBy: phpnut $
- * @lastmodified $Date: 2008-01-02 13:33:51 -0800 (Wed, 02 Jan 2008) $
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- */
/**
* CakePHP Debug Level:
*
@@ -233,7 +206,7 @@
}
Cache::config('project', array(
- 'engine' => 'File', 'duration' => $duration,
+ 'engine' => 'File', 'duration' => $duration,
'prefix' => 'p_', 'path' => CACHE . 'projects'
));
diff --git a/config/database.php b/config/database.php
index 0afa423..471692e 100644
--- a/config/database.php
+++ b/config/database.php
@@ -13,7 +13,7 @@ class DATABASE_CONFIG {
'prefix' => '',
'encoding' => ''
);
-
+
var $test = array(
'driver' => 'mysql',
'persistent' => false,
diff --git a/config/routes.php b/config/routes.php
index 8f3747e..95d5a54 100755
--- a/config/routes.php
+++ b/config/routes.php
@@ -1,81 +1,74 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.config
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
- Router::parseExtensions('rss', 'tar');
- /* Base Routes */
- Router::connect('/', array('controller' => 'wiki', 'action' => 'index'));
- Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
- Router::connect('/start', array('controller' => 'pages', 'action' => 'start'));
- Router::connect('/dashboard', array('controller' => 'dashboard', 'action' => 'index'));
- Router::connect('/feed', array('controller' => 'dashboard', 'action' => 'feed'));
+Router::parseExtensions('rss');
+
+/* Base Routes */
+Router::connect('/', array('controller' => 'wiki', 'action' => 'index'));
+Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+Router::connect('/start', array('controller' => 'pages', 'action' => 'start'));
+Router::connect('/dashboard', array('controller' => 'dashboard', 'action' => 'index'));
+Router::connect('/feed', array('controller' => 'dashboard', 'action' => 'feed'));
- /* Admin Routes */
- Router::connect('/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'), array('admin' => true));
- Router::connect('/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'), array('admin' => true));
+/* Admin Routes */
+Router::connect('/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'), array('admin' => true));
+Router::connect('/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'), array('admin' => true));
- Router::connect('/forks/:fork/:project/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'));
- Router::connect('/forks/:fork/:project/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'));
+Router::connect('/forks/:fork/:project/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'));
+Router::connect('/forks/:fork/:project/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'));
- Router::connect('/:project/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'));
- Router::connect('/:project/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'));
+Router::connect('/:project/admin/:controller', array('admin'=> true, 'controller' => 'dashboard'));
+Router::connect('/:project/admin/:controller/:action/*', array('admin'=> true, 'controller' => 'dashboard'));
- /* Specific Routes */
- Router::connect('/fork/it', array('controller' => 'repo', 'action' => 'fork_it'), array('action' => 'fork_it'));
- Router::connect('/:project/fork/it', array('controller' => 'repo', 'action' => 'fork_it'), array('action' => 'fork_it'));
- //Router::connect('/download/:project', array('controller' => 'repo', 'action' => 'download', 'ext' => 'tar'), array('ext' => 'tar'));
- //Router::connect('/download/forks/:fork/:project', array('controller' => 'repo', 'action' => 'download', 'ext' => 'tar'), array('ext' => 'tar'));
+/* Specific Routes */
+Router::connect('/fork/it', array('controller' => 'repo', 'action' => 'fork_it'), array('action' => 'fork_it'));
+Router::connect('/:project/fork/it', array('controller' => 'repo', 'action' => 'fork_it'), array('action' => 'fork_it'));
+//Router::connect('/download/:project', array('controller' => 'repo', 'action' => 'download', 'ext' => 'tar'), array('ext' => 'tar'));
+//Router::connect('/download/forks/:fork/:project', array('controller' => 'repo', 'action' => 'download', 'ext' => 'tar'), array('ext' => 'tar'));
- /* General Routes */
- Router::connect('/:controller', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
- 'action' => 'index', 'project' => false)
- );
- Router::connect('/:controller/:action/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
- 'action' => 'branches|history|branch|logs|view|start|add|edit|modify|delete|remove|activate|forgotten|verify|change|login|account|logout|forks',
- 'project' => false)
- );
- Router::connect('/:controller/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
- 'action' => 'index', 'project' => false)
- );
+/* General Routes */
+Router::connect('/:controller', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
+ 'action' => 'index', 'project' => false)
+);
+Router::connect('/:controller/:action/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
+ 'action' => 'branches|history|branch|logs|view|start|add|edit|modify|delete|remove|activate|forgotten|verify|change|login|account|logout|forks',
+ 'project' => false)
+);
+Router::connect('/:controller/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
+ 'action' => 'index', 'project' => false)
+);
- /* Genral Fork Routes */
- Router::connect('/forks/:fork/:project/', array('controller' => 'source', 'action' => 'index'));
- Router::connect('/forks/:fork/:project/:controller', array('action' => 'index'), array('action' => 'index'));
- Router::connect('/forks/:fork/:project/:controller/:action/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects|repo',
- 'action' => 'branches|history|branch|logs|fast_forward|view|add|edit|modify|delete|remove|parent')
- );
- Router::connect('/forks/:fork/:project/:controller/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
- 'action' => 'index')
- );
+/* Genral Fork Routes */
+Router::connect('/forks/:fork/:project/', array('controller' => 'source', 'action' => 'index'));
+Router::connect('/forks/:fork/:project/:controller', array('action' => 'index'), array('action' => 'index'));
+Router::connect('/forks/:fork/:project/:controller/:action/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects|repo',
+ 'action' => 'branches|history|branch|logs|fast_forward|view|add|edit|modify|delete|remove|parent')
+);
+Router::connect('/forks/:fork/:project/:controller/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
+ 'action' => 'index')
+);
- /* Genral Project Routes */
- Router::connect('/:project', array('controller' => 'source', 'action' => 'index'));
- Router::connect('/:project/:controller', array('action' => 'index'), array('action' => 'index'));
- Router::connect('/:project/:controller/:action/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects|repo',
- 'action' => 'branches|history|branch|logs|merge|view|add|edit|modify|delete|remove|forks')
- );
- Router::connect('/:project/:controller/*', array(), array(
- 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
- 'action' => 'index')
- );
+/* Genral Project Routes */
+Router::connect('/:project', array('controller' => 'source', 'action' => 'index'));
+Router::connect('/:project/:controller', array('action' => 'index'), array('action' => 'index'));
+Router::connect('/:project/:controller/:action/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects|repo',
+ 'action' => 'branches|history|branch|logs|merge|view|add|edit|modify|delete|remove|forks')
+);
+Router::connect('/:project/:controller/*', array(), array(
+ 'controller' => 'source|wiki|commits|tickets|comments|timeline|versions|users|projects',
+ 'action' => 'index')
+);
diff --git a/config/schema/schema.php b/config/schema/schema.php
index 3e53c9c..7938a2e 100644
--- a/config/schema/schema.php
+++ b/config/schema/schema.php
@@ -1,6 +1,12 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Chaw schema generated on: 2009-12-14 08:12:10 : 1260809950*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class ChawSchema extends CakeSchema {
var $name = 'Chaw';
diff --git a/controllers/comments_controller.php b/controllers/comments_controller.php
index d2b0976..b2e6dc5 100644
--- a/controllers/comments_controller.php
+++ b/controllers/comments_controller.php
@@ -1,23 +1,31 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class CommentsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Comments';
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function delete($id = null) {
if (empty($this->params['isAdmin'])) {
$this->Session->setFlash(__('Authorization Failed',true));
diff --git a/controllers/commits_controller.php b/controllers/commits_controller.php
index 4d57f94..108b469 100755
--- a/controllers/commits_controller.php
+++ b/controllers/commits_controller.php
@@ -1,27 +1,44 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class CommitsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Commits';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Time', 'Text');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $paginate = array('order' => 'Commit.commit_date DESC');
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
$this->Commit->recursive = 0;
$this->Commit->bindModel(array('hasOne' => array(
@@ -35,12 +52,24 @@ class CommitsController extends AppController {
$this->set('commits', $this->paginate('Commit', $conditions));
}
+ /**
+ * undocumented function
+ *
+ * @param string $revision
+ * @return void
+ */
function view($revision = null) {
$branches = $this->Project->Repo->find('branches');
$commit = $this->Commit->findByRevision($revision);
$this->set(compact('commit', 'branches'));
}
+ /**
+ * undocumented function
+ *
+ * @param string $commits
+ * @return void
+ */
function logs($commits = null) {
$Source = ClassRegistry::init('Source');
$this->paginate = array('order' => 'asc');
@@ -48,6 +77,11 @@ class CommitsController extends AppController {
$this->set(compact('commits', 'args', 'current'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function branch() {
$branches = $this->Project->Repo->find('branches');
$args = func_get_args();
@@ -66,6 +100,11 @@ class CommitsController extends AppController {
$this->set(compact('commits', 'branches', 'args', 'current'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function history() {
$args = func_get_args();
if ($this->Project->Repo->type == 'git') {
@@ -84,6 +123,12 @@ class CommitsController extends AppController {
$this->set(compact('commits', 'args', 'current'));
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function remove($id = null) {
if (!$id || empty($this->params['isAdmin'])) {
$this->redirect($this->referer());
diff --git a/controllers/components/access.php b/controllers/components/access.php
index 5efef2d..ba6c4d5 100755
--- a/controllers/components/access.php
+++ b/controllers/components/access.php
@@ -1,62 +1,66 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers.components
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
-class AccessComponent extends Object {
/**
- * undocumented class variable
+ * undocumented class
*
- * @var string
- **/
+ * @package default
+ */
+class AccessComponent extends Object {
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $access = 'r';
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $user = array();
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $url = false;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $isPublic = true;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $isAllowed = false;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $allowedActions = array();
-/**
- * initialize
- *
- * @return void
- *
- **/
+
+ /**
+ * initialize
+ *
+ * @return void
+ *
+ */
function initialize(&$C) {
$C->params['isAdmin'] = false;
@@ -128,12 +132,13 @@ class AccessComponent extends Object {
return true;
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function startup(&$C) {
if (!empty($_COOKIE['Chaw']['User']) && empty($this->user) && $C->action !== 'login' && $C->action !== 'logout') {
$C->Session->write('Access.redirect', '/' . ltrim($this->url, '/'));
@@ -201,14 +206,15 @@ class AccessComponent extends Object {
}
return false;
}
-/**
- * Check access against permissions
- *
- * @param array options
- * username, action, access, admin, default
- * @return void
- *
- **/
+
+ /**
+ * Check access against permissions
+ *
+ * @param array options
+ * username, action, access, admin, default
+ * @return void
+ *
+ */
function check(&$C, $options = array()) {
extract(array_merge(array(
'username' => $this->user('username'),
@@ -261,12 +267,13 @@ class AccessComponent extends Object {
}
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function user($key = null) {
if (empty($this->user)) {
return false;
@@ -293,12 +300,13 @@ class AccessComponent extends Object {
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function allow($actions = array()) {
if (!is_array($actions)) {
$actions = func_get_args();
diff --git a/controllers/components/gpr.php b/controllers/components/gpr.php
index 488df95..7c793d8 100644
--- a/controllers/components/gpr.php
+++ b/controllers/components/gpr.php
@@ -1,25 +1,39 @@
<?php
/**
- * GprComponent
+ * Chaw : source code and project management
*
- * Get, Post, Redirect component for CakePHP
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers.components
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class GprComponent extends Object {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $keys = array();
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actions = array();
+ /**
+ * undocumented function
+ *
+ * @param string $controller
+ * @param string $options
+ * @return void
+ */
function initialize($controller, $options) {
$this->params = $_GET;
unset($this->params['url']);
@@ -55,6 +69,12 @@ class GprComponent extends Object {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $controller
+ * @return void
+ */
function startup($controller) {
if (in_array($controller->action, $this->allowedActions)) {
foreach ($this->keys as $key) {
@@ -70,6 +90,12 @@ class GprComponent extends Object {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $keys
+ * @return void
+ */
function keys($keys) {
$this->keys = array_merge($this->keys, $keys);
}
diff --git a/controllers/dashboard_controller.php b/controllers/dashboard_controller.php
index 76833ca..7288879 100755
--- a/controllers/dashboard_controller.php
+++ b/controllers/dashboard_controller.php
@@ -1,37 +1,64 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class DashboardController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Dashboard';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Timeline');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Text');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $paginate = array(
'limit' => 20,
'order' => 'Timeline.created DESC, Timeline.id DESC'
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeFilter() {
parent::beforeFilter();
$this->Access->allow('index', 'feed');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
Router::connectNamed(array('page', 'type'));
@@ -54,6 +81,11 @@ class DashboardController extends AppController {
$this->set('timeline', $this->paginate('Timeline'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function feed() {
$this->set('rssFeed', array('controller' => 'dashboard', 'action' => 'feed'));
@@ -72,6 +104,11 @@ class DashboardController extends AppController {
$this->set('feed', $this->paginate('Timeline'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_index() {
Router::connectNamed(array('page', 'type'));
diff --git a/controllers/pages_controller.php b/controllers/pages_controller.php
index 5e9c78e..e558eaf 100755
--- a/controllers/pages_controller.php
+++ b/controllers/pages_controller.php
@@ -1,38 +1,15 @@
<?php
-/* SVN FILE: $Id: pages_controller.php 6296 2008-01-01 22:18:17Z phpnut $ */
/**
- * Static content controller.
+ * Chaw : source code and project management
*
- * This file will render views from views/pages/
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * PHP versions 4 and 5
- *
- * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright 2005-2008, Cake Software Foundation, Inc.
- * 1785 E. Sahara Avenue, Suite 490-204
- * Las Vegas, Nevada 89104
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
- * @package cake
- * @subpackage cake.cake.libs.controller
- * @since CakePHP(tm) v 0.2.9
- * @version $Revision: 6296 $
- * @modifiedby $LastChangedBy: phpnut $
- * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
- * Static content controller
+ * undocumented class
*
- * Override this controller by placing a copy in controllers directory of an application
- *
- * @package cake
- * @subpackage cake.cake.libs.controller
+ * @package default
*/
class PagesController extends AppController{
/**
@@ -61,7 +38,7 @@ class PagesController extends AppController{
*
* @return void
*
- **/
+ */
function beforeFilter() {
parent::beforeFilter();
}
@@ -70,7 +47,7 @@ class PagesController extends AppController{
*
* @return void
*
- **/
+ */
function start() {
}
diff --git a/controllers/permissions_controller.php b/controllers/permissions_controller.php
index 96987dd..e89d24a 100755
--- a/controllers/permissions_controller.php
+++ b/controllers/permissions_controller.php
@@ -1,23 +1,30 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class PermissionsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Permissions';
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_index() {
if (empty($this->params['isAdmin'])) {
$this->redirect($this->referer());
@@ -41,7 +48,12 @@ class PermissionsController extends AppController {
$this->set(compact('users', 'groups'));
}
-
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function admin_remove($id = null) {
if (!$id || empty($this->params['isAdmin'])) {
$this->Session->setFlash(__('Invalid request',true));
diff --git a/controllers/projects_controller.php b/controllers/projects_controller.php
index a617bb4..b44365c 100755
--- a/controllers/projects_controller.php
+++ b/controllers/projects_controller.php
@@ -1,27 +1,39 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class ProjectsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Projects';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $paginate = array(
'order' => 'Project.users_count DESC, Project.created ASC'
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeFilter() {
parent::beforeFilter();
$this->Auth->mapActions(array('fork' => 'create'));
@@ -29,6 +41,11 @@ class ProjectsController extends AppController {
$this->Access->allow('index', 'start');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
Router::connectNamed(array('type', 'page'));
@@ -73,6 +90,11 @@ class ProjectsController extends AppController {
$this->set('rssFeed', array('controller' => 'projects'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function forks() {
$this->paginate['conditions'] = array(
'Project.fork !=' => null, 'Project.project_id' => $this->Project->id
@@ -84,6 +106,12 @@ class ProjectsController extends AppController {
$this->render('index');
}
+ /**
+ * undocumented function
+ *
+ * @param string $url
+ * @return void
+ */
function view($url = null) {
$project = array('Project' => $this->Project->current);
if (empty($this->params['project']) && $url == null && $project['id'] != 1) {
@@ -93,6 +121,12 @@ class ProjectsController extends AppController {
$this->set('project', $project);
}
+ /**
+ * undocumented function
+ *
+ * @param string $type
+ * @return void
+ */
function start($type = null) {
$this->pageTitle = 'Projects/Start';
if ($type || !empty($this->data)) {
@@ -101,6 +135,11 @@ class ProjectsController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function add() {
if (!empty($this->data)) {
$this->Project->create(array(
@@ -147,6 +186,11 @@ class ProjectsController extends AppController {
$this->render('add');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function edit() {
if ($this->params['isAdmin'] === false) {
$this->redirect($this->referer());
@@ -175,6 +219,12 @@ class ProjectsController extends AppController {
$this->render('edit');
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function remove($id) {
$project = $this->Project->findById($id);
if (empty($project)) {
@@ -188,6 +238,11 @@ class ProjectsController extends AppController {
$this->redirect($this->referer());
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function delete() {
if (!empty($this->params['form']['cancel'])) {
$this->redirect(array('controller' => 'source'));
@@ -220,6 +275,11 @@ class ProjectsController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_index() {
if ($this->Project->id != 1 || $this->params['isAdmin'] === false) {
$this->redirect($this->referer());
@@ -248,6 +308,11 @@ class ProjectsController extends AppController {
$this->set('projects', $this->paginate());
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_add() {
$this->pageTitle = 'Project Setup';
@@ -286,6 +351,12 @@ class ProjectsController extends AppController {
$this->set('messages', $this->Project->messages);
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function admin_edit($id = null) {
if (!$id) {
$this->Session->setFlash(__('The project was invalid',true));
@@ -317,12 +388,24 @@ class ProjectsController extends AppController {
$this->set('messages', $this->Project->messages);
}
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @return void
+ */
function admin_approve($project = null) {
$this->_toggle($project, array(
'field' => 'approved', 'value' => 1, 'action' => 'approved'
));
}
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @return void
+ */
function admin_reject($project = null) {
$this->_toggle($project, array(
'field' => 'approved', 'value' => 0, 'action' => 'rejected'
@@ -330,18 +413,37 @@ class ProjectsController extends AppController {
}
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @return void
+ */
function admin_activate($project = null) {
$this->_toggle($project, array(
'field' => 'active', 'value' => 1, 'action' => 'activated'
));
}
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @return void
+ */
function admin_deactivate($project = null) {
$this->_toggle($project, array(
'field' => 'active', 'value' => 0, 'action' => 'deactivated'
));
}
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @param string $options
+ * @return void
+ */
function _toggle($project, $options = array()) {
$options = array_merge(array('field' => null, 'value' => null, 'action' => null), $options);
@@ -387,6 +489,10 @@ class ProjectsController extends AppController {
$this->redirect(array('project' => false, 'fork' => false, 'action' => 'index'));
}
+ /**
+ * undocumented
+ *
+ */
function &_loadEmail() {
App::import('Component', 'Email');
$Email = new EmailComponent();
diff --git a/controllers/repo_controller.php b/controllers/repo_controller.php
index e62a491..0f5cb8f 100644
--- a/controllers/repo_controller.php
+++ b/controllers/repo_controller.php
@@ -1,24 +1,37 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class RepoController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Repo';
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Commit');
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function fast_forward() {
if ($this->Project->Repo->type != 'git') {
$this->Session->setFlash(__('You cannot fork an svn project yet',true));
@@ -35,6 +48,12 @@ class RepoController extends AppController {
$this->redirect($this->referer());
}
+ /**
+ * undocumented function
+ *
+ * @param string $fork
+ * @return void
+ */
function merge($fork = null) {
if ($this->Project->Repo->type != 'git') {
$this->Session->setFlash(__('You cannot fork an svn project yet',true));
@@ -61,6 +80,11 @@ class RepoController extends AppController {
$this->redirect($this->referer());
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function fork_it() {
if ($this->Project->Repo->type != 'git') {
$this->Session->setFlash(__('You cannot fork an svn project',true));
@@ -115,6 +139,11 @@ class RepoController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function download() {
if ($this->RequestHandler->ext == 'tar') {
$this->set(array(
diff --git a/controllers/source_controller.php b/controllers/source_controller.php
index 52bf68b..62cbfa2 100644
--- a/controllers/source_controller.php
+++ b/controllers/source_controller.php
@@ -1,32 +1,31 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
-class SourceController extends AppController {
/**
- * undocumented class variable
+ * undocumented class
*
- * @var string
- **/
+ * @package default
+ */
+class SourceController extends AppController {
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $name = 'Source';
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function beforeFilter() {
parent::beforeFilter();
$this->Auth->mapActions(array(
@@ -34,12 +33,13 @@ class SourceController extends AppController {
'rebase' => 'update'
));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function index() {
$args = func_get_args();
if ($this->Project->Repo->type == 'git') {
@@ -47,11 +47,11 @@ class SourceController extends AppController {
} else {
$this->Project->Repo->update();
}
-
+
list($args, $path, $current) = $this->Source->initialize($this->Project->Repo, $args);
$data = $this->Source->read($path);
-
+
$this->pageTitle = $current;
if (!empty($args)) {
$this->pageTitle = join('/', $args) . '/' . $current;
@@ -59,12 +59,13 @@ class SourceController extends AppController {
$this->set(compact('data', 'path', 'args', 'current'));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function branches() {
$args = func_get_args();
if ($this->Project->Repo->type == 'svn') {
@@ -84,12 +85,13 @@ class SourceController extends AppController {
$this->render('index');
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function rebase() {
if (!empty($this->params['isAdmin'])) {
if ($this->Source->rebase()) {
@@ -101,12 +103,12 @@ class SourceController extends AppController {
$this->redirect($this->referer());
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented function
+ *
+ * @return void
+ *
+ */
function delete($branch = null) {
$this->autoRender = false;
if (!empty($branch) && !empty($this->params['isAdmin'])) {
diff --git a/controllers/tickets_controller.php b/controllers/tickets_controller.php
index 2c4983b..58f7b1d 100755
--- a/controllers/tickets_controller.php
+++ b/controllers/tickets_controller.php
@@ -1,27 +1,44 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class TicketsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Tickets';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Time');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $paginate = array('order' => array('Ticket.number' => 'desc'));
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $components = array(
'Gpr' => array(
'keys' => array('type', 'priority'),
@@ -30,6 +47,11 @@ class TicketsController extends AppController {
)
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
$conditions = array(
'Ticket.project_id' => $this->Project->id,
@@ -85,6 +107,12 @@ class TicketsController extends AppController {
$this->_ticketInfo(false);
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid ticket',true));
@@ -134,6 +162,12 @@ class TicketsController extends AppController {
$this->_ticketInfo();
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function modify($id = null) {
if (empty($this->params['form']['cancel']) && !empty($this->data)) {
@@ -162,6 +196,12 @@ class TicketsController extends AppController {
$this->redirect(array('action' => 'view', $id));
}
+ /**
+ * undocumented function
+ *
+ * @param string $all
+ * @return void
+ */
function _ticketInfo($all = true) {
if ($all) {
$versions = $this->Ticket->Version->find('list', array(
diff --git a/controllers/timeline_controller.php b/controllers/timeline_controller.php
index 6f55b0b..d98db77 100755
--- a/controllers/timeline_controller.php
+++ b/controllers/timeline_controller.php
@@ -1,30 +1,47 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class TimelineController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Timeline';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Time', 'Text');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $paginate = array(
'limit' => 20,
'order' => 'Timeline.created DESC, Timeline.id DESC'
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
Router::connectNamed(array('type', 'page'));
@@ -46,6 +63,11 @@ class TimelineController extends AppController {
$this->set('rssFeed', array('controller' => 'timeline'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function parent() {
if (!empty($this->Project->current['fork'])) {
$this->paginate['conditions'] = array(
@@ -58,6 +80,11 @@ class TimelineController extends AppController {
$this->render('index');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function forks() {
if (empty($this->Project->current['fork'])) {
$forks = $this->Project->forks();
@@ -71,6 +98,12 @@ class TimelineController extends AppController {
$this->render('index');
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function remove($id = null) {
if (!$id || empty($this->params['isAdmin'])) {
$this->redirect($this->referer());
diff --git a/controllers/users_controller.php b/controllers/users_controller.php
index a6bd3de..210237f 100755
--- a/controllers/users_controller.php
+++ b/controllers/users_controller.php
@@ -1,23 +1,30 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class UsersController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Users';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $components = array(
'Email', 'Cookie' => array('name' => 'Chaw', 'time' => '+2 weeks'),
'Gpr' => array(
@@ -25,6 +32,11 @@ class UsersController extends AppController {
)
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeFilter() {
parent::beforeFilter();
$this->Auth->autoRedirect = false;
@@ -39,13 +51,29 @@ class UsersController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
$this->redirect(array('action' => 'account'));
}
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function view() {
$this->redirect(array('action' => 'account'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function login() {
if ($cookie = $this->Cookie->read('User')) {
$this->Session->write('Auth.User', $cookie);
@@ -109,6 +137,11 @@ class UsersController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function logout() {
$this->Cookie->destroy('User');
$this->Auth->logout();
@@ -117,6 +150,11 @@ class UsersController extends AppController {
$this->redirect('/');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function add() {
if (!empty($this->data)) {
$this->User->create();
@@ -131,6 +169,11 @@ class UsersController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function account() {
$id = $this->Auth->user('id');
if (!$id) {
@@ -140,6 +183,12 @@ class UsersController extends AppController {
$this->render('edit');
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function edit($id = null) {
if (!$id && !empty($this->passedArgs[0])) {
$id = $this->passedArgs[0];
@@ -185,6 +234,11 @@ class UsersController extends AppController {
$this->set(compact('sshKeys', 'types'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_index() {
if (!empty($this->data['Permission'])) {
foreach ($this->data['Permission'] as $permission) {
@@ -206,39 +260,56 @@ class UsersController extends AppController {
$this->User->bindModel(array('hasOne' => array('Permission' => array(
'conditions' => array('Permission.project_id' => $this->Project->id
)))), false);
-
+
$this->paginate['order'] = 'Permission.group ASC';
$this->paginate['fields'] = array(
- 'User.id', 'User.username', 'User.email', 'User.last_login',
+ 'User.id', 'User.username', 'User.email', 'User.last_login',
'Permission.id', 'Permission.group'
);
-
+
$this->paginate['conditions'] = array('Permission.project_id' => $this->Project->id);
-
+
if (!empty($this->passedArgs['all']) && ($this->params['isAdmin'] && $this->Project->id == 1)) {
$this->paginate['conditions'] = array();
} else {
$groups = $this->Project->groups();
}
-
+
if (!empty($this->passedArgs['username'])) {
$this->paginate['conditions'] = array('User.username' => $this->passedArgs['username']);
}
-
+
$users = $this->paginate();
$this->set(compact('users', 'groups'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_add() {
$this->add();
$this->render('add');
}
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_edit() {
$this->edit();
$this->render('edit');
}
+ /**
+ * undocumented function
+ *
+ * @param string $token
+ * @return void
+ */
function activate($token = null) {
if (empty($token)) {
if ($data = $this->User->setToken($this->Auth->user())) {
@@ -274,6 +345,11 @@ class UsersController extends AppController {
$this->redirect('/dashboard');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function forgotten() {
if ($this->Auth->user()) {
$this->redirect(array('action' => 'account'));
@@ -300,6 +376,12 @@ class UsersController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $token
+ * @return void
+ */
function verify($token = null) {
if (!empty($token)) {
if ($data = $this->User->setTempPassword(compact('token'))) {
@@ -325,6 +407,11 @@ class UsersController extends AppController {
$this->redirect(array('action' => 'login'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function change() {
if (!empty($this->data)) {
$this->User->id = $this->Auth->user('id');
@@ -338,6 +425,12 @@ class UsersController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function admin_remove($id = null) {
if ($id && $this->Project->id == 1 && !empty($this->params['isAdmin'])) {
$this->User->id = $id;
diff --git a/controllers/versions_controller.php b/controllers/versions_controller.php
index 8ad6dae..d968b36 100755
--- a/controllers/versions_controller.php
+++ b/controllers/versions_controller.php
@@ -1,24 +1,37 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class VersionsController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Versions';
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Html', 'Form');
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
$this->Version->recursive = 0;
$this->paginate = array(
@@ -27,6 +40,12 @@ class VersionsController extends AppController {
$this->set('versions', $this->paginate());
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Version.', true));
@@ -36,6 +55,11 @@ class VersionsController extends AppController {
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_index() {
$this->Version->recursive = 0;
@@ -50,6 +74,11 @@ class VersionsController extends AppController {
$this->render('index');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function admin_add() {
$this->pageTitle = __("New Version",true);
@@ -64,6 +93,12 @@ class VersionsController extends AppController {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @return void
+ */
function admin_edit($id = null) {
if (empty($this->params['isAdmin'])) {
$this->Session->setFlash(__('Invalid Action.', true));
diff --git a/controllers/wiki_controller.php b/controllers/wiki_controller.php
index c612417..d85d8dd 100755
--- a/controllers/wiki_controller.php
+++ b/controllers/wiki_controller.php
@@ -1,25 +1,37 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class WikiController extends AppController {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Wiki';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $helpers = array('Text');
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function index() {
extract($this->__params());
@@ -142,6 +154,11 @@ class WikiController extends AppController {
$this->render('index');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function add() {
extract($this->__params());
@@ -190,12 +207,22 @@ class WikiController extends AppController {
$this->set(compact('path', 'slug'));
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function edit() {
$this->pageTitle = 'Wiki/edit/';
$this->add();
$this->render('add');
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function __params() {
$path = '/'; $slug = null;
$slug = $this->Wiki->slug(array_pop($this->passedArgs));
diff --git a/models/behaviors/directory.php b/models/behaviors/directory.php
index 877c4fd..4b7f6e9 100644
--- a/models/behaviors/directory.php
+++ b/models/behaviors/directory.php
@@ -1,21 +1,25 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class DirectoryBehavior extends ModelBehavior {
+ /**
+ * undocumented function
+ *
+ * @param string $Model
+ * @param string $settings
+ * @return void
+ */
function setup(&$Model, $settings = array()) {
if (!isset($this->settings[$Model->alias])) {
$this->settings[$Model->alias] = array('field' => 'path');
@@ -23,6 +27,13 @@ class DirectoryBehavior extends ModelBehavior {
$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], (array)$settings);
}
+ /**
+ * undocumented function
+ *
+ * @param string $Model
+ * @param string $query
+ * @return void
+ */
function beforeFind(&$Model, $query) {
extract($this->settings[$Model->alias]);
@@ -48,6 +59,12 @@ class DirectoryBehavior extends ModelBehavior {
return $query;
}
+ /**
+ * undocumented function
+ *
+ * @param string $Model
+ * @return void
+ */
function beforeSave(&$Model) {
if (!empty($Model->data[$Model->alias]['path'])) {
diff --git a/models/behaviors/state_machine.php b/models/behaviors/state_machine.php
index bce32a7..2aad49e 100644
--- a/models/behaviors/state_machine.php
+++ b/models/behaviors/state_machine.php
@@ -1,7 +1,25 @@
<?php
-
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+/**
+ * undocumented class
+ *
+ * @package default
+ */
class StateMachineBehavior extends ModelBehavior {
+ /**
+ * undocumented function
+ *
+ * @param string $model
+ * @param string $config
+ * @return void
+ */
function setup(&$model, $config) {
$defaults = array(
'field' => 'state', 'default' => null, 'states' => array(),
@@ -22,6 +40,14 @@ class StateMachineBehavior extends ModelBehavior {
$this->mapMethods['/^(' . join('|', $config['events']) . ')$/'] = 'event';
}
+ /**
+ * undocumented function
+ *
+ * @param string $model
+ * @param string $from
+ * @param string $to
+ * @return void
+ */
function transition(&$model, $from, $to = null) {
$model->recursive = -1;
if (!empty($model->data[$model->alias][$this->settings[$model->name]['field']])) {
@@ -94,6 +120,7 @@ class StateMachineBehavior extends ModelBehavior {
}
return $results;
}
+
/**
* If 'transitions' is defined in settings, returns the possible transition events for the
* current state.
@@ -121,6 +148,12 @@ class StateMachineBehavior extends ModelBehavior {
return false;
}
+ /**
+ * undocumented function
+ *
+ * @param string $model
+ * @return void
+ */
function beforeValidate(&$model) {
if ($model->exists()) {
return true;
diff --git a/models/branch.php b/models/branch.php
deleted file mode 100644
index 35ea928..0000000
--- a/models/branch.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.tests.fixtures
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class Branch extends AppModel {
-
- var $name = 'Branch';
-
- var $validate = array(
- 'name' => array(
- 'required' => true, 'rule' => 'notEmpty'
- ),
- 'project_id' => array(
- 'required' => true, 'rule' => 'numeric'
- )
- );
-
- function beforeSave() {
- $ref = explode('/', $this->data['Branch']['name']);
- $this->data['Branch']['name'] = array_pop($ref);
- $this->data['Branch']['ref'] = join('/', $ref);
- $this->id = $this->field('id', array(
- 'name' => $this->data['Branch']['name'],
- 'ref' => $this->data['Branch']['ref'],
- 'project_id' => $this->data['Branch']['project_id']
- ));
- return $this->id == false;
- }
-}
-?>
\ No newline at end of file
diff --git a/models/comment.php b/models/comment.php
index eb9bff2..0a42795 100644
--- a/models/comment.php
+++ b/models/comment.php
@@ -1,23 +1,30 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Comment extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Comment';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array(
'User',
'Ticket' => array(
@@ -34,6 +41,12 @@ class Comment extends AppModel {
)
);
*/
+ /**
+ * undocumented function
+ *
+ * @param string $created
+ * @return void
+ */
function afterSave($created) {
if ($created && $this->addToTimeline && !empty($this->data['Comment']['project_id'])) {
$Timeline = ClassRegistry::init('Timeline');
diff --git a/models/commit.php b/models/commit.php
index 0c9cc5f..58fd4b2 100644
--- a/models/commit.php
+++ b/models/commit.php
@@ -1,23 +1,30 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Commit extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Commit';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array(
'project_id' => array('notEmpty'),
'revision' => array('isUnique'),
@@ -27,6 +34,11 @@ class Commit extends AppModel {
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array(
'User', 'Project'
);
@@ -39,6 +51,13 @@ class Commit extends AppModel {
)
);
*/
+ /**
+ * undocumented function
+ *
+ * @param string $one
+ * @param string $two
+ * @return void
+ */
function set($one = array(), $two = null) {
parent::set($one, $two);
if (!empty($this->data)) {
@@ -47,6 +66,12 @@ class Commit extends AppModel {
), $this->data['Commit']);
}
}
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave() {
if (empty($this->data['Commit']['user_id']) && !empty($this->data['Commit']['author'])) {
$this->data['Commit']['user_id'] = $this->User->field('id', array('username' => $this->data['Commit']['author']));
@@ -58,14 +83,20 @@ class Commit extends AppModel {
if (!empty($this->data['Commit']['branch'])) {
$ref = explode('/', $this->data['Commit']['branch']);
$this->data['Commit']['branch'] = array_pop($ref);
- }
-
+ }
+
return true;
}
+ /**
+ * undocumented function
+ *
+ * @param string $created
+ * @return void
+ */
function afterSave($created) {
$this->log($this->data);
-
+
if ($created && $this->addToTimeline) {
$Timeline = ClassRegistry::init('Timeline');
$timeline = array('Timeline' => array(
@@ -81,6 +112,12 @@ class Commit extends AppModel {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $revision
+ * @return void
+ */
function findByRevision($revision) {
$commit = parent::findByRevision($revision);
$data = $this->Project->Repo->read($revision, true);
@@ -92,6 +129,13 @@ class Commit extends AppModel {
return $commit;
}
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @param string $options
+ * @return void
+ */
function isUnique($data, $options = array()) {
if (!empty($data['revision'])) {
$this->recursive = -1;
diff --git a/models/permission.php b/models/permission.php
index bdbfe66..f61e587 100644
--- a/models/permission.php
+++ b/models/permission.php
@@ -1,46 +1,66 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Permission extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Permission';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array('User', 'Project');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $__rules = array();
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $__config = array();
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @return void
+ */
function user($user = null) {
if (!is_numeric($user)) {
$user = $this->User->field('id', array('username' => $user));
}
return $user;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @param string $user
+ * @return void
+ */
function group($project, $user = null) {
if (is_array($project)) {
extract($project);
@@ -54,12 +74,13 @@ class Permission extends AppModel {
return $this->field('group', array('project_id' => $project, 'user_id' => $user));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $config
+ * @return void
+ */
function saveFile($config = array()) {
if (empty($config['repo'])) {
$this->set($config);
@@ -115,12 +136,13 @@ class Permission extends AppModel {
$this->__rules = array();
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $config
+ * @return void
+ */
function config($config = array()) {
if (!empty($config)) {
return $this->__config = array_merge($this->__config, $config);
@@ -131,12 +153,13 @@ class Permission extends AppModel {
return $this->__config;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented function
+ *
+ * @param string $path
+ * @param string $options
+ * @return void
+ */
function check($path, $options = array()) {
$defaults = array(
'user' => null, 'group' => null, 'access' => null,
@@ -221,12 +244,13 @@ class Permission extends AppModel {
}
return $default;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $rules
+ * @return void
+ */
function groups($rules = null) {
if ($rules === null) {
$rules = $this->rules();
@@ -246,12 +270,14 @@ class Permission extends AppModel {
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @param string $atomic
+ * @return void
+ */
function rules($project = null, $atomic = array()) {
$config = $this->config();
@@ -300,12 +326,13 @@ class Permission extends AppModel {
return $this->__rules[$project];
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $string
+ * @return void
+ */
function toArray($string = null) {
if (!$string) {
return array();
@@ -350,22 +377,22 @@ class Permission extends AppModel {
}
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function fileExists() {
$File = $this->__getFile();
return $File->exists();
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function file() {
$File = $this->__getFile();
if (!$File->readable()) {
@@ -375,12 +402,12 @@ class Permission extends AppModel {
}
return $File->read();
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function root() {
$path = Configure::read("Content.base");
$File = new File($path . 'permissions.ini');
@@ -389,12 +416,12 @@ class Permission extends AppModel {
}
return $File->read();
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function parent() {
$config = $this->config();
if($config['id'] == 1 || empty($config['fork'])) {
@@ -412,12 +439,11 @@ class Permission extends AppModel {
}
return $File->read();
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented
+ *
+ */
function &__getFile() {
$config = $this->config();
$path = $config['repo']['path'] . DS;
diff --git a/models/project.php b/models/project.php
index eb2d005..5f979c2 100755
--- a/models/project.php
+++ b/models/project.php
@@ -15,50 +15,56 @@
*
*/
class Project extends AppModel {
-/**
- * undocumented class variable
- *
- * @var string
- **/
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $name = 'Project';
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $current = array();
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $Repo;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $hooks = array(
'git' => array('pre-receive', 'post-receive'),
'svn' => array('pre-commit', 'post-commit')
);
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $repoTypes = array('Git', 'Svn');
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $messages = array('response' => null, 'debug' => null);
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $validate = array(
'name' => array(
'minimum' => array(
@@ -74,30 +80,34 @@ class Project extends AppModel {
),
'user_id' => array('notEmpty')
);
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $belongsTo = array('User');
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $hasMany = array('Permission');
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $__created = false;
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $params
+ * @return void
+ */
function initialize($params = array()) {
$this->recursive = -1;
$this->current = Configure::read('Project');
@@ -181,12 +191,12 @@ class Project extends AppModel {
$this->Repo = ClassRegistry::init($this->current['repo']);
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeValidate() {
if (!empty($this->data['Project']['name']) && empty($this->data['Project']['url'])) {
$this->data['Project']['url'] = Inflector::slug(strtolower($this->data['Project']['name']));
@@ -198,12 +208,12 @@ class Project extends AppModel {
}
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave() {
$this->createShell();
if (empty($this->data['Project']['fork'])) {
@@ -248,12 +258,13 @@ class Project extends AppModel {
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $created
+ * @return void
+ */
function afterSave($created) {
if (!empty($this->data['Project']['approved'])) {
@@ -316,12 +327,12 @@ class Project extends AppModel {
$this->__created = false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function afterDelete() {
$CleanUp = new Folder($this->Repo->path);
if ($CleanUp->pwd() == $this->Repo->path && strpos($this->Repo->path, 'forks') !== false) {
@@ -337,12 +348,14 @@ class Project extends AppModel {
}
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $hooks
+ * @param string $options
+ * @return void
+ */
function createHooks($hooks, $options = array()) {
extract(array_merge(array('project' => null, 'fork' => null, 'root' => null), $options));
$result = array();
@@ -355,12 +368,13 @@ class Project extends AppModel {
}
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function createShell($data = array()) {
$template = CONFIGS . 'templates' . DS;
@@ -379,12 +393,13 @@ class Project extends AppModel {
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function fork($data = array()) {
$this->set($data);
@@ -422,29 +437,12 @@ class Project extends AppModel {
}
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
- function branches($id = null) {
- if (!$id) {
- $id = $this->id;
- }
- $Branch = ClassRegistry::init('Branch');
- $Branch->recursive = -1;
- return $Branch->find('all', array('conditions' =>
- array('project_id' => $this->id)
- ));
- }
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function forks() {
$forks = $this->find('all', array(
'conditions' => array('Project.project_id' => $this->id),
@@ -452,12 +450,14 @@ class Project extends AppModel {
));
return Set::extract('/Project/id', $forks);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @param string $include
+ * @return void
+ */
function all($id = null, $include = true) {
if (!$id) {
$id = $this->id;
@@ -477,12 +477,13 @@ class Project extends AppModel {
return $this->find('all', compact('conditions'));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $conditions
+ * @return void
+ */
function users($conditions = array()) {
$scope = array('Permission.project_id' => $this->id, 'User.username !=' => null);
if (!empty($conditions)) {
@@ -499,12 +500,14 @@ class Project extends AppModel {
return array_filter(Set::combine($users, '/User/id', '/User/username'));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @param string $group
+ * @return void
+ */
function permit($user, $group = null) {
$id = $this->id;
$count = 'Project.users_count + 1';
@@ -534,12 +537,14 @@ class Project extends AppModel {
);
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @param string $options
+ * @return void
+ */
function isUnique($data, $options = array()) {
if (!empty($data['name'])) {
$test = $this->findByUrl(Inflector::slug(strtolower($data['name'])));
@@ -562,12 +567,13 @@ class Project extends AppModel {
return true;
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $key
+ * @return void
+ */
function ticket($key = null) {
if ($key == null) {
foreach ($this->current['config']['ticket'] as $key => $ticket) {
@@ -581,12 +587,13 @@ class Project extends AppModel {
return array_combine($data, $data);
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $key
+ * @return void
+ */
function groups($key = null) {
$result = array();
if (!empty($this->current['config']['groups'])) {
@@ -604,21 +611,21 @@ class Project extends AppModel {
arsort($result);
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function repoTypes() {
return array_combine($this->repoTypes, $this->repoTypes);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function from() {
$baseDomain = env('HTTP_BASE');
if ($baseDomain[0] === '.') {
@@ -627,12 +634,13 @@ class Project extends AppModel {
$from = sprintf('<noreply@%s>', $baseDomain);
return $from;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $params
+ * @return void
+ */
function key($params = array()) {
if (empty($params)) {
$params = $this->current;
diff --git a/models/queue.php b/models/queue.php
deleted file mode 100644
index c2a71d5..0000000
--- a/models/queue.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class Queue extends AppModel {
-
- var $name = 'Queue';
-
- var $belongsTo = array('Project');
-}
-
-?>
\ No newline at end of file
diff --git a/models/source.php b/models/source.php
index 71241e7..59087c7 100644
--- a/models/source.php
+++ b/models/source.php
@@ -1,38 +1,39 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
-class Source extends Object {
/**
- * undocumented class variable
+ * undocumented class
*
- * @var string
- **/
+ * @package default
+ */
+class Source extends Object {
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $useTable = false;
-/**
- * the current uri
- *
- * @var string
- **/
+
+ /**
+ * the current uri
+ *
+ * @var string
+ */
var $Repo = null;
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $Repo
+ * @param string $args
+ * @return void
+ */
function initialize(&$Repo, $args = array()) {
$this->Repo =& $Repo;
@@ -72,12 +73,12 @@ class Source extends Object {
}
return array($args, $path, $current);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function branches() {
if ($this->Repo->type != 'git') {
return array();
@@ -98,12 +99,12 @@ class Source extends Object {
$this->Repo->config($config);
return $branches;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function rebase() {
if ($this->Repo->working) {
$path = dirname($this->Repo->working);
@@ -114,12 +115,13 @@ class Source extends Object {
}
return $this->Repo->pull();
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $path
+ * @return void
+ */
function read($path = null) {
$data = null;
@@ -191,12 +193,15 @@ class Source extends Object {
return array('Folder' => $dir, 'File' => $file);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $file
+ * @param string $ext
+ * @param string $size
+ * @return void
+ */
function __size($file = null, $ext = 'B', $size = '0') {
$size_ext = array('','K','M','G','T');
@@ -214,12 +219,13 @@ class Source extends Object {
return array('num' => 0,'ext' => '');
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $file
+ * @return void
+ */
function __icon($file) {
$array = explode('.', $file);
$ext = '';
@@ -231,35 +237,37 @@ class Source extends Object {
$ext = array_pop($array);
}
- $exts = array("bin" => "/icons/binary.gif",
- "hqx" => "/icons/binhex.gif",
- "tar" => "/icons/tar.gif",
- "wrl" => "/icons/world2.gif",
- "Z" => "/icons/compressed.gif",
- "gz" => "/icons/compressed.gif",
- "zip" => "/icons/compressed.gif",
- "bz2" => "/icons/compressed.gif",
- "rar" => "/icons/compressed.gif",
- "ace" => "/icons/compressed.gif",
- "ps" => "/icons/ps.gif",
- "pdf" => "/icons/ps.gif",
- "html" => "/icons/layout.gif",
- "txt" => "/icons/text.gif",
- "c" => "/icons/c.gif",
- "cpp" => "/icons/small/c.gif",
- "pl" => "/icons/p.gif",
- "php" => "/icons/p.gif",
- "php3" => "/icons/p.gif",
- "php4" => "/icons/p.gif",
- "php5" => "/icons/p.gif",
- "for" => "/icons/f.gif",
- "dvi" => "/icons/dvi.gif",
- "uu" => "/icons/uuencoded.gif",
- "conf" => "/icons/script.gif",
- "tex" => "/icons/tex.gif",
- "core" => "/icons/bomb.gif",
- "^^BLANKICON^^" => "/icons/blank.gif",
- "^^UNKOWN^^" => "/icons/unknown.gif");
+ $exts = array(
+ "bin" => "/icons/binary.gif",
+ "hqx" => "/icons/binhex.gif",
+ "tar" => "/icons/tar.gif",
+ "wrl" => "/icons/world2.gif",
+ "Z" => "/icons/compressed.gif",
+ "gz" => "/icons/compressed.gif",
+ "zip" => "/icons/compressed.gif",
+ "bz2" => "/icons/compressed.gif",
+ "rar" => "/icons/compressed.gif",
+ "ace" => "/icons/compressed.gif",
+ "ps" => "/icons/ps.gif",
+ "pdf" => "/icons/ps.gif",
+ "html" => "/icons/layout.gif",
+ "txt" => "/icons/text.gif",
+ "c" => "/icons/c.gif",
+ "cpp" => "/icons/small/c.gif",
+ "pl" => "/icons/p.gif",
+ "php" => "/icons/p.gif",
+ "php3" => "/icons/p.gif",
+ "php4" => "/icons/p.gif",
+ "php5" => "/icons/p.gif",
+ "for" => "/icons/f.gif",
+ "dvi" => "/icons/dvi.gif",
+ "uu" => "/icons/uuencoded.gif",
+ "conf" => "/icons/script.gif",
+ "tex" => "/icons/tex.gif",
+ "core" => "/icons/bomb.gif",
+ "^^BLANKICON^^" => "/icons/blank.gif",
+ "^^UNKOWN^^" => "/icons/unknown.gif"
+ );
if (isset($exts[$ext])) {
return $exts[ $ext ];
diff --git a/models/ssh_key.php b/models/ssh_key.php
index 24d8c7d..a595a54 100644
--- a/models/ssh_key.php
+++ b/models/ssh_key.php
@@ -1,38 +1,66 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class SshKey extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'SshKey';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $type = 'git';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $lines = array();
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $user = array();
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $_File = null;
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $useTable = false;
-/**
- * set properties
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function set($data = array()) {
parent::set($data);
@@ -52,12 +80,13 @@ class SshKey extends AppModel {
$this->lines = $this->user = array();
return true;
}
-/**
- * save key to file if it does not exist
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function save($data = array()) {
if ($this->set($data) === false) {
return false;
@@ -93,14 +122,14 @@ class SshKey extends AppModel {
return $this->write();
}
-/**
- * read lines from file
- * is username is present in $data, return only user keys
- * sets $lines to an array of contents in the file
- *
- * @return array
- *
- **/
+
+ /**
+ * read lines from file
+ * is username is present in $data, return only user keys
+ * sets $lines to an array of contents in the file
+ *
+ * @return array
+ */
function read($data = array()) {
if ($this->set($data) === false) {
return false;
@@ -148,23 +177,23 @@ class SshKey extends AppModel {
return array();
}
-/**
- * write lines to file
- *
- * @return void
- *
- **/
+
+ /**
+ * write lines to file
+ *
+ * @return void
+ */
function write() {
$this->_File->lock = true;
$result = $this->_File->write(join("\n", $this->lines), 'w', true);
return $result;
}
-/**
- * delete a key
- *
- * @return void
- *
- **/
+
+ /**
+ * delete a key
+ *
+ * @return void
+ */
function delete($data = array()) {
if ($this->set($data) === false) {
return false;
@@ -208,13 +237,13 @@ class SshKey extends AppModel {
}
return true;
}
-/**
- * get command for a given user
- *
- * @param string $username
- * @return void
- *
- **/
+
+ /**
+ * get command for a given user
+ *
+ * @param string $username
+ * @return void
+ */
function command($type, $username = null) {
if ($username === null) {
$username = $type;
diff --git a/models/tag.php b/models/tag.php
index 8d36bcd..2c3ca43 100644
--- a/models/tag.php
+++ b/models/tag.php
@@ -1,27 +1,45 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Tag extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Tag';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array('name' => VALID_NOT_EMPTY);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $hasAndBelongsToMany = array('Ticket');
+ /**
+ * undocumented function
+ *
+ * @param string $string
+ * @return void
+ */
function generate($string = null) {
$return = array();
if($string) {
@@ -47,6 +65,12 @@ class Tag extends AppModel {
return $return;
}
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function toString($data = array()) {
if (empty($data)) {
return null;
diff --git a/models/ticket.php b/models/ticket.php
index 94246b8..cd2272f 100644
--- a/models/ticket.php
+++ b/models/ticket.php
@@ -1,23 +1,30 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Ticket extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Ticket';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actsAs = array(
'Containable',
'List' => array('position_column' => 'number', 'scope' => 'project_id'),
@@ -41,6 +48,11 @@ class Ticket extends AppModel {
)
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array(
'Project', 'Version',
'Owner' => array('className' => 'User', 'foreignKey' => 'Owner'),
@@ -54,6 +66,11 @@ class Ticket extends AppModel {
// )
// );
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $hasMany = array(
'Comment' => array(
'foreignKey' => 'foreign_key',
@@ -62,8 +79,18 @@ class Ticket extends AppModel {
)
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $hasAndBelongsToMany = array('Tag');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array(
'project_id' => array('numeric'),
'title' => array('notEmpty'),
@@ -74,10 +101,21 @@ class Ticket extends AppModel {
// 'resolution' => array('notEmpty'),
);
+ /**
+ * undocumented function
+ *
+ * @param string $event
+ * @return void
+ */
function transitions($event) {
return true;
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeValidate() {
if (!empty($this->data['Ticket']['project'])) {
$this->data['Ticket']['project_id'] = $this->Project->field('id', array(
@@ -87,6 +125,11 @@ class Ticket extends AppModel {
return true;
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave() {
if (
empty($this->data['Ticket']['title'])
@@ -190,6 +233,12 @@ class Ticket extends AppModel {
return true;
}
+ /**
+ * undocumented function
+ *
+ * @param string $created
+ * @return void
+ */
function afterSave($created) {
if ($created && $this->addToTimeline) {
$Timeline = ClassRegistry::init('Timeline');
diff --git a/models/timeline.php b/models/timeline.php
index 8ef040a..051b3fa 100644
--- a/models/timeline.php
+++ b/models/timeline.php
@@ -1,34 +1,61 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Timeline extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Timeline';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $useTable = 'timeline';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $_findMethods = array('events' => true);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actsAs = array('Containable');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array(
'model' => array('notEmpty'),
'foreign_key' => array('numeric')
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array(
'Project',
'Comment' => array(
@@ -53,6 +80,14 @@ class Timeline extends AppModel {
)
);
+ /**
+ * undocumented function
+ *
+ * @param string $conditions
+ * @param string $recursive
+ * @param string $extra
+ * @return void
+ */
function paginateCount($conditions = array(), $recursive = 0, $extra = array()) {
$this->unbindModel(array('belongsTo' => array(
'Comment', 'Ticket', 'Wiki', 'Commit',
@@ -60,10 +95,30 @@ class Timeline extends AppModel {
return $this->find('count', compact('conditions'));
}
+ /**
+ * undocumented function
+ *
+ * @param string $conditions
+ * @param string $fields
+ * @param string $order
+ * @param string $limit
+ * @param string $page
+ * @param string $recursive
+ * @param string $extra
+ * @return void
+ */
function paginate($conditions = array(), $fields = array(), $order = array(), $limit = null, $page = null, $recursive = 0, $extra = array()) {
return $this->find('events', compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive'));
}
+ /**
+ * undocumented function
+ *
+ * @param string $state
+ * @param string $query
+ * @param string $results
+ * @return void
+ */
function _findEvents($state, $query, $results = array()) {
if ($state == 'before') {
$defaults = array(
diff --git a/models/user.php b/models/user.php
index e1d6abc..3c0ee00 100644
--- a/models/user.php
+++ b/models/user.php
@@ -1,37 +1,37 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
-class User extends AppModel {
/**
- * undocumented class variable
+ * undocumented class
*
- * @var string
- **/
+ * @package default
+ */
+class User extends AppModel {
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $name = 'User';
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $displayField = 'username';
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $validate = array(
'username' => array(
'allowedChars' => array(
@@ -62,34 +62,38 @@ class User extends AppModel {
'message' => 'Required: Alpha-numeric passwords only'
)
);
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $hasOne = array('Permission');
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $SshKey = null;
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $id
+ * @param string $table
+ * @param string $ds
+ */
function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->SshKey = ClassRegistry::init('SshKey');
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave() {
if (!empty($this->data['SshKey']['content'])) {
$this->SshKey->set(array(
@@ -119,12 +123,14 @@ class User extends AppModel {
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @param string $conditions
+ * @return void
+ */
function projects($user, $conditions = array()) {
if ($user = $this->Permission->user($user)) {
$projects = $this->Permission->find('all', array(
@@ -134,12 +140,13 @@ class User extends AppModel {
return compact('ids', 'projects');
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @return void
+ */
function groups($user) {
if ($user = $this->Permission->user($user)) {
$results = $this->Permission->find('all', array(
@@ -148,12 +155,12 @@ class User extends AppModel {
return array_filter(Set::combine($results, '/Project/id', '/Permission/group'));
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function permit() {
if (!empty($this->data['User']['group'])) {
$data = array('Permission' => array(
@@ -164,12 +171,13 @@ class User extends AppModel {
$this->Permission->save($data);
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @return void
+ */
function setToken($user = array()) {
$this->set($user);
$this->recursive = -1;
@@ -200,12 +208,13 @@ class User extends AppModel {
$this->invalidate('email', 'Email could not be sent');
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $token
+ * @return void
+ */
function setTempPassword($token = array()) {
if (is_array($token)) {
$this->set($token);
@@ -241,12 +250,13 @@ class User extends AppModel {
$this->invalidate('password', 'Password could not be reset');
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $token
+ * @return void
+ */
function activate($token = array()) {
if (is_array($token)) {
$this->set($token);
@@ -281,12 +291,13 @@ class User extends AppModel {
$this->invalidate('username', 'Account could not be activated');
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $length
+ * @return void
+ */
function __generatePassword($length = 10) {
srand((double)microtime() * 1000000);
$password = '';
@@ -299,22 +310,27 @@ class User extends AppModel {
App::import('Core', 'Security');
return array($password, Security::hash($password, null, true));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $conditions
+ * @param string $recursive
+ * @param string $extra
+ * @return void
+ */
function paginateCount($conditions, $recursive, $extra) {
$fields = array('fields' => 'DISTINCT User.username');
return count($this->find('all', compact('conditions', 'fields', 'recursive', 'extra')));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @param string $options
+ * @return void
+ */
function isUnique($data, $options = array()) {
if (!empty($data['username'])) {
$this->recursive = -1;
diff --git a/models/version.php b/models/version.php
index f5fd34b..f4ff0f6 100644
--- a/models/version.php
+++ b/models/version.php
@@ -1,29 +1,46 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Version extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Version';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array('Project');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array(
'title' => array('notEmpty')
);
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave() {
$this->data['Version']['slug'] = Inflector::slug($this->data['Version']['title'], '-');
return true;
diff --git a/models/wiki.php b/models/wiki.php
index f6ab115..9c450d1 100644
--- a/models/wiki.php
+++ b/models/wiki.php
@@ -1,29 +1,51 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class Wiki extends AppModel {
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $name = 'Wiki';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $displayField = 'slug';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $useTable = 'wiki';
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actsAs = array('Directory');
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $validate = array(
'slug' => array(
'required' => true,
@@ -32,6 +54,11 @@ class Wiki extends AppModel {
'content' => array('notEmpty')
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $belongsTo = array(
'User' => array(
'foreignKey' => 'last_changed_by'
@@ -39,7 +66,13 @@ class Wiki extends AppModel {
'Project'
);
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $_findMethods = array('superList' => true);
+
/*
var $hasOne = array(
'Timeline' => array(
@@ -48,11 +81,25 @@ class Wiki extends AppModel {
)
);
*/
+ /**
+ * undocumented function
+ *
+ * @param string $string
+ * @return void
+ */
function slug($string) {
$replace = (strpos($string, '-') !== false) ? '-' : '_';
return Inflector::slug($string, $replace);
}
+ /**
+ * undocumented function
+ *
+ * @param string $state
+ * @param string $query
+ * @param string $results
+ * @return void
+ */
function _findSuperList($state, $query, $results = array()) {
if ($state == 'before') {
return $query;
@@ -77,6 +124,11 @@ class Wiki extends AppModel {
}
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeValidate(){
if (!empty($this->data['Wiki']['title'])) {
$this->data['Wiki']['slug'] = $this->data['Wiki']['title'];
@@ -84,6 +136,11 @@ class Wiki extends AppModel {
return true;
}
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function beforeSave(){
$this->data['Wiki']['slug'] = $this->slug($this->data['Wiki']['slug']);
@@ -103,6 +160,12 @@ class Wiki extends AppModel {
return true;
}
+ /**
+ * undocumented function
+ *
+ * @param string $created
+ * @return void
+ */
function afterSave($created) {
if ($created && $this->addToTimeline && !empty($this->data['Wiki']['active'])) {
$Timeline = ClassRegistry::init('Timeline');
@@ -117,6 +180,12 @@ class Wiki extends AppModel {
}
}
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @return void
+ */
function activate($data = array()) {
$this->set($data);
$this->data['Wiki']['active'] = 1;
diff --git a/plugins/repo/models/git.php b/plugins/repo/models/git.php
index 2f92b0b..989d3ec 100644
--- a/plugins/repo/models/git.php
+++ b/plugins/repo/models/git.php
@@ -1,63 +1,58 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw.plugins.Repo
- * @subpackage chaw.plugins.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
+
App::import('Model', 'repo.Repo');
/**
* undocumented class
*
* @package default
*
- **/
+ */
class Git extends Repo {
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $gitDir = null;
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $branch = null;
-/**
- * available commands for magic methods
- *
- * @var array
- **/
+
+ /**
+ * available commands for magic methods
+ *
+ * @var array
+ */
var $_commands = array(
'clone', 'config', 'diff', 'status', 'log', 'show', 'blame', 'whatchanged',
'add', 'rm', 'commit', 'pull', 'push', 'branch', 'checkout', 'merge', 'remote'
);
-/**
- * undocumented class variable
- *
- * @var array
- **/
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $__data = array();
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $options
+ * @return void
+ */
function create($options = array()) {
parent::_create();
extract($this->config);
@@ -96,12 +91,14 @@ class Git extends Repo {
return true;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $user
+ * @param string $options
+ * @return void
+ */
function fork($user = null, $options = array()) {
if (!$user) {
return false;
@@ -157,12 +154,14 @@ class Git extends Repo {
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $name
+ * @param string $switch
+ * @return void
+ */
function branch($name, $switch = false) {
if (!$name) {
return false;
@@ -205,12 +204,13 @@ class Git extends Repo {
return $this->branch = $name;
}
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $options
+ * @return void
+ */
function commit($options = array()) {
$path = '.';
if (is_string($options)) {
@@ -231,32 +231,40 @@ class Git extends Repo {
$this->cd();
return $this->run('commit', $options);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $remote
+ * @param string $branch
+ * @return void
+ */
function push($remote = 'origin', $branch = 'master') {
$this->cd();
return $this->run('push', array($remote, $branch), 'capture');
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $remote
+ * @param string $branch
+ * @param string $params
+ * @return void
+ */
function update($remote = null, $branch = null, $params = array()) {
$this->cd();
return $this->run('pull', array_merge($params, array($remote, $branch)), 'capture');
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $remote
+ * @param string $branch
+ * @param string $params
+ * @return void
+ */
function pull($remote ='origin', $branch = 'master', $params = array()) {
if (!is_dir($this->path)) {
return false;
@@ -270,12 +278,14 @@ class Git extends Repo {
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $project
+ * @param string $fork
+ * @return void
+ */
function merge($project, $fork = false) {
$this->branch('master', true);
$this->update('origin', 'master');
@@ -304,13 +314,15 @@ class Git extends Repo {
$this->push('origin', 'master');
return true;
}
-/**
- * find all revisions and return contents of read.
- * type: all, count, array()
- *
- * @return array
- *
- **/
+
+ /**
+ * find all revisions and return contents of read.
+ * type: all, count, array()
+ *
+ * @param string $type
+ * @param array $options
+ * @return array
+ */
function find($type = 'all', $options = array()) {
if ($type == 'branches') {
if (empty($this->branch)) {
@@ -382,12 +394,12 @@ class Git extends Repo {
return parent::_findAll($data, $options);
}
}
-/**
- * undocumented function
- *
- * @return string
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return array
+ */
function __fields($fields = null) {
$fieldMap = array(
'hash' => '%H',
@@ -412,12 +424,14 @@ class Git extends Repo {
}
return array($fields, $format);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $newrev
+ * @param string $options
+ * @return void
+ */
function read($newrev = null, $options = false) {
if (!is_array($options)) {
$options = array('diff' => $options);
@@ -448,12 +462,14 @@ class Git extends Repo {
return $data;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $branch
+ * @param string $params
+ * @return void
+ */
function info($branch, $params = null) {
if ($params === null) {
$params = array('--header', '--max-count=1', $branch);
@@ -467,12 +483,14 @@ class Git extends Repo {
return $out;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $branch
+ * @param string $params
+ * @return void
+ */
function tree($branch, $params = array()) {
if (empty($params)) {
$params = array($branch, "| sed -e 's/\t/ /g'");
@@ -502,12 +520,13 @@ class Git extends Repo {
}
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $path
+ * @return void
+ */
function pathInfo($path = null) {
$this->cd();
if ($path) {
@@ -521,12 +540,12 @@ class Git extends Repo {
$message = str_replace(dirname($this->path), "", $message);
return compact('revision', 'author', 'date', 'message');
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function delete() {
$branch = $this->branch;
$working = $this->working;
@@ -542,13 +561,13 @@ class Git extends Repo {
}
return false;
}
-/**
- * Run a command specific to this type of repo
- *
- * @see execute for params
- * @return misxed
- *
- **/
+
+ /**
+ * Run a command specific to this type of repo
+ *
+ * @see execute for params
+ * @return mixed
+ */
function run($command, $args = array(), $return = false) {
extract($this->config);
diff --git a/plugins/repo/models/repo.php b/plugins/repo/models/repo.php
index 202dac7..53cc4ff 100644
--- a/plugins/repo/models/repo.php
+++ b/plugins/repo/models/repo.php
@@ -1,137 +1,141 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw.plugins.Repo
- * @subpackage chaw.plugins.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
/**
* Base class for various repo types
*
- * @package chaw.plugins.Repo
- * @subpackage chaw.plugins.models
- *
- **/
+ */
class Repo extends Overloadable {
-/**
- * configuration
- *
- * @var string
- **/
+
+ /**
+ * configuration
+ *
+ * @var array
+ */
var $config = array(
'class' => 'Git', 'type' => 'git', 'path' => null, 'working' => null,
'username' => '', 'password' => '', 'chmod' => 0755, 'chawuser' => 'chawbacca'
);
-/**
- * Type of Repo
- *
- * @var string
- **/
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $_commands = array();
-/**
- * Type of Repo
- *
- * @var string
- **/
+
+ /**
+ * Type of Repo
+ *
+ * @var string
+ */
var $type = 'git';
-/**
- * Type of Repo
- *
- * @var string
- **/
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $path = null;
-/**
- * Type of Repo
- *
- * @var string
- **/
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $working = null;
-/**
- * branch name used mostly by Git
- *
- * @var string
- **/
+
+ /**
+ * branch name used mostly by Git
+ *
+ * @var string
+ */
var $branch = null;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $debug = array();
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $response = array();
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $useTable = false;
-/**
- * undocumented class variable
- *
- * @var string
- **/
+
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $_before = array();
-/**
- * so we can paginate
- *
- * @var string
- **/
+
+ /**
+ * so we can paginate
+ *
+ * @var string
+ */
var $recursive = 0;
-/**
- * so we can paginate
- *
- * @var string
- **/
+
+ /**
+ * so we can paginate
+ *
+ * @var string
+ */
var $alias = null;
-/**
- * should the command be logged
- *
- * @var boolean
- **/
+
+ /**
+ * should the command be logged
+ *
+ * @var boolean
+ */
var $logDebug = true;
-/**
- * should the response be logged
- *
- * @var boolean
- **/
+
+ /**
+ * should the response be logged
+ *
+ * @var boolean
+ */
var $logResponse = false;
-/**
- * should the response be logged
- *
- * @var boolean
- **/
- var $chawuser = 'chawbacca';
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
+ var $chawuser = 'chawbacca';
+
+ /**
+ * undocumented function
+ *
+ * @param string $config
+ */
function __construct($config = array()) {
$this->config($config);
$this->alias = ucwords($this->type);
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $config
+ * @return void
+ */
function config($config = array()) {
if (!empty($config['alias']) && empty($config['type'])) {
$config['type'] = $config['alias'];
@@ -143,12 +147,12 @@ class Repo extends Overloadable {
$this->chawuser = $config['chawuser'];
return $this->config = $config;
}
-/**
- * Magic methods
- *
- * @return void
- *
- **/
+
+ /**
+ * Magic methods
+ *
+ * @return void
+ */
function call__($method, $params = array()) {
if (method_exists($this, "_{$method}")) {
$finder = "_{$method}";
@@ -164,13 +168,13 @@ class Repo extends Overloadable {
}
return false;
}
-/**
- * Set multiple commands to be run before will be joined with &&
- *
- * @param mixed command single command string or array of commands
- * @return void
- *
- **/
+
+ /**
+ * Set multiple commands to be run before will be joined with &&
+ *
+ * @param mixed command single command string or array of commands
+ * @return void
+ */
function cd($dir = null) {
if (is_null($dir)) {
$dir = $this->working;
@@ -180,26 +184,26 @@ class Repo extends Overloadable {
}
$this->_before[0] = "cd {$dir}";
}
-/**
- * Set multiple commands to be run before will be joined with &&
- *
- * @param mixed command single command string or array of commands
- * @return void
- *
- **/
+
+ /**
+ * Set multiple commands to be run before will be joined with &&
+ *
+ * @param mixed command single command string or array of commands
+ * @return void
+ */
function before($command = array()) {
if (is_string($command)) {
$command = array($command);
}
$this->_before = array_merge($this->_before, $command);
}
-/**
- * Run a command specific to this type of repo
- *
- * @see execute for params
- * @return misxed
- *
- **/
+
+ /**
+ * Run a command specific to this type of repo
+ *
+ * @see execute for params
+ * @return misxed
+ */
function run($command, $args = array(), $return = false) {
extract($this->config);
$response = $this->execute("{$type} {$command}", $args, $return);
@@ -208,21 +212,21 @@ class Repo extends Overloadable {
}
return $response;
}
-/**
- * Executes given command with results based on return type
- *
- *
- * @param string $command - the command to run
- * @param mixed $args as array - the arguments for the command, as string - the return type
- * @param string $return
- * false - will use shell_exec() and return a string
- * true - will return the command
- * capture - will use exec() and return an array
- * pass - will use passthru() and return binary type
- *
- * @return mixed
- *
- **/
+
+ /**
+ * Executes given command with results based on return type
+ *
+ *
+ * @param string $command - the command to run
+ * @param mixed $args as array - the arguments for the command, as string - the return type
+ * @param string $return
+ * false - will use shell_exec() and return a string
+ * true - will return the command
+ * capture - will use exec() and return an array
+ * pass - will use passthru() and return binary type
+ *
+ * @return mixed
+ */
function execute($command, $args = array(), $return = false) {
$before = null;
if ($return !== true) {
@@ -260,13 +264,14 @@ class Repo extends Overloadable {
}
return $response;
}
-
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $data
+ * @param string $query
+ * @return void
+ */
function _findAll($data, $query = array()) {
$query = array_merge(array(
'fields' => null,
@@ -299,12 +304,12 @@ class Repo extends Overloadable {
return $results;
}
-/**
- * Create the parent folders for a repository
- *
- * @return void
- *
- **/
+
+ /**
+ * Create the parent folders for a repository
+ *
+ * @return boolean
+ */
function _create($options = array(), $return = false) {
extract(array_merge($this->config, $options));
@@ -324,22 +329,22 @@ class Repo extends Overloadable {
return false;
}
-/**
- * Creates a hook
- *
- * @param string $name
- * GIT
- * applypatch-msg, commit-message, post-commit, post-receive, post-update,
- * pre-applypatch, pre-commit, pre-rebase, update)
- *
- * SVN
- * post-commit, post-lock, post-revprop-change, post-unlock, pre-commit, pre-lock,
- * pre-revprop-change, pre-unlock, start-commit
- *
- * @param string $data location of the repository
- * @return void
- *
- **/
+
+ /**
+ * Creates a hook
+ *
+ * @param string $name
+ * GIT
+ * applypatch-msg, commit-message, post-commit, post-receive, post-update,
+ * pre-applypatch, pre-commit, pre-rebase, update)
+ *
+ * SVN
+ * post-commit, post-lock, post-revprop-change, post-unlock, pre-commit, pre-lock,
+ * pre-revprop-change, pre-unlock, start-commit
+ *
+ * @param string $data location of the repository
+ * @return boolean
+ */
function _hook($name, $data = null, $options = array()) {
extract($this->config);
$Hook = new File($path . DS . 'hooks' . DS . $name, true, $chmod);
@@ -364,12 +369,12 @@ class Repo extends Overloadable {
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _credentials() {
return null;
}
diff --git a/plugins/repo/models/svn.php b/plugins/repo/models/svn.php
index 4fe73fa..5d0743f 100644
--- a/plugins/repo/models/svn.php
+++ b/plugins/repo/models/svn.php
@@ -1,32 +1,26 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw.plugins.Repo
- * @subpackage chaw.plugins.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
+
App::import('Model', 'repo.Repo');
/**
* undocumented class
*
* @package default
*
- **/
+ */
class Svn extends Repo {
-/**
- * available commands for magic methods
- *
- * @var array
- **/
+
+ /**
+ * available commands for magic methods
+ *
+ * @var array
+ */
var $_commands = array(
//standard commands
'add', 'annotate', 'blame', 'cat', 'checkout', 'cleanup', 'commit', 'copy', 'delete', 'diff', 'export', 'help',
@@ -36,30 +30,30 @@ class Svn extends Repo {
'ann', 'co', 'ci', 'cp', 'del', 'rm', 'ls', 'mv', 'ren', 'pdel', 'pd', 'pedit', 'pe', 'pget', 'pg', 'plist', 'pl',
'pset', 'ps', 'stat', 'st', 'sw', 'up'
);
-/**
- * Run svnadmin, Besides providing the ability to create Subversion repositories,
- * this program allows you to perform several maintenance operations on those repositories.
- *
- * @param string $command
- * @param mixed $params
- * @example $this->Svn->admin('create', '/path/to/new/repo');
- * @return void
- *
- **/
+
+ /**
+ * Run svnadmin, Besides providing the ability to create Subversion repositories,
+ * this program allows you to perform several maintenance operations on those repositories.
+ *
+ * @param string $command
+ * @param mixed $params
+ * @example $this->Svn->admin('create', '/path/to/new/repo');
+ * @return void
+ */
function admin($command, $options = array()) {
extract($this->config);
return $this->execute("{$type}admin {$command}", $options);
}
-/**
- * Run svnlook, is a command-line utility for examining different aspects of a Subversion repository.
- * It does not make any changes to the repository—it's just used for “peeking”
- *
- * @param string $command
- * @param mixed $params
- * @example $this->Svn->look('author', 'file:///path/to/repo');
- * @return void
- *
- **/
+
+ /**
+ * Run svnlook, is a command-line utility for examining different aspects of a Subversion repository.
+ * It does not make any changes to the repository—it's just used for “peeking”
+ *
+ * @param string $command
+ * @param mixed $params
+ * @example $this->Svn->look('author', 'file:///path/to/repo');
+ * @return void
+ */
function look($command, $options = array()) {
extract($this->config);
@@ -70,15 +64,16 @@ class Svn extends Repo {
}
return $this->execute("{$type}look {$command} {$this->path}{$path}", $options);
}
-/**
- * Create a new repo; initialize the branches, tags, trunk; checkout a working copy to TMP
- *
- * @param string $project name of the project
- * @param array $options repo, working
- * @example $this->Svn->create(array('repo' => TMP . 'svn/repo', 'working' => APP . 'working'));
- * @return void
- *
- **/
+
+ /**
+ * Create a new repo; initialize the branches, tags, trunk; checkout a working copy to TMP
+ *
+ * @param string $project name of the project
+ * @param array $options repo, working
+ * @example $this->Svn->create(array('repo' => TMP . 'svn/repo', 'working' => APP . 'working'));
+ * @return void
+ *
+ */
function create($options = array()) {
parent::_create();
extract($this->config);
@@ -104,24 +99,27 @@ class Svn extends Repo {
}
return false;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $path
+ * @return void
+ */
function update($path = null) {
if ($path === null) {
$path = $this->working;
}
return $this->run('update', array($path));
}
-/**
- * find all revisions and return contents of read.
- *
- * @return array
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $type
+ * @param string $options
+ * @return void
+ */
function find($type = 'all', $options = array()) {
if (!empty($options['conditions']['path'])) {
$options['path'] = $options['conditions']['path'];
@@ -147,14 +145,14 @@ class Svn extends Repo {
return parent::_findAll($data, compact('limit', 'page'));
}
}
-/**
- * Read the author, data, messages, changes, and diff for a revision
- *
- * @param string $revision id of the revision
- * @example $this->Svn->read(1);
- * @return array
- *
- **/
+
+ /**
+ * Read the author, data, messages, changes, and diff for a revision
+ *
+ * @param string $revision id of the revision
+ * @example $this->Svn->read(1);
+ * @return array
+ */
function read($revision = null, $diff = false) {
$author = trim($this->look('author', array('-r', $revision)));
@@ -206,23 +204,25 @@ class Svn extends Repo {
$data = compact('revision', 'author', 'commit_date', 'message', 'changes', 'diff');
return $data;
}
-/**
- * Get the info about a directory or file
- *
- * @param string $path path inside of working with preceeding /
- * @example $this->Svn->info('/branches');
- * @return void
- *
- **/
+
+ /**
+ * Get the info about a directory or file
+ *
+ * @param string $path path inside of working with preceeding /
+ * @example $this->Svn->info('/branches');
+ * @return void
+ *
+ */
function info($path = null) {
return $this->run('info', array($this->working . $path));
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @param string $path
+ * @return void
+ */
function pathInfo($path) {
//return array('revision' => null, 'date' => null, 'message' => null, 'author' => null);
$info = $this->run('info', array($path));
@@ -248,13 +248,13 @@ class Svn extends Repo {
$result['message'] = (!empty($lines[3])) ? trim($lines[3]) : null;
return $result;
}
-/**
- * Get the config credentials
- *
- * @return void
- *
- **/
- function _creds() {
+
+ /**
+ * Get the config credentials
+ *
+ * @return string
+ */
+ function _credentials() {
extract($this->config);
if (!empty($username) && !empty($password)) {
return "--username {$username} --password {$password}";
diff --git a/plugins/repo/tests/cases/models/git.test.php b/plugins/repo/tests/cases/models/git.test.php
index f6f6c02..53d4ca2 100644
--- a/plugins/repo/tests/cases/models/git.test.php
+++ b/plugins/repo/tests/cases/models/git.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Git Test cases generated on: 2008-09-09 18:09:14 : 1220999054*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class GitTest extends CakeTestCase {
function startTest() {
@@ -163,7 +169,7 @@ class GitTest extends CakeTestCase {
$result = $Git->find('count', array('path' => TMP . 'tests/git/working/test/master/.gitignore'));
$this->assertEqual($result, 2);
-
+
$Git->update();
$results = $Git->find('all', array(
'branch' => 'master', 'order' => 'asc'
@@ -171,14 +177,14 @@ class GitTest extends CakeTestCase {
$oldrev = $results[0]['Repo']['revision'];
$newrev = $results[1]['Repo']['revision'];
-
+
$count = $Git->find('count', array(
'conditions' => array($oldrev . '..' . $newrev),
'order' => 'asc'
));
-
+
$this->assertEqual(1, $count);
-
+
//pr($Git->working);
// pr($Git->debug);
// pr($Git->response);
diff --git a/plugins/repo/tests/cases/models/repo.test.php b/plugins/repo/tests/cases/models/repo.test.php
index 5baaf4a..45a318d 100644
--- a/plugins/repo/tests/cases/models/repo.test.php
+++ b/plugins/repo/tests/cases/models/repo.test.php
@@ -1,4 +1,12 @@
<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Model', array('Repo.Git', 'Repo.Svn'));
class TestRepo extends Repo {
diff --git a/plugins/repo/tests/cases/models/svn.test.php b/plugins/repo/tests/cases/models/svn.test.php
index d56e6a1..dca74a3 100644
--- a/plugins/repo/tests/cases/models/svn.test.php
+++ b/plugins/repo/tests/cases/models/svn.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Svn Test cases generated on: 2008-08-28 13:08:20 : 1219956320*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class SvnTest extends CakeTestCase {
function setUp() {
diff --git a/plugins/repo/tests/groups/repo.group.php b/plugins/repo/tests/groups/repo.group.php
index 5d0243a..4bc1520 100644
--- a/plugins/repo/tests/groups/repo.group.php
+++ b/plugins/repo/tests/groups/repo.group.php
@@ -1,24 +1,31 @@
<?php
-/** RepoGroup
+/**
+ * Chaw : source code and project management
*
- * This test group will run all the Cache class test and all core cache engine tests
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * @package chaw.plugins.tests
- * @subpackage chaw.plugins.tests.groups
*/
-class RepoGroupTest extends GroupTest {
/**
- * label property
+ * undocumented class
*
- * @access public
+ * @package default
*/
+class RepoGroupTest extends GroupTest {
+
+ /**
+ * label property
+ *
+ * @access public
+ */
var $label = 'Test All Repo Types';
-/**
- * RepoGroupGroupTest method
- *
- * @access public
- * @return void
- */
+
+ /**
+ * RepoGroupGroupTest method
+ *
+ * @access public
+ * @return void
+ */
function RepoGroupTest() {
$path = dirname(dirname(__FILE__));
TestManager::addTestCasesFromDirectory($this, $path . DS . 'cases' . DS . 'models');
diff --git a/tests/cases/behaviors/directory.test.php b/tests/cases/behaviors/directory.test.php
index 99d8281..5a6a905 100644
--- a/tests/cases/behaviors/directory.test.php
+++ b/tests/cases/behaviors/directory.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Directory Test cases generated on: 2008-11-25 18:11:31 : 1227667771*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('AppModel');
App::import('Behavior', 'Directory');
class TestDirectoryBehavior extends DirectoryBehavior {
@@ -87,8 +93,8 @@ class DirectoryBehaviorTest extends CakeTestCase {
$this->assertEqual($results[0]['TestDirectory']['path'], '/guides');
$this->assertEqual($results[1]['TestDirectory']['path'], '/guides/ssh');
$this->assertEqual($results[2]['TestDirectory']['path'], '/guides/ssh/keys');
-
-
+
+
$results = $this->Directory->find('all', array('conditions' => array('TestDirectory.path' => '/guides/ssh')));
$this->assertEqual(count($results), 2);
$this->assertEqual($results[0]['TestDirectory']['path'], '/guides/ssh');
diff --git a/tests/cases/components/access.test.php b/tests/cases/components/access.test.php
index f95e869..8079f84 100644
--- a/tests/cases/components/access.test.php
+++ b/tests/cases/components/access.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Access Test cases generated on: 2008-11-01 10:11:29 : 1225561949*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Component', array('Auth', 'Session', 'Access'));
App::import('Controller');
App::import('Model', array('Project', 'Permission'));
diff --git a/tests/cases/models/branch.test.php b/tests/cases/models/branch.test.php
deleted file mode 100644
index 7c8bbc7..0000000
--- a/tests/cases/models/branch.test.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.tests.cases.models
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class BranchTestCase extends CakeTestCase {
- var $Branch = null;
- var $fixtures = array('app.branch');
-
- function startTest() {
- $this->Branch =& ClassRegistry::init('Branch');
- }
-
- function testBranchInstance() {
- $this->assertTrue(is_a($this->Branch, 'Branch'));
- }
-
- function testBranchSave() {
- $data = array('Branch' => array(
- 'project_id' => 1,
- 'name' => 'refs/heads/master',
- 'created' => '2009-01-15 09:04:41',
- 'modified' => '2009-01-15 09:04:41'
- ));
-
- $this->Branch->create($data);
- $this->assertTrue($this->Branch->save());
- $this->assertEqual($this->Branch->id, 1);
-
-
- $this->Branch->recursive = -1;
- $results = $this->Branch->find('all');
- $this->assertTrue(!empty($results));
- $this->assertEqual($results, array(array('Branch' => array(
- 'id' => 1,
- 'project_id' => 1,
- 'name'=> 'master',
- 'ref' => 'refs/heads',
- 'created' => '2009-01-15 09:04:41',
- 'modified' => '2009-01-15 09:04:41'
- ))));
-
- $data = array('Branch' => array(
- 'project_id' => 1,
- 'name' => 'refs/heads/master',
- 'created' => '2009-01-15 09:04:41',
- 'modified' => '2009-01-15 09:04:41'
- ));
- $this->Branch->create($data);
- $this->assertFalse($this->Branch->save($data));
- $this->assertEqual($this->Branch->id, 1);
-
- $this->Branch->recursive = -1;
- $results = $this->Branch->find('all');
- $this->assertTrue(!empty($results));
- $this->assertEqual($results, array(array('Branch' => array(
- 'id' => 1,
- 'project_id' => 1,
- 'name'=> 'master',
- 'ref' => 'refs/heads',
- 'created' => '2009-01-15 09:04:41',
- 'modified' => '2009-01-15 09:04:41'
- ))));
-
- }
-}
-?>
\ No newline at end of file
diff --git a/tests/cases/models/comment.test.php b/tests/cases/models/comment.test.php
index 412147f..bb47ea9 100644
--- a/tests/cases/models/comment.test.php
+++ b/tests/cases/models/comment.test.php
@@ -1,6 +1,11 @@
<?php
-/* SVN FILE: $Id$ */
-/* Comment Test cases generated on: 2008-10-16 22:10:35 : 1224221135*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class CommentTestCase extends CakeTestCase {
var $Comment = null;
diff --git a/tests/cases/models/commit.test.php b/tests/cases/models/commit.test.php
index 5ec1a55..af9d722 100644
--- a/tests/cases/models/commit.test.php
+++ b/tests/cases/models/commit.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Commit Test cases generated on: 2008-10-13 09:10:08 : 1223915168*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class CommitTestCase extends CakeTestCase {
var $Commit = null;
var $fixtures = array(
@@ -51,8 +57,8 @@ class CommitTestCase extends CakeTestCase {
)));
}
-
-
+
+
function testCommitSaveUnique() {
$data = array('Commit' => array(
//'id' => 1,
@@ -86,7 +92,7 @@ class CommitTestCase extends CakeTestCase {
'event' => 'committed',
'data' => 0
)));
-
+
$this->Commit->create($data);
$this->assertFalse($this->Commit->save($data));
@@ -103,7 +109,7 @@ class CommitTestCase extends CakeTestCase {
'event' => 'committed',
'data' => 0
)));
-
+
}
function testCommitAggregate() {
diff --git a/tests/cases/models/permission.test.php b/tests/cases/models/permission.test.php
index df3429a..4c5de49 100644
--- a/tests/cases/models/permission.test.php
+++ b/tests/cases/models/permission.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Permission Test cases generated on: 2008-10-17 12:10:29 : 1224273329*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Model', 'Permission');
class TestPermission extends Permission {
@@ -399,15 +405,15 @@ class PermissionTest extends CakeTestCase {
$data['Permission']['fine_grained'] = "";
$Permission->saveFile($data);
-
+
$this->assertTrue(file_exists(TMP . 'tests' . DS . 'git' . DS . 'repo' . DS . 'project_two.git' . DS . 'permissions.ini'));
$this->assertTrue($Permission->check("source", array('user' => 'gwoo', 'access' => array('r', 'r'), 'default' => true)));
$this->assertTrue($Permission->check("source", array('user' => false, 'access' => array('r', 'r'), 'default' => true)));
-
+
$data['Permission']['fine_grained'] = "[tickets]\n* = r";
- $this->assertTrue($Permission->saveFile($data));
+ $this->assertTrue($Permission->saveFile($data));
$this->assertFalse($Permission->check("tickets", array('user' => 'gwoo', 'access' => 'c', 'default' => true)));
$this->assertFalse($Permission->check("tickets", array('user' => 'gwoo', 'access' => array('c', 'w'), 'default' => true)));
$this->assertFalse($Permission->check("tickets", array('user' => 'bob', 'access' => 'c', 'default' => true)));
diff --git a/tests/cases/models/project.test.php b/tests/cases/models/project.test.php
index 58ecb07..d4f8dfc 100644
--- a/tests/cases/models/project.test.php
+++ b/tests/cases/models/project.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Project Test cases generated on: 2008-10-06 15:10:20 : 1223321240*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class ProjectTestCase extends CakeTestCase {
var $Project = null;
var $fixtures = array(
@@ -669,12 +675,12 @@ class ProjectTestCase extends CakeTestCase {
$path = Configure::read('Content.base');
$this->assertTrue(file_exists($path . 'permissions.ini'));
$this->assertTrue(file_exists($this->Project->Repo->path . DS . 'permissions.ini'));
-
-
+
+
$this->assertEqual(2, $this->Project->id);
-
+
$this->assertTrue($this->Project->initialize(array('project' => 'new_project')));
-
+
$this->assertEqual(1, $this->Project->current['id']);
}
diff --git a/tests/cases/models/source.test.php b/tests/cases/models/source.test.php
index e771514..876c229 100644
--- a/tests/cases/models/source.test.php
+++ b/tests/cases/models/source.test.php
@@ -1,6 +1,11 @@
<?php
-/* SVN FILE: $Id$ */
-/* Source Test cases generated on: 2008-10-16 22:10:35 : 1224221135*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class SourceTestCase extends CakeTestCase {
var $Source = null;
diff --git a/tests/cases/models/ssh_key.test.php b/tests/cases/models/ssh_key.test.php
index 47737d0..63506f8 100644
--- a/tests/cases/models/ssh_key.test.php
+++ b/tests/cases/models/ssh_key.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* SshKey Test cases generated on: 2008-10-16 22:10:35 : 1224221135*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Model', 'SshKey');
class SshKeyTestCase extends CakeTestCase {
diff --git a/tests/cases/models/ticket.test.php b/tests/cases/models/ticket.test.php
index 06de7e5..6c55694 100644
--- a/tests/cases/models/ticket.test.php
+++ b/tests/cases/models/ticket.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Ticket Test cases generated on: 2008-12-08 15:12:43 : 1228778743*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class TicketTest extends CakeTestCase {
var $fixtures = array(
diff --git a/tests/cases/models/timeline.test.php b/tests/cases/models/timeline.test.php
index b481dd7..3cdadc8 100644
--- a/tests/cases/models/timeline.test.php
+++ b/tests/cases/models/timeline.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Timeline Test cases generated on: 2009-04-15 13:04:08 : 1239825668*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
class TimelineTest extends CakeTestCase {
var $fixtures = array(
diff --git a/tests/cases/models/user.test.php b/tests/cases/models/user.test.php
index 37248f3..8cf508e 100644
--- a/tests/cases/models/user.test.php
+++ b/tests/cases/models/user.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* User Test cases generated on: 2008-10-16 10:10:23 : 1224177023*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Model', 'User');
class UserTestCase extends CakeTestCase {
diff --git a/tests/cases/models/version.test.php b/tests/cases/models/version.test.php
index 57eaaf9..d30b771 100644
--- a/tests/cases/models/version.test.php
+++ b/tests/cases/models/version.test.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Version Test cases generated on: 2008-10-10 16:10:08 : 1223680508*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class VersionTestCase extends CakeTestCase {
var $Version = null;
@@ -19,7 +24,7 @@ class VersionTestCase extends CakeTestCase {
}
function testVersionFind() {
-
+
}
}
?>
\ No newline at end of file
diff --git a/tests/cases/models/wiki.test.php b/tests/cases/models/wiki.test.php
index 30bc498..03e2f98 100644
--- a/tests/cases/models/wiki.test.php
+++ b/tests/cases/models/wiki.test.php
@@ -1,6 +1,12 @@
<?php
-/* SVN FILE: $Id$ */
-/* Wiki Test cases generated on: 2008-10-10 16:10:08 : 1223680508*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
App::import('Model', 'Wiki');
class WikiTestCase extends CakeTestCase {
diff --git a/tests/cases/shells/post_receive.test.php b/tests/cases/shells/post_receive.test.php
index 6a826f9..c74c9f0 100644
--- a/tests/cases/shells/post_receive.test.php
+++ b/tests/cases/shells/post_receive.test.php
@@ -1,4 +1,12 @@
<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
+
require_once(CONSOLE_LIBS . 'shell.php');
require_once(APP . 'vendors' . DS . 'shells' . DS . 'post_receive.php');
class TestShellDispatcher extends Object {
diff --git a/tests/fixtures/branch_fixture.php b/tests/fixtures/branch_fixture.php
index 1d42889..7f3bc01 100644
--- a/tests/fixtures/branch_fixture.php
+++ b/tests/fixtures/branch_fixture.php
@@ -1,19 +1,12 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.models
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
+
class BranchFixture extends CakeTestFixture {
var $name = 'Branch';
var $fields = array(
diff --git a/tests/fixtures/comment_fixture.php b/tests/fixtures/comment_fixture.php
index e52c6ce..eb4a90b 100644
--- a/tests/fixtures/comment_fixture.php
+++ b/tests/fixtures/comment_fixture.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Comment Fixture generated on: 2008-10-16 22:10:35 : 1224221135*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class CommentFixture extends CakeTestFixture {
var $name = 'Comment';
diff --git a/tests/fixtures/commit_fixture.php b/tests/fixtures/commit_fixture.php
index d8ec3c0..283f2c8 100644
--- a/tests/fixtures/commit_fixture.php
+++ b/tests/fixtures/commit_fixture.php
@@ -1,6 +1,11 @@
<?php
-/* SVN FILE: $Id$ */
-/* Commit Fixture generated on: 2008-10-16 22:10:35 : 1224221135*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class CommitFixture extends CakeTestFixture {
var $name = 'Commit';
diff --git a/tests/fixtures/permission_fixture.php b/tests/fixtures/permission_fixture.php
index 4228cd9..495a1fb 100644
--- a/tests/fixtures/permission_fixture.php
+++ b/tests/fixtures/permission_fixture.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Project Fixture generated on: 2008-10-06 23:10:38 : 1223348498*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class PermissionFixture extends CakeTestFixture {
var $name = 'Permission';
diff --git a/tests/fixtures/project_fixture.php b/tests/fixtures/project_fixture.php
index 55ee6b2..adb6db0 100644
--- a/tests/fixtures/project_fixture.php
+++ b/tests/fixtures/project_fixture.php
@@ -1,10 +1,15 @@
<?php
-/* SVN FILE: $Id$ */
-/* Project Fixture generated on: 2008-10-06 23:10:38 : 1223348498*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class ProjectFixture extends CakeTestFixture {
var $name = 'Project';
-
+
function __construct() {
parent::__construct();
$Schema = new CakeSchema(array(
diff --git a/tests/fixtures/tag_fixture.php b/tests/fixtures/tag_fixture.php
index 0da5a3b..da72293 100644
--- a/tests/fixtures/tag_fixture.php
+++ b/tests/fixtures/tag_fixture.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Tag Fixture generated on: 2008-10-10 16:10:08 : 1223680508*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class TagFixture extends CakeTestFixture {
var $name = 'Tag';
diff --git a/tests/fixtures/tags_tickets_fixture.php b/tests/fixtures/tags_tickets_fixture.php
index 6ece98e..8f25a79 100644
--- a/tests/fixtures/tags_tickets_fixture.php
+++ b/tests/fixtures/tags_tickets_fixture.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* TagsTickets Fixture generated on: 2008-10-10 16:10:08 : 1223680508*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class TagsTicketsFixture extends CakeTestFixture {
var $name = 'TagsTickets';
diff --git a/tests/fixtures/ticket_fixture.php b/tests/fixtures/ticket_fixture.php
index 433218a..bd50226 100644
--- a/tests/fixtures/ticket_fixture.php
+++ b/tests/fixtures/ticket_fixture.php
@@ -1,6 +1,11 @@
<?php
-/* SVN FILE: $Id$ */
-/* Ticket Fixture generated on: 2008-09-23 07:09:29 : 1222170869*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class TicketFixture extends CakeTestFixture {
var $name = 'Ticket';
diff --git a/tests/fixtures/timeline_fixture.php b/tests/fixtures/timeline_fixture.php
index f610f66..3658fb1 100644
--- a/tests/fixtures/timeline_fixture.php
+++ b/tests/fixtures/timeline_fixture.php
@@ -1,12 +1,17 @@
<?php
-/* SVN FILE: $Id$ */
-/* Timeline Fixture generated on: 2008-10-13 09:10:08 : 1223915168*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class TimelineFixture extends CakeTestFixture {
var $name = 'Timeline';
-
+
var $table = 'timeline';
-
+
var $fields = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'project_id' => array('type' => 'integer', 'null' => true, 'default' => NULL),
diff --git a/tests/fixtures/user_fixture.php b/tests/fixtures/user_fixture.php
index 543d105..8e216dc 100644
--- a/tests/fixtures/user_fixture.php
+++ b/tests/fixtures/user_fixture.php
@@ -1,6 +1,11 @@
<?php
-/* SVN FILE: $Id$ */
-/* User Fixture generated on: 2008-10-16 10:10:23 : 1224177023*/
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class UserFixture extends CakeTestFixture {
var $name = 'User';
diff --git a/tests/fixtures/version_fixture.php b/tests/fixtures/version_fixture.php
index 2183443..b2de91a 100644
--- a/tests/fixtures/version_fixture.php
+++ b/tests/fixtures/version_fixture.php
@@ -1,6 +1,11 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Version Fixture generated on: 2008-10-10 16:10:08 : 1223680508*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class VersionFixture extends CakeTestFixture {
var $name = 'Version';
diff --git a/tests/fixtures/wiki_fixture.php b/tests/fixtures/wiki_fixture.php
index d6b47b2..31fc045 100644
--- a/tests/fixtures/wiki_fixture.php
+++ b/tests/fixtures/wiki_fixture.php
@@ -1,11 +1,16 @@
-<?php
-/* SVN FILE: $Id$ */
-/* Wiki Fixture generated on: 2008-10-10 16:10:08 : 1223680508*/
+<?php
+/**
+ * Chaw : source code and project management
+ *
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
+ *
+ */
class WikiFixture extends CakeTestFixture {
var $name = 'Wiki';
var $table = 'wiki';
-
+
var $fields = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'project_id' => array('type' => 'integer', 'null' => false, 'default' => '0'),
diff --git a/vendors/shells/chaw_upgrade.php b/vendors/shells/chaw_upgrade.php
index c09cc30..cb908d4 100644
--- a/vendors/shells/chaw_upgrade.php
+++ b/vendors/shells/chaw_upgrade.php
@@ -1,28 +1,41 @@
<?php
-App::import('Model', 'CakeSchema');
/**
- * Short description
- *
- * Long description
+ * Chaw : source code and project management
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+App::import('Model', 'CakeSchema');
+
+/**
+ * undocumented class
*
+ * @package default
*/
class ChawUpgradeShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {
$this->out("Chaw Upgrade");
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
$choice = '';
$Tasks = new Folder(dirname(__FILE__) . DS . 'tasks');
@@ -60,7 +73,11 @@ class ChawUpgradeShell extends Shell {
return $this->{$upgrade}->execute();
}
-
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function execute() {
$parentMethods = get_class_methods('ChawUpgradeShell');
$methods = array_diff(
@@ -75,7 +92,13 @@ class ChawUpgradeShell extends Shell {
}
}
-
+ /**
+ * undocumented function
+ *
+ * @param string $table
+ * @param string $options
+ * @return void
+ */
function _updateSchema($table, $options = array()) {
$defaults = array(
'connection' => 'default',
diff --git a/vendors/shells/git_shell.php b/vendors/shells/git_shell.php
index aaad6cf..fe210c3 100644
--- a/vendors/shells/git_shell.php
+++ b/vendors/shells/git_shell.php
@@ -1,33 +1,40 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class GitShellShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Permission', 'Commit');
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actionMap = array(
'git-upload-pack' => 'r',
'git-receive-pack' => 'rw',
);
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
if (empty($this->params['user'])) {
$this->err('User not found.');
@@ -81,70 +88,11 @@ class GitShellShell extends Shell {
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
- function sync() {
- $project = $this->args[0];
- $fork = @$this->args[1];
-
- $this->args[] = 'git_shell';
- //$this->log($this->args, LOG_INFO);
-
- if ($this->Project->initialize(compact('project', 'fork')) === false || $this->Project->current['url'] !== $project) {
- $this->err('Invalid Project');
- return false;
- }
-
- if ($this->Project->Repo->type !== 'git') {
- $this->err('Invalid Repo. Check that you supplied the correct project');
- return false;
- }
-
- $this->out('This may take a while...');
- $this->out('First we start by getting all the previous revisions.');
-
- $data = array_reverse($this->Project->Repo->find('all'));
-
- if (!empty($data)) {
-
- $this->out('Now we can sync up the timeline.');
-
- $this->Commit->deleteAll(array('Commit.project_id' => $this->Project->id));
-
- $results = false;
- foreach ($data as $revision) {
-
- if (!empty($revision['Repo']['revision'])) {
-
- $revision['Repo']['project_id'] = $this->Project->id;
- $this->Commit->create($revision['Repo']);
- if ($this->Commit->save()) {
- $this->out("Commit: {$revision['Repo']['revision']} synced.");
- $results = true;
- }
- sleep(1);
- }
- }
- }
-
- if (!empty($results)) {
- $this->out('Sync complete');
- exit();
- }
- $this->err('Nothing was synced');
- return false;
-
- }
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
}
\ No newline at end of file
diff --git a/vendors/shells/minify.php b/vendors/shells/minify.php
index ee77e79..99984f8 100644
--- a/vendors/shells/minify.php
+++ b/vendors/shells/minify.php
@@ -1,21 +1,23 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class MinifyShell extends Shell {
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
$result = $folder = null;
diff --git a/vendors/shells/post_commit.php b/vendors/shells/post_commit.php
index 7b5c16c..6c5e34c 100644
--- a/vendors/shells/post_commit.php
+++ b/vendors/shells/post_commit.php
@@ -1,29 +1,46 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class PostCommitShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Commit');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
return $this->commit();
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function commit() {
$project = $this->args[0];
diff --git a/vendors/shells/post_receive.php b/vendors/shells/post_receive.php
index 018f85d..b71fed2 100644
--- a/vendors/shells/post_receive.php
+++ b/vendors/shells/post_receive.php
@@ -1,29 +1,47 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+
+/**
+ * undocumented class
*
+ * @package default
*/
class PostReceiveShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array( 'Project', 'Commit', 'Timeline');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
return $this->commit();
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function commit() {
$project = str_replace('.git', '', trim(@$this->args[0], "'"));
diff --git a/vendors/shells/pre_commit.php b/vendors/shells/pre_commit.php
index b0bcca2..afd15a2 100644
--- a/vendors/shells/pre_commit.php
+++ b/vendors/shells/pre_commit.php
@@ -1,29 +1,41 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
class PreCommitShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Permission');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
return $this->authorize();
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function authorize() {
$this->args[] = 'pre_commit';
$this->log($this->args, LOG_DEBUG);
diff --git a/vendors/shells/pre_receive.php b/vendors/shells/pre_receive.php
index 460249d..3df0d8d 100644
--- a/vendors/shells/pre_receive.php
+++ b/vendors/shells/pre_receive.php
@@ -1,29 +1,46 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class PreReceiveShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Permission');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
return $this->access();
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function access() {
$project = @$this->args[0];
$refname = @$this->args[1];
diff --git a/vendors/shells/svn_shell.php b/vendors/shells/svn_shell.php
index 7519b0c..49bc3e3 100644
--- a/vendors/shells/svn_shell.php
+++ b/vendors/shells/svn_shell.php
@@ -1,32 +1,34 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
class SvnShellShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Commit');
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $actionMap = array(
'svnserve' => 'rw',
);
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
if (empty($this->params['user'])) {
$this->err('User not found.');
@@ -50,63 +52,11 @@ class SvnShellShell extends Shell {
passthru("svnserve -t -r {$path}repo --tunnel-user " . $this->params['user'], $result);
return $result;
}
-/**
- * undocumented function
- *
- * @return void
- *
- **/
- function sync() {
- $project = $this->args[0];
- $fork = @$this->args[1];
-
- if ($this->Project->initialize(compact('project', 'fork')) === false || $this->Project->current['url'] !== $project) {
- $this->err('Invalid Project');
- return false;
- }
-
- if ($this->Project->Repo->type !== 'svn') {
- $this->err('Invalid Repo. Check that you supplied the correct project');
- return false;
- }
- $this->out('This may take a while...');
- $this->out('First we start by getting all the previous revisions.');
-
- $data = array_reverse($this->Project->Repo->find());
-
- if (!empty($data)) {
-
- $this->out('Now we can sync up the timeline.');
-
- $this->Commit->deleteAll(array('Commit.project_id' => $this->Project->id));
-
- $results = false;
- foreach ($data as $revision) {
-
- $revision['Repo']['project_id'] = $this->Project->id;
-
- $this->Commit->create($revision['Repo']);
- if ($this->Commit->save()) {
- $this->out("Commit: {$revision['Repo']['revision']} synced.");
- $results = true;
- }
- sleep(1);
- }
- }
-
- if (!empty($results)) {
- $this->out('Sync complete');
- exit();
- }
- $this->err('Nothing was synced');
- return false;
- }
-/**
- * undocumented function
- *
- * @return void
- *
- **/
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
}
\ No newline at end of file
diff --git a/vendors/shells/tasks/upgrade_one.php b/vendors/shells/tasks/upgrade_one.php
deleted file mode 100644
index fc9d2e0..0000000
--- a/vendors/shells/tasks/upgrade_one.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class UpgradeOneTask extends ChawUpgradeShell {
-
- function projects() {
- $this->Project = ClassRegistry::init('Project');
- $this->Project->addToTimeline = false;
-
- if ($this->Project->schema('config')) {
- $this->out('projects up to date');
- return true;
- }
-
- $this->Project->recursive = -1;
- $projects = $this->Project->find('all', array('order' => 'id ASC'));
-
- if ($this->_updateSchema($this->Project, 'projects') == false) {
- return false;
- }
-
- extract(array(
- 'types' => 'rfc, bug, enhancement',
- 'statuses' => 'pending, approved, in progress, on hold, closed',
- 'priorities' => 'low, normal, high',
- 'resolutions' => 'fixed, invalid, works-for-me, duplicate, wont-fix'
- ));
-
- foreach ($projects as $project) {
-
- $new = array('config' => array(
- 'groups' => $project['Project']['groups'],
- 'ticket' => compact('types', 'statuses', 'priorities', 'resolutions')
- ));
-
- $this->Project->setSource('old_projects');
- $this->Project->create($project);
- if (!$this->Project->save($project)) {
- $this->out("ERROR: OLD {$project['Project']['id']}:{$project['Project']['url']} NOT saved");
- continue;
- }
- sleep(1);
- $this->Project->setSource('projects');
- $this->Project->create($project);
- if ($this->Project->save($new)) {
- $this->out("{$project['Project']['id']}:{$project['Project']['url']} upgraded");
- } else {
- $this->out("ERROR: {$project['Project']['id']}:{$project['Project']['url']} NOT upgraded");
- }
- }
- }
-
- function tickets() {
- $this->Ticket = ClassRegistry::init('Ticket');
- $this->Ticket->addToTimeline = false;
-
- $this->Ticket->recursive = -1;
- $tickets = $this->Ticket->find('all');
-
- if ($this->_updateSchema($this->Ticket, 'tickets') == false) {
- return false;
- }
-
- $this->Ticket->setSource('tickets');
-
- foreach ($tickets as $ticket) {
-
- $this->Ticket->set($ticket);
-
- $new['Ticket']['status'] = 'pending';
- $new['Ticket']['resolution'] = null;
-
- if ($ticket['Ticket']['status'] != 'open') {
- $new['Ticket']['resolution'] = $ticket['Ticket']['status'];
- $new['Ticket']['status'] = 'closed';
- }
-
- $new['Ticket']['user_id'] = $ticket['Ticket']['owner'];
-
- if ($this->Ticket->save($new)) {
- $this->out("Ticket {$ticket['Ticket']['id']} upgraded");
- } else {
- $this->out("ERROR: Ticket {$ticket['Ticket']['id']} NOT upgraded");
- }
- }
-
- }
-
- function comments() {
- $this->Comment = ClassRegistry::init('Comment');
- $this->Comment->addToTimeline = false;
-
- if ($this->Comment->schema('model')) {
- $this->out('comments up to date');
- return true;
- }
-
- $this->Comment->recursive = -1;
- $comments = $this->Comment->find('all');
-
- if ($this->_updateSchema($this->Comment, 'comments') == false) {
- return false;
- }
-
- foreach ($comments as $comment) {
- $this->Comment->setSource('old_comments');
- $this->Comment->create($comment);
- if (!$this->Comment->save($comment)) {
- $this->out("ERROR: OLD {$project['Project']['id']}:{$project['Project']['url']} NOT saved");
- continue;
- }
- sleep(1);
- $new = array(
- 'model' => 'Ticket',
- 'foreign_key' => $comment['Comment']['ticket_id']
- );
- $this->Comment->setSource('comments');
- $this->Comment->create($comment);
- if ($this->Comment->save($new)) {
- $this->out("Comment {$comment['Comment']['id']} upgraded");
- } else {
- $this->out("ERROR: Comment {$comment['Comment']['id']} NOT upgraded");
- }
-
- }
- }
-}
diff --git a/vendors/shells/tasks/upgrade_two.php b/vendors/shells/tasks/upgrade_two.php
deleted file mode 100644
index 0fc50e3..0000000
--- a/vendors/shells/tasks/upgrade_two.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class UpgradeTwoTask extends ChawUpgradeShell {
-
- function commits() {
- $this->Timeline->cacheSources = false;
- $this->Commit->cacheSources = false;
-
- $this->Timeline = ClassRegistry::init('Timeline');
- $this->Timeline->setSource('timeline');
-
- $this->Commit = ClassRegistry::init('Commit');
- $this->Commit->setSource('commits');
-
- $this->Commit->addToTimeline = false;
-
- if ($this->_updateSchema('commits', array('new' => true)) == false) {
- return false;
- }
-
- if ($this->_updateSchema('timeline', array('new' => true)) == false) {
- return false;
- }
-
- //$conditions = array('Project.repo_type' => 'git');
-
- $conditions = array();
- $count = $this->Timeline->find('count', compact('conditions'));
-
- for ($i = 1; $i <= ceil($count / 100); $i++) {
- $this->Timeline->setSource('timeline');
- $this->Commit->setSource('commits');
- $events = $this->Timeline->find('all', array(
- 'conditions' => $conditions,
- 'order' => array(
- 'Timeline.id' => 'ASC',
- ),
- 'limit' => '100',
- 'page' => $i
- ));
-
- $this->Timeline->setSource('new_timeline');
- $this->Commit->setSource('new_commits');
-
- $previous = null;
- $batch = array();
-
- foreach ($events as $key => $event) {
- $event['Timeline']['event'] = 'added';
-
- if ('Commit' == $event['Timeline']['model']) {
- if (!empty($previous) && $previous['Timeline']['model'] == 'Commit' && $previous['Timeline']['created'] == $event['Timeline']['created']) {
- $batch[] = $event;
- $previous = $event;
- continue;
- }
- if (!empty($events[$key+1]) && empty($batch)) {
- $next = $events[$key+1];
- if ($next['Timeline']['model'] == 'Commit' && $next['Timeline']['created'] == $event['Timeline']['created']) {
- $batch[] = $event;
- $previous = $event;
- continue;
- }
- }
- }
-
- $previous = $event;
-
- if (!empty($batch) && $batch > 1) {
- $first = $batch[0];
- $last = end($batch);
- $commit = $last['Commit'];
-
- $last['Timeline']['user_id'] = $last['Commit']['user_id'];
- $last['Timeline']['event'] = 'pushed';
-
- if ($commit['revision'] !== $first['Commit']['revision']) {
- $last['Timeline']['data'] = count($batch);
- $commit['changes'] = $first['Commit']['revision'] . '..' . $commit['revision'];
- }
-
- $this->Commit->create($commit);
- if ($this->Commit->save()) {
- $this->out("Commit {$commit['id']} upgraded");
- } else {
- $this->out("ERROR: Batch Commit {$commit['id']} NOT upgraded");
- }
-
- $this->Timeline->create($last['Timeline']);
- if ($this->Timeline->save()) {
- $this->out("Timeline {$last['Timeline']['id']} upgraded");
- } else {
- $this->out("Timeline {$last['Timeline']['id']} NOT upgraded");
- }
- $batch = array();
- continue;
- }
-
- if ('Wiki' == $event['Timeline']['model']) {
- $event['Timeline']['event'] = 'updated';
- }
-
- if ('Commit' == $event['Timeline']['model']) {
-
- $commit = $event['Commit'];
-
- $event['Timeline']['event'] = 'pushed';
- $event['Timeline']['data'] = 0;
- $event['Timeline']['user_id'] = $commit['user_id'];
-
- $this->Commit->create($commit);
- if ($this->Commit->save()) {
- $this->out("Commit {$commit['id']} upgraded");
- } else {
- $this->out("ERROR: Commit {$commit['id']} NOT upgraded");
- }
- }
-
- $this->Timeline->create($event['Timeline']);
- if ($this->Timeline->save()) {
- $this->out("Timeline {$event['Timeline']['id']} upgraded");
- } else {
- $this->out("Timeline {$event['Timeline']['id']} NOT upgraded");
- }
-
- usleep(25);
- }
- }
- }
-
-}
diff --git a/vendors/shells/tasks/upgrade_two_reverse.php b/vendors/shells/tasks/upgrade_two_reverse.php
deleted file mode 100644
index f6ec811..0000000
--- a/vendors/shells/tasks/upgrade_two_reverse.php
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-/**
- * Short description
- *
- * Long description
- *
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
- *
- */
-class UpgradeTwoReverseTask extends ChawUpgradeShell {
-
- function commits() {
- $this->Timeline->cacheSources = false;
- $this->Commit->cacheSources = false;
-
- $this->Timeline = ClassRegistry::init('Timeline');
- $this->Timeline->setSource('timeline');
-
- $this->Timeline->bindModel(array('belongsTo' => array(
- 'BranchCommit' => array(
- 'foreignKey' => 'foreign_key',
- 'conditions' => array('Timeline.model = \'BranchCommit\'')
- )
- )));
-
- $this->Branch = ClassRegistry::init('Branch');
-
-
- $this->Commit = ClassRegistry::init('Commit');
- $this->Commit->setSource('commits');
-
- $this->Commit->addToTimeline = false;
-
- $events = $this->Timeline->find('all', array(
- 'order' => array(
- 'Timeline.created' => 'ASC',
- 'Timeline.id' => 'ASC',
- )
- ));
-
- if ($this->_updateSchema('commits', array('new' => true)) == false) {
- return false;
- }
-
- if ($this->_updateSchema('timeline', array('new' => true)) == false) {
- return false;
- }
-
- $this->Timeline->setSource('new_timeline');
- $this->Commit->setSource('new_commits');
-
- $previous = null;
- $batch = array();
-
- foreach ($events as $i => $event) {
- $this->Commit->setSource('new_commits');
-
- $event['Timeline']['event'] = 'added';
-
- if ('BranchCommit' == $event['Timeline']['model']) {
-
- if (!empty($events[$i+1]) && empty($batch)) {
- $next = $events[$i+1];
- if ($next['Timeline']['model'] == 'BranchCommit' && $next['Timeline']['created'] == $event['Timeline']['created']) {
- $batch[] = $event;
- $this->out("Timeline {$event['Timeline']['id']} batched");
- $previous = $event;
- continue;
- }
- }
-
- if (!empty($batch) && !empty($previous) && $previous['Timeline']['model'] == 'BranchCommit' && $previous['Timeline']['created'] == $event['Timeline']['created']) {
- $batch[] = $event;
- $this->out("Timeline {$event['Timeline']['id']} batched");
- $previous = $event;
- continue;
- }
-
- }
-
- $previous = $event;
-
- if (!empty($batch)) {
- $count = count($batch);
- $first = $batch[0];
- $event = end($batch);
-
- $this->Commit->setSource('commits');
- $first = $this->Commit->findById($first['BranchCommit']['commit_id']);
- $commit = $this->Commit->findById($event['BranchCommit']['commit_id']);
- $this->Commit->setSource('new_commits');
-
- $branch = $this->Branch->findById($event['BranchCommit']['branch_id']);
-
-
- if (!empty($commit)) {
- $event['Timeline']['user_id'] = $commit['Commit']['user_id'];
- $event['Timeline']['model'] = 'Commit';
- $event['Timeline']['foreign_key'] = $commit['Commit']['id'];
- $event['Timeline']['event'] = 'pushed';
- $event['Timeline']['data'] = $count;
-
- $commit['Commit']['branch'] = $branch['Branch']['name'];
- $commit['Commit']['changes'] = $first['Commit']['revision'] . '..' . $commit['Commit']['revision'];
-
- $this->Commit->create($commit);
- if ($this->Commit->save()) {
- $this->out("Commit {$commit['Commit']['id']} upgraded");
- } else {
- $this->out("ERROR: Batch Commit {$commit['Commit']['id']} NOT upgraded");
- }
-
- $this->Timeline->create($event['Timeline']);
- if ($this->Timeline->save()) {
- $this->out("Timeline {$event['Timeline']['id']} saved");
- }
- }
- $previous = null;
- $this->out("Timeline {$event['Timeline']['id']} upgraded");
- $batch = array();
- continue;
- }
-
- if ('Wiki' == $event['Timeline']['model']) {
- $event['Timeline']['event'] = 'updated';
- }
-
- if ('BranchCommit' == $event['Timeline']['model']) {
- $this->Commit->setSource('commits');
- $commit = $this->Commit->findById($event['BranchCommit']['commit_id']);
- $this->Commit->setSource('new_commits');
-
- if (!empty($commit)) {
- $event['Timeline']['user_id'] = $commit['Commit']['user_id'];
- $event['Timeline']['model'] = 'Commit';
- $event['Timeline']['foreign_key'] = $commit['Commit']['id'];
- $event['Timeline']['event'] = 'pushed';
- $event['Timeline']['data'] = 0;
-
- $this->Commit->create($commit);
- if ($this->Commit->save()) {
- $this->out("Commit {$commit['Commit']['id']} upgraded");
- } else {
- $this->out("ERROR: Commit {$commit['Commit']['id']} NOT upgraded");
- }
- }
- }
-
- $this->Timeline->create($event['Timeline']);
- if ($this->Timeline->save()) {
- $this->out("Timeline {$event['Timeline']['id']} upgraded");
- } else {
- $this->out("Timeline {$event['Timeline']['id']} NOT upgraded");
- }
- $batch = array();
- usleep(25);
- }
- }
-}
diff --git a/vendors/shells/trac.php b/vendors/shells/trac.php
index c3adbad..88d2a96 100644
--- a/vendors/shells/trac.php
+++ b/vendors/shells/trac.php
@@ -1,40 +1,50 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.vendors.shells
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
*
* Select id as number, type, milestone as version, reporter, owner, resolution as status, summary as title, description, keywords, time as created, changetime as modified
*/
class TracShell extends Shell {
-/**
- * undocumented class variable
- *
- * @var string
- **/
+ /**
+ * undocumented class variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Ticket');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
$this->help();
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function migrate() {
$type = "__{$this->args[0]}";
if (method_exists($this, $type)) {
return $this->{$type}();
}
}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function __tickets() {
$this->out('This may take a while...');
$project = @$this->args[1];
diff --git a/vendors/shells/update.php b/vendors/shells/update.php
index 9b72157..2ac9f05 100644
--- a/vendors/shells/update.php
+++ b/vendors/shells/update.php
@@ -15,20 +15,35 @@
*
*/
class UpdateShell extends Shell {
-
+
+ /**
+ * undocumented variable
+ *
+ * @var string
+ */
var $uses = array('Project', 'Permission', 'Git');
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function _welcome() {}
-
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function main() {
return $this->authorize();
}
-/**
- * undocumented function
- *
- * @return exit value 0 for true, 1-255 for status
- *
- **/
+
+ /**
+ * undocumented function
+ *
+ * @return void
+ */
function authorize() {
$this->Project->id = $this->args[0];
$project = $this->Project->field('url');
diff --git a/views/helpers/chaw.php b/views/helpers/chaw.php
index 045b243..b5af8e0 100755
--- a/views/helpers/chaw.php
+++ b/views/helpers/chaw.php
@@ -1,18 +1,15 @@
<?php
/**
- * Short description
+ * Chaw : source code and project management
*
- * Long description
+ * @copyright Copyright 2009, Garrett J. Woodworth (gwoohoo@gmail.com)
+ * @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
- * Copyright 2008, Garrett J. Woodworth <gwoo@cakephp.org>
- * Redistributions not permitted
- *
- * @copyright Copyright 2008, Garrett J. Woodworth
- * @package chaw
- * @subpackage chaw.controllers
- * @since Chaw 0.1
- * @license commercial
+ */
+/**
+ * undocumented class
*
+ * @package default
*/
class ChawHelper extends AppHelper {
@@ -46,7 +43,7 @@ class ChawHelper extends AppHelper {
* @param string $escapeTitle
* @return void
*
- **/
+ */
function type($type, $url = array(), $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true) {
$view = ClassRegistry::getObject('view');
$passedArgs = $view->passedArgs;
