Gumbo PHP Library API Documentation
Debug
[
class tree
] [
index
] [
all elements
]
Todo List
Packages:
Buffer
Collection
Composite
Config
Converter
Curl
Date
DB
Debug
Encryption
Error
Factory
Filter
Flyweight
Http
Input
Iterator
List
Load
Lockable
Log
Map
Number
Observer
Output
Query
Record
Router
Session
Setting
Singleton
Template
Timer
Utility
Valid
Source for file Constant.class.php
Documentation is available at
Constant.class.php
<?php
/**
* Gumbo Library Framework
*
* LICENSE
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
*
*
@category
Gumbo
*
@package
Debug
*
@copyright
Copyright (c) 2007, iBayou, Michael Luster
*
@license
http://www.opensource.org/licenses/bsd-license.php New BSD License
*
@author
Michael Luster <mluster79@yahoo.com>
*
@link
http://sourceforge.net/projects/phpgumbo
*
@version
0.0.1
*/
/**
* Debug Server Report - Constants
*
*
@category
Gumbo
*
@package
Debug
*
@copyright
Copyright (c) 2007, iBayou, Michael Luster
*
@license
http://www.opensource.org/licenses/bsd-license.php New BSD License
*
@author
Michael Luster <mluster79@yahoo.com>
*
@link
http://sourceforge.net/projects/phpgumbo
*
@desc
Debug Server Report - Constants
*
@version
0.0.1
*/
gumbo_load
(
"Interface_Debug_Server_Report"
)
;
class
Gumbo_Debug_Server_Constant
implements
Gumbo_Interface_Debug_Server_Report
{
/**
@var
bool
$_php
include defined PHP Constants */
private
$_php
=
false
;
/**
* Constructor
*
@param
bool
$php
include defined PHP Constants
*/
public
function
__construct
(
$php
=
null
)
{
if
(
!
is_null
(
$php
))
{
$this
->
setPhp
(
$php
)
;
}
}
/** ACTION METHODS **/
/**
* Runs the Report
*
@return
string
*/
public
function
run
(
)
{
$txt
=
"<div class=\"debug\">\n"
;
$txt
.=
"\t<ul>Defined Constants\n"
;
$restrict
=
$this
->
getPhp
(
)
;
foreach
(
get_defined_constants
(
)
as
$key
=>
$val
)
{
if
(
$restrict
&&
$key
!=
"GUMBO_HOME"
)
{
continue
;
}
$txt
.=
"
\t\t<
li
><
b
>{
$key
}
::</
b
> {
$val
}
</
li
>\n
"
;
$restrict
=
false
;
}
$txt
.=
"\t</ul>\n"
;
return
$txt
;
}
/** MUTATOR METHODS **/
/**
* Sets if to include defined PHP Constants
*
@param
bool
$php
*
@throws
Gumbo_Exception
*/
public
function
setPhp
(
$php
)
{
try
{
// verify precondition
if
(
!
is_bool
(
$php
))
{
throw
new
Gumbo_Exception
(
"
Invalid
Argument
'
php
:
bool
' => {
$php
}
:
"
.
gettype
(
$php
))
;
}
$this
->
_php
=
$php
;
}
catch
(
Gumbo_Exception
$e
)
{
$e
->
setFunction
(
__METHOD__
)
;
gumbo_trigger
(
$e
)
;
}
}
/** ACCESSOR METHODS **/
/**
* Returns if to include defined PHP Constants
*
@return
bool
*/
public
function
getPhp
(
)
{
return
$this
->
_php
;
}
}
?>