PageRenderTime 2ms CodeModel.GetById 17ms app.highlight 36ms RepoModel.GetById 2ms app.codeStats 0ms

/elpa/php-mode-20171204.23/php-var.el

https://github.com/andreaja/dotemacs
Lisp | 263 lines | 205 code | 40 blank | 18 comment | 0 complexity | f7f5380e8a85415ea41132b68172cf38 MD5 | raw file
  1;; Copyright (C) 2015  David Arroyo MenĂŠndez
  2
  3;; Author: David Arroyo MenĂŠndez <davidam@gnu.org>
  4;; Maintainer: David Arroyo MenĂŠndez <davidam@gnu.org>
  5
  6;; This file is free software; you can redistribute it and/or modify
  7;; it under the terms of the GNU General Public License as published by
  8;; the Free Software Foundation; either version 3, or (at your option)
  9;; any later version.
 10
 11;; This file is distributed in the hope that it will be useful,
 12;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 13;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14;; GNU General Public License for more details.
 15
 16;; You should have received a copy of the GNU General Public License
 17;; along with GNU Emacs; see the file COPYING.  If not, write to
 18;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 19;; Boston, MA 02110-1301 USA,
 20
 21;; Variable handling functions
 22;; http://php.net/manual/en/ref.var.php
 23;; file:///usr/share/doc/php-doc/html/ref.var.html
 24
 25(define-skeleton php-boolval
 26  "Insert a boolval statement"
 27  ""
 28  '(setq variable (skeleton-read "Variable? "))
 29  "boolval(" variable ");"
 30)
 31 
 32(define-skeleton php-debug_zval_dump
 33  "Insert a debug_zval_dump"
 34  ""
 35  '(setq variable (skeleton-read "Variable: "))
 36  "debug_zval_dump(" variable ");" \n
 37)
 38
 39(define-skeleton php-empty
 40  "Insert an empty statement"
 41  ""
 42  '(setq variable (skeleton-read "Variable? "))
 43  "empty(" variable ");"
 44)
 45
 46(define-skeleton php-floatval
 47  "Insert a floatval statement. Gets the float value of a variable"
 48  ""
 49  '(setq variable (skeleton-read "Variable: "))
 50  > "floatval(" variable ");" \n
 51)
 52
 53(define-skeleton php-get_defined_vars
 54  "Insert a get_defined_vars statement. Returns an array of all defined variables"
 55  > "get_defined_vars();" \n
 56)
 57
 58(define-skeleton php-get_resource_type
 59  "Insert a get_resource_type statement. Returns the resource type"
 60  ""
 61  '(setq variable (skeleton-read "Variable: "))
 62  > "get_resource_type(" variable ");" \n
 63)
 64
 65(define-skeleton php-gettype
 66  "Insert a gettype statement. Returns the type of variable"
 67  ""
 68  '(setq variable (skeleton-read "Variable: "))
 69  > "gettype(" variable ");" \n
 70)
 71
 72(define-skeleton php-import_request_variables 
 73  "Insert an import_request_variables statement. Import GET/POST/Cookie variables into the global scope"
 74  ""
 75  '(setq types (skeleton-read "Types: "))
 76  '(setq prefix (skeleton-read "Prefix: "))
 77  > "import_request_variables(" types ", " prefix ");" \n
 78)
 79
 80(define-skeleton php-intval
 81  "Insert an intval statement."
 82  ""
 83  '(setq variable (skeleton-read "Variable: "))
 84  '(setq base (skeleton-read "Base: "))
 85  > "intval(" variable ", " base ");" \n
 86)
 87
 88(define-skeleton php-is_array
 89  "Insert an is_array statement"
 90  ""
 91  '(setq variable (skeleton-read "Variable: "))  
 92  > "is_array(" variable ");" \n
 93)
 94
 95(define-skeleton php-is_bool
 96  "Insert an is_bool statement"
 97  ""
 98  '(setq variable (skeleton-read "Variable: "))  
 99  > "is_bool(" variable ");" \n
100)
101
102(define-skeleton php-is_callable
103  "Insert an is_callable statement"
104  ""
105  '(setq variable (skeleton-read "Variable: "))  
106  > "is_callable(" variable ");" \n
107)
108
109(define-skeleton php-is_double
110  "Insert an is_double statement"
111  ""
112  '(setq variable (skeleton-read "Variable: "))  
113  > "is_double(" variable ");" \n
114)
115
116(define-skeleton php-is_float
117  "Insert an is_float statement"
118  ""
119  '(setq variable (skeleton-read "Variable: "))  
120  > "is_float(" variable ");" \n
121)
122
123(define-skeleton php-is_int
124  "Insert an is_int statement"
125  ""
126  '(setq variable (skeleton-read "Variable: "))  
127  > "is_int(" variable ");" \n
128)
129
130(define-skeleton php-is_integer
131  "Insert an is_integer statement"
132  ""
133  '(setq variable (skeleton-read "Variable: "))  
134  > "is_integer(" variable ");" \n
135)
136
137(define-skeleton php-is_long
138  "Insert an is_long statement"
139  ""
140  '(setq variable (skeleton-read "Variable: "))  
141  > "is_long(" variable ");" \n
142)
143
144(define-skeleton php-is_null
145  "Insert an is_null statement"
146  ""
147  '(setq variable (skeleton-read "Variable: "))  
148  > "is_null(" variable ");" \n
149)
150
151(define-skeleton php-is_numeric
152  "Insert an is_numeric statement"
153  ""
154  '(setq variable (skeleton-read "Variable: "))  
155  > "is_numeric(" variable ");" \n
156)
157
158(define-skeleton php-is_object
159  "Insert an is_object statement"
160  ""
161  '(setq variable (skeleton-read "Variable: "))  
162  > "is_object(" variable ");" \n
163)
164
165(define-skeleton php-is_real
166  "Insert an is_real statement"
167  ""
168  '(setq variable (skeleton-read "Variable: "))  
169  > "is_real(" variable ");" \n
170)
171
172(define-skeleton php-is_resource
173  "Insert an is_resource statement"
174  ""
175  '(setq variable (skeleton-read "Variable: "))  
176  > "is_resource(" variable ");" \n
177)
178
179(define-skeleton php-is_scalar
180  "Insert an is_scalar statement"
181  ""
182  '(setq variable (skeleton-read "Variable: "))  
183  > "is_scalar(" variable ");" \n
184)
185
186(define-skeleton php-is_string
187  "Insert an is_string statement"
188  ""
189  '(setq variable (skeleton-read "Variable: "))  
190  > "is_string(" variable ");" \n
191)
192
193(define-skeleton php-isset
194  "Insert an isset statement"
195  ""
196  '(setq variable (skeleton-read "Variable: "))  
197  > "isset(" variable ");" \n
198)
199
200(define-skeleton php-print_r
201  "Insert a print_r statement"
202  ""
203  '(setq expression (skeleton-read "Expression: "))
204  '(setq return (skeleton-read "Return (true | false): "))
205  > "print_r(" expression ", " return ");"
206)
207
208(define-skeleton php-serialize
209  "Insert an serialize statement. Generates a storable representation of a value
210"
211  ""
212  '(setq variable (skeleton-read "Variable: "))  
213  > "serialize(" variable ");" \n
214)
215
216(define-skeleton php-settype
217  "Insert a settype statement. Set the type of a variable" 
218  ""
219  '(setq variable (skeleton-read "Variable: "))
220  '(setq type (skeleton-read "Type: "))
221  > "settype(" variable ", " type ");" \n
222)
223
224(define-skeleton php-strval
225  "Insert a strval statement. Get string value of a variable"
226  ""
227  '(setq variable (skeleton-read "Variable: "))  
228  > "strval(" variable ");" \n
229)  
230
231(define-skeleton php-unserialize
232  "Insert an unserialize statement. Creates a php value from a stored representation" 
233  ""
234  '(setq variable (skeleton-read "Variable: "))  
235  > "unserialize(" variable ");" \n
236)
237
238(define-skeleton php-unset
239  "Insert an unset statement. Unset a given variable." 
240  ""
241  '(setq variable (skeleton-read "Variable: "))  
242  > "unset(" variable ");" \n
243)  
244
245(define-skeleton php-var_dump
246  "Insert a var_dump statement"
247  ""
248  '(setq variable (skeleton-read "Variable? "))
249  > "var_dump(" variable 
250  ( "Other variable? %s: "
251    > ", " str )
252  > ");"
253)
254
255(define-skeleton php-var_export
256  "Insert a var_export statement"
257  ""
258  '(setq variable (skeleton-read "Variable? "))
259  '(setq return (skeleton-read "Return? "))
260  > "var_export(" variable ", " return ");" \n 
261)
262 
263