Permalink
Browse files

Add connector BorderCloud, replace old lib 4Store and insert tag lang

  • Loading branch information...
1 parent 9fecd90 commit ec88bd5483a9509d6c192d3f6cd1d9d3c5729fa9 @BorderCloud committed Mar 10, 2011
Showing with 3,441 additions and 1,953 deletions.
  1. +16 −13 LinkedWiki.php
  2. +10 −6 README
  3. +6 −8 class/LinkedWikiJob.php
  4. +32 −22 class/SMW_LinkedWikiStore.php
  5. +8 −18 lib/{FourStore/Curl_HTTP_Client.php → 4store/Curl.php}
  6. +469 −0 lib/4store/Endpoint.php
  7. +3 −6 lib/{FourStore → 4store}/Namespace.php
  8. +4 −9 lib/{FourStore → 4store}/Net.php
  9. +17 −18 lib/{FourStore → 4store}/SparqlTools.php
  10. +0 −94 lib/FourStore/FourStore_NTriplesSerializer.php
  11. +0 −338 lib/FourStore/FourStore_Store.php
  12. +0 −230 lib/FourStore/FourStore_StorePlus.php
  13. +0 −3 lib/arc/Version
  14. +0 −214 lib/arc/parsers/ARC2_SPARQLPlusParser.php
  15. +0 −53 lib/arc/serializers/ARC2_LegacyHTMLSerializer.php
  16. +0 −147 lib/arc/serializers/ARC2_NTriplesSerializer.php
  17. +0 −70 lib/arc/store/ARC2_StoreHelper.php
  18. +54 −61 lib/{arc → arc2}/ARC2.php
  19. +41 −24 lib/{arc → arc2}/ARC2_Class.php
  20. +2 −6 lib/{arc → arc2}/ARC2_Reader.php
  21. +3 −7 lib/{arc → arc2}/ARC2_Resource.php
  22. +431 −0 lib/arc2/ARC2_TestHandler.php
  23. +1 −1 lib/{arc → arc2}/ARC2_getFormat.php
  24. +13 −10 lib/{arc → arc2}/ARC2_getPreferredFormat.php
  25. +2 −6 lib/{arc → arc2}/extractors/ARC2_DcExtractor.php
  26. +2 −6 lib/{arc → arc2}/extractors/ARC2_ErdfExtractor.php
  27. +4 −8 lib/{arc → arc2}/extractors/ARC2_MicroformatsExtractor.php
  28. +2 −6 lib/{arc → arc2}/extractors/ARC2_OpenidExtractor.php
  29. +2 −6 lib/{arc → arc2}/extractors/ARC2_PoshRdfExtractor.php
  30. +2 −14 lib/{arc → arc2}/extractors/ARC2_RDFExtractor.php
  31. +2 −6 lib/{arc → arc2}/extractors/ARC2_RdfaExtractor.php
  32. +2 −6 lib/{arc → arc2}/extractors/ARC2_TwitterProfilePicExtractor.php
  33. +4 −8 lib/{arc → arc2}/parsers/ARC2_AtomParser.php
  34. +3 −7 lib/{arc → arc2}/parsers/ARC2_CBJSONParser.php
  35. +3 −7 lib/{arc → arc2}/parsers/ARC2_JSONParser.php
  36. +5 −9 lib/{arc → arc2}/parsers/ARC2_LegacyXMLParser.php
  37. +5 −9 lib/{arc → arc2}/parsers/ARC2_RDFParser.php
  38. +5 −9 lib/{arc → arc2}/parsers/ARC2_RDFXMLParser.php
  39. +3 −7 lib/{arc → arc2}/parsers/ARC2_RSSParser.php
  40. +2 −6 lib/{arc → arc2}/parsers/ARC2_SGAJSONParser.php
  41. +57 −61 lib/{arc → arc2}/parsers/ARC2_SPARQLParser.php
  42. +44 −43 lib/{FourStore/FourStore_SPARQLParser.php → arc2/parsers/ARC2_SPARQLPlusParser.php}
  43. +2 −6 lib/{arc → arc2}/parsers/ARC2_SPARQLXMLResultParser.php
  44. +4 −8 lib/{arc → arc2}/parsers/ARC2_SPOGParser.php
  45. +9 −21 lib/{arc → arc2}/parsers/ARC2_SemHTMLParser.php
  46. +3 −7 lib/{arc → arc2}/parsers/ARC2_TurtleParser.php
  47. +111 −0 lib/arc2/serializers/ARC2_LegacyHTMLSerializer.php
  48. +2 −6 lib/{arc → arc2}/serializers/ARC2_LegacyJSONSerializer.php
  49. +2 −6 lib/{arc → arc2}/serializers/ARC2_LegacyXMLSerializer.php
  50. +2 −6 lib/{arc → arc2}/serializers/ARC2_MicroRDFSerializer.php
  51. +128 −0 lib/arc2/serializers/ARC2_NTriplesSerializer.php
  52. +2 −6 lib/{arc → arc2}/serializers/ARC2_POSHRDFSerializer.php
  53. +3 −7 lib/{arc → arc2}/serializers/ARC2_RDFJSONSerializer.php
  54. +3 −7 lib/{arc → arc2}/serializers/ARC2_RDFSerializer.php
  55. +17 −19 lib/{arc → arc2}/serializers/ARC2_RDFXMLSerializer.php
  56. +2 −6 lib/{arc → arc2}/serializers/ARC2_RSS10Serializer.php
  57. +9 −10 lib/{arc → arc2}/serializers/ARC2_TurtleSerializer.php
  58. +3 −7 lib/{arc → arc2}/sparqlscript/ARC2_SPARQLScriptParser.php
  59. +3 −7 lib/{arc → arc2}/sparqlscript/ARC2_SPARQLScriptProcessor.php
  60. +194 −0 lib/arc2/store/ARC2_MemStore.php
  61. +8 −10 lib/{arc → arc2}/store/ARC2_RemoteStore.php
  62. +30 −13 lib/{arc → arc2}/store/ARC2_Store.php
  63. +3 −7 lib/{arc → arc2}/store/ARC2_StoreAskQueryHandler.php
  64. +2 −6 lib/{arc → arc2}/store/ARC2_StoreAtomLoader.php
  65. +2 −6 lib/{arc → arc2}/store/ARC2_StoreCBJSONLoader.php
  66. +3 −7 lib/{arc → arc2}/store/ARC2_StoreConstructQueryHandler.php
  67. +4 −8 lib/{arc → arc2}/store/ARC2_StoreDeleteQueryHandler.php
  68. +3 −7 lib/{arc → arc2}/store/ARC2_StoreDescribeQueryHandler.php
  69. +4 −8 lib/{arc → arc2}/store/ARC2_StoreDumpQueryHandler.php
  70. +3 −7 lib/{arc → arc2}/store/ARC2_StoreDumper.php
  71. +10 −10 lib/{arc → arc2}/store/ARC2_StoreEndpoint.php
  72. +66 −0 lib/arc2/store/ARC2_StoreHelper.php
  73. +4 −9 lib/{arc → arc2}/store/ARC2_StoreInsertQueryHandler.php
  74. +11 −15 lib/{arc → arc2}/store/ARC2_StoreLoadQueryHandler.php
  75. +2 −6 lib/{arc → arc2}/store/ARC2_StoreQueryHandler.php
  76. +2 −6 lib/{arc → arc2}/store/ARC2_StoreRDFXMLLoader.php
  77. +2 −6 lib/{arc → arc2}/store/ARC2_StoreRSSLoader.php
  78. +2 −6 lib/{arc → arc2}/store/ARC2_StoreSGAJSONLoader.php
  79. +3 −7 lib/{arc → arc2}/store/ARC2_StoreSPOGLoader.php
  80. +97 −72 lib/{arc → arc2}/store/ARC2_StoreSelectQueryHandler.php
  81. +2 −6 lib/{arc → arc2}/store/ARC2_StoreSemHTMLLoader.php
  82. +2 −6 lib/{arc → arc2}/store/ARC2_StoreTableManager.php
  83. +2 −6 lib/{arc → arc2}/store/ARC2_StoreTurtleLoader.php
  84. +583 −0 lib/bordercloud/Curl.php
  85. +594 −0 lib/bordercloud/Endpoint.php
  86. +70 −0 lib/bordercloud/Net.php
  87. +154 −0 lib/bordercloud/SparqlTools.php
  88. +15 −8 specialpages/SpecialSparqlEndpoint.php
View
@@ -1,13 +1,14 @@
<?php
/**
- * @version 0.1.0.0
+ * @version 1.0.0.0
* @package Bourdercloud/linkedwiki
- * @copyright (c) 2010 Bourdercloud.com
+ * @copyright (c) 2011 Bourdercloud.com
* @author Karima Rafes <karima.rafes@bordercloud.com>
+ * @link http://www.mediawiki.org/wiki/Extension:LinkedWiki
+ * @license CC-by-nc-sa V3.0
*
* Last version : http://github.com/BorderCloud/LinkedWiki
- *
- Copyright (c) 2010 Bourdercloud.com
+
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0
@@ -36,6 +37,9 @@
$wgLinkedWikiEndPoint = "http://localhost:8080/sparql/";
$wgLinkedWikiGraphWiki = "http://fr.linkedwiki.org/wiki/";
$wgLinkedWikiLocalEndPoint = "http://fr.linkedwiki.org/sparql/";
+$wgLinkedWikiLanguageTag = null;
+$wgLinkedWikiBorderCloudJeton = null;
+
//Paths
$wgLinkedWikiPath = dirname(__FILE__);
@@ -45,14 +49,13 @@
//Libraries
/* ARC2 static class inclusion */
-include_once( $wgLinkedWikiLibPath . "/arc/ARC2.php");
-include_once( $wgLinkedWikiLibPath . "/FourStore/FourStore_StorePlus.php");
-include_once( $wgLinkedWikiLibPath . "/FourStore/FourStore_Store.php");
-include_once( $wgLinkedWikiLibPath . "/FourStore/SparqlTools.php");
+include_once( $wgLinkedWikiLibPath . "/arc2/ARC2.php");
+//include_once( $wgLinkedWikiLibPath . "/4store/SparqlTools.php");
+
//Classes
-$wgAutoloadClasses['SparqlTools'] = $wgLinkedWikiClassesPath.'/SparqlTools.php';
-//$wgAutoloadClasses['LinkedWikiJob'] = $wgLinkedWikiClassesPath.'/LinkedWikiJob.php';
+//$wgAutoloadClasses['SparqlTools'] = $wgLinkedWikiClassesPath.'/SparqlTools.php';
+$wgAutoloadClasses['LinkedWikiJob'] = $wgLinkedWikiClassesPath.'/LinkedWikiJob.php';
$wgAutoloadClasses['SMW_LinkedWikiStore'] = $wgLinkedWikiClassesPath.'/SMW_LinkedWikiStore.php';
$wgAutoloadClasses['SpecialSparqlEndpoint'] = $wgLinkedWikiSpecialPagesPath . '/SpecialSparqlEndpoint.php';
@@ -195,7 +198,7 @@ function efSparqlParserFunction_widget($namewidget, $querySparqlWiki,$endpoint ,
$querySparql = str_replace($specialC ,$replaceC , $querySparqlWiki);
$str = "";
- $sp = new FourStore_StorePlus($endpoint);
+ $sp = new Endpoint($endpoint);
$rs = $sp->query($querySparqlWiki);
$errs = $sp->getErrors();
if ($errs) {
@@ -242,7 +245,7 @@ function efSparqlParserFunction_array( $querySparqlWiki,$endpoint ,$classHeader
$querySparql = str_replace($specialC ,$replaceC , $querySparqlWiki);
$str = "";
- $sp = new FourStore_StorePlus($endpoint);
+ $sp = new Endpoint($endpoint);
$rs = $sp->query($querySparqlWiki);
$errs = $sp->getErrors();
if ($errs) {
@@ -318,7 +321,7 @@ function efSparqlParserFunction_simple( $querySparqlWiki,$endpoint ,$classHeader
$querySparql = str_replace($specialC ,$replaceC , $querySparqlWiki);
$str = "";
- $sp = new FourStore_StorePlus($endpoint);
+ $sp = new Endpoint($endpoint);
$rs = $sp->query($querySparqlWiki);
$errs = $sp->getErrors();
if ($errs) {
View
16 README
@@ -1,18 +1,16 @@
== About ==
This extension semantic mediawiki, LinkedWiki, can print
-a simple query sparql in a page mediawiki with a remote and local endpoint.
+a simple query sparql in a page mediawiki with a remote endpoint
+like the service BorderCloud.com or local endpoint like with 4store.
You can also build (and share) a widget mediawiki
and print the result of your query in your widget.
-If you want test your widgets or extensions with
-your local sparql endpoint, this extension can connect your semantic mediawiki
-with 4Store.
See also : http://www.mediawiki.org/wiki/Extension:LinkedWiki
== license ==
- Copyright (c) 2010 Bourdercloud.com
+ Copyright (c) 2011 Bourdercloud.com
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0
@@ -33,10 +31,16 @@ See : http://www.mediawiki.org/wiki/Extension:LinkedWiki
== Release-Notes ==
+* V1.0.0.0 version Extension LinkedWiki by Karima Rafes <karima.rafes@bordercloud.com>
+ - Add the connector SMW for BorderCloud with the lib http://github.com/BorderCloud/bordercloud-php
+ - Add tag lang for the wiki farm
+ - Add replace old lib by the last of 4store-php http://github.com/BorderCloud/4store-php
+
* V0.1.0.0 version Extension LinkedWiki by Karima Rafes <karima.rafes@bordercloud.com>
- Add the connector SMW for 4Store with the lib http://github.com/BorderCloud/4store-php
- Add special page : Special:SparqlEndpoint
- Add parser sparql : print a sparqlresult in an array of wikipage
- Add parser wsparql : print a widget with in the parameters the sparqlresult
-
+== Example ==
+You can share your example with SPARQL
View
@@ -1,15 +1,13 @@
<?php
/**
- * @version 0.1.0.0
+ * @version 1.0.0.0
* @package Bourdercloud/linkedwiki
- * @copyright (c) 2010 Bourdercloud.com
+ * @copyright (c) 2011 Bourdercloud.com
* @author Karima Rafes <karima.rafes@bordercloud.com>
* @link http://www.mediawiki.org/wiki/Extension:LinkedWiki
* @license CC-by-nc-sa V3.0
-
- Description : http://www.mediawiki.org/wiki/Extension:LinkedWiki
-
- Copyright (c) 2010 Bourdercloud.com
+ *
+ * Last version : http://github.com/BorderCloud/LinkedWiki
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0
@@ -56,9 +54,9 @@ function run() {
$success = true;
try{
if($this->params["mode"] == "update"){
- SparqlTools::updateRDF($this->params["uri"],$this->params["mode"],$this->params["graph"],$this->params["endpoint"]);
+ SparqlTools::updateRDF($this->params["uri"],$this->params["mode"],$this->params["graph"],$this->params["endpoint"],$wgLinkedWikiBorderCloudJeton);
}elseif($this->params["mode"] == "delete"){
- SparqlTools::deleteTriples($this->params["uri"],$this->params["mode"],$this->params["graph"],$this->params["endpoint"]);
+ SparqlTools::deleteTriples($this->params["uri"],$this->params["mode"],$this->params["graph"],$this->params["endpoint"],$wgLinkedWikiBorderCloudJeton);
}
}catch (Exception $e) {
@@ -1,15 +1,13 @@
<?php
/**
- * @version 0.1.0.0
+ * @version 1.0.0.0
* @package Bourdercloud/linkedwiki
- * @copyright (c) 2010 Bourdercloud.com
+ * @copyright (c) 2011 Bourdercloud.com
* @author Karima Rafes <karima.rafes@bordercloud.com>
* @link http://www.mediawiki.org/wiki/Extension:LinkedWiki
* @license CC-by-nc-sa V3.0
-
- Description : http://www.mediawiki.org/wiki/Extension:LinkedWiki
-
- Copyright (c) 2010 Bourdercloud.com
+ *
+ * Last version : http://github.com/BorderCloud/LinkedWiki
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0
@@ -38,7 +36,7 @@ public function SMW_LinkedWikiStore() {
// private function updatePageLinkedWikiStore(Title $title,$uri) {
// global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint;
// try{
-// SparqlTools::insertRDF($uri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint);
+// SparqlTools::insertRDF($uri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton);
// }catch (Exception $e){
// LinkedWikiJob::doJob($title,
// $uri,
@@ -50,9 +48,9 @@ public function SMW_LinkedWikiStore() {
// }
private function deletePageLinkedWikiStore(Title $title,$uri) {
- global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint;
+ global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton;
// try{
- SparqlTools::deleteTriples($uri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint);
+ SparqlTools::deleteTriples($uri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton);
// }catch (Exception $e){
// LinkedWikiJob::doJob($title,
// $uri,
@@ -79,14 +77,14 @@ function updateData( SMWSemanticData $data ) {
}
function _update( SMWSemanticData $data) {
- global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint;
+ global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton;
$ed = SMWExporter::makeExportData( $data ); // ExpData
$iri = $this->getIRI( $ed->getSubject()->getName());
//first solution but the rdf is not update in real time //FIXME
// $this->updatePageLinkedWikiStore($data->getSubject()->getTitle(),$uri);
//SECOND SOLUTION
- SparqlTools::deleteTriples($iri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint);
+ SparqlTools::deleteTriples($iri,$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton);
$triples = array();
$tl = $ed->getTripleList(); // list of tenary arrays
@@ -112,7 +110,7 @@ function _update( SMWSemanticData $data) {
}
}
- SparqlTools::insert($this->implodeTriples($triples),$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint);
+ SparqlTools::insert($this->implodeTriples($triples),$wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton);
}
@@ -166,12 +164,12 @@ function setup( $verbose = true ) {
$res = parent::setup( $verbose );
//TEST if the wiki can connect to endpoint and if the endpoint is compatible.
- global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint;
+ global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton;
$this->reportProgress( "\nLinkedWiki : Checking parameters in your LocalSettings.php \n", $verbose );
$this->reportProgress( 'LinkedWiki : $wgLinkedWikiEndPoint : Endpoint\'s address = ' .$wgLinkedWikiEndPoint."\n", $verbose );
$this->reportProgress( 'LinkedWiki : $wgLinkedWikiGraphWiki : Graph = ' .$wgLinkedWikiGraphWiki."\n", $verbose );
$this->reportProgress( "LinkedWiki : checking connection to Endpoint :...", $verbose );
- $s = new FourStore_Store($wgLinkedWikiEndPoint);
+ $s = new Endpoint($wgLinkedWikiEndPoint);
if(! $s->check())
$this->reportProgress( " KO. the server is down "."\n", $verbose );
else{
@@ -180,7 +178,11 @@ function setup( $verbose = true ) {
$this->reportProgress( "LinkedWiki : checking the compatibility of this Endpoint :...\n", $verbose );
$this->reportProgress( "LinkedWiki : query INSERT DATA (SPARQL 1.1 Update) : ", $verbose );
- $sp_write = new FourStore_StorePlus($wgLinkedWikiEndPoint,false );
+ if($wgLinkedWikiBorderCloudJeton == null){
+ $sp_write = new Endpoint($wgLinkedWikiEndPoint,false );
+ }else{
+ $sp_write = new Endpoint($wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton );
+ }
$q = " PREFIX a: <http://example.com/test/a/>
PREFIX b: <http://example.com/test/b/>
INSERT DATA {
@@ -192,7 +194,7 @@ function setup( $verbose = true ) {
$res = $sp_write->query($q,'raw');
$err = $sp_write->getErrors();
if ($err || !$res) {
- $this->reportProgress( " KO \n", $verbose );
+ $this->reportProgress( " KO \n", $verbose . print_r($err,true). print_r($res,true));
}else{
$this->reportProgress( " OK \n", $verbose );
}
@@ -211,18 +213,18 @@ function setup( $verbose = true ) {
$res = $sp_write->query($q,'raw');
$err = $sp_write->getErrors();
if ($err || !$res) {
- $this->reportProgress( " KO \n", $verbose );
+ $this->reportProgress( " KO \n" . print_r($err,true). print_r($res,true), $verbose );
}else{
$this->reportProgress( " OK \n", $verbose );
}
$this->reportProgress( "LinkedWiki : query SELECT (SPARQL 1.0) : ", $verbose );
- $sp_readonly = new FourStore_StorePlus($wgLinkedWikiEndPoint);
+ $sp_readonly = new Endpoint($wgLinkedWikiEndPoint);
$q = "select * where { GRAPH <".$wgLinkedWikiGraphWiki."> {?x ?y ?z.}} ";
$rows = $sp_readonly->query($q, 'rows');
- $err = $sp_readonly->getErrors();
+ $err = $sp_readonly->getErrors();
if ($err || !$res) {
- $this->reportProgress( " KO \n", $verbose );
+ $this->reportProgress( " KO \n" . print_r($err,true). print_r($res,true), $verbose);
}else{
$this->reportProgress( " OK \n", $verbose );
}
@@ -231,12 +233,12 @@ function setup( $verbose = true ) {
}
function drop( $verbose = true ) {
- global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint;
+ global $wgLinkedWikiGraphWiki,$wgLinkedWikiEndPoint,$wgLinkedWikiBorderCloudJeton;
$res = parent::drop();
$this->reportProgress( "LinkedWiki : Delete the graph <".$wgLinkedWikiGraphWiki."> in the endpoint ". $wgLinkedWikiEndPoint." : ", $verbose );
try{
- SparqlTools::deleteGraph($wgLinkedWikiGraphWiki);
+ SparqlTools::deleteGraph($wgLinkedWikiGraphWiki,$wgLinkedWikiBorderCloudJeton);
LinkedWikiJob::cleanJobs();
$this->reportProgress( " OK \n", $verbose );
}catch (Exception $e){
@@ -272,6 +274,14 @@ private function buildStringTriple($node) {
$res = "<".$iri.">";
}elseif ( $node instanceof SMWExpLiteral ) {
$res = "\"".addcslashes($name,"\t\n\r\f\"\'\\")."\"";
+
+ //tag lang
+ global $wgLinkedWikiLanguageTag;
+ if($wgLinkedWikiLanguageTag != null){
+ $res .= "@".$wgLinkedWikiLanguageTag;
+ }
+
+ //type
$type = $node->getDatatype();
// bug of 4Store so I add a condition $type != "http://www.w3.org/2001/XMLSchema#string"
if ($type != '' && $type != "http://www.w3.org/2001/XMLSchema#string" ) {
@@ -1,16 +1,11 @@
<?php
/**
- * @version 0.1.0.0
+ * @version 0.4.0.0
* @package Bourdercloud/4store-PHP
- * @copyright (c) 2010 Bourdercloud.com
+ * @copyright (c) 2011 Bourdercloud.com
* @author Karima Rafes <karima.rafes@bordercloud.com>
- *
- * This file is a fork of version 1.0 :
- * @copyright &copy; 2007 Dinke.net
- * @author Dragan Dinic <dragan@dinke.net>
- *
- *
- Copyright (c) 2010 Bourdercloud.com
+
+ Copyright (c) 2011 Bourdercloud.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +41,7 @@
* $post_data = array('login' => 'pera', 'password' => 'joe');
* $html_data = $curl->send_post_data(http://www.foo.com/login.php, $post_data);
*/
-class Curl_HTTP_Client
+class Curl
{
/**
* Curl handler
@@ -68,14 +63,13 @@ class Curl_HTTP_Client
* @var string
*/
var $error_msg;
-
-
+
/**
* Curl_HTTP_Client constructor
* @param boolean debug
* @access public
*/
- function Curl_HTTP_Client($debug = false)
+ function Curl($debug = false)
{
$this->debug = $debug;
@@ -149,8 +143,6 @@ function set_proxy($proxy)
curl_setopt($this->ch, CURLOPT_PROXY, $proxy);
}
-
-
/**
* Send post data to target URL
* return data returned from url or false if error occured
@@ -187,7 +179,6 @@ function send_post_data($url, $postdata, $arrayHeader=null, $ip=null, $timeout=1
//set method to post
curl_setopt($this->ch, CURLOPT_POST, true);
-
//generate post string
$post_array = array();
if(!is_array($postdata))
@@ -606,5 +597,4 @@ function send_delete($url, $ip=null, $timeout=10)
}
}
-}
-?>
+}
Oops, something went wrong.

0 comments on commit ec88bd5

Please sign in to comment.