Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pquery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
pquery
Commits
65b55aee
Commit
65b55aee
authored
Jan 04, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SITE_ROOT constant for relative includes.
parent
cf055ed4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
pquery.php
pquery.php
+2
-6
pquery.template.php
pquery.template.php
+1
-1
No files found.
pquery.php
View file @
65b55aee
...
...
@@ -276,18 +276,14 @@ class pQuery {
/**
* Assert that the given constants have been defined.
* Add the prefix 'PQUERY_' to each constant name.
*/
static
function
assert_defined
(
/* $constant1 [ , $constant2, ... ] */
)
{
$constants
=
func_get_args
();
$undefined
=
array
();
foreach
(
$constants
as
$constant
)
{
$constant
=
'PQUERY_'
.
$constant
;
foreach
(
$constants
as
$constant
)
if
(
!
defined
(
$constant
)
)
$undefined
[]
=
$constant
;
}
count
(
$undefined
)
&&
self
::
error
(
'The following constants have'
.
' not been defined: %s'
,
implode
(
', '
,
$undefined
));
...
...
@@ -338,6 +334,6 @@ class_alias('pQuery', '__p');
*/
set_exception_handler
(
'__p::exception_handler'
);
__p
::
assert_defined
(
'
DEBUG'
,
'
ROOT'
);
__p
::
assert_defined
(
'
PQUERY_DEBUG'
,
'PQUERY_ROOT'
,
'SITE_
ROOT'
);
?>
\ No newline at end of file
pquery.template.php
View file @
65b55aee
...
...
@@ -251,7 +251,7 @@ class pQueryTemplate extends pQuery {
* @param bool $relative Indicates whether the path is relative to the document root.
*/
static
function
add_root
(
$path
,
$relative
=
true
)
{
$relative
&&
$path
=
PQUERY
_ROOT
.
$path
;
$relative
&&
$path
=
SITE
_ROOT
.
$path
;
preg_match
(
'%/$%'
,
$path
)
||
$path
.=
'/'
;
if
(
!
is_dir
(
$path
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment