5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
21 public static function _GET(
$name, $default = null ) {
22 return self::get( $_GET,
$name, $default );
34 return self::get( $_POST,
$name, $default );
46 return self::get( $_REQUEST,
$name, $default );
58 return self::get( $_SERVER,
$name, $default );
72 public static function get( $array, $key, $default = null ) {
73 if ( ! is_array( $array ) && ! is_object( $array ) ) {
80 if ( is_array( $array ) || $array instanceof \ArrayAccess ) {
81 if ( isset( $array[ $key ] ) ) {
82 return $array[ $key ];
84 }
else if ( is_object( $array ) ) {
85 if ( isset( $array->$key ) ) {
93 if ( count( $parts = explode(
'/', $key, 2 ) ) > 1 ) {
94 return self::get( self::get( $array, $parts[0] ), $parts[1], $default );
112 if ( strpos(
$value,
'=' ) === 0 ) {
146 $introspect = $query->_introspect();
148 'where' => $query->_where_unwrap( $introspect[
'where'] )
166 if ( $condition->expressions ) {
167 $conditions = array();
168 foreach ( $condition->expressions as $expression ) {
169 $conditions[] = self::gf_query_strip_condition_column_aliases( $expression );
171 return call_user_func_array(
172 array(
'\GF_Query_Condition', $condition->operator ==
'AND' ?
'_and' :
'_or' ),
176 if ( $condition->left instanceof \GF_Query_Column ) {
177 return new \GF_Query_Condition(
178 new \GF_Query_Column( $condition->left->field_id ),
179 $condition->operator,
static _GET( $name, $default=null)
Grab a value from the _GET superglobal or default.
static _SERVER( $name, $default=null)
Grab a value from the _SERVER superglobal or default.
static _REQUEST( $name, $default=null)
Grab a value from the _REQUEST superglobal or default.
static strip_excel_formulas( $value)
Sanitizes Excel formulas inside CSV output.
static _return( $value)
Return a value by call.
static gf_query_strip_condition_column_aliases( $condition)
Strips aliases in columns.
static gf_query_debug( $query)
Output an associative array represenation of the query parameters.
If this file is called directly, abort.
static _POST( $name, $default=null)
Grab a value from the _POST superglobal or default.