Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some refactoring of Ping class

  • Loading branch information...
commit ae6c285d014e2dbc613578de8669da7a3475ae90 1 parent 1c383ee
@white-gecko white-gecko authored
Showing with 18 additions and 18 deletions.
  1. +18 −18 library/Erfurt/Ping.php
View
36 library/Erfurt/Ping.php
@@ -44,7 +44,7 @@ public function __construct ($options)
*
* @return integer An integer (fault) code
*/
- public function ping($sourceUri, $targetUri)
+ public function receive ($sourceUri, $targetUri)
{
$this->_logInfo('Method ping was called.');
@@ -166,7 +166,7 @@ public function ping($sourceUri, $targetUri)
return 'Pingback has been registered or updated... Keep spinning the Data Web ;-)';
}
- protected function _addPingback($s, $p, $o)
+ protected function _addPingback ($s, $p, $o)
{
if ($this->_targetGraph === null) {
return false;
@@ -174,7 +174,7 @@ protected function _addPingback($s, $p, $o)
$store = Erfurt_App::getInstance()->getStore();
- $sql = 'INSERT INTO ow_pingback_pingbacks (source, target, relation) '
+ $sql = 'INSERT INTO ef_pingback_pingbacks (source, target, relation) '
. 'VALUES ("' . $s . '", "' . $o . '", "' . $p . '")';
$this->_query($sql);
@@ -204,7 +204,7 @@ protected function _addPingback($s, $p, $o)
return true;
}
- protected function _checkTargetExists($targetUri)
+ protected function _checkTargetExists ($targetUri)
{
if ($this->_targetGraph == null) {
$event = new Erfurt_Event('onNeedsGraphForLinkedDataUri');
@@ -222,11 +222,11 @@ protected function _checkTargetExists($targetUri)
}
}
- function _deleteInvalidPingbacks($sourceUri, $targetUri, $foundPingbackTriples = array())
+ protected function _deleteInvalidPingbacks ($sourceUri, $targetUri, $foundPingbackTriples = array())
{
$store = Erfurt_App::getInstance()->getStore();
- $sql = 'SELECT * FROM ow_pingback_pingbacks WHERE source="' . $sourceUri . '" AND target="' . $targetUri . '"';
+ $sql = 'SELECT * FROM ef_pingback_pingbacks WHERE source="' . $sourceUri . '" AND target="' . $targetUri . '"';
$result = $this->_query($sql);
$removed = false;
@@ -241,7 +241,7 @@ function _deleteInvalidPingbacks($sourceUri, $targetUri, $foundPingbackTriples =
}
if (!$found) {
- $sql = 'DELETE FROM ow_pingback_pingbacks WHERE id=' . $row['id'];
+ $sql = 'DELETE FROM ef_pingback_pingbacks WHERE id=' . $row['id'];
$this->_query($sql);
$oSpec = array(
@@ -264,7 +264,7 @@ function _deleteInvalidPingbacks($sourceUri, $targetUri, $foundPingbackTriples =
return $removed;
}
- protected function _determineInverseProperty($propertyUri)
+ protected function _determineInverseProperty ($propertyUri)
{
$client = Erfurt_App::getInstance()->getHttpClient(
$propertyUri,
@@ -301,7 +301,7 @@ protected function _determineInverseProperty($propertyUri)
}
}
- private function _getResourceFromWrapper($sourceUri, $targetUri, $wrapperName = 'Linkeddata')
+ private function _getResourceFromWrapper ($sourceUri, $targetUri, $wrapperName = 'Linkeddata')
{
$r = new Erfurt_Rdf_Resource($sourceUri);
@@ -329,7 +329,7 @@ private function _getResourceFromWrapper($sourceUri, $targetUri, $wrapperName =
return $newStatements;
}
- protected function _logError($msg)
+ protected function _logError ($msg)
{
$logger = Erfurt_App::getInstance()->getLog();
@@ -340,7 +340,7 @@ protected function _logError($msg)
}
}
- protected function _logInfo($msg)
+ protected function _logInfo ($msg)
{
$logger = Erfurt_App::getInstance()->getLog();
@@ -351,9 +351,9 @@ protected function _logInfo($msg)
}
}
- protected function _pingbackExists($s, $p, $o)
+ protected function _pingbackExists ($s, $p, $o)
{
- $sql = 'SELECT * FROM ow_pingback_pingbacks '
+ $sql = 'SELECT * FROM ef_pingback_pingbacks '
. 'WHERE source="' . $s . '" AND target="' . $o . '" AND relation="' . $p . '" '
. 'LIMIT 1';
$result = $this->_query($sql);
@@ -364,14 +364,14 @@ protected function _pingbackExists($s, $p, $o)
return false;
}
- private function _checkDb()
+ private function _checkDb ()
{
if ($this->_dbChecked) {
return;
}
$store = Erfurt_App::getInstance()->getStore();
- $sql = 'SELECT * FROM ow_pingback_pingbacks LIMIT 1';
+ $sql = 'SELECT * FROM ef_pingback_pingbacks LIMIT 1';
try {
$result = $store->sqlQuery($sql);
@@ -382,11 +382,11 @@ private function _checkDb()
$this->_dbChecked = true;
}
- private function _createTable()
+ private function _createTable ()
{
$store = Erfurt_App::getInstance()->getStore();
- $sql = 'CREATE TABLE IF NOT EXISTS ow_pingback_pingbacks (
+ $sql = 'CREATE TABLE IF NOT EXISTS ef_pingback_pingbacks (
id TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
source VARCHAR(255) COLLATE ascii_bin NOT NULL,
target VARCHAR(255) COLLATE ascii_bin NOT NULL,
@@ -396,7 +396,7 @@ private function _createTable()
return $this->_query($sql, false);
}
- protected function _query($sql, $withCheck = true)
+ protected function _query ($sql, $withCheck = true)
{
if ($withCheck) {
$this->_checkDb();

2 comments on commit ae6c285

@pfrischmuth

At least [1] states, that whitespace after method names is not permitted. Did we change this? Or do we just do not care anymore?

[1] https://github.com/AKSW/OntoWiki/wiki/Coding-Standards

@white-gecko
Please sign in to comment.
Something went wrong with that request. Please try again.