File tree Expand file tree Collapse file tree 9 files changed +38
-11
lines changed Expand file tree Collapse file tree 9 files changed +38
-11
lines changed Original file line number Diff line number Diff line change 1
1
.idea
2
2
vendor /
3
+ dsl-clc.jar
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " dsl-platform/dsl-skeleton" ,
3
+ "description" : " PHP skeleton application" ,
3
4
"license" : " BSD-3-Clause" ,
4
5
"type" : " project" ,
6
+ "minimum-stability" : " dev" ,
5
7
"require" : {
6
8
"dsl-platform/dsl-admin-php" : " dev-master"
7
9
},
11
13
"post-root-package-install" : " PhpDslAdmin\\ Installer::install"
12
14
},
13
15
"autoload" : {
14
- "psr-0" : { "" : " src/" }
16
+ "psr-4" : {
17
+ "" : [
18
+ " src/" ,
19
+ " Generated-PHP/" ,
20
+ " Generated-PHP-UI/"
21
+ ]
22
+ }
15
23
}
16
24
}
Original file line number Diff line number Diff line change 12
12
$ app ['twig.options ' ] = array (
13
13
'cache ' => false ,
14
14
);
15
- $ client = new \NGS \Client \RestHttp ('http://localhost:9012 / ' , 'revenj ' , 'revenj ' );
15
+ $ client = new \NGS \Client \RestHttp ('http://localhost:8999 / ' , 'revenj ' , 'revenj ' );
16
16
\NGS \Client \RestHttp::instance ($ client );
17
17
$ app ['dsl.client ' ] = $ app ->share (function () use ($ client ) {
18
18
return $ client ;
Original file line number Diff line number Diff line change 7
7
$ app ->register (new \Silex \Provider \ValidatorServiceProvider ());
8
8
$ app ->register (new \Silex \Provider \TranslationServiceProvider ());
9
9
$ app ->register (new \Silex \Provider \SessionServiceProvider ());
10
- $ app ['message ' ] = $ app ->share (function () use ($ app ) {
11
- return new \NGS \Service \MessageService ($ app ['session ' ]);
12
- });
13
10
14
11
$ app ['dsl.source.forms ' ] = function () { return require __DIR__ .'/../Generated-PHP-UI/ModulesForms.php ' ; };
15
12
$ app ['ngs.form.typemap ' ] = $ app ->share (function () use ($ app ) {
53
50
54
51
$ app ['crud.controller ' ] = $ app ->share (function () use ($ app ) {
55
52
$ controller = new \PhpDslAdmin \CrudController ($ app );
56
- $ controller ->setTwigNamespace ('' );
57
53
return $ controller ;
58
54
});
59
55
$ crudProvider = new \PhpDslAdmin \CrudControllerProvider ();
Original file line number Diff line number Diff line change
1
+ *
Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
require_once __DIR__ .'/../vendor/autoload.php ' ;
4
3
5
4
$ app = new Silex \Application ();
6
5
7
6
require __DIR__ .'/../config/dev.php ' ;
8
7
9
- $ app ->get ('/ ' , function () use ($ app ) {
10
- return $ app ['twig ' ]->render ('index.twig ' );
11
- });
12
-
13
8
$ app ->run ();
Original file line number Diff line number Diff line change
1
+ <?php
2
+ // router for PHP built-in web server, replaces rewrite rules
3
+
4
+ $ staticAlias = realpath (__DIR__ .'/../vendor/dsl-platform/dsl-admin-php/public ' );
5
+
6
+ if (isset ($ _SERVER ['REQUEST_URI ' ]))
7
+ $ uri = $ _SERVER ['REQUEST_URI ' ];
8
+
9
+ if (strpos ($ uri , '/static ' ) === 0 ) {
10
+ $ path = realpath ($ staticAlias . $ uri );
11
+ if ($ path === false || strpos ($ path , $ staticAlias ) !== 0 )
12
+ return http_response_code (404 );
13
+
14
+ $ ext = substr ($ path , strrpos ($ path , '. ' ));
15
+ if ($ ext === '.css ' )
16
+ $ mime = 'text/css ' ;
17
+ else if ($ ext === '.js ' )
18
+ $ mime = 'text/javascript ' ;
19
+ if (isset ($ mime ))
20
+ header ('Content-Type: ' .$ mime );
21
+
22
+ if (@readfile ($ path ) === false )
23
+ return http_response_code (404 );
24
+ }
25
+ else
26
+ require __DIR__ .'/index.php ' ;
You can’t perform that action at this time.
0 commit comments