Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| common_uri_AbstractUriProvider | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| getDriver | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| setDriver | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg |
| 19 | * (under the project TAO & TAO2); |
| 20 | * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung |
| 21 | * (under the project TAO-TRANSFER); |
| 22 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 23 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | /** |
| 28 | * Any implementation of the AbstractUriProvider class aims at providing unique |
| 29 | * to client code. It should take into account the state of the Knowledge Base |
| 30 | * avoid collisions. The AbstractUriProvider::provide method must be implemented |
| 31 | * subclasses to return a valid URI. |
| 32 | * |
| 33 | * @abstract |
| 34 | * @access public |
| 35 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 36 | * @package generis |
| 37 | |
| 38 | */ |
| 39 | abstract class common_uri_AbstractUriProvider implements common_uri_UriProvider |
| 40 | { |
| 41 | // --- ASSOCIATIONS --- |
| 42 | |
| 43 | |
| 44 | // --- ATTRIBUTES --- |
| 45 | |
| 46 | /** |
| 47 | * The database driver the UriProvider is using. |
| 48 | * |
| 49 | * @access protected |
| 50 | * @var string |
| 51 | */ |
| 52 | protected $driver = ''; |
| 53 | |
| 54 | // --- OPERATIONS --- |
| 55 | |
| 56 | /** |
| 57 | * Returns the database driver that the UriProvider implementation is |
| 58 | * using. |
| 59 | * |
| 60 | * @access public |
| 61 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 62 | * @return string |
| 63 | */ |
| 64 | public function getDriver() |
| 65 | { |
| 66 | $returnValue = (string) ''; |
| 67 | |
| 68 | |
| 69 | $returnValue = $this->driver; |
| 70 | |
| 71 | |
| 72 | return (string) $returnValue; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Sets the database driver that will be used for further URI generations. |
| 77 | * |
| 78 | * @access public |
| 79 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 80 | * @param string driver A driver name such as 'mysql', 'postgres', ... |
| 81 | * @return void |
| 82 | */ |
| 83 | public function setDriver($driver) |
| 84 | { |
| 85 | |
| 86 | $this->driver = strtolower($driver); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Instantiates an instance of UriProvider for a given database driver. |
| 91 | * |
| 92 | * @access public |
| 93 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 94 | * @param string driver A driver name such as 'mysql', 'postgres', ... |
| 95 | * @return mixed |
| 96 | */ |
| 97 | public function __construct($driver) |
| 98 | { |
| 99 | |
| 100 | $this->setDriver($driver); |
| 101 | } |
| 102 | } |