/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright ©2006 by sTEFANs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* This file contains interfaces that needs to be implemented for project configuration.
* @copyright Copyright ©2006 by sTEFANs
* @license http://opensource.org/licenses/lgpl-license.php GNU General Public License
* This interface defines a factory for SVN Web Control (SWC) configuration.
* There are two ways of applying configurations via Configuration Factory:
* 1. In the root folder of a project that should
* be controlled via SWC is a frameset page. This
* frameset page offers just on frame. The source url
* of that frame points to swc/start.php and has a argument
* that points to the SWC configuration file for that project.
* This means the frame src could be swc/start.php?config=../conf.php.
* The path of the config file must be relative to SWC directory
* from SWCs point of view. The example above assumes that SWC is
* located within root/swc directory. By the way, it is a good idea
* to place the project also into a subdirectory of root, just keep
* everything clean and separated.
* Within this configuration file there must be function called
* <b>GetSwcConfigFactory()</b> that returns the implementation
* object of <b>SwcConfigFactory</b> and provides the config
* 2. If a configuration factory is not provided as described above,
* SWC takes the config factory instance proivded within
* <b>.swc/config/std_config_factory.php</b>. This factory needs to be
* implemented in a way, that it returns <b>Configuration</b>s for
* all projects that should be controled by SWC.
* Both scenarios described above has some advantages but also some disadvantages.
* It depends highly on the development rules and environment, which one
* to use. However, examples for both scenarios are provided together SWC.
* Have a look into the html root directory for scenario 1 and into swc/config
* Returns an array of <b>SwcConfig</b> objects.
* These objects represents configured projects that
* are selectable within the project list, if more
* than one project is returned.
* @return array Array of configured projects.
* This interface defines a configuration that encapsulates several project settings
* needed by SVN Web Control. The main reason why a interface is chosen is to enable
* multiple instances of configuration. This interface must be implemented
* Returns a user friendly name for the project.
* @return string User friendly project name.
* Returns the relative URL of the Webpage under control.
* @return string URL of page to display in MainFrame.
* Returns the URL of the repository for the main frame.
* @return string URL of repository. Any protocol
* (http://, svn://, etc.) is supported.
* <b>Note:</b> <i>public function GetRepositoryRootDir</i> is deprecated
* and removed from <i>SwcConfig</i> interface in SWC v1.1.0.
* Please use <i>GetRepositoryRoot</i> instead.
* Returns subdirectories which contains directories for tags.
* @return array or string (Array of) repository directory that contains tags.
* Returns the maximum depth of directories that should be considered
* as tag directory underneath <b>GetTagDirs()</b> hierarchy.
* E.g. if this is set to 2 than GetTagDirs()/dir1/dir2 is considered
* as tag directory while GetTagDirs()/dir1/dir2/dir3 is not.
* @return int Maximal path depth for tag directories.
* Returns subdirectories which contains directories for branches.
* @return array or string (Array of) repository directory that contains branches.
* Returns the maximum depth of directories that should be considered
* as branch directory underneath <b>GetBranchDirs()</b> hierarchy.
* E.g. if this is set to 2 than GetBranchDirs()/dir1/dir2 is considered
* as tag directory while GetBranchDirs()/dir1/dir2/dir3 is not.
* @return int Maximal path depth for branch directories.
* Returns subdirectoy which contains repository trunk.
* @return string Repository directory that contains main developement.
* Returns the absolute path of the workspace directory in the local file system.
* @return string Absolute path of the workspace.
* <b>Note:</b> <i>public function GetWebspaceRoot</i> is deprecated
* and removed from <i>SwcConfig</i> interface in SWC v1.1.0.
* Please use <i>GetWebspaceRootDir</i> instead.
* Returns the SVN user which should be used for repository access.
* @return string SVN user.
* Returns the password of the SVN user which should be used for repository access.
* @return string Password of SVN user.
* Returns the URL of WebSVN view for this project or NULL if WebSVN is not available.
* @return string URL for WebSVN view for this project.
* Returns true if SVN command bar may be shown, false otherwise.
* This setting overrides corresponding user setting in order to
* protect the system agaist malicious commands.
* Returns the directory for packed (release) archives called
* spaceballs. Spaceballs archives are usually created for a dedicated revision.
* <i>Note</i> PHP needs write access granted on this directory.
* @return string Path for archive directory.
* Returns the HTTP URL for packed (release) archives. The
* URL should point to the directory returned by
* <i>GetSpaceballDir()</i>.
* @return string URL for spaceball directory.
* This interface contains any deprecated functions of interface <i>SwcConfig</i>
* and is introduced for documentation purposes only. <br>
* <b>Do not implement or extend this interface.</i>
* Returns the absolute path of the repository in the local file system.
* @deprecated v1.1.0 Use GetRepositroyRoot() instead to configure the repository root.
* @return string Absolute path of the repository.
* @see SwcConfig::GetRepositoryRoot
* Returns the URL for the workspace where the project
* is checked out. Used by SVN.
* @return string URL of Webspace.
* @deprecated v1.1.0 Use <i>GetWebspaceRootDir</i> instead to configure
* @see SwcConfig::GetWebspaceRootDir
* This abstract class provides default implementations of
* configuration methods that usually do not change. Deriving
* from this class instead of the the interface minimizes the
* number of methods that needs to be implemented.
* Returns subdirectories which contains directories for tags.
* @return array or string (Array of) repository directory that contains tags.
* Returns the maximum depth of directories that should be considered
* as tag directory underneath <b>GetTagDirs()</b> hierarchy.
* E.g. if this is set to 2 than GetTagDirs()/dir1/dir2 is considered
* as tag directory while GetTagDirs()/dir1/dir2/dir3 is not.
* @return int Maximal path depth for tag directories.
* Returns subdirectories which contains directories for branches.
* @return array or string (Array of) repository directory that contains branches.
* Returns the maximum depth of directories that should be considered
* as branch directory underneath <b>GetBranchDirs()</b> hierarchy.
* E.g. if this is set to 2 than GetBranchDirs()/dir1/dir2 is considered
* as tag directory while GetBranchDirs()/dir1/dir2/dir3 is not.
* @return int Maximal path depth for branch directories.
* Returns subdirectoy which contains repository trunk.
* @return string Repository directory that contains main developement.
* Returns the SVN user which should be used for repository access.
* @return string SVN user.
* Returns the password of the SVN user which should be used for repository access.
* @return string Password of SVN user.
* Returns the URL of WebSVN view for this project or NULL if WebSVN is not available.
* Returns true if SVN command bar may be shown, false otherwise.
* This setting overrides corresponding user setting in order to
* protect the system agaist malicious commands.
* Returns the directory for packed (release) archives called
* spaceballs. Spaceballs archives are usually created for a dedicated revision.
* <i>Note</i> PHP needs write access granted on this directory.
* @return string Path for archive directory.
$dir =
$this->GetWebspaceRootDir().
'archives';
* Returns the HTTP URL for packed (release) archives. The
* URL should point to the directory returned by
* <i>GetSpaceballDir()</i>. The default implementation
* tries to match the frist part of <i>GetMainFrame()</i>
* against the later part of <i>GetSpaceBallDir()</i>
* since usually the URL for the main frame contains the
* common root URL that also leads to the spaceball
* directory URL. If this implementation does not fit
* concrete requirments, this function must be overwritten
* within the concrete project configuration.
* @return string URL for spaceball directory.
$mf_url =
$this->GetMainFrame();
$sb_dir_tokens =
explode('/', $dir);
$mf_url_tokens =
explode('/', $mf_url);
if ($last !=
NULL &&
$last !=
''){
$url .=
$mf_url_tokens[$i].
'/';
$cnt =
count($sb_dir_tokens);
$url .=
$sb_dir_tokens[$i].
'/';