@@ -70,6 +70,13 @@ public function setClass($classname)
70
70
*/
71
71
public function setNamespace ($ namespace )
72
72
{
73
+ if (DIRECTORY_SEPARATOR == '/ ' ) {
74
+ $ namespace = str_replace ('/ ' , '\\' , $ namespace );
75
+ }
76
+
77
+ // if (DIRECTORY_SEPARATOR == '\\') {
78
+ // // windows
79
+ // }
73
80
$ this ->namespace = $ namespace ;
74
81
return $ this ;
75
82
}
@@ -98,9 +105,9 @@ public function setPath($path)
98
105
public function MakeController ($ resource =false )
99
106
{
100
107
if ($ resource )
101
- $ filename = __DIR__ .'\..\ stubs\ module\ Controllers\ ModuleRController.stub ' ;
108
+ $ filename = __DIR__ .'/../ stubs/ module/ Controllers/ ModuleRController.stub ' ;
102
109
else
103
- $ filename = __DIR__ .'\..\ stubs\ module\ Controllers\ ModuleController.stub ' ;
110
+ $ filename = __DIR__ .'/../ stubs/ module/ Controllers/ ModuleController.stub ' ;
104
111
105
112
$ contents = File::get ($ filename );
106
113
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Controllers ' );
@@ -118,7 +125,7 @@ public function MakeController($resource=false)
118
125
119
126
public function MakeModel ()
120
127
{
121
- $ filename = __DIR__ .'\..\ stubs\ module\ Models\ Model.stub ' ;
128
+ $ filename = __DIR__ .'/../ stubs/ module/ Models/ Model.stub ' ;
122
129
123
130
$ contents = File::get ($ filename );
124
131
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Models ' );
@@ -139,14 +146,14 @@ public function MakeMigration($create=false,$table=false)
139
146
{
140
147
if ($ create ){
141
148
$ this ->tablename = $ create ;
142
- $ filename = __DIR__ .'\..\ stubs\ module\ Database\ Migration\ createmigtration.stub ' ;
149
+ $ filename = __DIR__ .'/../ stubs/ module/ Database/ Migration/ createmigtration.stub ' ;
143
150
}
144
151
elseif ($ table ) {
145
152
$ this ->tablename = $ table ;
146
- $ filename = __DIR__ .'\..\ stubs\ module\ Database\ Migration\ tablemigration.stub ' ;
153
+ $ filename = __DIR__ .'/../ stubs/ module/ Database/ Migration/ tablemigration.stub ' ;
147
154
}
148
155
else
149
- $ filename = __DIR__ .'\..\ stubs\ module\ Database\ Migration\ Migration.stub ' ;
156
+ $ filename = __DIR__ .'/../ stubs/ module/ Database/ Migration/ Migration.stub ' ;
150
157
151
158
$ contents = File::get ($ filename );
152
159
$ this ->temprory = $ this ->classname ;
@@ -166,7 +173,7 @@ public function MakeMigration($create=false,$table=false)
166
173
*/
167
174
public function MakeCommand ()
168
175
{
169
- $ filename = __DIR__ .'\..\ stubs\ module\ Console\ Commands\ command.stub ' ;
176
+ $ filename = __DIR__ .'/../ stubs/ module/ Console/ Commands/ command.stub ' ;
170
177
171
178
$ contents = File::get ($ filename );
172
179
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Console ' .DIRECTORY_SEPARATOR .'Commands ' );
@@ -184,7 +191,7 @@ public function MakeCommand()
184
191
*/
185
192
public function MakeEvent ()
186
193
{
187
- $ filename = __DIR__ .'\..\ stubs\ module\ Events\ event.stub ' ;
194
+ $ filename = __DIR__ .'/../ stubs/ module/ Events/ event.stub ' ;
188
195
189
196
$ contents = File::get ($ filename );
190
197
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Events ' );
@@ -202,7 +209,7 @@ public function MakeEvent()
202
209
*/
203
210
public function MakeJob ()
204
211
{
205
- $ filename = __DIR__ .'\..\ stubs\ module\ Jobs\ job.stub ' ;
212
+ $ filename = __DIR__ .'/../ stubs/ module/ Jobs/ job.stub ' ;
206
213
207
214
$ contents = File::get ($ filename );
208
215
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Jobs ' );
@@ -220,7 +227,7 @@ public function MakeJob()
220
227
*/
221
228
public function MakeListener ()
222
229
{
223
- $ filename = __DIR__ .'\..\ stubs\ module\ Listeners\ listener.stub ' ;
230
+ $ filename = __DIR__ .'/../ stubs/ module/ Listeners/ listener.stub ' ;
224
231
225
232
$ contents = File::get ($ filename );
226
233
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Listeners ' );
@@ -240,7 +247,7 @@ public function MakeListener()
240
247
*/
241
248
public function MakeMail ($ view ='view.name ' ,$ markdown =false )
242
249
{
243
- $ filename = __DIR__ .'\..\ stubs\ module\ Mail\ mail.stub ' ;
250
+ $ filename = __DIR__ .'/../ stubs/ module/ Mail/ mail.stub ' ;
244
251
245
252
$ contents = File::get ($ filename );
246
253
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Mail ' );
@@ -264,7 +271,7 @@ public function MakeMail($view='view.name',$markdown=false)
264
271
*/
265
272
public function MakeNotification ($ markdown =false )
266
273
{
267
- $ filename = __DIR__ .'\..\ stubs\ module\ Notifications\ notification.stub ' ;
274
+ $ filename = __DIR__ .'/../ stubs/ module/ Notifications/ notification.stub ' ;
268
275
269
276
$ contents = File::get ($ filename );
270
277
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Notifications ' );
@@ -292,7 +299,7 @@ public function MakeNotification($markdown=false)
292
299
*/
293
300
public function MakeMiddleware ()
294
301
{
295
- $ filename = __DIR__ .'\..\ stubs\ module\ Middleware\ middleware.stub ' ;
302
+ $ filename = __DIR__ .'/../ stubs/ module/ Middleware/ middleware.stub ' ;
296
303
297
304
$ contents = File::get ($ filename );
298
305
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Middleware ' );
@@ -310,7 +317,7 @@ public function MakeMiddleware()
310
317
*/
311
318
public function MakeProvider ()
312
319
{
313
- $ filename = __DIR__ .'\..\ stubs\ module\ Providers\ provider.stub ' ;
320
+ $ filename = __DIR__ .'/../ stubs/ module/ Providers/ provider.stub ' ;
314
321
315
322
$ contents = File::get ($ filename );
316
323
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Providers ' );
@@ -329,7 +336,7 @@ public function MakeProvider()
329
336
*/
330
337
public function MakeSeeder ()
331
338
{
332
- $ filename = __DIR__ .'\..\ stubs\ module\ Database\ Seeds\ seeder.stub ' ;
339
+ $ filename = __DIR__ .'/../ stubs/ module/ Database/ Seeds/ seeder.stub ' ;
333
340
334
341
$ contents = File::get ($ filename );
335
342
$ this ->setNamespace ('cms ' .DIRECTORY_SEPARATOR .Cms::getModulesPath ().DIRECTORY_SEPARATOR .Cms::getCurrentTheme ().DIRECTORY_SEPARATOR .$ this ->modulename .DIRECTORY_SEPARATOR .'Database ' .DIRECTORY_SEPARATOR .'seeds ' );
@@ -347,7 +354,7 @@ public function MakeSeeder()
347
354
*/
348
355
public function makeModuleJson ()
349
356
{
350
- $ filename = __DIR__ .'\..\ stubs\ module\ module.stub ' ;
357
+ $ filename = __DIR__ .'/../ stubs/ module/ module.stub ' ;
351
358
352
359
$ contents = File::get ($ filename );
353
360
$ contents = $ this ->changeClass ($ contents );
@@ -363,7 +370,7 @@ public function makeModuleJson()
363
370
*/
364
371
public function makeModuleComposer ()
365
372
{
366
- $ filename = __DIR__ .'\..\ stubs\ module\ composer.stub ' ;
373
+ $ filename = __DIR__ .'/../ stubs/ module/ composer.stub ' ;
367
374
368
375
$ contents = File::get ($ filename );
369
376
$ contents = $ this ->changeClass ($ contents );
@@ -462,4 +469,4 @@ protected function dashesToCamelCase($string)
462
469
return $ str ;
463
470
}
464
471
465
- }
472
+ }
0 commit comments