@@ -130,30 +130,32 @@ public String getErrorMessage() {
130
130
}
131
131
132
132
private void validate () {
133
- CakePHP3CustomizerValidator validator = new CakePHP3CustomizerValidator ();
134
- FileObject srcDir = FileUtil .toFileObject (sourceDirectory );
135
- String rootPath = getPanel ().getRoot ();
136
- String srcPath = String .format ("%s/%s" , rootPath , getPanel ().getSrc ()).replaceAll ("/+" , "/" );
137
- String wwwRootPath = String .format ("%s/%s" , rootPath , getPanel ().getWWWRoot ()).replaceAll ("/+" , "/" );
138
- String cssPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getCss ()).replaceAll ("/+" , "/" );
139
- String imgPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getImg ()).replaceAll ("/+" , "/" );
140
- String jsPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getJs ()).replaceAll ("/+" , "/" );
141
- String dotcakePath = getPanel ().getDotcakePath ();
142
- ValidationResult result = validator .validateRootPath (srcDir , rootPath )
143
- .validateSrc (srcDir , srcPath )
144
- .validateWWWRoot (srcDir , wwwRootPath )
145
- .validateCss (srcDir , cssPath )
146
- .validateImg (srcDir , imgPath )
147
- .validateJs (srcDir , jsPath )
148
- .validateDotcake (srcDir , dotcakePath )
149
- .getResult ();
150
- if (result .hasErrors ()) {
151
- errorMessage = result .getErrors ().get (0 ).getMessage ();
152
- return ;
153
- }
154
- if (result .hasWarnings ()) {
155
- errorMessage = result .getWarnings ().get (0 ).getMessage ();
156
- return ;
133
+ if (getPanel ().isCakePHP3Enabled ()) {
134
+ CakePHP3CustomizerValidator validator = new CakePHP3CustomizerValidator ();
135
+ FileObject srcDir = FileUtil .toFileObject (sourceDirectory );
136
+ String rootPath = getPanel ().getRoot ();
137
+ String srcPath = String .format ("%s/%s" , rootPath , getPanel ().getSrc ()).replaceAll ("/+" , "/" );
138
+ String wwwRootPath = String .format ("%s/%s" , rootPath , getPanel ().getWWWRoot ()).replaceAll ("/+" , "/" );
139
+ String cssPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getCss ()).replaceAll ("/+" , "/" );
140
+ String imgPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getImg ()).replaceAll ("/+" , "/" );
141
+ String jsPath = String .format ("%s/%s" , wwwRootPath , getPanel ().getJs ()).replaceAll ("/+" , "/" );
142
+ String dotcakePath = getPanel ().getDotcakePath ();
143
+ ValidationResult result = validator .validateRootPath (srcDir , rootPath )
144
+ .validateSrc (srcDir , srcPath )
145
+ .validateWWWRoot (srcDir , wwwRootPath )
146
+ .validateCss (srcDir , cssPath )
147
+ .validateImg (srcDir , imgPath )
148
+ .validateJs (srcDir , jsPath )
149
+ .validateDotcake (srcDir , dotcakePath )
150
+ .getResult ();
151
+ if (result .hasErrors ()) {
152
+ errorMessage = result .getErrors ().get (0 ).getMessage ();
153
+ return ;
154
+ }
155
+ if (result .hasWarnings ()) {
156
+ errorMessage = result .getWarnings ().get (0 ).getMessage ();
157
+ return ;
158
+ }
157
159
}
158
160
159
161
// everything ok
0 commit comments