Issue #1367000 by chris.leversuch: Clean up API docs for php module.
parent
37f2b2f265
commit
7059b26506
|
@ -36,23 +36,26 @@ function php_permission() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Evaluate a string of PHP code.
|
||||
* Implements hook_filter_FILTER_process().
|
||||
*
|
||||
* This is a wrapper around PHP's eval(). It uses output buffering to capture both
|
||||
* returned and printed text. Unlike eval(), we require code to be surrounded by
|
||||
* <?php ?> tags; in other words, we evaluate the code as if it were a stand-alone
|
||||
* PHP file.
|
||||
* This is a wrapper around PHP's eval(). It uses output buffering to capture
|
||||
* both returned and printed text. Unlike eval(), we require code to be
|
||||
* surrounded by <?php ?> tags; in other words, we evaluate the code as if it
|
||||
* were a stand-alone PHP file.
|
||||
*
|
||||
* Using this wrapper also ensures that the PHP code which is evaluated can not
|
||||
* overwrite any variables in the calling code, unlike a regular eval() call.
|
||||
*
|
||||
* @param $code
|
||||
* The code to evaluate.
|
||||
*
|
||||
* @return
|
||||
* A string containing the printed output of the code, followed by the returned
|
||||
* output of the code.
|
||||
* A string containing the printed output of the code, followed by the
|
||||
* returned output of the code.
|
||||
*
|
||||
* @ingroup php_wrappers
|
||||
*
|
||||
* @see php_filter_info()
|
||||
*/
|
||||
function php_eval($code) {
|
||||
global $theme_path, $theme_info, $conf;
|
||||
|
@ -82,7 +85,9 @@ function php_eval($code) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tips callback for php filter.
|
||||
* Implements hook_filter_FILTER_tips().
|
||||
*
|
||||
* @see php_filter_info()
|
||||
*/
|
||||
function _php_filter_tips($filter, $format, $long = FALSE) {
|
||||
global $base_url;
|
||||
|
@ -137,4 +142,3 @@ function php_filter_info() {
|
|||
);
|
||||
return $filters;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Base PHP test case class.
|
||||
* Defines a base PHP test case class.
|
||||
*/
|
||||
class PHPTestCase extends DrupalWebTestCase {
|
||||
protected $php_code_format;
|
||||
|
@ -38,7 +38,7 @@ class PHPTestCase extends DrupalWebTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a test node with PHP code in the body.
|
||||
* Creates a test node with PHP code in the body.
|
||||
*
|
||||
* @return stdObject Node object.
|
||||
*/
|
||||
|
@ -60,7 +60,7 @@ class PHPFilterTestCase extends PHPTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Make sure that the PHP filter evaluates PHP code when used.
|
||||
* Makes sure that the PHP filter evaluates PHP code when used.
|
||||
*/
|
||||
function testPHPFilter() {
|
||||
// Log in as a user with permission to use the PHP code text format.
|
||||
|
@ -101,7 +101,7 @@ class PHPAccessTestCase extends PHPTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Make sure that user can't use the PHP filter when not given access.
|
||||
* Makes sure that the user can't use the PHP filter when not given access.
|
||||
*/
|
||||
function testNoPrivileges() {
|
||||
// Create node with PHP filter enabled.
|
||||
|
|
Loading…
Reference in New Issue