Skip to content

Commit 8dba2d0

Browse files
committed
Merge pull request #3 from Yallee/master
'/' in paths replaced with DIRECTORY_SEPARATOR
2 parents 92d2f08 + e397884 commit 8dba2d0

File tree

8 files changed

+41
-41
lines changed

8 files changed

+41
-41
lines changed

src/Builders/ControllerBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function build()
2929
{
3030
$cache = new QuickCache();
3131
$cached = $cache->get('fieldsinfo');
32-
$this->template = __DIR__ . '/../Templates/controller';
32+
$this->template = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'controller';
3333
$this->name = $cached['name'];
3434
$this->fields = $cached['fields'];
3535
$this->relationships = $cached['relationships'];
@@ -239,11 +239,11 @@ private function names()
239239
*/
240240
private function publish($template)
241241
{
242-
if (!file_exists(app_path('Http/Controllers/Admin'))) {
243-
mkdir(app_path('Http/Controllers/Admin'));
244-
chmod(app_path('Http/Controllers/Admin'), 0777);
242+
if (!file_exists(app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Admin'))) {
243+
mkdir(app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Admin'));
244+
chmod(app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Admin'), 0777);
245245
}
246-
file_put_contents(app_path('Http/Controllers/Admin/' . $this->fileName), $template);
246+
file_put_contents(app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Admin'. DIRECTORY_SEPARATOR . $this->fileName), $template);
247247
}
248248

249249
}

src/Builders/MigrationBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function build()
2525
{
2626
$cache = new QuickCache();
2727
$cached = $cache->get('fieldsinfo');
28-
$this->template = __DIR__ . '/../Templates/migration';
28+
$this->template = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'migration';
2929
$this->name = $cached['name'];
3030
$this->fields = $cached['fields'];
3131
$this->soft = $cached['soft_delete'];

src/Builders/ModelBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function build()
3131
{
3232
$cache = new QuickCache();
3333
$cached = $cache->get('fieldsinfo');
34-
$this->template = __DIR__ . '/../Templates/model';
34+
$this->template = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'model';
3535
$this->name = $cached['name'];
3636
$this->fields = $cached['fields'];
3737
$this->soft = $cached['soft_delete'];

src/Builders/RequestBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function build()
2525
{
2626
$cache = new QuickCache();
2727
$cached = $cache->get('fieldsinfo');
28-
$this->template = __DIR__ . '/../Templates/request';
28+
$this->template = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'request';
2929
$this->name = $cached['name'];
3030
$this->fields = $cached['fields'];
3131
$this->soft = $cached['soft_delete'];
@@ -146,8 +146,8 @@ private function names()
146146
*/
147147
private function publish($template)
148148
{
149-
file_put_contents(app_path('Http/Requests/Create' . $this->fileName), $template[0]);
150-
file_put_contents(app_path('Http/Requests/Update' . $this->fileName), $template[1]);
149+
file_put_contents(app_path('Http'. DIRECTORY_SEPARATOR .'Requests'. DIRECTORY_SEPARATOR .'Create' . $this->fileName), $template[0]);
150+
file_put_contents(app_path('Http'. DIRECTORY_SEPARATOR .'Requests'. DIRECTORY_SEPARATOR .'Update' . $this->fileName), $template[1]);
151151
}
152152

153153
}

src/Builders/ViewsBuilder.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function build()
3434
$cache = new QuickCache();
3535
$cached = $cache->get('fieldsinfo');
3636
$this->template = [
37-
0 => __DIR__ . '/../Templates/view_index',
38-
1 => __DIR__ . '/../Templates/view_edit',
39-
2 => __DIR__ . '/../Templates/view_create',
37+
0 => __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'view_index',
38+
1 => __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'view_edit',
39+
2 => __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'view_create',
4040
];
4141
$this->name = $cached['name'];
4242
$this->fields = $cached['fields'];
@@ -162,7 +162,7 @@ private function buildEditForm()
162162
if ($field->type == 'relationship') {
163163
$label = $field->relationship_name . '_id';
164164
}
165-
$temp = file_get_contents(__DIR__ . '/../Templates/fields/' . $field->type);
165+
$temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'fields'. DIRECTORY_SEPARATOR . $field->type);
166166
$temp = str_replace([
167167
'old(\'$LABEL$\')',
168168
'$LABEL$',
@@ -200,7 +200,7 @@ private function buildCreateForm()
200200
if ($field->type == 'relationship') {
201201
$key = $field->relationship_name . '_id';
202202
}
203-
$temp = file_get_contents(__DIR__ . '/../Templates/fields/' . $field->type);
203+
$temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Templates'. DIRECTORY_SEPARATOR .'fields'. DIRECTORY_SEPARATOR . $field->type);
204204
$temp = str_replace([
205205
'$LABEL$',
206206
'$TITLE$',
@@ -238,12 +238,12 @@ private function names()
238238
*/
239239
private function publish($template)
240240
{
241-
if (!file_exists(base_path('resources/views/admin/' . $this->path))) {
242-
mkdir(base_path('resources/views/admin/' . $this->path));
241+
if (!file_exists(base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'. DIRECTORY_SEPARATOR . $this->path))) {
242+
mkdir(base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'. DIRECTORY_SEPARATOR . $this->path));
243243
}
244-
file_put_contents(base_path('resources/views/admin/' . $this->path . '/index.blade.php'), $template[0]);
245-
file_put_contents(base_path('resources/views/admin/' . $this->path . '/edit.blade.php'), $template[1]);
246-
file_put_contents(base_path('resources/views/admin/' . $this->path . '/create.blade.php'), $template[2]);
244+
file_put_contents(base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'. DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .'index.blade.php'), $template[0]);
245+
file_put_contents(base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'. DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .'edit.blade.php'), $template[1]);
246+
file_put_contents(base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'. DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .'create.blade.php'), $template[2]);
247247
}
248248

249249
}

src/Cache/QuickCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class QuickCache
1111

1212
public function __construct()
1313
{
14-
$this->cacheDir = storage_path('framework/cache/');
14+
$this->cacheDir = storage_path('framework'. DIRECTORY_SEPARATOR .'cache'. DIRECTORY_SEPARATOR);
1515
$this->files = new Filesystem();
1616
if (!file_exists($this->cacheDir)) {
1717
mkdir($this->cacheDir);

src/Commands/QuickAdminInstall.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function handle()
5454
*/
5555
public function copyInitial()
5656
{
57-
copy(__DIR__ . '/../Migrations/2015_10_10_000000_create_roles_table',
58-
database_path('migrations/2015_10_10_000000_create_roles_table.php'));
59-
copy(__DIR__ . '/../Migrations/2015_10_10_000000_update_users_table',
60-
database_path('migrations/2015_10_10_000000_update_users_table.php'));
61-
copy(__DIR__ . '/../Migrations/2015_10_10_000000_create_cruds_table',
62-
database_path('migrations/2015_10_10_000000_create_cruds_table.php'));
63-
copy(__DIR__ . '/../Models/publish/User', app_path('User.php'));
57+
copy(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_create_roles_table',
58+
database_path('migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_create_roles_table.php'));
59+
copy(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_update_users_table',
60+
database_path('migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_update_users_table.php'));
61+
copy(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_create_cruds_table',
62+
database_path('migrations'. DIRECTORY_SEPARATOR .'2015_10_10_000000_create_cruds_table.php'));
63+
copy(__DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'Models'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'User', app_path('User.php'));
6464
$this->info('Migrations were transferred successfully');
6565
}
6666

src/QuickadminServiceProvider.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ class QuickadminServiceProvider extends ServiceProvider
1717
public function boot()
1818
{
1919
// Register vendor views
20-
$this->loadViewsFrom(__DIR__ . '/Views/qa', 'qa');
21-
$this->loadViewsFrom(__DIR__ . '/Views/templates', 'tpl');
20+
$this->loadViewsFrom(__DIR__ . DIRECTORY_SEPARATOR . 'Views'. DIRECTORY_SEPARATOR .'qa', 'qa');
21+
$this->loadViewsFrom(__DIR__ . DIRECTORY_SEPARATOR . 'Views'. DIRECTORY_SEPARATOR .'templates', 'tpl');
2222
/* Publish master templates */
2323
$this->publishes([
24-
__DIR__ . '/Config/quickadmin.php' => config_path('quickadmin.php'),
25-
__DIR__ . '/Views/admin' => base_path('resources/views/admin'),
26-
__DIR__ . '/Views/auth' => base_path('resources/views/auth'),
27-
__DIR__ . '/Views/emails' => base_path('resources/views/emails'),
28-
__DIR__ . '/Public/quickadmin' => base_path('public/quickadmin'),
29-
__DIR__ . '/Controllers/publish/UsersController' => app_path('Http/Controllers/UsersController.php'),
30-
__DIR__ . '/Controllers/publish/Controller' => app_path('Http/Controllers/Controller.php'),
31-
__DIR__ . '/Controllers/publish/PasswordController' => app_path('Http/Controllers/Auth/PasswordController.php'),
32-
__DIR__ . '/Controllers/publish/FileUploadTrait' => app_path('Http/Controllers/Traits/FileUploadTrait.php'),
33-
__DIR__ . '/Models/publish/Role' => app_path('Role.php'),
24+
__DIR__ . DIRECTORY_SEPARATOR . 'Config'. DIRECTORY_SEPARATOR .'quickadmin.php' => config_path('quickadmin.php'),
25+
__DIR__ . DIRECTORY_SEPARATOR . 'Views'. DIRECTORY_SEPARATOR .'admin' => base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'admin'),
26+
__DIR__ . DIRECTORY_SEPARATOR . 'Views'. DIRECTORY_SEPARATOR .'auth' => base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'auth'),
27+
__DIR__ . DIRECTORY_SEPARATOR . 'Views'. DIRECTORY_SEPARATOR .'emails' => base_path('resources'. DIRECTORY_SEPARATOR .'views'. DIRECTORY_SEPARATOR .'emails'),
28+
__DIR__ . DIRECTORY_SEPARATOR . 'Public'. DIRECTORY_SEPARATOR .'quickadmin' => base_path('public'. DIRECTORY_SEPARATOR .'quickadmin'),
29+
__DIR__ . DIRECTORY_SEPARATOR . 'Controllers'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'UsersController' => app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'UsersController.php'),
30+
__DIR__ . DIRECTORY_SEPARATOR . 'Controllers'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'Controller' => app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Controller.php'),
31+
__DIR__ . DIRECTORY_SEPARATOR . 'Controllers'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'PasswordController' => app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Auth'. DIRECTORY_SEPARATOR .'PasswordController.php'),
32+
__DIR__ . DIRECTORY_SEPARATOR . 'Controllers'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'FileUploadTrait' => app_path('Http'. DIRECTORY_SEPARATOR .'Controllers'. DIRECTORY_SEPARATOR .'Traits'. DIRECTORY_SEPARATOR .'FileUploadTrait.php'),
33+
__DIR__ . DIRECTORY_SEPARATOR . 'Models'. DIRECTORY_SEPARATOR .'publish'. DIRECTORY_SEPARATOR .'Role' => app_path('Role.php'),
3434
], 'quickadmin');
3535

3636
// Register commands
@@ -41,7 +41,7 @@ public function boot()
4141
'quickadmin:install'
4242
]);
4343
// Routing
44-
include __DIR__ . '/routes.php';
44+
include __DIR__ . DIRECTORY_SEPARATOR .'routes.php';
4545
}
4646

4747
/**

0 commit comments

Comments
 (0)