Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marcus-lodspeakr
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uib-ub
Spesialsamlingene
marcus-lodspeakr
Commits
6d6788d1
Commit
6d6788d1
authored
13 years ago
by
alvaro
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' into hotfixes
parents
28f2bda5
859dccb5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
classes/Endpoint.php
+1
-1
1 addition, 1 deletion
classes/Endpoint.php
classes/Utils.php
+7
-2
7 additions, 2 deletions
classes/Utils.php
classes/modules/uriModule.php
+48
-11
48 additions, 11 deletions
classes/modules/uriModule.php
utils/modules/debug.php
+1
-0
1 addition, 0 deletions
utils/modules/debug.php
with
57 additions
and
14 deletions
classes/Endpoint.php
+
1
−
1
View file @
6d6788d1
...
@@ -61,7 +61,7 @@ class Endpoint{
...
@@ -61,7 +61,7 @@ class Endpoint{
$r
=
json_decode
(
$aux
,
true
);
$r
=
json_decode
(
$aux
,
true
);
return
$r
;
return
$r
;
}
}
}
}
public
function
queryPost
(
$q
){
public
function
queryPost
(
$q
){
$params
=
$this
->
params
;
$params
=
$this
->
params
;
...
...
This diff is collapsed.
Click to expand it.
classes/Utils.php
+
7
−
2
View file @
6d6788d1
...
@@ -174,7 +174,7 @@ class Utils{
...
@@ -174,7 +174,7 @@ class Utils{
}
}
p
rivate
static
function
serializeRdf
(
$data
,
$extension
){
p
ublic
static
function
serializeRdf
(
$data
,
$extension
=
'rdf'
){
global
$conf
;
global
$conf
;
global
$lodspk
;
global
$lodspk
;
$ser
;
$ser
;
...
@@ -427,6 +427,7 @@ class Utils{
...
@@ -427,6 +427,7 @@ class Utils{
$rPointer[$modelFile]['first'] = $rPointer[$modelFile][0];
$rPointer[$modelFile]['first'] = $rPointer[$modelFile][0];
}*/
}*/
}
else
{
}
else
{
$lodspk
[
'resultRdf'
]
=
true
;
$rPointer
[
$strippedModelFile
]
=
$aux
;
$rPointer
[
$strippedModelFile
]
=
$aux
;
}
}
}
else
{
}
else
{
...
@@ -437,6 +438,7 @@ class Utils{
...
@@ -437,6 +438,7 @@ class Utils{
$rPointer['first'] = $rPointer[0];
$rPointer['first'] = $rPointer[0];
}*/
}*/
}
else
{
}
else
{
$lodspk
[
'resultRdf'
]
=
true
;
$rPointer
=
$aux
;
$rPointer
=
$aux
;
}
}
}
}
...
@@ -521,9 +523,12 @@ class Utils{
...
@@ -521,9 +523,12 @@ class Utils{
echo
(
$data
);
echo
(
$data
);
}
elseif
(
is_file
(
$lodspk
[
'view'
]
.
$view
)){
}
elseif
(
is_file
(
$lodspk
[
'view'
]
.
$view
)){
Haanga
::
Load
(
$view
,
$vars
);
Haanga
::
Load
(
$view
,
$vars
);
}
elseif
(
$view
==
null
){
$fnc
=
Haanga
::
compile
(
'{{models|safe}}'
);
$fnc
(
$vars
,
TRUE
);
}
else
{
}
else
{
$fnc
=
Haanga
::
compile
(
$view
);
$fnc
=
Haanga
::
compile
(
$view
);
$fnc
(
$vars
,
FALS
E
);
$fnc
(
$vars
,
TRU
E
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
classes/modules/uriModule.php
+
48
−
11
View file @
6d6788d1
...
@@ -35,10 +35,16 @@ class UriModule extends abstractModule{
...
@@ -35,10 +35,16 @@ class UriModule extends abstractModule{
if
(
$modelFile
==
NULL
){
if
(
$modelFile
==
NULL
){
return
FALSE
;
return
FALSE
;
}
}
return
$pair
;
$result
=
array
(
'res'
=>
$pair
[
0
],
'page'
=>
$pair
[
1
],
'format'
=>
$pair
[
2
],
'modelFile'
=>
$modelFile
,
'viewFile'
=>
$viewFile
);
return
$result
;
}
}
public
function
execute
(
$p
air
){
public
function
execute
(
$p
){
global
$conf
;
global
$conf
;
global
$localUri
;
global
$localUri
;
global
$uri
;
global
$uri
;
...
@@ -47,10 +53,14 @@ class UriModule extends abstractModule{
...
@@ -47,10 +53,14 @@ class UriModule extends abstractModule{
global
$lodspk
;
global
$lodspk
;
global
$results
;
global
$results
;
global
$first
;
global
$first
;
list
(
$res
,
$page
,
$format
)
=
$pair
;
$res
=
$p
[
'res'
];
$page
=
$p
[
'page'
];
$format
=
$p
[
'format'
];
$modelFile
=
$p
[
'modelFile'
];
$viewFile
=
$p
[
'viewFile'
];
$uri
=
$res
;
$uri
=
$res
;
$curie
=
Utils
::
uri2curie
(
$res
);
$curie
=
Utils
::
uri2curie
(
$res
);
//If resource is not the page, send a 303 to the document
//If resource is not the page, send a 303 to the document
if
(
$res
==
$localUri
){
if
(
$res
==
$localUri
){
Utils
::
send303
(
$page
,
$acceptContentType
);
Utils
::
send303
(
$page
,
$acceptContentType
);
...
@@ -67,14 +77,14 @@ class UriModule extends abstractModule{
...
@@ -67,14 +77,14 @@ class UriModule extends abstractModule{
* dcterms:format for this page
* dcterms:format for this page
*/
*/
$acceptContentType
=
$format
;
$acceptContentType
=
$format
;
$curie
=
Utils
::
uri2curie
(
$uri
);
$curie
=
Utils
::
uri2curie
(
$uri
);
list
(
$modelFile
,
$viewFile
)
=
$this
->
getModelandView
(
$curie
,
$extension
);
if
(
$modelFile
==
NULL
){
if
(
$modelFile
==
NULL
){
return
;
return
;
}
}
$lodspk
=
$conf
[
'view'
][
'standard'
];
//$lodspk = $conf['view']['standard'];
$lodspk
[
'type'
]
=
$modelFile
;
$lodspk
[
'type'
]
=
$modelFile
;
$lodspk
[
'module'
]
=
'uri'
;
$lodspk
[
'module'
]
=
'uri'
;
$lodspk
[
'add_mirrored_uris'
]
=
true
;
$lodspk
[
'add_mirrored_uris'
]
=
true
;
...
@@ -92,8 +102,12 @@ class UriModule extends abstractModule{
...
@@ -92,8 +102,12 @@ class UriModule extends abstractModule{
chdir
(
$conf
[
'home'
]
.
$conf
[
'model'
][
'directory'
]);
chdir
(
$conf
[
'home'
]
.
$conf
[
'model'
][
'directory'
]);
Utils
::
queryFile
(
$modelFile
,
$endpoints
[
'local'
],
$results
,
$first
);
Utils
::
queryFile
(
$modelFile
,
$endpoints
[
'local'
],
$results
,
$first
);
$results
=
Utils
::
internalize
(
$results
);
if
(
$lodspk
[
'resultRdf'
]){
echo
Utils
::
serializeRdf
(
$results
,
$extension
);
exit
(
0
);
}
else
{
$results
=
Utils
::
internalize
(
$results
);
}
$lodspk
[
'first'
]
=
Utils
::
getFirsts
(
$results
);
$lodspk
[
'first'
]
=
Utils
::
getFirsts
(
$results
);
chdir
(
$conf
[
'home'
]);
chdir
(
$conf
[
'home'
]);
if
(
is_array
(
$results
)){
if
(
is_array
(
$results
)){
...
@@ -101,17 +115,40 @@ class UriModule extends abstractModule{
...
@@ -101,17 +115,40 @@ class UriModule extends abstractModule{
}
else
{
}
else
{
$resultsObj
=
$results
;
$resultsObj
=
$results
;
}
}
if
(
$conf
[
'debug'
]){
trigger_error
(
"Using template "
.
$viewFile
,
E_USER_NOTICE
);
echo
(
"TEMPLATE: "
.
$viewFile
.
"
\n\n
"
);
}
Utils
::
processDocument
(
$viewFile
,
$lodspk
,
$resultsObj
);
Utils
::
processDocument
(
$viewFile
,
$lodspk
,
$resultsObj
);
}
}
private
static
function
getModelandView
(
$uri
,
$extension
){
private
static
function
getModelandView
(
$uri
,
$extension
){
global
$conf
;
global
$conf
;
global
$lodspk
;
$auxViewFile
=
$conf
[
'view'
][
'directory'
]
.
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.template'
;
$auxViewFile
=
$conf
[
'view'
][
'directory'
]
.
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.template'
;
$auxModelFile
=
$conf
[
'model'
][
'directory'
]
.
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.queries'
;
$auxModelFile
=
$conf
[
'model'
][
'directory'
]
.
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.queries'
;
if
(
file_exists
(
$auxModelFile
)
&&
file_exists
(
$auxViewFile
)
){
if
(
file_exists
(
$auxModelFile
)){
$viewFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.template'
;
//Model exists
$modelFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.queries'
;
$modelFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.queries'
;
if
(
file_exists
(
$auxViewFile
)
){
//View exists, everything is fine
$viewFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.template'
;
}
elseif
(
$extension
!=
'html'
){
//View doesn't exists (and is not HTML)
$viewFile
=
null
;
}
return
array
(
$modelFile
,
$viewFile
);
}
elseif
(
$extension
!=
'html'
&&
file_exists
(
$conf
[
'model'
][
'directory'
]
.
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/html.queries'
)){
$modelFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/html.queries'
;
if
(
file_exists
(
$auxViewFile
)
){
//View exists, everything is fine
$viewFile
=
$conf
[
'uri'
][
'prefix'
]
.
$uri
.
'/'
.
$extension
.
'.template'
;
}
elseif
(
$extension
!=
'html'
){
//View doesn't exists (and is not HTML)
$lodspk
[
'transform_select_query'
]
=
true
;
$viewFile
=
null
;
}
return
array
(
$modelFile
,
$viewFile
);
return
array
(
$modelFile
,
$viewFile
);
}
}
return
array
(
NULL
,
NULL
);
return
array
(
NULL
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
utils/modules/debug.php
+
1
−
0
View file @
6d6788d1
<?
<?
error_reporting
(
E_ERROR
);
$s
=
'settings.inc.php'
;
$s
=
'settings.inc.php'
;
$c
=
file_get_contents
(
$s
);
$c
=
file_get_contents
(
$s
);
$optionarray
=
Array
(
'on'
=>
'true'
,
'1'
=>
'true'
,
'off'
=>
'false'
,
'0'
=>
'false'
);
$optionarray
=
Array
(
'on'
=>
'true'
,
'1'
=>
'true'
,
'off'
=>
'false'
,
'0'
=>
'false'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment