File tree Expand file tree Collapse file tree 3 files changed +63
-7
lines changed Expand file tree Collapse file tree 3 files changed +63
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ class Application implements BaseApplicationContract
13
13
*
14
14
* @var string
15
15
*/
16
- const VERSION = '0.0.5 ' ;
16
+ const VERSION = '0.0.6 ' ;
17
+
18
+ /**
19
+ * The base path for the SimpleStub installation.
20
+ *
21
+ * @var string
22
+ */
23
+ protected $ basePath ;
17
24
18
25
/**
19
26
* The application namespace.
@@ -36,14 +43,18 @@ class Application implements BaseApplicationContract
36
43
*/
37
44
private static $ output ;
38
45
39
- public function __construct ()
46
+ public function __construct ($ basePath )
40
47
{
41
- self ::$ input = Input::getInstance ();
42
- self ::$ output = Output::getInstance ();
48
+ // self::$input = Input::getInstance();
49
+ // self::$output = Output::getInstance();
50
+ if ($ basePath ) {
51
+ $ this ->basePath = rtrim ($ basePath , '\/ ' );
52
+ }
43
53
}
44
54
45
55
public function version (): string
46
56
{
57
+ if (defined ('STUB_APP_VERSION ' )) echo STUB_APP_VERSION ;
47
58
return static ::VERSION ;
48
59
}
49
60
Original file line number Diff line number Diff line change 9
9
use Throwable ;
10
10
11
11
/**
12
- *
12
+ * Класс ядра консоли
13
13
*/
14
14
class Kernel implements \Stub \Framework \Contracts \Console \Kernel
15
15
{
Original file line number Diff line number Diff line change 2
2
3
3
namespace Stub \Framework \Main \Http ;
4
4
5
+ use DateTime ;
6
+ use Stub \Framework \Contracts \Main \Application ;
7
+ use Stub \Framework \Http \View \Stub ;
8
+
9
+ /**
10
+ * Класс ядра НТТР
11
+ */
5
12
class Kernel implements \Stub \Framework \Contracts \Http \Kernel
6
13
{
14
+ /**
15
+ * Содержит экземпляр класса приложения
16
+ * @var Application
17
+ */
18
+ protected $ app ;
19
+
20
+ /**
21
+ * Дата и время старта обрабатываемого запроса
22
+ * @var DateTime|Null
23
+ */
24
+ protected $ requestStartedDateTime ;
25
+
26
+ /**
27
+ * Создает новый экземпляр ядра HTTP
28
+ * @param Application $app
29
+ */
30
+ public function __construct (Application $ app )
31
+ {
32
+ $ this ->app = $ app ;
33
+ }
34
+
35
+ /**
36
+ * @return void
37
+ */
38
+ public function hendle ()
39
+ {
40
+ $ this ->requestStartedDateTime = new DateTime ();
41
+
42
+ }
43
+
44
+ /**
45
+ * @return string
46
+ */
7
47
public function sayHello (): string
8
48
{
9
- echo "Hello!! It is Console Kernel... " ;
10
- return "Hi!! It is Console Kernel... " ;
49
+ // echo "Hello!! It is Console Kernel...";
50
+ // return "Hi!! It is Console Kernel...";
51
+ $ stub = new Stub ($ this ->app );
52
+ $ stub ->generate ($ this ->app );
53
+ echo $ stub ->getDocumentResult ();
54
+
55
+ return "" ;
11
56
}
12
57
}
You can’t perform that action at this time.
0 commit comments