gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/common/scm SCMFactory.class,NONE,1.1


From: kikov
Subject: [Gforge-commits] gforge/common/scm SCMFactory.class,NONE,1.1
Date: Mon, 02 Aug 2004 13:55:08 -0500

Update of /cvsroot/gforge/gforge/common/scm
In directory db.perdue.net:/tmp/cvs-serv2715

Added Files:
        SCMFactory.class 
Log Message:
A Factory class to get info about installed SCM plugins.
Fixes [#856].


--- NEW FILE: SCMFactory.class ---
<?php
/**
 * GForge SCM Facility
 *
 * Copyright 2004 GForge, LLC
 * http://gforge.org/
 *
 * @version   $Id: SCMFactory.class,v 1.1 2004/08/02 18:55:05 kikov Exp $
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
 */

require_once('common/include/Error.class');
require_once('common/include/PluginManager.class');

class SCMFactory extends Error {

        /**
         * The scms array.
         *
         * @var  array  scms.
         */
        var $scms;
        var $fetched_rows;

        /**
         *  Constructor.
         *
         *      @return boolean success.
         */
        function SCMFactory() {
                $this->Error();
                if (!$sys_use_scm) {
                        $this->setError('SCMFactory::sys_use_scm');
                        return false;
                }
                return true;
        }

        /**
         *      getSCMs - get an array of Plugin SCM objects.
         *
         *      @return array   The array of SCM objects.
         */
        function &getSCMs() {
                $scm_plugins = array();
                if ($this->scms) {
                        return $this->scms;
                }
                $hookParams['scm_plugins']=& $scm_plugins;
                plugin_hook("scm_plugin", $hookParams);
                $this->scms= $scm_plugins;
                return $this->scms;
        }

}

?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]