-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/nex 136/configure spanner #636
Changes from 28 commits
e1fdcd5
8052082
517bb8d
c55d854
bc4d9d3
4f95439
7bc6e55
e363a7a
6d11a56
0432cf5
fe81ec1
b43204a
6f1d3a3
d424b0b
5e3b903
33477d3
c80a0b7
909b164
f55f38b
c1c8b98
05078e2
2f7ec12
7ee367c
6b559fb
e79ab52
710c1c9
5cb5df3
b21434f
bd16e4a
90dc968
99317e3
03e832b
a768a64
76b32d1
d64e869
2cf8572
4900c30
08f3286
e90251b
6c1886d
fd45ee8
18052a8
9c5a791
261a59d
eb9cc5c
9dd2ba3
e0b556e
634889d
7940538
92163d3
9032ebe
949e004
de849cf
c8d7097
f397a74
ee36b3b
1c614d9
dfcd1fa
eee9d6a
6e020dc
472b511
d109921
6417cdb
e513237
d3f9565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,169 +1,117 @@ | ||
<?php | ||
/** | ||
* 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; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER); | ||
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV); | ||
* | ||
*/ | ||
<?php | ||
/** | ||
* 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; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER); | ||
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV); | ||
ferenckiss89 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
*/ | ||
|
||
/** | ||
* Short description of class common_ext_Namespace | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @package generis | ||
|
||
*/ | ||
class common_ext_Namespace | ||
{ | ||
// --- ASSOCIATIONS --- | ||
// generateAssociationEnd : | ||
|
||
// --- ATTRIBUTES --- | ||
|
||
/** | ||
* A unique identifier of the namespace | ||
* | ||
* @access protected | ||
* @var int | ||
* @var string | ||
*/ | ||
protected $modelId = 0; | ||
protected $modelId; | ||
|
||
/** | ||
* the namespace URI | ||
* | ||
* @access protected | ||
* @var string | ||
*/ | ||
protected $uri = ''; | ||
|
||
// --- OPERATIONS --- | ||
protected $uri; | ||
|
||
/** | ||
* Create a namespace instance | ||
* Namespace constructor. | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @param int id | ||
* | ||
* @param string id | ||
* @param string uri | ||
* @return mixed | ||
*/ | ||
public function __construct($id = 0, $uri = '') | ||
public function __construct($id = '', $uri = '') | ||
{ | ||
|
||
|
||
if($id > 0){ | ||
$this->modelId = $id; | ||
} | ||
if(!empty($uri)){ | ||
$this->uri = $uri; | ||
} | ||
|
||
|
||
$this->modelId = $id; | ||
$this->uri = $uri; | ||
} | ||
|
||
/** | ||
* Get the identifier of the namespace instance | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @return int | ||
* @return string | ||
*/ | ||
public function getModelId() | ||
{ | ||
$returnValue = (int) 0; | ||
|
||
|
||
|
||
$returnValue = $this->modelId; | ||
|
||
|
||
|
||
return (int) $returnValue; | ||
return $this->modelId; | ||
} | ||
|
||
/** | ||
* Get the namespace URI | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @return string | ||
*/ | ||
public function getUri() | ||
{ | ||
$returnValue = (string) ''; | ||
|
||
|
||
|
||
$returnValue = $this->uri; | ||
|
||
|
||
|
||
return (string) $returnValue; | ||
return $this->uri; | ||
} | ||
|
||
/** | ||
* Magic method, return the Namespace URI | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
$returnValue = (string) ''; | ||
|
||
|
||
|
||
$returnValue = $this->getUri(); | ||
|
||
|
||
|
||
return (string) $returnValue; | ||
return $this->getUri(); | ||
} | ||
|
||
/** | ||
* Remove a namespace from the ontology. All triples bound to the model will | ||
* be removed. | ||
* | ||
* @access public | ||
* @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> | ||
* | ||
* @return boolean | ||
* @throws core_kernel_persistence_Exception | ||
*/ | ||
public function remove() | ||
{ | ||
$returnValue = (bool) false; | ||
|
||
|
||
$db = core_kernel_classes_DbWrapper::singleton(); | ||
if (false === $db->exec("DELETE FROM statements WHERE modelid = ?", array($this->getModelId()))){ | ||
$returnValue = false; | ||
|
||
// TODO refactor this to use triple store abstraction. | ||
if (false === $db->exec("DELETE FROM statements WHERE modelid = ?", [$this->getModelId()])) { | ||
return false; | ||
} | ||
else{ | ||
if (false === $db->exec("DELETE FROM models WHERE modelid = ?", array($this->getModelId()))){ | ||
$returnValue = false; | ||
} | ||
else{ | ||
$returnValue = true; | ||
} | ||
|
||
// TODO refactor this to use triple store abstraction. | ||
if (false === $db->exec("DELETE FROM models WHERE modelid = ?", [$this->getModelId()])) { | ||
return false; | ||
} | ||
|
||
|
||
|
||
return (bool) $returnValue; | ||
return true; | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,16 +53,24 @@ | |
"extra": { | ||
"tao-extension-name": "generis" | ||
}, | ||
"repositories": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. repositories added in non root composer.json will be ignored an lead to confussion |
||
{ | ||
"type": "vcs", | ||
"url": "git@github.com:oat-sa/lib-dbal-spanner.git" | ||
} | ||
], | ||
"require": { | ||
"clearfw/clearfw": "~1.2.0", | ||
"easyrdf/easyrdf": "^0.9.0", | ||
"doctrine/dbal": "~2.5.0", | ||
"doctrine/dbal": "^2.9.0", | ||
"doctrine/annotations": "1.*", | ||
"zendframework/zend-servicemanager": "~2.5.0", | ||
"league/flysystem": "~1.0", | ||
"oat-sa/oatbox-extension-installer": "~1.1||dev-master", | ||
"php": "^7.1", | ||
ferenckiss89 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"psr/log": "~1.0", | ||
"oat-sa/lib-generis-search": "^2.0.1", | ||
"oat-sa/lib-generis-search": "dev-feature/NEX-84/spanner-compatible-statements", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. develop branches should not be references |
||
"oat-sa/lib-dbal-spanner": "dev-feature/NEX-84/spanner-query-refactoring", | ||
"monolog/monolog": "^1.23.0", | ||
"fluent/logger": "^1.0.1", | ||
"symfony/lock": "^3.4", | ||
|
@@ -90,5 +98,6 @@ | |
"psr-4": { | ||
"oat\\generis\\test\\": "generis/test/" | ||
} | ||
} | ||
}, | ||
"minimum-stability" : "dev" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minimum-stability is ignored in non root composer.json and can be confussing |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already part of https://github.com/oat-sa/generis/pull/686/files#diff-cb45d9e73f3ab29ea11eadbdc095c55fR59