semsol / arc2

ARC RDF Classes for PHP
Other
331 stars 92 forks source link

Port repeating himself on localhost (with custom port) #124

Open PulsarFox opened 5 years ago

PulsarFox commented 5 years ago

I've launched a Symfony project, and I use the built in webserver which launches me a server hosted on http://localhost:8000.

When I try to work with SPARQLScript, I've noticed some weird value in the BASE field on the SparlScript array : the port is repeated twice, that gives me BASE : http://localhost:8000:8000/api/user/new

The problems comes from the function getRequestUri() on the ARC2.php file as the $_SERVER['SERVER_NAME'] value gives me "http://localhost:8000/api/user/new" and my variable $_SERVER['SERVER_PORT'] is of course 8000.

Unfortunately I don't have time to fix it myself

EDIT: The same thing happens in the function getScriptURI()

PulsarFox commented 5 years ago

The thing is the SparqlScript gives me no output, never. here's what the SPARQLScriptPreprocessor variable gives me after a call to processScript()

EDIT: The request is send to the remote endpoint (Jena) and is successful, but I can't manage to find where the result is.

ARC2_SPARQLScriptProcessor Object
(
    [db_object:protected] => 
    [a] => Array
        (
            [sparqlscript_default_endpoint] => http://localhost:3030/SemappsTests/update
            [sparqlscript_max_operations] => 100
            [sparqlscript_max_queries] => 10
        )

    [caller] => stdClass Object
        (
        )

    [inc_path] => /home/foxy/Documents/Sites/Semapps/SemappsV2-Back/vendor/semsol/arc2/
    [ns_count] => 0
    [nsp] => Array
        (
            [http://www.w3.org/1999/02/22-rdf-syntax-ns#] => rdf
        )

    [used_ns] => Array
        (
            [0] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
        )

    [ns] => Array
        (
            [rdf] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
        )

    [base] => http://127.0.0.1:8000/api/user/new
    [errors] => Array
        (
        )

    [warnings] => Array
        (
        )

    [adjust_utf8] => 0
    [max_errors] => 25
    [has_pcre_unicode] => 1
    [max_operations] => 100
    [max_queries] => 10
    [return] => 0
    [script_hash] => 2223019922
    [env] => Array
        (
            [endpoint] => http://localhost:3030/SemappsTests/sparql
            [vars] => Array
                (
                )

            [output] => 
            [operation_count] => 2
            [query_count] => 1
            [query_log] => Array
                (
                    [0] => (http://localhost:3030/SemappsTests/sparql) BASE <http://127.0.0.1:8000/index.php>

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name {
            GRAPH <http://localhost:3030/SemappsTests/data/Users> {
                ?person foaf:name ?name
            }
        }
                )

        )

)
k00ni commented 5 years ago

Hi @PulsarFox, i am not familiar with ARC2 "webserver". Maybe @semsol has an idea?