|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule; |
|
4
|
|
|
|
|
5
|
|
|
use Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule\ApiController\ApiHooks; |
|
6
|
|
|
use Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule\ApiController\ExecuteApi; |
|
7
|
|
|
|
|
8
|
|
|
class ApiController extends Controller |
|
|
|
|
|
|
9
|
|
|
{ |
|
10
|
|
|
use ApiHooks; |
|
11
|
|
|
|
|
12
|
|
|
var $method_type; |
|
13
|
|
|
|
|
14
|
|
|
var $permalink; |
|
15
|
|
|
|
|
16
|
|
|
var $hook_api_status; |
|
17
|
|
|
|
|
18
|
|
|
var $hook_api_message; |
|
19
|
|
|
|
|
20
|
|
|
var $validate = false; |
|
21
|
|
|
|
|
22
|
|
|
var $last_id_tmp = []; |
|
23
|
|
|
|
|
24
|
|
|
public function hook_api_status($boolean) |
|
25
|
|
|
{ |
|
26
|
|
|
$this->hook_api_status = $boolean; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
public function hook_api_message($message) |
|
30
|
|
|
{ |
|
31
|
|
|
$this->hook_api_message = $message; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function execute_api() |
|
35
|
|
|
{ |
|
36
|
|
|
(new ExecuteApi($this))->execute(); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @param $name |
|
41
|
|
|
* @param $row_assign |
|
42
|
|
|
* @return array |
|
43
|
|
|
*/ |
|
44
|
|
|
/*private function handleFile($name, $row_assign) |
|
45
|
|
|
{ |
|
46
|
|
|
if (! Request::hasFile($name)) { |
|
47
|
|
|
return; |
|
48
|
|
|
} |
|
49
|
|
|
$file = Request::file($name); |
|
50
|
|
|
$ext = $file->getClientOriginalExtension(); |
|
51
|
|
|
|
|
52
|
|
|
//Create Directory Monthly |
|
53
|
|
|
Storage::makeDirectory(date('Y-m')); |
|
54
|
|
|
|
|
55
|
|
|
//Move file to storage |
|
56
|
|
|
$filename = md5(str_random(5)).'.'.$ext; |
|
57
|
|
|
if ($file->move(storage_path('app'.DIRECTORY_SEPARATOR.date('Y-m')), $filename)) { |
|
58
|
|
|
$v = 'uploads/'.date('Y-m').'/'.$filename; |
|
59
|
|
|
$row_assign[$name] = $v; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
return $row_assign; |
|
63
|
|
|
}*/ |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param $value |
|
67
|
|
|
* @param $uploads_format_candidate |
|
68
|
|
|
* @param $row_assign |
|
69
|
|
|
* @param $name |
|
70
|
|
|
* @return mixed |
|
71
|
|
|
*/ |
|
72
|
|
|
/* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name) |
|
73
|
|
|
{ |
|
74
|
|
|
$filedata = base64_decode($value); |
|
75
|
|
|
$f = finfo_open(); |
|
76
|
|
|
$mime_type = finfo_buffer($f, $filedata, FILEINFO_MIME_TYPE); |
|
77
|
|
|
@$mime_type = explode('/', $mime_type); |
|
78
|
|
|
@$mime_type = $mime_type[1]; |
|
79
|
|
|
|
|
80
|
|
|
if ($mime_type && in_array($mime_type, $uploads_format_candidate)) { |
|
81
|
|
|
Storage::makeDirectory(date('Y-m')); |
|
82
|
|
|
$filename = md5(str_random(5)).'.'.$mime_type; |
|
83
|
|
|
if (file_put_contents(storage_path('app'.DIRECTORY_SEPARATOR.date('Y-m')).'/'.$filename, $filedata)) { |
|
84
|
|
|
$v = 'uploads/'.date('Y-m').'/'.$filename; |
|
85
|
|
|
$row_assign[$name] = $v; |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
return $row_assign; |
|
90
|
|
|
}*/ |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
|
|
94
|
|
|
|
|
95
|
|
|
|
|
96
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths