Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pquery
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
pquery
Commits
65b55aee
Commit
65b55aee
authored
13 years ago
by
Taddeus Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Added SITE_ROOT constant for relative includes.
parent
cf055ed4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pquery.php
+2
-6
2 additions, 6 deletions
pquery.php
pquery.template.php
+1
-1
1 addition, 1 deletion
pquery.template.php
with
3 additions
and
7 deletions
pquery.php
+
2
−
6
View file @
65b55aee
...
@@ -276,18 +276,14 @@ class pQuery {
...
@@ -276,18 +276,14 @@ class pQuery {
/**
/**
* Assert that the given constants have been defined.
* Assert that the given constants have been defined.
* Add the prefix 'PQUERY_' to each constant name.
*/
*/
static
function
assert_defined
(
/* $constant1 [ , $constant2, ... ] */
)
{
static
function
assert_defined
(
/* $constant1 [ , $constant2, ... ] */
)
{
$constants
=
func_get_args
();
$constants
=
func_get_args
();
$undefined
=
array
();
$undefined
=
array
();
foreach
(
$constants
as
$constant
)
{
foreach
(
$constants
as
$constant
)
$constant
=
'PQUERY_'
.
$constant
;
if
(
!
defined
(
$constant
)
)
if
(
!
defined
(
$constant
)
)
$undefined
[]
=
$constant
;
$undefined
[]
=
$constant
;
}
count
(
$undefined
)
&&
self
::
error
(
'The following constants have'
count
(
$undefined
)
&&
self
::
error
(
'The following constants have'
.
' not been defined: %s'
,
implode
(
', '
,
$undefined
));
.
' not been defined: %s'
,
implode
(
', '
,
$undefined
));
...
@@ -338,6 +334,6 @@ class_alias('pQuery', '__p');
...
@@ -338,6 +334,6 @@ class_alias('pQuery', '__p');
*/
*/
set_exception_handler
(
'__p::exception_handler'
);
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
This diff is collapsed.
Click to expand it.
pquery.template.php
+
1
−
1
View file @
65b55aee
...
@@ -251,7 +251,7 @@ class pQueryTemplate extends pQuery {
...
@@ -251,7 +251,7 @@ class pQueryTemplate extends pQuery {
* @param bool $relative Indicates whether the path is relative to the document root.
* @param bool $relative Indicates whether the path is relative to the document root.
*/
*/
static
function
add_root
(
$path
,
$relative
=
true
)
{
static
function
add_root
(
$path
,
$relative
=
true
)
{
$relative
&&
$path
=
PQUERY
_ROOT
.
$path
;
$relative
&&
$path
=
SITE
_ROOT
.
$path
;
preg_match
(
'%/$%'
,
$path
)
||
$path
.
=
'/'
;
preg_match
(
'%/$%'
,
$path
)
||
$path
.
=
'/'
;
if
(
!
is_dir
(
$path
)
)
if
(
!
is_dir
(
$path
)
)
...
...
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