-
Notifications
You must be signed in to change notification settings - Fork 59
/
yaf.php
2931 lines (2601 loc) · 79.3 KB
/
yaf.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
define('YAF_VERSION', '2.3.5', true);
define('YAF_ENVIRON', 'product', true);
define('YAF_ERR_STARTUP_FAILED', 512, true);
define('YAF_ERR_ROUTE_FAILED', 513, true);
define('YAF_ERR_DISPATCH_FAILED', 514, true);
define('YAF_ERR_NOTFOUND_MODULE', 515, true);
define('YAF_ERR_NOTFOUND_CONTROLLER', 516, true);
define('YAF_ERR_NOTFOUND_ACTION', 517, true);
define('YAF_ERR_NOTFOUND_VIEW', 518, true);
define('YAF_ERR_CALL_FAILED', 519, true);
define('YAF_ERR_AUTOLOAD_FAILED', 520, true);
define('YAF_ERR_TYPE_ERROR', 521, true);
//================================================
/**
* Yaf_Application provides a bootstrapping facility for applications which provides reusable resources, common- and module-based bootstrap classes and dependency checking.
* <br/>
* <b>Note:</b>
* <p>
* Yaf_Application implements the singleton pattern, and Yaf_Application can not be serialized or un-serialized which will cause problem when you try to use PHPUnit to write some test case for Yaf.<br/>
* You may use @backupGlobals annotation of PHPUnit to control the backup and restore operations for global variables. thus can solve this problem.
* </p>
* @link http://www.php.net/manual/en/class.yaf-application.php
*/
final class Yaf_Application {
/**
* @var Yaf_Application
*/
protected static $_app;
/**
* @var Yaf_Config_Abstract
*/
protected $config;
/**
* @var Yaf_Dispatcher
*/
protected $dispatcher;
/**
* @var array
*/
protected $_modules;
/**
* @var string
*/
protected $_running = "";
/**
* @var string
*/
protected $_environ = YAF_ENVIRON;
/**
* @since 2.1.2
* @var int
*/
protected $_err_no = 0;
/**
* @since 2.1.2
* @var string
*/
protected $_err_msg = "";
/**
* @link http://www.php.net/manual/en/yaf-application.construct.php
*
* @param string|array $config A ini config file path, or a config array
* <p>
* If is a ini config file, there should be a section named as the one defined by yaf.environ, which is "product" by default.
* </p>
* <br/>
* <b>Note:</b>
* <p>If you use a ini configuration file as your application's config container. you would open the yaf.cache_config to improve performance.</p>
* <p>And the config entry(and there default value) list blow:</p>
*
* <p>
* <b>Example #1 A ini config file example</b><br/>
* [product]<br/>
* ;this one should always be defined, and have no default value<br/>
* application.directory=APPLICATION_PATH<br/><br/>
* </p>
* <p>
* ;following configs have default value, you may no need to define them
* <br/>
* application.library = APPLICATION_PATH . "/library" <br/>
* application.dispatcher.throwException=1 <br/>
* application.dispatcher.catchException=1 <br/><br/>
* </p>
* <p>application.baseUri=""<br/><br/></p>
* <p>
* ;the php script ext name<br/>
* ap.ext=php<br/><br/>
* </p>
* <p>
* ;the view template ext name<br/>
* ap.view.ext=phtml<br/><br/>
* </p>
* <p>
* ap.dispatcher.defaultModule=Index<br/>
* ap.dispatcher.defaultController=Index<br/>
* ap.dispatcher.defaultAction=index<br/><br/>
* </p>
* <p>
* ;defined modules<br/>
* ap.modules=Index
* </p>
* @param string $envrion Which section will be loaded as the final config
*
* @throws Yaf_Exception_TypeError|Yaf_Exception_StartupError
*/
public function __construct($config, $envrion = null){ }
/**
* Run a Yaf_Application, let the Yaf_Application accept a request, and route the request, dispatch to controller/action, and render response.
* return response to client finally.
*
* @link http://www.php.net/manual/en/yaf-application.run.php
* @throws Yaf_Exception_StartupError
*/
public function run(){ }
/**
* This method is typically used to run Yaf_Application in a crontab work.
* Make the crontab work can also use the autoloader and Bootstrap mechanism.
*
* @link http://www.php.net/manual/en/yaf-application.execute.php
*
* @param callable $entry a valid callback
* @param string $_ parameters will pass to the callback
*/
public function execute(callable $entry, $_ = "..."){ }
/**
* Retrieve the Yaf_Application instance, alternatively, we also could use Yaf_Dispatcher::getApplication().
*
* @link http://www.php.net/manual/en/yaf-application.app.php
*
* @return Yaf_Application|NULL an Yaf_Application instance, if no Yaf_Application initialized before, NULL will be returned.
*/
public static function app(){ }
/**
* Retrieve environ which was defined in yaf.environ which has a default value "product".
*
* @link http://www.php.net/manual/en/yaf-application.environ.php
*
* @return string
*/
public function environ(){ }
/**
* Run a Bootstrap, all the methods defined in the Bootstrap and named with prefix "_init" will be called according to their declaration order, if the parameter bootstrap is not supplied, Yaf will look for a Bootstrap under application.directory.
*
* @link http://www.php.net/manual/en/yaf-application.bootstrap.php
*
* @param Yaf_Bootstrap_Abstract $bootstrap A Yaf_Bootstrap_Abstract instance
* @return Yaf_Application
*/
public function bootstrap(Yaf_Bootstrap_Abstract $bootstrap = null){ }
/**
* @link http://www.php.net/manual/en/yaf-application.getconfig.php
*
* @return Yaf_Config_Abstract
*/
public function getConfig(){ }
/**
* Get the modules list defined in config, if no one defined, there will always be a module named "Index".
*
* @link http://www.php.net/manual/en/yaf-application.getmodules.php
*
* @return array
*/
public function getModules(){ }
/**
* @link http://www.php.net/manual/en/yaf-application.getdispatcher.php
*
* @return Yaf_Dispatcher
*/
public function getDispatcher(){ }
/**
* Change the application directory
*
* @since 2.1.4
* @link http://www.php.net/manual/en/yaf-application.setappdirectory.php
*
* @param string $directory
* @return Yaf_Application
*/
public function setAppDirectory($directory){ }
/**
* @since 2.1.4
* @link http://www.php.net/manual/en/yaf-application.getappdirectory.php
*
* @return string
*/
public function getAppDirectory(){ }
/**
* @since 2.1.2
* @link http://www.php.net/manual/en/yaf-application.getlasterrorno.php
*
* @return int
*/
public function getLastErrorNo(){ }
/**
* @since 2.1.2
* @link http://www.php.net/manual/en/yaf-application.getlasterrormsg.php
*
* @return string
*/
public function getLastErrorMsg(){ }
/**
*
* @since 2.1.2
* @link http://www.php.net/manual/en/yaf-application.clearlasterror.php
*/
public function clearLastError(){ }
/**
*
* @link http://www.php.net/manual/en/yaf-application.destruct.php
*/
public function __destruct(){ }
/**
*
* @link http://www.php.net/manual/en/yaf-application.clone.php
*/
private function __clone(){ }
/**
*
* @link http://www.php.net/manual/en/yaf-application.sleep.php
*/
private function __sleep(){ }
/**
*
* @link http://www.php.net/manual/en/yaf-application.wakeup.php
*/
private function __wakeup(){ }
}
/**
* <p><b>Yaf_Dispatcher</b> purpose is to initialize the request environment, route the incoming request, and then dispatch any discovered actions; it aggregates any responses and returns them when the process is complete.</p><br/>
* <p><b>Yaf_Dispatcher</b> also implements the Singleton pattern, meaning only a single instance of it may be available at any given time. This allows it to also act as a registry on which the other objects in the dispatch process may draw.</p>
*
* @link http://www.php.net/manual/en/class.yaf-dispatcher.php
*/
final class Yaf_Dispatcher {
/**
* @var Yaf_Dispatcher
*/
protected static $_instance;
/**
* @var Yaf_Router
*/
protected $_router;
/**
* @var Yaf_View_Interface
*/
protected $_view;
/**
* @var Yaf_Request_Abstract
*/
protected $_request;
/**
* @var Yaf_Plugin_Abstract
*/
protected $_plugins;
/**
* @var bool
*/
protected $_auto_render = true;
/**
* @var string
*/
protected $_return_response = "";
/**
* @var string
*/
protected $_instantly_flush = "";
/**
* @var string
*/
protected $_default_module;
/**
* @var string
*/
protected $_default_controller;
/**
* @var string
*/
protected $_default_action;
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.construct.php
*/
private function __construct(){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.clone.php
*/
private function __clone(){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.sleep.php
*/
private function __sleep(){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.wakeup.php
*/
private function __wakeup(){ }
/**
* enable view rendering
*
* @link http://www.php.net/manual/en/yaf-dispatcher.enableview.php
*
* @return Yaf_Dispatcher
*/
public function enableView(){ }
/**
* <p>disable view engine, used in some app that user will output by himself</p><br/>
* <b>Note:</b>
* <p>you can simply return FALSE in a action to prevent the auto-rendering of that action</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.disableview.php
*
* @return bool
*/
public function disableView(){ }
/**
* Initialize view and return it
*
* @link http://www.php.net/manual/en/yaf-dispatcher.initview.php
*
* @param string $templates_dir
* @param array $options
* @return Yaf_View_Interface
*/
public function initView($templates_dir, array $options = null){ }
/**
* This method provides a solution for that if you want use a custom view engine instead of Yaf_View_Simple
*
* @link http://www.php.net/manual/en/yaf-dispatcher.setview.php
*
* @param Yaf_View_Interface $view A Yaf_View_Interface instance
* @return Yaf_Dispatcher
*/
public function setView(Yaf_View_Interface $view){ }
/**
*
* @link http://www.php.net/manual/en/yaf-dispatcher.setrequest.php
*
* @param Yaf_Request_Abstract $request
* @return Yaf_Dispatcher
*/
public function setRequest(Yaf_Request_Abstract $request){ }
/**
* Retrieve the Yaf_Application instance. same as Yaf_Application::app().
*
* @link http://www.php.net/manual/en/yaf-dispatcher.getapplication.php
* @return Yaf_Application
*/
public function getApplication(){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.getrouter.php
*
* @return Yaf_Router
*/
public function getRouter(){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.getrequest.php
*
* @return Yaf_Request_Abstract
*/
public function getRequest(){ }
/**
* <p>Set error handler for Yaf. when application.dispatcher.throwException is off, Yaf will trigger catch-able error while unexpected errors occurred.</p><br/>
* <p>Thus, this error handler will be called while the error raise.</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.seterrorhandler.php
*
* @param callable $callback a callable callback
* @param int $error_types YAF_ERR_* constants mask
*
* @return Yaf_Dispatcher
*/
public function setErrorHandler(callable $callback, $error_types){ }
/**
* Change default module name
*
* @link http://www.php.net/manual/en/yaf-dispatcher.setdefaultmodule.php
*
* @param string $module
* @return Yaf_Dispatcher
*/
public function setDefaultModule($module){ }
/**
* Change default controller name
*
* @link http://www.php.net/manual/en/yaf-dispatcher.setdefaultcontroller.php
*
* @param string $controller
* @return Yaf_Dispatcher
*/
public function setDefaultController($controller){ }
/**
* Change default action name
*
* @link http://www.php.net/manual/en/yaf-dispatcher.setdefaultaction.php
*
* @param string $action
* @return Yaf_Dispatcher
*/
public function setDefaultAction($action){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.returnresponse.php
*
* @param bool $flag
* @return Yaf_Dispatcher
*/
public function returnResponse($flag){ }
/**
* <p>Yaf_Dispatcher will render automatically after dispatches an incoming request, you can prevent the rendering by calling this method with $flag TRUE</p><br/>
* <b>Note:</b>
* <p>you can simply return FALSE in a action to prevent the auto-rendering of that action</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.autorender.php
*
* @param bool $flag since 2.2.0, if this parameter is not given, then the current state will be set
* @return Yaf_Dispatcher
*/
public function autoRender($flag = null){ }
/**
* Switch on/off the instant flushing
*
* @link http://www.php.net/manual/en/yaf-dispatcher.flushinstantly.php
*
* @param bool $flag since 2.2.0, if this parameter is not given, then the current state will be set
* @return Yaf_Dispatcher
*/
public function flushInstantly($flag = null){ }
/**
* @link http://www.php.net/manual/en/yaf-dispatcher.getinstance.php
*
* @return Yaf_Dispatcher
*/
public static function getInstance(){ }
/**
* <p>This method does the heavy work of the Yaf_Dispatcher. It take a request object.</p><br/>
* <p>The dispatch process has three distinct events:</p>
* <ul>
* <li>Routing</li>
* <li>Dispatching</li>
* <li>Response</li>
* </ul>
* <p>Routing takes place exactly once, using the values in the request object when dispatch() is called. Dispatching takes place in a loop; a request may either indicate multiple actions to dispatch, or the controller or a plugin may reset the request object to force additional actions to dispatch(see Yaf_Plugin_Abstract. When all is done, the Yaf_Dispatcher returns a response.</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.dispatch.php
*
* @param Yaf_Request_Abstract $request
*
* @throws Yaf_Exception_TypeError
* @throws Yaf_Exception_RouterFailed
* @throws Yaf_Exception_DispatchFailed
* @throws Yaf_Exception_LoadFailed
* @throws Yaf_Exception_LoadFailed_Action
* @throws Yaf_Exception_LoadFailed_Controller
*
* @return Yaf_Response_Abstract
*/
public function dispatch(Yaf_Request_Abstract $request){ }
/**
* <p>Switch on/off exception throwing while unexpected error occurring. When this is on, Yaf will throwing exceptions instead of triggering catchable errors.</p><br/>
* <p>You can also use application.dispatcher.throwException to achieve the same purpose.</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.throwexception.php
*
* @param bool $flag
* @return Yaf_Dispatcher
*/
public function throwException($flag = null){ }
/**
* <p>While the application.dispatcher.throwException is On(you can also calling to <b>Yaf_Dispatcher::throwException(TRUE)</b> to enable it), Yaf will throw Exception whe error occurs instead of trigger error.</p><br/>
* <p>then if you enable <b>Yaf_Dispatcher::catchException()</b>(also can enabled by set application.dispatcher.catchException), all uncaught Exceptions will be caught by ErrorController::error if you have defined one.</p>
*
* @link http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
*
* @param bool $flag
* @return Yaf_Dispatcher
*/
public function catchException($flag = null){ }
/**
* Register a plugin(see Yaf_Plugin_Abstract). Generally, we register plugins in Bootstrap(see Yaf_Bootstrap_Abstract).
*
* @link http://www.php.net/manual/en/yaf-dispatcher.registerplugin.php
*
* @param Yaf_Plugin_Abstract $plugin
* @return Yaf_Dispatcher
*/
public function registerPlugin(Yaf_Plugin_Abstract $plugin){ }
}
/**
* <p><b>Yaf_Loader</b> introduces a comprehensive autoloading solution for Yaf.</p>
* <br/>
* <p>The first time an instance of Yaf_Application is retrieved, <b>Yaf_Loader</b> will instance a singleton, and registers itself with spl_autoload. You retrieve an instance using the Yaf_Loader::getInstance()</p>
* <br/>
* <p><b>Yaf_Loader</b> attempt to load a class only one shot, if failed, depend on yaf.use_spl_autoload, if this config is On Yaf_Loader::autoload() will return FALSE, thus give the chance to other autoload function. if it is Off (by default), Yaf_Loader::autoload() will return TRUE, and more important is that a very useful warning will be triggered (very useful to find out why a class could not be loaded).</p>
* <br/>
* <b>Note:</b>
* <p>Please keep yaf.use_spl_autoload Off unless there is some library have their own autoload mechanism and impossible to rewrite it.</p>
* <br/>
* <p>If you want <b>Yaf_Loader</b> search some classes(libraries) in the local class directory(which is defined in application.ini, and by default, it is application.directory . "/library"), you should register the class prefix using the Yaf_Loader::registerLocalNameSpace()</p>
* @link http://www.php.net/manual/en/class.yaf-loader.php
*
*/
class Yaf_Loader {
/**
* @var string
*/
protected $_local_ns;
/**
* By default, this value is application.directory . "/library", you can change this either in the application.ini(application.library) or call to Yaf_Loader::setLibraryPath()
* @var string
*/
protected $_library;
/**
* @var string
*/
protected $_global_library;
/**
* @var Yaf_Loader
*/
protected static $_instance;
/**
* @link http://www.php.net/manual/en/yaf-loader.construct.php
*/
private function __construct(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.clone.php
*/
private function __clone(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.sleep.php
*/
private function __sleep(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.wakeup.php
*/
private function __wakeup(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.autoload.php
*
* @param string $class_name
*
* @return bool
*/
public function autoload($class_name){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.getinstance.php
*
* @param string $local_library_path
* @param string $global_library_path
*
* @return Yaf_Loader
*/
public static function getInstance($local_library_path = null, $global_library_path = null){ }
/**
* <p>Register local class prefix name, Yaf_Loader search classes in two library directories, the one is configured via application.library.directory(in application.ini) which is called local library directory; the other is configured via yaf.library (in php.ini) which is called global library directory, since it can be shared by many applications in the same server.</p>
* <br/>
* <p>When an autoloading is triggered, Yaf_Loader will determine which library directory should be searched in by examining the prefix name of the missed classname. If the prefix name is registered as a local namespace then look for it in local library directory, otherwise look for it in global library directory.</p>
* <br/>
* <b>Note:</b>
* <p>If yaf.library is not configured, then the global library directory is assumed to be the local library directory. in that case, all autoloading will look for local library directory. But if you want your Yaf application be strong, then always register your own classes as local classes.</p>
* @link http://www.php.net/manual/en/yaf-loader.registerlocalnamespace.php
*
* @param string|string[] $name_prefix a string or a array of class name prefix. all class prefix with these prefix will be loaded in local library path.
*
* @return bool
*/
public function registerLocalNamespace($name_prefix){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.getlocalnamespace.php
*
* @return string
*/
public function getLocalNamespace(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.clearlocalnamespace.php
*/
public function clearLocalNamespace(){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.islocalname.php
*
* @param string $class_name
*
* @return bool
*/
public function isLocalName($class_name){ }
/**
* @link http://www.php.net/manual/en/yaf-loader.import.php
*
* @param string $file
*
* @return bool
*/
public static function import($file){ }
/**
* @since 2.1.4
* @link http://www.php.net/manual/en/yaf-loader.setlibrarypath.php
*
* @param string $directory
* @param bool $global
*
* @return Yaf_Loader
*/
public function setLibraryPath($directory, $global = false){ }
/**
* @since 2.1.4
* @link http://www.php.net/manual/en/yaf-loader.getlibrarypath.php
*
* @param bool $is_global
*
* @return string
*/
public function getLibraryPath($is_global = false){ }
}
/**
* <p>All methods of <b>Yaf_Registry</b> declared as static, making it universally accessible. This provides the ability to get or set any custom data from anyway in your code as necessary.</p>
* @link http://www.php.net/manual/en/class.yaf-registry.php
*/
final class Yaf_Registry {
/**
* @var Yaf_Registry
*/
protected static $_instance;
/**
* @var array
*/
protected $_entries;
/**
* @link http://www.php.net/manual/en/yaf-registry.construct.php
*/
private function __construct(){ }
/**
* @link http://www.php.net/manual/en/yaf-registry.clone.php
*/
private function __clone(){ }
/**
* Retrieve an item from registry
*
* @link http://www.php.net/manual/en/yaf-registry.get.php
*
* @param string $name
*
* @return mixed
*/
public static function get($name){ }
/**
* Check whether an item exists
*
* @link http://www.php.net/manual/en/yaf-registry.has.php
*
* @param string $name
*
* @return bool
*/
public static function has($name){ }
/**
* @link http://www.php.net/manual/en/yaf-registry.set.php
*
* @param string $name
* @param mixed $value
*
* @return bool
*/
public static function set($name, $value){ }
/**
* @link http://www.php.net/manual/en/yaf-registry.del.php
*
* @param string $name
*
* @return void|bool
*/
public static function del($name){ }
}
/**
* @link http://www.php.net/manual/en/class.yaf-session.php
* @version 2.2.9
*/
final class Yaf_Session implements Iterator, Traversable, ArrayAccess, Countable {
/**
* @var Yaf_Session
*/
protected static $_instance;
/**
* @var array
*/
protected $_session;
/**
* @var bool
*/
protected $_started = true;
/**
* @link http://www.php.net/manual/en/yaf-session.construct.php
*/
private function __construct(){ }
/**
* @link http://www.php.net/manual/en/yaf-session.clone.php
*/
private function __clone(){ }
/**
* @link http://www.php.net/manual/en/yaf-session.sleep.php
*/
private function __sleep(){ }
/**
* @link http://www.php.net/manual/en/yaf-session.wakeup.php
*/
private function __wakeup(){ }
/**
* @link http://www.php.net/manual/en/yaf-session.getinstance.php
*
* @return Yaf_Session
*/
public static function getInstance(){ }
/**
* @link http://www.php.net/manual/en/yaf-session.start.php
*
* @return Yaf_Session
*/
public function start(){ }
// /**
// * @since 2.2.10
// * @link http://www.php.net/manual/en/yaf-session.clear.php
// */
// public function clear(){}
/**
* @link http://www.php.net/manual/en/yaf-session.get.php
*
* @param string $name
*
* @return mixed
*/
public function get($name){ }
/**
* @link http://www.php.net/manual/en/yaf-session.has.php
*
* @param string $name
*
* @return bool
*/
public function has($name){ }
/**
* @link http://www.php.net/manual/en/yaf-session.set.php
*
* @param string $name
* @param mixed $value
*
* @return bool|Yaf_Session return FALSE on failure
*/
public function set($name, $value){ }
/**
* @link http://www.php.net/manual/en/yaf-session.del.php
*
* @param string $name
*
* @return bool|Yaf_Session return FALSE on failure
*/
public function del($name){ }
/**
* @see Countable::count
*/
public function count(){ }
/**
* @see Iterator::rewind
*/
public function rewind(){ }
/**
* @see Iterator::current
*/
public function current(){ }
/**
* @see Iterator::next
*/
public function next(){ }
/**
* @see Iterator::valid
*/
public function valid(){ }
/**
* @see Iterator::key
*/
public function key(){ }
/**
* @see ArrayAccess::offsetUnset
*/
public function offsetUnset($name){ }
/**
* @see ArrayAccess::offsetGet
*/
public function offsetGet($name){ }
/**
* @see ArrayAccess::offsetExists
*/
public function offsetExists($name){ }
/**
* @see ArrayAccess::offsetSet
*/
public function offsetSet($name, $value){ }
/**
* @see Yaf_Session::get()
*/
public function __get($name){ }
/**
* @see Yaf_Session::has()
*/
public function __isset($name){ }
/**
* @see Yaf_Session::set()
*/
public function __set($name, $value){ }
/**
* @see Yaf_Session::del()
*/
public function __unset($name){ }
}
/**
* <p><b>Yaf_Router</b> is the standard framework router. Routing is the process of taking a URI endpoint (that part of the URI which comes after the base URI: see Yaf_Request_Abstract::setBaseUri()) and decomposing it into parameters to determine which module, controller, and action of that controller should receive the request. This values of the module, controller, action and other parameters are packaged into a Yaf_Request_Abstract object which is then processed by Yaf_Dispatcher. Routing occurs only once: when the request is initially received and before the first controller is dispatched. Yaf_Router is designed to allow for mod_rewrite-like functionality using pure PHP structures. It is very loosely based on Ruby on Rails routing and does not require any prior knowledge of webserver URL rewriting</p>
* <br/>
* <b>Default Route</b>
* <br/>
* <p><b>Yaf_Router</b> comes pre-configured with a default route Yaf_Route_Static, which will match URIs in the shape of controller/action. Additionally, a module name may be specified as the first path element, allowing URIs of the form module/controller/action. Finally, it will also match any additional parameters appended to the URI by default - controller/action/var1/value1/var2/value2.</p>
* <br/>
* <b>Note:</b>
* <p>Module name must be defined in config, considering application.module="Index,Foo,Bar", in this case, only index, foo and bar can be considered as a module name. if doesn't config, there is only one module named "Index".</p>
* <br/>
* <p>** See examples by opening the external documentation</p>
* @link http://www.php.net/manual/en/class.yaf-router.php
*/
class Yaf_Router {
/**
* @var Yaf_Route_Interface[] registered routes stack
*/
protected $_routes;
/**
* @var string after routing phase, this indicated the name of which route is used to route current request. you can get this name by Yaf_Router::getCurrentRoute()
*/
protected $_current;
/**
* @link http://www.php.net/manual/en/yaf-router.construct.php
*/
public function __construct(){ }
/**
* <p>by default, Yaf_Router using a Yaf_Route_Static as its default route. you can add new routes into router's route stack by calling this method.</p>
* <br/>
* <p>the newer route will be called before the older(route stack), and if the newer router return TRUE, the router process will be end. otherwise, the older one will be called.</p>
*
* @link http://www.php.net/manual/en/yaf-router.addroute.php
*
* @param string $name
* @param Yaf_Route_Interface $route
*
* @return bool|Yaf_Router return FALSE on failure
*/
public function addRoute($name, Yaf_Route_Interface $route){ }
/**
* <p>Add routes defined by configs into Yaf_Router's route stack</p>
*
* @link http://www.php.net/manual/en/yaf-router.addconfig.php
*
* @param Yaf_Config_Abstract $config
*
* @return bool|Yaf_Router return FALSE on failure
*/
public function addConfig(Yaf_Config_Abstract $config){ }
/**
* @link http://www.php.net/manual/en/yaf-router.route.php
*
* @param Yaf_Request_Abstract $request
*
* @return bool|Yaf_Router return FALSE on failure
*/
public function route(Yaf_Request_Abstract $request){ }
/**
* <p>Retrieve a route by name, see also Yaf_Router::getCurrentRoute()</p>
*
* @link http://www.php.net/manual/en/yaf-router.getroute.php
*
* @param string $name
*
* @return Yaf_Route_Interface
*/
public function getRoute($name){ }
/**
* @link http://www.php.net/manual/en/yaf-router.getroutes.php
*
* @return Yaf_Route_Interface[]
*/
public function getRoutes(){ }
/**
* <p>Get the name of the route which is effective in the route process.</p>
* <br/>
* <b>Note:</b>
* <p>You should call this method after the route process finished, since before that, this method will always return NULL.</p>
*
* @link http://www.php.net/manual/en/yaf-router.getcurrentroute.php
*
* @return string the name of the effective route.
*/
public function getCurrentRoute(){ }