File tree Expand file tree Collapse file tree 2 files changed +56
-1
lines changed
Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,47 @@ public function bootstrap($app)
1818 $ app ->urlManager ->addRules ([
1919 $ prefix .'/<route:[a-zA-Z0-9-/]+> ' => '/cms/page/view '
2020 ]);
21+
22+ <?php
23+
24+ namespace nullref \cms ;
25+
26+
27+ use yii \base \ActionEvent ;
28+ use yii \base \Application ;
29+ use yii \base \BootstrapInterface ;
30+ use yii \base \Controller ;
31+ use yii \base \Event ;
32+ use yii \web \ErrorAction ;
33+ use yii \web \Application as WebApplication ;
34+
35+ class Bootstrap implements BootstrapInterface
36+ {
37+ public function bootstrap ($ app )
38+ {
39+ $ prefix = $ app ->getModule ('cms ' )->urlPrefix ;
40+ $ app ->urlManager ->addRules ([
41+ $ prefix . '/<route:[a-zA-Z0-9-/]+> ' => '/cms/page/view '
42+ ]);
43+
44+ if ($ app instanceof WebApplication) {
45+ $ app ->controllerMap ['elfinder-backend ' ] = [
46+ 'class ' => 'mihaildev\elfinder\Controller ' ,
47+ 'user ' => 'admin ' ,
48+ 'access ' => ['@ ' ],
49+ 'disabledCommands ' => ['netmount ' ],
50+ 'roots ' => [
51+ [
52+ 'path ' => 'uploads ' ,
53+ 'name ' => 'Uploads '
54+ ],
55+ ],
56+ ];
57+ }
58+ }
59+
60+ }
61+
2162 }
2263
2364}
Original file line number Diff line number Diff line change 55
66namespace nullref \cms ;
77
8-
98use nullref \core \components \ModuleInstaller ;
109use Yii ;
10+ use yii \helpers \Console ;
1111
1212class Installer extends ModuleInstaller
1313{
@@ -16,4 +16,18 @@ public function getModuleId()
1616 return 'cms ' ;
1717 }
1818
19+ public function install ()
20+ {
21+ parent ::install ();
22+ if (Console::confirm ('Create upload folder? ' )) {
23+ try {
24+ $ this ->createFolder ('@webroot/uploads ' );
25+ echo 'Folder @webroot/uploads was created ' . PHP_EOL ;
26+ } catch (\Exception $ e ) {
27+ echo $ e ->getMessage () . PHP_EOL ;
28+ }
29+ }
30+ }
31+
32+
1933}
You can’t perform that action at this time.
0 commit comments