This repository was archived by the owner on Nov 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,60 @@ function is_really_writable($file)
124124
125125// ------------------------------------------------------------------------
126126
127+ if ( ! function_exists ('is ' ))
128+ {
129+ /**
130+ * 'Is' function
131+ *
132+ * @param string $key
133+ * @param string $value
134+ * @return boolean
135+ */
136+ function is ($ key , $ value = null )
137+ {
138+ $ common = ['https ' , 'cli ' , 'php ' , 'writable ' ];
139+ $ useragent = ['browser ' , 'mobile ' , 'referral ' , 'robot ' ];
140+
141+ if (in_array ($ key , $ useragent ))
142+ {
143+ return get_instance ()->user_agent ->{'is_ ' .$ key }($ value );
144+ }
145+
146+ if (in_array ($ key , $ common ))
147+ {
148+ $ function = ($ key == 'writable ' )
149+ ? 'is_really_writable '
150+ : 'is_ ' .$ key ;
151+
152+ return $ function ($ value );
153+ }
154+
155+ if ($ key == 'ajax ' )
156+ {
157+ return get_instance ()->input ->is_ajax_request ();
158+ }
159+
160+ if ($ key == 'post ' )
161+ {
162+ return (get_instance ()->input ->server ('REQUEST_METHOD ' ) === 'POST ' );
163+ }
164+
165+ if ($ key == 'get ' )
166+ {
167+ return (get_instance ()->input ->server ('REQUEST_METHOD ' ) === 'GET ' );
168+ }
169+
170+ if ($ key == 'loaded ' OR $ key == 'load ' )
171+ {
172+ return (bool ) get_instance ()->load ->is_loaded ($ value );
173+ }
174+
175+ return false ;
176+ }
177+ }
178+
179+ // ------------------------------------------------------------------------
180+
127181if ( ! function_exists ('load_class ' ))
128182{
129183 /**
You can’t perform that action at this time.
0 commit comments