openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit e480910b6526a123ee01ffe20b2026dae4512995
parent 910f634aee65b916b3b6e05af1ced86656839b5c
Author: Jan Dankert <develop@jandankert.de>
Date:   Mon, 21 Sep 2020 22:50:49 +0200

Missed 1 class in last commit.

Diffstat:
modules/cms/generator/target/BaseTarget.class.php | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+), 0 deletions(-)

diff --git a/modules/cms/generator/target/BaseTarget.class.php b/modules/cms/generator/target/BaseTarget.class.php @@ -0,0 +1,76 @@ +<?php +// OpenRat Content Management System +// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de +// +// 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. +namespace cms\generator\target; + +use util\Url; + + +/** + * Superclass for publication targets. + * + * @author Jan Dankert + */ +abstract class BaseTarget implements Target +{ + /** + * @var Url + */ + protected $url; + + public function __construct( $targetUrl ) { + $this->url = new Url( $targetUrl ); + + $this->open(); + } + + + public static function accepts( $scheme ) { + return in_array( $scheme, static::acceptsSchemes() ); + } + + + /** + * For which types this target is reponsible? + * + * @return array + */ + protected abstract static function acceptsSchemes(); + + + public function open() { + + } + + + public abstract function put($source, $dest, $timestamp); + + + /** + * Closes the connection. + */ + public function close() { + + } + + + public static function isAvailable() { + + return true; + } + +}