@@ -34,11 +34,11 @@ public function __construct()
3434 public function index (Request $ request , Response $ response ) : Response
3535 {
3636 $ tokens = [];
37- $ tokens_list = Filesystem::listContents (PATH ['project ' ] . '/tokens/folders/ ' );
37+ $ tokens_list = Filesystem::listContents (PATH ['project ' ] . '/tokens/media/ folders/ ' );
3838
3939 if (count ($ tokens_list ) > 0 ) {
4040 foreach ($ tokens_list as $ token ) {
41- if ($ token ['type ' ] == 'dir ' && Filesystem::has (PATH ['project ' ] . '/tokens/folders/ ' . $ token ['dirname ' ] . '/token.yaml ' )) {
41+ if ($ token ['type ' ] == 'dir ' && Filesystem::has (PATH ['project ' ] . '/tokens/media/ folders/ ' . $ token ['dirname ' ] . '/token.yaml ' )) {
4242 $ tokens [] = $ token ;
4343 }
4444 }
@@ -117,7 +117,7 @@ public function addProcess(Request $request, Response $response) : Response
117117 // Generate API token
118118 $ api_token = bin2hex (random_bytes (16 ));
119119
120- $ api_token_dir_path = PATH ['project ' ] . '/tokens/folders/ ' . $ api_token ;
120+ $ api_token_dir_path = PATH ['project ' ] . '/tokens/media/ folders/ ' . $ api_token ;
121121 $ api_token_file_path = $ api_token_dir_path . '/token.yaml ' ;
122122
123123 if (! Filesystem::has ($ api_token_file_path )) {
@@ -133,7 +133,7 @@ public function addProcess(Request $request, Response $response) : Response
133133 // Create API Token account
134134 if (Filesystem::write (
135135 $ api_token_file_path ,
136- flextype ('yaml ' )->encode ([
136+ flextype ('serializers ' )-> yaml ( )->encode ([
137137 'title ' => $ post_data ['title ' ],
138138 'icon ' => $ post_data ['icon ' ],
139139 'limit_calls ' => (int ) $ post_data ['limit_calls ' ],
@@ -170,7 +170,7 @@ public function addProcess(Request $request, Response $response) : Response
170170 public function edit (Request $ request , Response $ response ) : Response
171171 {
172172 $ token = $ request ->getQueryParams ()['token ' ];
173- $ token_data = flextype ('yaml ' )->decode (Filesystem::read (PATH ['project ' ] . '/tokens/folders/ ' . $ token . '/token.yaml ' ));
173+ $ token_data = flextype ('serializers ' )->yaml ()-> decode (Filesystem::read (PATH ['project ' ] . '/tokens/media /folders/ ' . $ token . '/token.yaml ' ));
174174
175175 return flextype ('twig ' )->render (
176176 $ response ,
@@ -209,14 +209,14 @@ public function editProcess(Request $request, Response $response) : Response
209209 // Get POST data
210210 $ post_data = $ request ->getParsedBody ();
211211
212- $ api_token_dir_path = PATH ['project ' ] . '/tokens/folders/ ' . $ post_data ['token ' ];
212+ $ api_token_dir_path = PATH ['project ' ] . '/tokens/media/ folders/ ' . $ post_data ['token ' ];
213213 $ api_token_file_path = $ api_token_dir_path . '/ ' . 'token.yaml ' ;
214214
215215 // Update API Token File
216216 if (Filesystem::has ($ api_token_file_path )) {
217217 if (Filesystem::write (
218218 $ api_token_file_path ,
219- flextype ('yaml ' )->encode ([
219+ flextype ('serializers ' )-> yaml ( )->encode ([
220220 'title ' => $ post_data ['title ' ],
221221 'icon ' => $ post_data ['icon ' ],
222222 'limit_calls ' => (int ) $ post_data ['limit_calls ' ],
@@ -249,7 +249,7 @@ public function deleteProcess(Request $request, Response $response) : Response
249249 // Get POST data
250250 $ post_data = $ request ->getParsedBody ();
251251
252- $ api_token_dir_path = PATH ['project ' ] . '/tokens/folders/ ' . $ post_data ['token ' ];
252+ $ api_token_dir_path = PATH ['project ' ] . '/tokens/media/ folders/ ' . $ post_data ['token ' ];
253253
254254 if (Filesystem::deleteDir ($ api_token_dir_path )) {
255255 flextype ('flash ' )->addMessage ('success ' , __ ('admin_message_folders_api_token_deleted ' ));
0 commit comments