-
Notifications
You must be signed in to change notification settings - Fork 0
/
_IDE_helper.php
9361 lines (8474 loc) · 196 KB
/
_IDE_helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
namespace {
die('Only to be used as an helper for your IDE');
}
namespace {
class Auth{
/**
* @var \Illuminate\Auth\Guard $root
*/
static private $root;
/**
* Create a new authentication guard.
*
* @static
* @param \Illuminate\Auth\UserProviderInterface $provider
* @param \Illuminate\Session\Store $session
*/
public static function __construct($provider, $session){
self::$root->__construct($provider, $session);
}
/**
* Determine if the current user is authenticated.
*
* @static
* @return bool
*/
public static function check(){
return self::$root->check();
}
/**
* Determine if the current user is a guest.
*
* @static
* @return bool
*/
public static function guest(){
return self::$root->guest();
}
/**
* Get the currently authenticated user.
*
* @static
* @return \Illuminate\Auth\UserInterface|null
*/
public static function user(){
return self::$root->user();
}
/**
* Log a user into the application without sessions or cookies.
*
* @static
* @param array $credentials
* @return bool
*/
public static function stateless($credentials = array()){
return self::$root->stateless($credentials);
}
/**
* Validate a user's credentials.
*
* @static
* @param array $credentials
* @return bool
*/
public static function validate($credentials = array()){
return self::$root->validate($credentials);
}
/**
* Attempt to authenticate a user using the given credentials.
*
* @static
* @param array $credentials
* @param bool $remember
* @param bool $login
* @return bool
*/
public static function attempt($credentials = array(), $remember = false, $login = true){
return self::$root->attempt($credentials, $remember, $login);
}
/**
* Log a user into the application.
*
* @static
* @param \Illuminate\Auth\UserInterface $user
* @param bool $remember
*/
public static function login($user, $remember = false){
self::$root->login($user, $remember);
}
/**
* Log the given user ID into the application.
*
* @static
* @param mixed $id
* @param bool $remember
* @return \Illuminate\Auth\UserInterface
*/
public static function loginUsingId($id, $remember = false){
return self::$root->loginUsingId($id, $remember);
}
/**
* Log the user out of the application.
*
* @static
*/
public static function logout(){
self::$root->logout();
}
/**
* Get the cookie creator instance used by the guard.
*
* @static
* @return \Illuminate\Cookie\CookieJar
*/
public static function getCookieJar(){
return self::$root->getCookieJar();
}
/**
* Set the cookie creator instance used by the guard.
*
* @static
* @param \Illuminate\Cookie\CookieJar $cookie
*/
public static function setCookieJar($cookie){
self::$root->setCookieJar($cookie);
}
/**
* Get the event dispatcher instance.
*
* @static
* @return \Illuminate\Events\Dispatcher
*/
public static function getDispatcher(){
return self::$root->getDispatcher();
}
/**
* Set the event dispatcher instance.
*
* @static
* @param \Illuminate\Events\Dispatcher
*/
public static function setDispatcher($events){
self::$root->setDispatcher($events);
}
/**
* Get the session store used by the guard.
*
* @static
* @return \Illuminate\Session\Store
*/
public static function getSession(){
return self::$root->getSession();
}
/**
* Get the cookies queued by the guard.
*
* @static
* @return array
*/
public static function getQueuedCookies(){
return self::$root->getQueuedCookies();
}
/**
* Get the user provider used by the guard.
*
* @static
* @return \Illuminate\Auth\UserProviderInterface
*/
public static function getProvider(){
return self::$root->getProvider();
}
/**
* Return the currently cached user of the application.
*
* @static
* @return \Illuminate\Auth\UserInterface|null
*/
public static function getUser(){
return self::$root->getUser();
}
/**
* Set the current user of the application.
*
* @static
* @param \Illuminate\Auth\UserInterface $user
*/
public static function setUser($user){
self::$root->setUser($user);
}
/**
* Get a unique identifier for the auth session value.
*
* @static
* @return string
*/
public static function getName(){
return self::$root->getName();
}
/**
* Get the name of the cookie used to store the "recaller".
*
* @static
* @return string
*/
public static function getRecallerName(){
return self::$root->getRecallerName();
}
}
}
namespace {
class Cache{
/**
* @var \Illuminate\Cache\StoreInterface $root
*/
static private $root;
/**
* Retrieve an item from the cache by key.
*
* @static
* @param string $key
* @return mixed
*/
public static function get($key){
return self::$root->get($key);
}
/**
* Store an item in the cache for a given number of minutes.
*
* @static
* @param string $key
* @param mixed $value
* @param int $minutes
*/
public static function put($key, $value, $minutes){
self::$root->put($key, $value, $minutes);
}
/**
* Increment the value of an item in the cache.
*
* @static
* @param string $key
* @param mixed $value
*/
public static function increment($key, $value = 1){
self::$root->increment($key, $value);
}
/**
* Increment the value of an item in the cache.
*
* @static
* @param string $key
* @param mixed $value
*/
public static function decrement($key, $value = 1){
self::$root->decrement($key, $value);
}
/**
* Store an item in the cache indefinitely.
*
* @static
* @param string $key
* @param mixed $value
*/
public static function forever($key, $value){
self::$root->forever($key, $value);
}
/**
* Remove an item from the cache.
*
* @static
* @param string $key
*/
public static function forget($key){
self::$root->forget($key);
}
/**
* Remove all items from the cache.
*
* @static
*/
public static function flush(){
self::$root->flush();
}
}
}
namespace {
class DB{
/**
* @var \Illuminate\Database\Connection $root
*/
static private $root;
/**
* Create a new database connection instance.
*
* @static
* @param PDO $pdo
* @param string $database
* @param string $tablePrefix
* @param array $config
*/
public static function __construct($pdo, $database = '', $tablePrefix = '', $config = array()){
self::$root->__construct($pdo, $database, $tablePrefix, $config);
}
/**
* Set the query grammar to the default implementation.
*
* @static
*/
public static function useDefaultQueryGrammar(){
self::$root->useDefaultQueryGrammar();
}
/**
* Set the schema grammar to the default implementation.
*
* @static
*/
public static function useDefaultSchemaGrammar(){
self::$root->useDefaultSchemaGrammar();
}
/**
* Set the query post processor to the default implementation.
*
* @static
*/
public static function useDefaultPostProcessor(){
self::$root->useDefaultPostProcessor();
}
/**
* Get a schema builder instance for the connection.
*
* @static
* @return \Illuminate\Database\Schema\Builder
*/
public static function getSchemaBuilder(){
return self::$root->getSchemaBuilder();
}
/**
* Begin a fluent query against a database table.
*
* @static
* @param string $table
* @return \Illuminate\Database\Query\Builder
*/
public static function table($table){
return self::$root->table($table);
}
/**
* Get a new raw query expression.
*
* @static
* @param mixed $value
* @return \Illuminate\Database\Query\Expression
*/
public static function raw($value){
return self::$root->raw($value);
}
/**
* Run a select statement and return a single result.
*
* @static
* @param string $query
* @param array $bindings
* @return mixed
*/
public static function selectOne($query, $bindings = array()){
return self::$root->selectOne($query, $bindings);
}
/**
* Run a select statement against the database.
*
* @static
* @param string $query
* @param array $bindings
* @return array
*/
public static function select($query, $bindings = array()){
return self::$root->select($query, $bindings);
}
/**
* Run an insert statement against the database.
*
* @static
* @param string $query
* @param array $bindings
* @return bool
*/
public static function insert($query, $bindings = array()){
return self::$root->insert($query, $bindings);
}
/**
* Run an update statement against the database.
*
* @static
* @param string $query
* @param array $bindings
* @return int
*/
public static function update($query, $bindings = array()){
return self::$root->update($query, $bindings);
}
/**
* Run a delete statement against the database.
*
* @static
* @param string $query
* @param array $bindings
* @return int
*/
public static function delete($query, $bindings = array()){
return self::$root->delete($query, $bindings);
}
/**
* Execute an SQL statement and return the boolean result.
*
* @static
* @param string $query
* @param array $bindings
* @return bool
*/
public static function statement($query, $bindings = array()){
return self::$root->statement($query, $bindings);
}
/**
* Run an SQL statement and get the number of rows affected.
*
* @static
* @param string $query
* @param array $bindings
* @return int
*/
public static function affectingStatement($query, $bindings = array()){
return self::$root->affectingStatement($query, $bindings);
}
/**
* Run a raw, unprepared query against the PDO connection.
*
* @static
* @param string $query
* @return bool
*/
public static function unprepared($query){
return self::$root->unprepared($query);
}
/**
* Prepare the query bindings for execution.
*
* @static
* @param array $bindings
* @return array
*/
public static function prepareBindings($bindings){
return self::$root->prepareBindings($bindings);
}
/**
* Execute a Closure within a transaction.
*
* @static
* @param Closure $callback
* @return mixed
*/
public static function transaction($callback){
return self::$root->transaction($callback);
}
/**
* Execute the given callback in "dry run" mode.
*
* @static
* @param Closure $callback
* @return array
*/
public static function pretend($callback){
return self::$root->pretend($callback);
}
/**
* Log a query in the connection's query log.
*
* @static
* @param string $query
* @param array $bindings
* @param $time
*/
public static function logQuery($query, $bindings, $time = null){
self::$root->logQuery($query, $bindings, $time);
}
/**
* Register a database query listener with the connection.
*
* @static
* @param Closure $callback
*/
public static function listen($callback){
self::$root->listen($callback);
}
/**
* Get the currently used PDO connection.
*
* @static
* @return PDO
*/
public static function getPdo(){
return self::$root->getPdo();
}
/**
* Get the database connection name.
*
* @static
* @return string|null
*/
public static function getName(){
return self::$root->getName();
}
/**
* Get an option from the configuration options.
*
* @static
* @param string $option
* @return mixed
*/
public static function getConfig($option){
return self::$root->getConfig($option);
}
/**
* Get the PDO driver name.
*
* @static
* @return string
*/
public static function getDriverName(){
return self::$root->getDriverName();
}
/**
* Get the query grammar used by the connection.
*
* @static
* @return \Illuminate\Database\Query\Grammars\Grammar
*/
public static function getQueryGrammar(){
return self::$root->getQueryGrammar();
}
/**
* Set the query grammar used by the connection.
*
* @static
* @param \Illuminate\Database\Query\Grammars\Grammar
*/
public static function setQueryGrammar($grammar){
self::$root->setQueryGrammar($grammar);
}
/**
* Get the schema grammar used by the connection.
*
* @static
* @return \Illuminate\Database\Query\Grammars\Grammar
*/
public static function getSchemaGrammar(){
return self::$root->getSchemaGrammar();
}
/**
* Set the schema grammar used by the connection.
*
* @static
* @param \Illuminate\Database\Schema\Grammars\Grammar
*/
public static function setSchemaGrammar($grammar){
self::$root->setSchemaGrammar($grammar);
}
/**
* Get the query post processor used by the connection.
*
* @static
* @return \Illuminate\Database\Query\Processors\Processor
*/
public static function getPostProcessor(){
return self::$root->getPostProcessor();
}
/**
* Set the query post processor used by the connection.
*
* @static
* @param \Illuminate\Database\Query\Processors\Processor
*/
public static function setPostProcessor($processor){
self::$root->setPostProcessor($processor);
}
/**
* Get the event dispatcher used by the connection.
*
* @static
* @return \Illuminate\Events\Dispatcher
*/
public static function getEventDispatcher(){
return self::$root->getEventDispatcher();
}
/**
* Set the event dispatcher instance on the connection.
*
* @static
* @param \Illuminate\Events\Dispatcher
*/
public static function setEventDispatcher($events){
self::$root->setEventDispatcher($events);
}
/**
* Get the paginator environment instance.
*
* @static
* @return \Illuminate\Pagination\Environment
*/
public static function getPaginator(){
return self::$root->getPaginator();
}
/**
* Set the pagination environment instance.
*
* @static
* @param \Illuminate\Pagination\Environment|Closure $paginator
*/
public static function setPaginator($paginator){
self::$root->setPaginator($paginator);
}
/**
* Determine if the connection in a "dry run".
*
* @static
* @return bool
*/
public static function pretending(){
return self::$root->pretending();
}
/**
* Get the default fetch mode for the connection.
*
* @static
* @return int
*/
public static function getFetchMode(){
return self::$root->getFetchMode();
}
/**
* Set the default fetch mode for the connection.
*
* @static
* @param int $fetchMode
* @return int
*/
public static function setFetchMode($fetchMode){
return self::$root->setFetchMode($fetchMode);
}
/**
* Get the connection query log.
*
* @static
* @return array
*/
public static function getQueryLog(){
return self::$root->getQueryLog();
}
/**
* Clear the query log.
*
* @static
*/
public static function flushQueryLog(){
self::$root->flushQueryLog();
}
/**
* Enable the query log on the connection.
*
* @static
*/
public static function enableQueryLog(){
self::$root->enableQueryLog();
}
/**
* Disable the query log on the connection.
*
* @static
*/
public static function disableQueryLog(){
self::$root->disableQueryLog();
}
/**
* Get the name of the connected database.
*
* @static
* @return string
*/
public static function getDatabaseName(){
return self::$root->getDatabaseName();
}
/**
* Set the name of the connected database.
*
* @static
* @param string $database
* @return string
*/
public static function setDatabaseName($database){
return self::$root->setDatabaseName($database);
}
/**
* Get the table prefix for the connection.
*
* @static
* @return string
*/
public static function getTablePrefix(){
return self::$root->getTablePrefix();
}
/**
* Set the table prefix in use by the connection.
*
* @static
* @param string $prefix
*/
public static function setTablePrefix($prefix){
self::$root->setTablePrefix($prefix);
}
/**
* Set the table prefix and return the grammar.
*
* @static
* @param \Illuminate\Database\Grammar $grammar
* @return \Illuminate\Database\Grammar
*/
public static function withTablePrefix($grammar){
return self::$root->withTablePrefix($grammar);
}
}
}
namespace {
class Queue{
/**
* @var \Illuminate\Queue\QueueInterface $root
*/
static private $root;
/**
* Push a new job onto the queue.
*
* @static
* @param string $job
* @param mixed $data
* @param string $queue
*/
public static function push($job, $data = '', $queue = null){
self::$root->push($job, $data, $queue);
}
/**
* Push a new job onto the queue after a delay.
*
* @static
* @param int $delay
* @param string $job
* @param mixed $data
* @param string $queue
*/
public static function later($delay, $job, $data = '', $queue = null){
self::$root->later($delay, $job, $data, $queue);
}
/**
* Pop the next job off of the queue.
*
* @static
* @param string $queue
* @return \Illuminate\Queue\Jobs\Job|null
*/
public static function pop($queue = null){
return self::$root->pop($queue);
}
}
}
namespace {
class Redis{
/**
* @var \Illuminate\Redis\Database $root
*/
static private $root;
/**
* Create a new Redis connection instance.
*
* @static
* @param string $host
* @param int $port
* @param int $database
* @param string $password
*/
public static function __construct($host, $port, $database = 0, $password = null){
self::$root->__construct($host, $port, $database, $password);
}
/**
* Connect to the Redis database.
*
* @static
*/
public static function connect(){
self::$root->connect();
}
/**
* Run a command against the Redis database.
*
* @static
* @param string $method
* @param array $parameters
* @return mixed
*/
public static function command($method, $parameters = array()){
return self::$root->command($method, $parameters);
}
/**
* Build the Redis command syntax.
* Redis protocol states that a command should conform to the following format:
* *<number of arguments> CR LF
* $<number of bytes of argument 1> CR LF
* <argument data> CR LF
* ...
* $<number of bytes of argument N> CR LF
* <argument data> CR LF
* More information regarding the Redis protocol: http://redis.io/topics/protocol
*
* @static
* @param string $method
* @param array $parameters
* @return string
*/
public static function buildCommand($method, $parameters){
return self::$root->buildCommand($method, $parameters);
}
/**
* Parse the Redis database response.
*
* @static
* @param string $response
* @return mixed
*/
public static function parseResponse($response){
return self::$root->parseResponse($response);
}
/**
* Read the specified number of bytes from the file resource.
*
* @static
* @param int $bytes
* @return string
*/
public static function fileRead($bytes){
return self::$root->fileRead($bytes);
}
/**
* Get the specified number of bytes from a file line.
*
* @static
* @param int $bytes
* @return string
*/
public static function fileGet($bytes){
return self::$root->fileGet($bytes);
}
/**
* Write the given command to the file resource.
*
* @static
* @param string $command
*/
public static function fileWrite($command){
self::$root->fileWrite($command);
}
/**
* Get the Redis socket connection.
*
* @static
* @return resource
*/
public static function getConnection(){
return self::$root->getConnection();
}
/**
* Dynamically make a Redis command.
*
* @static
* @param string $method
* @param array $parameters
* @return mixed
*/
public static function __call($method, $parameters){
return self::$root->__call($method, $parameters);
}
}
}
namespace {
class App{
/**
* @var \Illuminate\Foundation\Application $root
*/
static private $root;
/**
* Create a new Illuminate application instance.
*
* @static
*/
public static function __construct(){
self::$root->__construct();