@artilingo/artiframe-cli 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core-stubs/bin/SystemMethod.php +600 -521
- package/core-stubs/bin/ViewMethod.php +591 -393
- package/core-stubs/docs/de.html +853 -1172
- package/core-stubs/docs/en.html +585 -904
- package/core-stubs/docs/es.html +934 -1253
- package/core-stubs/docs/fr.html +913 -1232
- package/core-stubs/docs/tr.html +4212 -5021
- package/package.json +1 -1
- package/src/App.php +38 -0
- package/src/Commands/AddCommand.php +1 -1
- package/src/Commands/AuthCommand.php +219 -0
- package/src/Commands/IssuesCommand.php +174 -0
- package/src/Commands/ListCommand.php +2 -1
- package/src/Commands/MakeApiCommand.php +1 -1
- package/src/Commands/MakeClassCommand.php +1 -1
- package/src/Commands/MakeViewCommand.php +1 -1
- package/src/Commands/NewProjectCommand.php +37 -25
- package/src/Commands/RemoveCommand.php +21 -10
- package/src/Commands/ServeCommand.php +29 -9
- package/src/Commands/SuggestCommand.php +143 -0
- package/src/Commands/TableCommand.php +2 -1
- package/src/Commands/UpgradeCommand.php +209 -0
- package/src/Commands/VersionCommand.php +2 -1
- package/src/Lang/de.php +9 -1
- package/src/Lang/en.php +8 -0
- package/src/Lang/es.php +9 -1
- package/src/Lang/fr.php +8 -0
- package/src/Lang/tr.php +10 -2
- package/src/Services/Safeguard.php +25 -0
- package/stubs/service/image.stub +334 -334
- package/stubs/service/iyzico.stub +637 -637
- package/stubs/service/jwt.stub +312 -312
- package/stubs/service/phpmailer.stub +143 -143
- package/stubs/service/pusher.stub +232 -232
- package/stubs/service/qrcode.stub +169 -169
- package/stubs/service/redis.stub +361 -361
- package/stubs/service/s3.stub +377 -377
- package/stubs/service/sentry.stub +76 -106
- package/stubs/service/stripe.stub +526 -526
- package/stubs/service/twilio.stub +361 -361
- package/core-stubs/app/R2Manager.php +0 -130
package/core-stubs/docs/fr.html
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
|
|
1
|
+
HTML
|
|
4
2
|
<html lang="fr">
|
|
5
3
|
<head>
|
|
6
4
|
<meta charset="utf-8"/>
|
|
7
5
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
|
8
|
-
<title>
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
6
|
+
<title>Documentation officielle du développeur — Framework PHP ArtiFrame</title>
|
|
7
|
+
<meta content="ArtiFrame framework kullanım rehberi ve API referansları. En hızlı ve güvenli PHP framework'ünü öğrenin." name="description"/>
|
|
8
|
+
<meta content="artiframe, artiframe framework, php framework, fast php framework, secure php framework, artilingo framework, php, framework, mvc" name="keywords"/>
|
|
9
|
+
<meta content="Artilingo" name="author"/>
|
|
10
|
+
Graphique ouvert / Médias sociaux
|
|
11
|
+
<meta content="Resmi Geliştirici Dokümantasyonu — ArtiFrame PHP Framework" property="og:title"/>
|
|
12
|
+
<meta content="ArtiFrame framework kullanım rehberi ve API referansları. En hızlı ve güvenli PHP framework'ünü öğrenin." property="og:description"/>
|
|
13
|
+
<meta content="website" property="og:type"/>
|
|
14
|
+
<meta content="https://artiframe.artilingo.com/docs/tr.html" property="og:url"/>
|
|
15
|
+
<meta content="ArtiFrame" property="og:site_name"/>
|
|
16
|
+
<link href="../../public/assets/images/favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/>
|
|
17
|
+
<link href="../../public/assets/images/favicon.svg" rel="icon" type="image/svg+xml"/>
|
|
18
|
+
<link href="../../public/assets/images/favicon.ico" rel="shortcut icon"/>
|
|
19
|
+
<link href="../../public/assets/images/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"/>
|
|
20
|
+
<link href="../../public/assets/images/site.webmanifest" rel="manifest"/>
|
|
16
21
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"/>
|
|
17
22
|
<style>
|
|
18
23
|
:root {
|
|
@@ -33,9 +38,7 @@
|
|
|
33
38
|
--sidebar-w: 280px;
|
|
34
39
|
}
|
|
35
40
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
36
|
-
|
|
37
41
|
html { scroll-behavior: smooth; }
|
|
38
|
-
|
|
39
42
|
body {
|
|
40
43
|
font-family: 'Inter', sans-serif;
|
|
41
44
|
background: var(--bg);
|
|
@@ -43,7 +46,6 @@
|
|
|
43
46
|
line-height: 1.75;
|
|
44
47
|
display: flex;
|
|
45
48
|
}
|
|
46
|
-
|
|
47
49
|
/* ---- SIDEBAR ---- */
|
|
48
50
|
.sidebar {
|
|
49
51
|
width: var(--sidebar-w);
|
|
@@ -57,7 +59,6 @@
|
|
|
57
59
|
display: flex;
|
|
58
60
|
flex-direction: column;
|
|
59
61
|
}
|
|
60
|
-
|
|
61
62
|
.sb-logo {
|
|
62
63
|
padding: 0 22px 24px;
|
|
63
64
|
border-bottom: 1px solid var(--border);
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
color: var(--muted);
|
|
76
77
|
margin-top: 3px;
|
|
77
78
|
}
|
|
78
|
-
|
|
79
79
|
.sb-subcat {
|
|
80
80
|
padding: 12px 22px 4px;
|
|
81
81
|
font-size: 0.62rem;
|
|
@@ -107,7 +107,6 @@
|
|
|
107
107
|
background: var(--green-dim);
|
|
108
108
|
border-left-color: var(--green);
|
|
109
109
|
}
|
|
110
|
-
|
|
111
110
|
/* ---- MAIN ---- */
|
|
112
111
|
.content {
|
|
113
112
|
margin-left: var(--sidebar-w);
|
|
@@ -115,7 +114,6 @@
|
|
|
115
114
|
max-width: 1100px;
|
|
116
115
|
width: 100%;
|
|
117
116
|
}
|
|
118
|
-
|
|
119
117
|
/* ---- TYPOGRAPHY ---- */
|
|
120
118
|
h1 { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 16px; }
|
|
121
119
|
h1 span { color: var(--green); }
|
|
@@ -133,10 +131,8 @@
|
|
|
133
131
|
li { margin-bottom: 8px; }
|
|
134
132
|
a { color: var(--green-light); text-decoration: none; }
|
|
135
133
|
a:hover { text-decoration: underline; }
|
|
136
|
-
|
|
137
134
|
/* ---- LEAD ---- */
|
|
138
135
|
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 0; max-width: 720px; }
|
|
139
|
-
|
|
140
136
|
/* ---- BADGES ---- */
|
|
141
137
|
.badge { font-size: 0.68rem; padding: 3px 8px; border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
|
|
142
138
|
.b-view { background: rgba(88,166,255,.12); color: #58a6ff; border: 1px solid rgba(88,166,255,.3); }
|
|
@@ -144,7 +140,6 @@
|
|
|
144
140
|
.b-cli { background: rgba(0,200,140,.12); color: #00c88c; border: 1px solid rgba(0,200,140,.3); }
|
|
145
141
|
.b-core { background: rgba(227,179,65,.12); color: #e3b341; border: 1px solid rgba(227,179,65,.3); }
|
|
146
142
|
.b-sec { background: rgba(248,81,73,.12); color: #f85149; border: 1px solid rgba(248,81,73,.3); }
|
|
147
|
-
|
|
148
143
|
/* ---- CODE ---- */
|
|
149
144
|
pre {
|
|
150
145
|
background: var(--code-bg);
|
|
@@ -172,7 +167,6 @@
|
|
|
172
167
|
.cm { color: #8b949e; } /* comment */
|
|
173
168
|
.nu { color: #79c0ff; } /* number / bool */
|
|
174
169
|
.var { color: #ffa657; } /* variable */
|
|
175
|
-
|
|
176
170
|
/* ---- CARDS ---- */
|
|
177
171
|
.card {
|
|
178
172
|
background: var(--surface);
|
|
@@ -182,21 +176,17 @@
|
|
|
182
176
|
margin-bottom: 20px;
|
|
183
177
|
}
|
|
184
178
|
.card.highlight { border-left: 3px solid var(--green); }
|
|
185
|
-
|
|
186
179
|
/* ---- ALERTS ---- */
|
|
187
180
|
.alert { padding: 18px 22px; border-radius: 8px; margin: 24px 0; border-left: 3px solid; font-size: 0.95rem; }
|
|
188
181
|
.a-info { background: rgba(88,166,255,.08); border-color: var(--blue); color: #93c5fd; }
|
|
189
182
|
.a-warn { background: rgba(227,179,65,.08); border-color: var(--yellow); color: #fbbf24; }
|
|
190
183
|
.a-danger { background: rgba(248,81,73,.08); border-color: var(--red); color: #fca5a5; }
|
|
191
184
|
.a-success { background: rgba(0,157,108,.08); border-color: var(--green); color: #6ee7b7; }
|
|
192
|
-
|
|
193
185
|
/* ---- RETURN TYPE ---- */
|
|
194
186
|
.ret { display: inline-block; font-size: 0.78rem; color: var(--green); font-family: 'JetBrains Mono', monospace; background: rgba(0,157,108,.12); padding: 3px 10px; border-radius: 4px; border: 1px solid rgba(0,157,108,.25); margin-bottom: 12px; }
|
|
195
|
-
|
|
196
187
|
/* ---- GRID ---- */
|
|
197
188
|
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
|
|
198
189
|
@media(max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
|
|
199
|
-
|
|
200
190
|
/* ---- DIR TREE ---- */
|
|
201
191
|
.tree { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 22px 24px; font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; line-height: 1.9; white-space: pre; overflow-x: auto; }
|
|
202
192
|
.tree .dir { color: var(--blue); font-weight: 600; }
|
|
@@ -204,7 +194,6 @@
|
|
|
204
194
|
.tree .note { color: #8b949e; }
|
|
205
195
|
.tree .warn { color: var(--yellow); }
|
|
206
196
|
.tree .safe { color: var(--green); }
|
|
207
|
-
|
|
208
197
|
/* ---- STEP LIST ---- */
|
|
209
198
|
.steps { counter-reset: step; list-style: none; margin: 0 0 24px; padding: 0; }
|
|
210
199
|
.steps li { counter-increment: step; display: flex; gap: 18px; margin-bottom: 20px; }
|
|
@@ -220,17 +209,14 @@
|
|
|
220
209
|
font-weight: 700; font-size: 0.85rem;
|
|
221
210
|
margin-top: 2px;
|
|
222
211
|
}
|
|
223
|
-
|
|
224
212
|
/* ---- SIGNATURE TABLE ---- */
|
|
225
213
|
.sig-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.87rem; }
|
|
226
214
|
.sig-table th { text-align: left; padding: 10px 14px; background: var(--surface-2); color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
|
|
227
215
|
.sig-table td { padding: 10px 14px; border-bottom: 1px solid rgba(48,54,61,.5); vertical-align: top; }
|
|
228
216
|
.sig-table td:first-child { font-family: 'JetBrains Mono', monospace; color: var(--yellow); white-space: nowrap; }
|
|
229
217
|
.sig-table td:last-child { color: var(--muted); }
|
|
230
|
-
|
|
231
218
|
/* ---- SCROLL SPY ---- */
|
|
232
219
|
header#page-header { margin-bottom: 52px; }
|
|
233
|
-
|
|
234
220
|
.table-wrapper {
|
|
235
221
|
width: 100%;
|
|
236
222
|
overflow-x: auto;
|
|
@@ -241,7 +227,6 @@
|
|
|
241
227
|
margin-bottom: 0; /* Override default table margin if any */
|
|
242
228
|
white-space: nowrap; /* Keep table cells on one line for better scroll */
|
|
243
229
|
}
|
|
244
|
-
|
|
245
230
|
@media(max-width: 900px) {
|
|
246
231
|
body { flex-direction: column; }
|
|
247
232
|
.sidebar { position: relative; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 20px; z-index: 10; }
|
|
@@ -255,7 +240,7 @@
|
|
|
255
240
|
</style>
|
|
256
241
|
</head>
|
|
257
242
|
<body>
|
|
258
|
-
|
|
243
|
+
BARRE LATÉRALE
|
|
259
244
|
<aside class="sidebar">
|
|
260
245
|
<div class="sb-logo">
|
|
261
246
|
<strong>ArtiFrame</strong>
|
|
@@ -268,86 +253,90 @@
|
|
|
268
253
|
<a href="#kurulum">Installation</a>
|
|
269
254
|
<a href="#dizin">Structure du répertoire</a>
|
|
270
255
|
<div class="sb-cat">Architectural</div>
|
|
256
|
+
<a href="#v2-routing">Routage sans configuration (v2.0)</a>
|
|
271
257
|
<a href="#bootstrapper">Architecture d'amorçage</a>
|
|
272
258
|
<a href="#kurallar">Ensemble de règles</a>
|
|
273
259
|
<div class="sb-cat">Outil CLI</div>
|
|
274
|
-
<a href="#cli-giris">
|
|
275
|
-
<a href="#cli-new">
|
|
276
|
-
<a href="#cli-
|
|
277
|
-
<a href="#cli-
|
|
278
|
-
<a href="#cli-
|
|
279
|
-
|
|
260
|
+
<a href="#cli-giris">Introduction à l'interface CLI</a>
|
|
261
|
+
<a href="#cli-new">nouveau</a>
|
|
262
|
+
<a href="#cli-upgrade">mise à niveau</a>
|
|
263
|
+
<a href="#cli-view">créer:afficher</a>
|
|
264
|
+
<a href="#cli-api">faire:API</a>
|
|
265
|
+
<a href="#cli-class">faire:classe</a>
|
|
266
|
+
<a href="#cli-table">tableau:</a>
|
|
280
267
|
<a href="#cli-cliv">cli v</a>
|
|
281
|
-
<a href="#cli-show">
|
|
282
|
-
<a href="#cli-list">
|
|
283
|
-
<a href="#cli-go">
|
|
284
|
-
<a href="#cli-remove">
|
|
268
|
+
<a href="#cli-show">montrer</a>
|
|
269
|
+
<a href="#cli-list">liste</a>
|
|
270
|
+
<a href="#cli-go">aller</a>
|
|
271
|
+
<a href="#cli-remove">retirer</a>
|
|
285
272
|
<a href="#cli-version">version</a>
|
|
286
|
-
<a href="#cli-mode">mode</a>
|
|
287
|
-
|
|
288
|
-
<a href="#cli-
|
|
273
|
+
<a href="#cli-mode">mode</a>
|
|
274
|
+
<a href="#cli-serve">servir</a>
|
|
275
|
+
<a href="#cli-auth">authentification</a>
|
|
276
|
+
<a href="#cli-suggest">suggérer</a>
|
|
277
|
+
<a href="#cli-add">ajouter</a>
|
|
289
278
|
<div class="sb-cat">Services intégrés</div>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
<a href="#svc-stripe">
|
|
294
|
-
<a href="#svc-jwt">
|
|
295
|
-
<a href="#svc-image">
|
|
296
|
-
<a href="#svc-s3">AWS S3
|
|
297
|
-
<a href="#svc-redis">
|
|
298
|
-
<a href="#svc-pusher">
|
|
299
|
-
<a href="#svc-twilio">
|
|
300
|
-
<a href="#svc-sentry">
|
|
279
|
+
<a href="#svc-qrcode">Code QR</a>
|
|
280
|
+
<a href="#svc-phpmailer">PHPMailer (Courrier)</a>
|
|
281
|
+
<a href="#svc-iyzico">Iyzico<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
282
|
+
<a href="#svc-stripe">Bande<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
283
|
+
<a href="#svc-jwt">J.W.T.</a>
|
|
284
|
+
<a href="#svc-image">Traitement d'images</a>
|
|
285
|
+
<a href="#svc-s3">AWS S3<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
286
|
+
<a href="#svc-redis">Rédis</a>
|
|
287
|
+
<a href="#svc-pusher">poussoir<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
288
|
+
<a href="#svc-twilio">Gazouillement<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
289
|
+
<a href="#svc-sentry">sentinelle<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></a>
|
|
301
290
|
<div class="sb-cat">Afficher les assistants</div>
|
|
302
|
-
<a href="#vh-display">
|
|
303
|
-
<a href="#vh-escapeurl">
|
|
291
|
+
<a href="#vh-display">afficher()</a>
|
|
292
|
+
<a href="#vh-escapeurl">URL d'échappement()</a>
|
|
304
293
|
<a href="#vh-csrf">csrfField()</a>
|
|
305
|
-
<a href="#vh-dates">
|
|
306
|
-
<a href="#vh-truncate">
|
|
307
|
-
<a href="#vh-activeclass">
|
|
308
|
-
<a href="#vh-formatsize">
|
|
309
|
-
<a href="#vh-maskemail">
|
|
310
|
-
<a href="#vh-maskphone">
|
|
294
|
+
<a href="#vh-dates">Fonctions de dates</a>
|
|
295
|
+
<a href="#vh-truncate">tronquer()</a>
|
|
296
|
+
<a href="#vh-activeclass">classe active()</a>
|
|
297
|
+
<a href="#vh-formatsize">formatTaille()</a>
|
|
298
|
+
<a href="#vh-maskemail">masqueEmail()</a>
|
|
299
|
+
<a href="#vh-maskphone">masqueTéléphone()</a>
|
|
311
300
|
<a href="#vh-slugify">slugify()</a>
|
|
312
|
-
<a href="#vh-money">
|
|
313
|
-
|
|
301
|
+
<a href="#vh-money">argent()</a>
|
|
302
|
+
<a href="#vh-uuid">uuid()</a>
|
|
314
303
|
<div class="sb-cat">Aides système</div>
|
|
315
304
|
<div class="sb-subcat">Réponse et débogage</div>
|
|
316
|
-
<a href="#sh-apiresponse">
|
|
317
|
-
<a href="#sh-json">
|
|
318
|
-
<a href="#sh-redirect">
|
|
319
|
-
<a href="#sh-dd">
|
|
305
|
+
<a href="#sh-apiresponse">apiRéponse()</a>
|
|
306
|
+
<a href="#sh-json">jsonRéponse()</a>
|
|
307
|
+
<a href="#sh-redirect">réorienter()</a>
|
|
308
|
+
<a href="#sh-dd">jj()</a>
|
|
320
309
|
<div class="sb-subcat">Sécurité CSRF</div>
|
|
321
|
-
<a href="#sh-generatecsrf">
|
|
322
|
-
<a href="#sh-csrf">
|
|
310
|
+
<a href="#sh-generatecsrf">générerCsrf()</a>
|
|
311
|
+
<a href="#sh-csrf">vérifierCsrf()</a>
|
|
323
312
|
<div class="sb-subcat">Désinfecter et valider</div>
|
|
324
313
|
<a href="#sh-sanitizeint">sanitizeInt()</a>
|
|
325
|
-
<a href="#sh-sanitizefloat">
|
|
326
|
-
<a href="#sh-sanitizestring">
|
|
327
|
-
<a href="#sh-sanitizeemail">
|
|
328
|
-
<a href="#sh-verifyemail">
|
|
314
|
+
<a href="#sh-sanitizefloat">assainirFloat()</a>
|
|
315
|
+
<a href="#sh-sanitizestring">désinfecterString()</a>
|
|
316
|
+
<a href="#sh-sanitizeemail">désinfecterEmail()</a>
|
|
317
|
+
<a href="#sh-verifyemail">vérifierEmail()</a>
|
|
329
318
|
<div class="sb-subcat">Requête HTTP</div>
|
|
330
|
-
<a href="#sh-ispost">
|
|
331
|
-
<a href="#sh-isget">
|
|
332
|
-
<a href="#sh-isput">
|
|
333
|
-
<a href="#sh-isdelete">
|
|
334
|
-
<a href="#sh-isajax">
|
|
319
|
+
<a href="#sh-ispost">estPost()</a>
|
|
320
|
+
<a href="#sh-isget">estObtenir()</a>
|
|
321
|
+
<a href="#sh-isput">estPut()</a>
|
|
322
|
+
<a href="#sh-isdelete">estSupprimer()</a>
|
|
323
|
+
<a href="#sh-isajax">estAjax()</a>
|
|
335
324
|
<a href="#sh-getclientip">getClientIp()</a>
|
|
336
325
|
<div class="sb-subcat">Authentification</div>
|
|
337
|
-
<a href="#sh-generatetoken">
|
|
326
|
+
<a href="#sh-generatetoken">générerToken()</a>
|
|
338
327
|
<a href="#sh-hashpassword">hashPassword()</a>
|
|
339
|
-
<a href="#sh-verifypassword">
|
|
328
|
+
<a href="#sh-verifypassword">vérifier le mot de passe()</a>
|
|
340
329
|
<div class="sb-subcat">Utilitaires de données</div>
|
|
341
330
|
<a href="#sh-slugify">slugify()</a>
|
|
342
|
-
<a href="#sh-arrayonly">
|
|
331
|
+
<a href="#sh-arrayonly">tableauOnly()</a>
|
|
343
332
|
<div class="sb-subcat">Génération d'ID et utilitaires</div>
|
|
344
|
-
<a href="#sh-byteid">
|
|
333
|
+
<a href="#sh-byteid">octetId()</a>
|
|
345
334
|
<a href="#sh-makeid">makeId()</a>
|
|
346
335
|
<a href="#sh-formatid">formatId()</a>
|
|
347
336
|
<a href="#sh-intid">intId()</a>
|
|
348
337
|
<a href="#sh-bigintid">bigintId()</a>
|
|
349
|
-
<a href="#sh-stringer">
|
|
350
|
-
|
|
338
|
+
<a href="#sh-stringer">raidisseur()</a>
|
|
339
|
+
<a href="#sh-otpcoder">Codeur OTP</a>
|
|
351
340
|
<div class="sb-cat">Sécurité des API</div>
|
|
352
341
|
<a href="#api-methods">Contrôle de méthode HTTP</a>
|
|
353
342
|
<a href="#api-cors">CORS</a>
|
|
@@ -356,17 +345,17 @@
|
|
|
356
345
|
<a href="#workflow">Flux de travail complet</a>
|
|
357
346
|
</nav>
|
|
358
347
|
</aside>
|
|
359
|
-
|
|
348
|
+
CONTENU PRINCIPAL
|
|
360
349
|
<main class="content">
|
|
361
|
-
|
|
350
|
+
====== CONNEXION ======
|
|
362
351
|
<header id="page-header">
|
|
363
|
-
<h1>ArtiFrame
|
|
352
|
+
<h1>ArtiFrame<span>Documentation</span></h1>
|
|
364
353
|
<p class="lead">Framework pour des projets PHP natifs évolutifs gérés sans aucune dépendance externe, des règles strictes et une CLI puissante. Aucune dépendance, un écosystème léger et rapide, sans soupe de packages Composer, vous permettant de vous concentrer sur votre logique métier.</p>
|
|
365
354
|
</header>
|
|
366
|
-
|
|
355
|
+
====== INTRODUCTION ET PHILOSOPHIE ======
|
|
367
356
|
<section id="giris">
|
|
368
357
|
<h2>Introduction et philosophie</h2>
|
|
369
|
-
<p>ArtiFrame
|
|
358
|
+
<p>ArtiFrame,<strong>"Convention sur la configuration"</strong>Il est basé sur le principe de (Règles Avant Configuration). La puissance d’un framework ne vient pas de la richesse des outils qu’il propose, mais de la cohérence de l’ordre qu’il établit.</p>
|
|
370
359
|
<div class="grid-2">
|
|
371
360
|
<div class="card highlight">
|
|
372
361
|
<h3>Zéro frais généraux</h3>
|
|
@@ -378,32 +367,30 @@
|
|
|
378
367
|
</div>
|
|
379
368
|
<div class="card highlight">
|
|
380
369
|
<h3>Ensemble de règles strictes</h3>
|
|
381
|
-
<p>Un développeur junior qui vient de rejoindre le projet
|
|
370
|
+
<p>Un développeur junior qui vient de rejoindre le projet,<code class="ic">data-js</code>Comprend l’architecture et la structure des répertoires en quelques minutes. La compatibilité des équipes est garantie au niveau du framework.</p>
|
|
382
371
|
</div>
|
|
383
372
|
<div class="card highlight">
|
|
384
373
|
<h3>Priorité CLI</h3>
|
|
385
|
-
<p>Il n’est pas nécessaire de créer manuellement des fichiers de vue, d’API ou de classe. La CLI génère des fichiers stub,
|
|
374
|
+
<p>Il n’est pas nécessaire de créer manuellement des fichiers de vue, d’API ou de classe. La CLI génère des fichiers stub, établit des liens d’actifs et maintient la cohérence du projet.</p>
|
|
386
375
|
</div>
|
|
387
376
|
</div>
|
|
388
377
|
<div class="alert a-info">
|
|
389
|
-
<strong>💡 Philosophie de la dépendance :</strong>
|
|
390
|
-
</div>
|
|
378
|
+
<strong>💡 Philosophie de la dépendance :</strong>Lors de la création d'un nouveau projet, des packages de composition de renommée mondiale tels que phpmailer, redis, ramsey/uuid sont installés. Cependant, le noyau ArtiFrame n’en dépend pas. Vous pouvez le supprimer quand vous le souhaitez, télécharger vos propres packages et réécrire vos fonctions selon votre propre architecture. ArtiFrame préserve votre liberté architecturale tout en réduisant à zéro la dépendance externe.</div>
|
|
391
379
|
<div class="alert a-info">
|
|
392
|
-
<strong>ℹ️ Licence AGPLv3 :</strong>
|
|
393
|
-
</div>
|
|
380
|
+
<strong>ℹ️ Licence AGPLv3 :</strong>ArtiFrame est open source. Les œuvres dérivées que vous produisez peuvent être utilisées librement, à condition que le code source reste ouvert. L'avis de droit d'auteur ne peut pas être supprimé.</div>
|
|
394
381
|
</section>
|
|
395
|
-
|
|
382
|
+
====== LICENCE ET UTILISATION ======
|
|
396
383
|
<section id="lisans">
|
|
397
384
|
<h2>Licence et conditions d'utilisation</h2>
|
|
398
385
|
<p>ArtiFrame est un framework open source avec licence AGPLv3. Cependant, des scénarios d'utilisation flexibles ont été conçus pour que les développeurs puissent commercialiser leurs projets et les vendre en source fermée.</p>
|
|
399
386
|
<div class="grid-2">
|
|
400
387
|
<div class="card highlight" style="border-left-color: var(--green);">
|
|
401
388
|
<h3>🗽 Özgür Ticaret (Projets d'utilisateurs finaux)</h3>
|
|
402
|
-
<p>Dans les sites Web de vos clients, les panels internes B2B, les infrastructures de commerce électronique ou tout projet SaaS/PaaS au service de l'utilisateur final
|
|
389
|
+
<p>Dans les sites Web de vos clients, les panels internes B2B, les infrastructures de commerce électronique ou tout projet SaaS/PaaS au service de l'utilisateur final.<strong>tu es libre</strong>Vous pouvez masquer votre code, le vendre et le protéger par droits d'auteur.</p>
|
|
403
390
|
</div>
|
|
404
391
|
<div class="card highlight" style="border-left-color: var(--yellow);">
|
|
405
392
|
<h3>🔄 Fork et nouveau framework</h3>
|
|
406
|
-
<p>Les fichiers principaux d'ArtiFrame (<code>bin/</code>
|
|
393
|
+
<p>Les fichiers principaux d'ArtiFrame (<code>bin/</code>Et<code>app/</code>) Si vous produisez un nouveau framework, une infrastructure CMS ou un outil de codage pour vous-même ou pour d'autres, vous pouvez également utiliser ce nouveau produit.<strong>Source ouverte</strong>Vous devez le publier en tant que .</p>
|
|
407
394
|
</div>
|
|
408
395
|
<div class="card highlight" style="border-left-color: var(--red); grid-column: span 2;">
|
|
409
396
|
<h3>⚖️ Situation d'application de la loi et de violation</h3>
|
|
@@ -417,11 +404,11 @@
|
|
|
417
404
|
<button class="tab-btn active" onclick="switchTab('tab-enduser', this)" style="white-space: nowrap; padding: 10px 20px; background: #00c88c; color: #000; font-weight: 600; border: none; border-radius: 5px; cursor: pointer;">Projet utilisateur final</button>
|
|
418
405
|
<button class="tab-btn" onclick="switchTab('tab-core', this)" style="white-space: nowrap; padding: 10px 20px; background: #1c2128; color: #fff; border: 1px solid #30363d; border-radius: 5px; cursor: pointer;">Changement de base (Framework/CMS)</button>
|
|
419
406
|
</div>
|
|
420
|
-
|
|
407
|
+
onglet 1
|
|
421
408
|
<div class="tab-content" id="tab-enduser" style="display: block;">
|
|
422
409
|
<div class="card highlight" style="border-left-color: var(--green);">
|
|
423
410
|
<h3>✅ Vous êtes totalement libre</h3>
|
|
424
|
-
<p>Si vous utilisez l'infrastructure ArtiFrame dans les sites Web de vos clients, les panels internes B2B, les infrastructures E-Commerce ou les projets SaaS
|
|
411
|
+
<p>Si vous utilisez l'infrastructure ArtiFrame dans les sites Web de vos clients, les panels internes B2B, les infrastructures E-Commerce ou les projets SaaS<strong>Vous n'êtes soumis à aucune restriction de licence.</strong></p>
|
|
425
412
|
<ul>
|
|
426
413
|
<li>Vous pouvez crypter et masquer votre code.</li>
|
|
427
414
|
<li>Vous pouvez vendre votre projet au prix que vous souhaitez.</li>
|
|
@@ -429,11 +416,10 @@
|
|
|
429
416
|
</ul>
|
|
430
417
|
</div>
|
|
431
418
|
</div>
|
|
432
|
-
|
|
419
|
+
onglet 2
|
|
433
420
|
<div class="tab-content" id="tab-core" style="display: none;">
|
|
434
421
|
<div class="alert a-info">
|
|
435
|
-
<strong>ℹ️ Modification du noyau :</strong>
|
|
436
|
-
</div>
|
|
422
|
+
<strong>ℹ️ Modification du noyau :</strong>Les propres codes sources d'ArtiFrame (<code>bin/</code>Et<code>app/</code>) et changez ceci<strong>un nouveau framework, CMS ou outil de codage</strong>Si vous utilisez as , l'arbre de décision suivant s'applique :</div>
|
|
437
423
|
<div class="card" style="padding: 0; overflow-x: auto; background: #0d1117; border-radius: 10px;">
|
|
438
424
|
<canvas height="520" id="licenseCanvasCore" style="min-width: 800px; display: block;" width="1200"></canvas>
|
|
439
425
|
</div>
|
|
@@ -448,87 +434,61 @@
|
|
|
448
434
|
el.style.border = '1px solid #30363d';
|
|
449
435
|
el.style.fontWeight = '400';
|
|
450
436
|
});
|
|
451
|
-
|
|
452
437
|
document.getElementById(tabId).style.display = 'block';
|
|
453
|
-
|
|
454
438
|
btn.style.background = tabId === 'tab-enduser' ? '#00c88c' : '#58a6ff';
|
|
455
439
|
btn.style.color = '#000';
|
|
456
440
|
btn.style.fontWeight = '600';
|
|
457
441
|
btn.style.border = 'none';
|
|
458
442
|
}
|
|
459
443
|
</script>
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
</section>
|
|
469
|
-
<!-- ====== KURULUM ====== -->
|
|
444
|
+
<h3 style="margin-top: 30px;">Commandes supplémentaires</h3>
|
|
445
|
+
<p><strong>Liste des tableaux :</strong>Pour voir tous les modèles et descriptions de tableaux disponibles :</p>
|
|
446
|
+
<pre><code>artiframe> <span class="fn">tableau</span> <span class="st">liste</span></code></pre>
|
|
447
|
+
<p><strong>Aperçu du contenu du tableau :</strong>une peinture<code>schema.sql</code>à la fin de la commande pour examiner le contenu SQL dans le terminal avant de l'ajouter au fichier.<code>check</code>Vous pouvez ajouter le paramètre :</p>
|
|
448
|
+
<pre><code>artiframe> <span class="fn">tableau:</span><span class="st">utilisateurs</span> <span class="st">vérifier</span></code></pre>
|
|
449
|
+
</section>
|
|
450
|
+
====== INSTALLATION ======
|
|
470
451
|
<section id="kurulum">
|
|
471
452
|
<h2>Installation</h2>
|
|
472
453
|
<p>ArtiFrame CLI est installé en tant qu'outil PHP global. Installé une fois, utilisé dans chaque projet.</p>
|
|
473
454
|
<h3>1. Installez l'outil CLI à l'échelle mondiale</h3>
|
|
474
|
-
<pre><code><span class="cm">#
|
|
455
|
+
<pre><code><span class="cm"># Installation globale via NPM</span>
|
|
475
456
|
npm install -g @artilingo/artiframe-cli
|
|
476
|
-
|
|
477
|
-
<span class="cm"># Kurulumu doğrula</span>
|
|
457
|
+
<span class="cm"># Vérifier l'installation</span>
|
|
478
458
|
artiframe</code></pre>
|
|
479
459
|
<h3>2. Coque interactive</h3>
|
|
480
|
-
<p>Vers le terminal uniquement
|
|
460
|
+
<p>Vers le terminal uniquement<code class="ic">artiframe</code>Tapez-le et appuyez sur Entrée. La CLI ne se ferme pas ; Un shell interactif s'ouvre, à l'écoute constante des commandes :</p>
|
|
481
461
|
<pre><code>==================================================
|
|
482
462
|
ArtiFrame CLI Interactive Shell v1.0.0
|
|
483
463
|
==================================================
|
|
484
464
|
Type 'help' for commands, or 'exit' to quit.
|
|
485
|
-
|
|
486
465
|
artiframe> </code></pre>
|
|
487
466
|
<h3>3. Démarrez un nouveau projet</h3>
|
|
488
467
|
<pre><code>artiframe> new benim-projem</code></pre>
|
|
489
|
-
<p>cette commande
|
|
468
|
+
<p>cette commande<code class="ic">benim-projem/</code>et y copie toute la structure du squelette :<code class="ic">app/</code>, <code class="ic">bin/</code>, <code class="ic">config/</code>, <code class="ic">public/</code>, <code class="ic">src/</code>, <code class="ic">.env.example</code>et d'abord<code class="ic">index.php</code>page.</p>
|
|
490
469
|
<h3>4. Paramètres d'environnement</h3>
|
|
491
470
|
<pre><code>cp .env.example .env</code></pre>
|
|
492
|
-
<p><code class="ic">.env</code>
|
|
471
|
+
<p><code class="ic">.env</code>Ouvrez votre dossier et remplissez la base de données et les informations de candidature. Ce fichier n'entre jamais dans le contrôle de version.</p>
|
|
493
472
|
<div class="alert a-warn">
|
|
494
|
-
<strong>⚠️ Paramètres du serveur Web :</strong>
|
|
495
|
-
</div>
|
|
473
|
+
<strong>⚠️ Paramètres du serveur Web :</strong>Racine du document Apache/Nginx<code class="ic">/public/</code>rediriger vers le dossier. Les autres répertoires ne doivent jamais être ouverts vers l’extérieur.</div>
|
|
496
474
|
</section>
|
|
497
|
-
|
|
475
|
+
====== STRUCTURE DU RÉPERTOIRE ======
|
|
498
476
|
<section id="dizin">
|
|
499
477
|
<h2>Structure du répertoire</h2>
|
|
500
478
|
<p>L'architecture créée au démarrage du projet ; Fournit une séparation claire des responsabilités (SoC).</p>
|
|
501
479
|
<div class="tree">
|
|
502
480
|
<span class="dir">nom-du-projet/</span>
|
|
503
|
-
├── <span class="dir">application/</span> <span class="note"># Couche d'infrastructure</span>
|
|
504
|
-
│ ├── <span class="file">ViewControl.php</span> <span class="note"># Afficher (page HTML) le bootstrapper</span>
|
|
505
|
-
│ ├── <span class="file">ApiControl.php</span> <span class="note"># Amorceur de point de terminaison d'API</span>
|
|
506
|
-
│ ├── <span class="file">base de données.php</span> <span class="note"># Connexion à une base de données basée sur PDO</span>
|
|
507
|
-
│ ├── <span class="file">DotEnv.php</span> <span class="note"># lecteur .env</span>
|
|
508
|
-
│ └── <span class="file">R2Manager.php</span> <span class="note"># Gestionnaire de fichiers Cloudflare R2</span>
|
|
481
|
+
├── <span class="dir">application/</span> <span class="note"># Couche d'infrastructure</span>│ ├──<span class="file">ViewControl.php</span> <span class="note"># Afficher (page HTML) le bootstrapper</span>│ ├──<span class="file">ApiControl.php</span> <span class="note"># Amorceur de point de terminaison d'API</span>│ ├──<span class="file">base de données.php</span> <span class="note"># Connexion à une base de données basée sur PDO</span>│ └──<span class="file">DotEnv.php</span> <span class="note"># lecteur .env</span>
|
|
509
482
|
│
|
|
510
|
-
├── <span class="dir warn">mille/</span> <span class="note"># ⚠️ Système de base — ne modifiez pas directement</span>
|
|
511
|
-
│ ├── <span class="file">MéthodeSystème.php</span> <span class="note"># Aides globales API/Backend</span>
|
|
512
|
-
│ ├── <span class="file">ViewMethod.php</span> <span class="note"># Aides globales View/Frontend</span>
|
|
513
|
-
│ └── <span class="dir">talons/</span> <span class="note"># Fichiers modèles utilisés par CLI</span>
|
|
514
|
-
│ ├── view.stub
|
|
483
|
+
├── <span class="dir warn">mille/</span> <span class="note"># ⚠️ Système de base — ne modifiez pas directement</span>│ ├──<span class="file">MéthodeSystème.php</span> <span class="note"># Aides globales API/Backend</span>│ ├──<span class="file">ViewMethod.php</span> <span class="note"># Aides globales View/Frontend</span>│ └──<span class="dir">talons/</span> <span class="note"># Fichiers modèles utilisés par CLI</span>│ ├── view.stub
|
|
515
484
|
│ ├── api-standard.stub
|
|
516
485
|
│ ├── api-switch-case.stub
|
|
517
486
|
│ └── classe.stub
|
|
518
487
|
│
|
|
519
|
-
|
|
520
|
-
│ └── <span class="file">version-de l'application.php</span> <span class="note"># Constantes APP_VERSION et APP_ENV</span>
|
|
488
|
+
├──<span class="dir">configuration/</span> <span class="note"># Fichiers de configuration</span>│ └──<span class="file">version-de l'application.php</span> <span class="note"># Constantes APP_VERSION et APP_ENV</span>
|
|
521
489
|
│
|
|
522
|
-
├── <span class="dir">publique/</span> <span class="note"># ← Le seul répertoire ouvert du serveur web</span>
|
|
523
|
-
│
|
|
524
|
-
│ │ ├── <span class="dir">css/</span> <span class="note"># Afficher des fichiers CSS spécifiques</span>
|
|
525
|
-
│ │ └── <span class="dir">js/</span> <span class="note"># Afficher les fichiers JS spécifiques</span>
|
|
526
|
-
│ ├── <span class="dir">comprend/</span> <span class="note"># Composants partagés</span>
|
|
527
|
-
│ │ ├── head.php
|
|
528
|
-
│ │ ├── header.php
|
|
529
|
-
│ │ └── footer.php
|
|
530
|
-
│ ├── <span class="dir">API/</span> <span class="note"># fichiers de point de terminaison d'API</span>
|
|
531
|
-
│ └── <span class="file">index.php</span> <span class="note"># Page d'accueil</span>
|
|
490
|
+
├── <span class="dir">publique/</span> <span class="note"># ← Le seul répertoire ouvert du serveur web</span>│ ├──<span class="dir safe">actifs/</span>│ │ ├──<span class="dir">css/</span> <span class="note"># Afficher des fichiers CSS spécifiques</span>│ │ └──<span class="dir">js/</span> <span class="note"># Afficher les fichiers JS spécifiques</span>│ ├──<span class="dir">comprend/</span> <span class="note"># Composants partagés</span>│ │ ├── head.php
|
|
491
|
+
│ ├──<span class="file">head.php</span>│ ├──<span class="file">en-tête.php</span>│ └──<span class="file">pied de page.php</span>│ ├──<span class="dir">API/</span> <span class="note"># fichiers de point de terminaison d'API</span>│ └──<span class="file">index.php</span> <span class="note"># Page d'accueil</span>
|
|
532
492
|
│
|
|
533
493
|
├── <span class="dir">src/</span> <span class="note"># Logique métier et classes</span>
|
|
534
494
|
├── <span class="file">.env</span> <span class="note"># Variables d'environnement (non incluses dans git)</span>
|
|
@@ -536,65 +496,128 @@ artiframe> </code></pre>
|
|
|
536
496
|
└── <span class="file">guide.html</span> <span class="note"># Ce document</span>
|
|
537
497
|
</div>
|
|
538
498
|
<div class="alert a-danger">
|
|
539
|
-
<strong>🚫 Ne touchez pas au répertoire bin/ :</strong> <code class="ic">bin/</code>
|
|
540
|
-
</div>
|
|
499
|
+
<strong>🚫 Ne touchez pas au répertoire bin/ :</strong> <code class="ic">bin/</code>Les fichiers à l'intérieur sont le cœur du framework. La logique métier spécifique au projet n'est pas ajoutée ici. Cours et services que vous ajouterez<code class="ic">src/</code>Sous les composants d'infrastructure<code class="ic">app/</code>se trouve en dessous.</div>
|
|
541
500
|
</section>
|
|
542
|
-
|
|
501
|
+
====== V2.0 ROUTAGE ET ARCHITECTURE ======
|
|
502
|
+
<section id="v2-routing">
|
|
503
|
+
<h2>Routage sans configuration et innovations v2.0.0<span class="tag b-cli">NOUVEAU</span></h2>
|
|
504
|
+
<p class="lead">Avec ArtiFrame v2.0.0, la structure de base du framework a acquis une architecture de routage basée sur des fichiers « Zero-Config » beaucoup plus légère, plus rapide et conviviale pour les développeurs.</p>
|
|
505
|
+
<h3>1. Routage automatique basé sur des fichiers (routeLink)</h3>
|
|
506
|
+
<p>Contrairement aux frameworks traditionnels, ArtiFrame permet une configuration individuelle pour chaque itinéraire (ex :<code>web.php</code>Il ne veut pas que vous y ajoutiez un itinéraire. Toutes les demandes<code>public/index.php</code>dans le dossier<strong>vers une seule passerelle</strong>tombe et<code>routeLink()</code>C’est géré comme par magie grâce à la méthode.</p>
|
|
507
|
+
<div class="card highlight">
|
|
508
|
+
<h4>Comment ça marche ?</h4>
|
|
509
|
+
<p>Si depuis le navigateur<code>/kategori/elektronik/15</code>Si l'adresse est saisie, le système<code>DOCUMENT_ROOT</code>Recherche dans le répertoire de bas en haut le fichier PHP correspondant le plus long :</p>
|
|
510
|
+
<ol>
|
|
511
|
+
<li><code>/kategori/elektronik/15.php</code>(Pas trouvé)</li>
|
|
512
|
+
<li><code>/kategori/elektronik.php</code>(Introuvable)</li>
|
|
513
|
+
<li><code>/kategori.php</code>(Trouvé!)</li>
|
|
514
|
+
</ol>
|
|
515
|
+
<p>Lors de l'exécution du fichier correspondant, les fragments d'URL restants sont automatiquement<code>$_GET</code>converti en paramètres :</p>
|
|
516
|
+
<pre><code>$_GET['params'] = ['elektronik', '15'];
|
|
517
|
+
$_GET['param1'] = 'elektronik';
|
|
518
|
+
$_GET['param2'] = '15';</code></pre>
|
|
519
|
+
</div>
|
|
520
|
+
<div class="alert a-info">
|
|
521
|
+
<strong>💡 Compatibilité descendante (ID) :</strong>Pour ne pas casser les habitudes des anciennes versions<code>$_GET['param1']</code>Toujours<code>$_GET['id']</code>Il est également synchronisé avec . Ainsi, directement sur les pages de détails<code>$_GET['id']</code>vous pouvez utiliser</div>
|
|
522
|
+
<div class="card">
|
|
523
|
+
<h4>Lien (a) Comment devraient être les étiquettes ?</h4>
|
|
524
|
+
<p>Dans le nouveau système de routage, les anciens paramètres de chaîne de requête (<code>?id=...&token=...</code>) à sa place<strong>Nettoyer l'URL</strong>structure est utilisée. De cette façon, vos liens seront à la fois plus lisibles et optimisés pour le référencement.</p>
|
|
525
|
+
<pre><code><span class="cm"><!-- ❌ ANCIEN BÂTIMENT (Ne doit pas être utilisé) --></span>
|
|
526
|
+
<a href="user.php?id=123456&token=123j54m23k">Profili Gör</a>
|
|
527
|
+
|
|
528
|
+
<span class="cm"><!-- ✅ NOUVELLE STRUCTURE (Standard ArtiFrame) --></span>
|
|
529
|
+
<a href="/user/123456/123j54m23k">Profili Gör</a></code></pre>
|
|
530
|
+
<p>Dans la nouvelle structure ci-dessus, accéder aux données sur la page correspondante est assez simple :</p>
|
|
531
|
+
<pre><code><span class="cm">// dans public/user.php :</span>
|
|
532
|
+
$userId = sanitizeInt($_GET['param1']); <span class="cm">// 123456 (ou $_GET['id'])</span>
|
|
533
|
+
$token = sanitizeString($_GET['param2']); <span class="cm">// 123j54m23k</span></code></pre>
|
|
534
|
+
</div>
|
|
535
|
+
<h3>2. Aides mondiales</h3>
|
|
536
|
+
<p>Dans les anciennes versions<code>\Bin\SystemMethod::generateToken()</code>ou<code>\Bin\ViewMethod::display()</code>Des appels d'espace de noms longs comme celui-ci étaient nécessaires. Avec la v2.0.0, toutes ces fonctions sont disponibles dans l'espace de noms global (<code>namespace { }</code>) a été inclus.</p>
|
|
537
|
+
<p>Vous pouvez désormais l'appeler depuis n'importe où dans votre application comme ceci :</p>
|
|
538
|
+
<pre><code>$token = generateToken();
|
|
539
|
+
echo display($user['name']);
|
|
540
|
+
echo csrfField();</code></pre>
|
|
541
|
+
<h3>3. Changements structurels (changements de rupture)</h3>
|
|
542
|
+
<div class="alert a-success">
|
|
543
|
+
<strong>🕊️ Plus de peur du refactor :</strong>Contrairement à d'autres frameworks, vous ne rencontrerez pas de crises de « refactorisation » qui durent plusieurs jours dans vos projets lorsque les mises à jour principales d'ArtiFrame sont publiées.<code>artiframe new</code>Dès que vous le dites, tous les fichiers principaux de cette version sont copiés dans votre projet. Les nouvelles versions publiées (par exemple v3, v4) ne briseront jamais vos projets existants ; Il continue de fonctionner de manière stable pendant des années, quelles que soient les exigences de la version installée dans le projet.</div>
|
|
544
|
+
<div class="alert a-danger">
|
|
545
|
+
<strong>⚠️Important :</strong>Dans tes anciens projets<code>public/index.php</code>une page d'accueil contenait du HTML. À partir de la version 2.0.0<code>index.php</code>C'est juste un fichier de routeur. L'ancienne conception de votre page d'accueil est désormais celle par défaut<code>public/landing.php</code>Il est proposé via. (Lorsqu'une URL vide arrive, le système par défaut<code>landing.php</code>redirige vers le fichier).</div>
|
|
546
|
+
<p>Également dans de nouveaux projets<code>artiframe new</code>afin que le système puisse automatiquement se replier lorsque vous l'exécutez.<code>public/404.php</code>Et<code>public/503.php</code>des pages d'erreur sont produites.</p>
|
|
547
|
+
<div class="card">
|
|
548
|
+
<h4>Gestion intelligente des erreurs API</h4>
|
|
549
|
+
<p>Si des erreurs 404 (Page introuvable) ou 503 (Mode de maintenance)<strong>au point de terminaison de l'API</strong>(Par exemple<code>/api/user/get</code>) vient ; Au lieu d'afficher une page HTML au client HTTP (application mobile, frontend), le système définit le code d'état et crée automatiquement un standard<strong>Erreur JSON</strong>revient. Cela garantit que votre API peut toujours répondre à JSON sans planter.</p>
|
|
550
|
+
<pre><code>{
|
|
551
|
+
"status": "error",
|
|
552
|
+
"message": "API Endpoint Not Found",
|
|
553
|
+
"data": []
|
|
554
|
+
}</code></pre>
|
|
555
|
+
<div class="alert a-warning" style="margin-top: 15px;">
|
|
556
|
+
<strong>💡 Remarque : capture des erreurs frontales</strong><br/>Le code d'erreur (404, 503, etc.) n'est pas inclus dans les données JSON, mais directement dans le standard<strong>Dans la réponse réseau HTTP (code d'état)</strong>rotatif. De cette façon, vous pouvez détecter les erreurs au niveau de la couche réseau sans avoir à analyser le contenu JSON :</div>
|
|
557
|
+
<pre><code><span class="cm">// Exemple d'API de récupération :</span>
|
|
558
|
+
fetch('/api/user/get').then(response => {
|
|
559
|
+
if (!response.ok) {
|
|
560
|
+
console.error("HTTP Hatası:", response.status); <span class="cm">// 404 ou 503</span>
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
<span class="cm">// Exemple Axios :</span>
|
|
565
|
+
axios.get('/api/user/get').catch(error => {
|
|
566
|
+
console.error("HTTP Hatası:", error.response.status); <span class="cm">// 404 ou 503</span>
|
|
567
|
+
});</code></pre>
|
|
568
|
+
</div>
|
|
569
|
+
</section>
|
|
570
|
+
====== BOOTSTRAPPER ======
|
|
543
571
|
<section id="bootstrapper">
|
|
544
|
-
<h2>Architecture d'amorçage
|
|
545
|
-
<p>ArtiFrame utilise deux bootstrappers complètement indépendants. Cette architecture
|
|
572
|
+
<h2>Architecture d'amorçage<span class="tag b-core">Critique</span></h2>
|
|
573
|
+
<p>ArtiFrame utilise deux bootstrappers complètement indépendants. Cette architecture<strong>Problèmes d'en-tête HTML et vulnérabilités de sécurité</strong>l’empêche radicalement.</p>
|
|
546
574
|
<div class="grid-2">
|
|
547
575
|
<div class="card highlight">
|
|
548
|
-
<h3><span class="badge b-view">
|
|
549
|
-
<p>Il est utilisé pour les pages HTML (afficher les fichiers). La séance démarre
|
|
550
|
-
<pre><code><span class="cm">// public/
|
|
576
|
+
<h3><span class="badge b-view">voir</span>ViewControl.php</h3>
|
|
577
|
+
<p>Il est utilisé pour les pages HTML (afficher les fichiers). La séance démarre,<code class="ic">ViewMethod</code>Installe .</p>
|
|
578
|
+
<pre><code><span class="cm">// public/profile.php — VERS LE HAUT, avant d'imprimer le HTML</span>
|
|
551
579
|
<span class="kw"><?php</span>
|
|
552
|
-
<span class="fn">require_once</span> <span class="var">$
|
|
580
|
+
<span class="fn">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>]
|
|
553
581
|
. <span class="st">'/../app/ViewControl.php'</span>;
|
|
554
|
-
<span class="kw">
|
|
582
|
+
<span class="kw">utiliser</span> Bin\ViewMethod;
|
|
555
583
|
<span class="kw">?></span>
|
|
556
|
-
<span class="kw"><!
|
|
584
|
+
<span class="kw"><!DOCTYPEhtml></span>
|
|
557
585
|
...</code></pre>
|
|
558
586
|
</div>
|
|
559
587
|
<div class="card highlight">
|
|
560
|
-
<h3><span class="badge b-api">API</span>
|
|
561
|
-
<p>
|
|
562
|
-
<pre><code><span class="cm">// public/api/
|
|
588
|
+
<h3><span class="badge b-api">API</span>ApiControl.php</h3>
|
|
589
|
+
<p>L'API est utilisée pour les fichiers de point de terminaison. Définit l'en-tête JSON, effectue le contrôle de la méthode HTTP,<code class="ic">SystemMethod</code>Installe .</p>
|
|
590
|
+
<pre><code><span class="cm">// public/api/user/getir.php</span>
|
|
563
591
|
<span class="kw"><?php</span>
|
|
564
|
-
<span class="cm">// $allowedMethods
|
|
565
|
-
<span class="var">$
|
|
566
|
-
|
|
567
|
-
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>]
|
|
592
|
+
<span class="cm">// $allowedMethods DOIT être défini avant require</span>
|
|
593
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'OBTENIR'</span>];
|
|
594
|
+
<span class="fn">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>]
|
|
568
595
|
. <span class="st">'/../app/ApiControl.php'</span>;
|
|
569
|
-
|
|
570
|
-
<span class="kw">use</span> Bin\SystemMethod;</code></pre>
|
|
596
|
+
<span class="kw">utiliser</span> Bin\SystemMethod;</code></pre>
|
|
571
597
|
</div>
|
|
572
598
|
</div>
|
|
573
599
|
<div class="alert a-danger">
|
|
574
|
-
<strong>🚫 ViewControl et ApiControl ne sont jamais mélangés :</strong>
|
|
575
|
-
</div>
|
|
600
|
+
<strong>🚫 ViewControl et ApiControl ne sont jamais mélangés :</strong>Si ViewControl est requis pour un fichier API, l'en-tête HTML peut être renvoyé à la place de l'en-tête JSON et l'intégralité de la réponse API sera corrompue. Si ApiControl est requis sur une page HTML, la session ne démarrera pas et la page sera interrompue.</div>
|
|
576
601
|
</section>
|
|
577
|
-
|
|
602
|
+
====== RÈGLES ======
|
|
578
603
|
<section id="kurallar">
|
|
579
|
-
<h2>Ensemble de règles
|
|
604
|
+
<h2>Ensemble de règles<span class="tag b-core">Standard</span></h2>
|
|
580
605
|
<div class="card">
|
|
581
|
-
<h3>Règle 1 : architecture data-js
|
|
582
|
-
<p>Les événements JavaScript ne sont jamais
|
|
583
|
-
<pre><code><span class="cm"><!-- ❌ Anti-Pattern —
|
|
606
|
+
<h3>Règle 1 : architecture data-js<span class="badge b-sec">Critique</span></h3>
|
|
607
|
+
<p>Les événements JavaScript ne sont jamais<code class="ic">class</code>ou<code class="ic">id</code>on ne peut pas l'écouter. Ce sont des identités visuelles/style. Toutes les interactions JS<code class="ic">data-js</code>Il est géré par l'attribut. JavaScript ne plante jamais lorsque CSS supprime une classe.</p>
|
|
608
|
+
<pre><code><span class="cm"><!-- ❌ Anti-Pattern — non pris en charge --></span>
|
|
584
609
|
<button id="submitBtn" class="btn">Gönder</button>
|
|
585
|
-
<span class="cm">// JS: document.getElementById('submitBtn').addEventListener(...)</span>
|
|
586
|
-
|
|
587
|
-
<span class="
|
|
588
|
-
|
|
589
|
-
<span class="cm">// JS: document.querySelector('[data-js="login-submit"]').addEventListener(...)</span></code></pre>
|
|
610
|
+
<span class="cm">// JS : document.getElementById('submitBtn').addEventListener(...)</span>
|
|
611
|
+
<span class="cm"><!-- ✅ ArtiFrame Standard --></span>
|
|
612
|
+
<button class="btn btn-primary" <span class="var">données-js</span>="login-submit">Gönder</button>
|
|
613
|
+
<span class="cm">// JS : document.querySelector('[data-js="login-submit"]').addEventListener(...)</span></code></pre>
|
|
590
614
|
</div>
|
|
591
615
|
<div class="card">
|
|
592
616
|
<h3>Règle 2 : Architecture thématique</h3>
|
|
593
|
-
<p>Mode et thèmes sombre/clair
|
|
594
|
-
<pre><code><span class="cm"><!--
|
|
617
|
+
<p>Mode et thèmes sombre/clair,<code class="ic"><html></code>de l'étiquette<code class="ic">data-theme</code>Et<code class="ic">data-mode</code>Il se gère à travers ses attributs. Les classes corporelles ne sont pas utilisées.</p>
|
|
618
|
+
<pre><code><span class="cm"><!-- Balise d'ouverture HTML du modèle view.stub --></span>
|
|
595
619
|
<html lang="tr" data-theme="default" data-mode="light">
|
|
596
|
-
|
|
597
|
-
<span class="cm">/* app.css içindeki tema tanımı */</span>
|
|
620
|
+
<span class="cm">/* définition du thème dans app.css */</span>
|
|
598
621
|
html[data-theme="default"][data-mode="dark"] {
|
|
599
622
|
--bg-color: #0b0c0e;
|
|
600
623
|
--text-main: #ffffff;
|
|
@@ -606,80 +629,69 @@ html[data-theme="default"][data-mode="light"] {
|
|
|
606
629
|
</div>
|
|
607
630
|
<div class="card">
|
|
608
631
|
<h3>Règle 3 : flux de données sécurisé</h3>
|
|
609
|
-
<p>Toutes les données provenant de la base de données sont traitées avant d'être transmises au DOM
|
|
632
|
+
<p>Toutes les données provenant de la base de données sont traitées avant d'être transmises au DOM.<code class="ic">display()</code>Il est enveloppé avec. Toutes les données arrivant à l'API sont traitées avant d'être traitées.<code class="ic">sanitizeString()</code>ou<code class="ic">sanitizeInt()</code>Il est nettoyé avec .</p>
|
|
610
633
|
</div>
|
|
611
634
|
<div class="card">
|
|
612
635
|
<h3>Règle 4 : Gestion des erreurs avec APP_ENV</h3>
|
|
613
|
-
<p><code class="ic">.env</code>
|
|
614
|
-
<pre><code><span class="cm">//
|
|
615
|
-
define(<span class="st">'APP_ENV'</span>, (int)<span class="var">$_ENV</span>[<span class="st">'APP_ENV'</span>]); <span class="cm">// 1=
|
|
616
|
-
|
|
617
|
-
<span class="
|
|
618
|
-
ini_set(<span class="st">'display_errors'</span>, <span class="nu">1</span>);
|
|
636
|
+
<p><code class="ic">.env</code>dans le dossier<code class="ic">APP_ENV</code>La valeur détermine la visibilité des erreurs. En Production, aucun message d’erreur n’est affiché à l’utilisateur.</p>
|
|
637
|
+
<pre><code><span class="cm">//config/app-version.php</span>
|
|
638
|
+
define(<span class="st">'APP_ENV'</span>, (int)<span class="var">$_ENV</span>[<span class="st">'APP_ENV'</span>]); <span class="cm">// 1=Débogage, 0=Production</span>
|
|
639
|
+
<span class="kw">si</span> (APP_ENV === <span class="nu">1</span>) {
|
|
640
|
+
ini_set(<span class="st">'affichage_erreurs'</span>, <span class="nu">1</span>);
|
|
619
641
|
error_reporting(E_ALL);
|
|
620
|
-
} <span class="kw">
|
|
621
|
-
ini_set(<span class="st">'
|
|
642
|
+
} <span class="kw">autre</span> {
|
|
643
|
+
ini_set(<span class="st">'affichage_erreurs'</span>, <span class="nu">0</span>);
|
|
622
644
|
}</code></pre>
|
|
623
645
|
</div>
|
|
624
646
|
</section>
|
|
625
|
-
|
|
647
|
+
====== CONNEXION CLI ======
|
|
626
648
|
<section id="cli-giris">
|
|
627
649
|
<h2>Écosystème CLI</h2>
|
|
628
|
-
<p>ArtiFrame CLI vers le terminal
|
|
629
|
-
<pre><code><span class="cm">#
|
|
650
|
+
<p>ArtiFrame CLI vers le terminal<code class="ic">artiframe</code>Ouvre un shell interactif lors de la saisie. Toutes les commandes s'exécutent dans ce shell. Les commandes peuvent également être exécutées une seule fois.</p>
|
|
651
|
+
<pre><code><span class="cm"># Mode interactif (recommandé)</span>
|
|
630
652
|
artiframe
|
|
631
653
|
artiframe> make:view admin/kullanicilar.php
|
|
632
|
-
|
|
633
|
-
<span class="cm"># Tek seferlik mod</span>
|
|
654
|
+
<span class="cm"># Mode unique</span>
|
|
634
655
|
artiframe make:view admin/kullanicilar.php</code></pre>
|
|
635
656
|
</section>
|
|
636
|
-
|
|
657
|
+
nouveau
|
|
637
658
|
<section id="cli-new">
|
|
638
|
-
<h2><code>new</code> <span class="tag b-cli">CLI
|
|
639
|
-
<p>Crée un nouveau projet ArtiFrame. Lorsque cette commande est exécutée, un assistant interactif est lancé et votre projet
|
|
640
|
-
<pre><code>artiframe> <span class="fn">
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
<span class="kw">?</span> Package name (e.g. vendor/project) <span class="st">[artiframe/benim-projem]</span>:
|
|
650
|
-
<span class="kw">?</span> Description <span class="st">[ArtiFrame Core PHP Application]</span>:
|
|
651
|
-
<span class="kw">?</span> Author name <span class="st">[Artilingo]</span>:
|
|
659
|
+
<h2><code>new</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
660
|
+
<p>Crée un nouveau projet ArtiFrame. Lorsque cette commande est exécutée, un assistant interactif est lancé et votre projet<code>composer.json</code>Il vous demande les informations de base nécessaires à sa configuration (nom du package, auteur, type de licence, etc.). Une fois tous les fichiers copiés, les dépendances sont installées automatiquement.</p>
|
|
661
|
+
<pre><code>artiframe> <span class="fn">nouveau</span> <span class="st">mon-projet</span>
|
|
662
|
+
<span class="cm">╔═════════════════════════ ═════════════════════════╗
|
|
663
|
+
║ Générateur de projets ArtiFrame ║
|
|
664
|
+
╚═════════════════════════ ═════════════════════════╝
|
|
665
|
+
Projet : mon-projet
|
|
666
|
+
Emplacement : C:/artiframe/mon-projet</span>
|
|
667
|
+
<span class="kw">?</span> Package name (e.g. vendor/project) <span class="st">[artiframe/mon-projet]</span>:
|
|
668
|
+
<span class="kw">?</span> Description <span class="st">[Application PHP de base ArtiFrame]</span>:
|
|
669
|
+
<span class="kw">?</span> Author name <span class="st">[Artilingue]</span>:
|
|
652
670
|
<span class="kw">?</span> Author homepage <span class="st">[https://artilingo.com]</span>:
|
|
653
|
-
<span class="kw">?</span> Type (project, library, composer-plugin) <span class="st">[
|
|
654
|
-
<span class="kw">?</span> License (AGPL-3.0-or-later, MIT, Apache-2.0, GPL-2.0-or-later, GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause, ISC, proprietary, none) <span class="st">[AGPL-3.0
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
│
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
<span class="cm">Installing dependencies from lock file (including require-dev)...</span>
|
|
678
|
-
|
|
679
|
-
<span class="cm"> ╔══════════════════════════════════════════════════╗
|
|
680
|
-
║ Tebrikler! Proje başarıyla oluşturuldu. ║
|
|
681
|
-
╚══════════════════════════════════════════════════╝</span>
|
|
682
|
-
|
|
671
|
+
<span class="kw">?</span> Type (project, library, composer-plugin) <span class="st">[projet]</span>:
|
|
672
|
+
<span class="kw">?</span> License (AGPL-3.0-or-later, MIT, Apache-2.0, GPL-2.0-or-later, GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause, ISC, proprietary, none) <span class="st">[AGPL-3.0 ou version ultérieure]</span>:
|
|
673
|
+
<span class="cm">┌──────────────────────── ─────────────────────────┐
|
|
674
|
+
│ 📂 Phase 1/4 — Copier... │
|
|
675
|
+
│ Fichiers à traiter : 42 pièces │
|
|
676
|
+
└──────────────────────── ─────────────────────────┘
|
|
677
|
+
[████████████████████] 100 % (42/42) docs/guide.html...
|
|
678
|
+
┌──────────────────────── ─────────────────────────┐
|
|
679
|
+
│ 📂 Phase 2/4 — Création de répertoires... │
|
|
680
|
+
│ Fichiers à traiter : 10 pièces │
|
|
681
|
+
└──────────────────────── ─────────────────────────┘
|
|
682
|
+
[████████████████████] 100 % (52/52) public/actifs/images/...
|
|
683
|
+
┌──────────────────────── ─────────────────────────┐
|
|
684
|
+
│ 📂 Phase 3/4 — Génération de fichiers dynamiques... │
|
|
685
|
+
│ Fichiers à traiter : 14 pièces │
|
|
686
|
+
└──────────────────────── ─────────────────────────┘
|
|
687
|
+
[████████████████████] 100 % (66/66) .agents/AGENTS.md...
|
|
688
|
+
┌──────────────────────── ─────────────────────────┐
|
|
689
|
+
│ 📦 Phase 4/4 — Installation des dépendances (Composer)│
|
|
690
|
+
└──────────────────────── ─────────────────────────┘</span>
|
|
691
|
+
<span class="cm">Installation des dépendances à partir du fichier de verrouillage (y compris require-dev)...</span>
|
|
692
|
+
<span class="cm">╔═════════════════════════ ═════════════════════════╗
|
|
693
|
+
║ Félicitations ! Le projet a été créé avec succès. ║
|
|
694
|
+
╚═════════════════════════ ═════════════════════════╝</span>
|
|
683
695
|
📂 benim-projem/
|
|
684
696
|
│ ├── 📂 bin/
|
|
685
697
|
│ ├── 📂 config/
|
|
@@ -693,247 +705,238 @@ artiframe make:view admin/kullanicilar.php</code></pre>
|
|
|
693
705
|
│ └── 📄 kilavuz.html [125 KB]
|
|
694
706
|
│
|
|
695
707
|
Sonraki Adım: Lütfen .env dosyasındaki ortam değişkenlerini yapılandırın.
|
|
696
|
-
|
|
697
708
|
</code></pre>
|
|
698
|
-
<p>Une fois le projet créé, ArtiFrame CLI l'exécute pour vous
|
|
709
|
+
<p>Une fois le projet créé, ArtiFrame CLI l'exécute pour vous.<strong>ouvre automatiquement une nouvelle fenêtre de terminal</strong>, accède à ce répertoire et redémarre l'outil axé sur ce projet. Vous pouvez fermer l'ancienne fenêtre du terminal.</p>
|
|
699
710
|
<p>Structure squelettique créée :</p>
|
|
700
|
-
<div class="tree" style="font-size:0.82rem; line-height:1.7">
|
|
701
|
-
nom-du-projet/
|
|
711
|
+
<div class="tree" style="font-size:0.82rem; line-height:1.7">nom-du-projet/
|
|
702
712
|
├── application/ (ViewControl.php, ApiControl.php, Database.php, DotEnv.php)
|
|
703
713
|
├── bin/ (SystemMethod.php, ViewMethod.php, stubs/)
|
|
704
714
|
├── config/ (app-version.php)
|
|
705
715
|
├── public/ (index.php, actifs/, include/, api/)
|
|
706
716
|
├──src/
|
|
707
717
|
├── .env.exemple
|
|
708
|
-
└── guide.html
|
|
709
|
-
|
|
718
|
+
└── guide.html</div>
|
|
719
|
+
</section>
|
|
720
|
+
mise à niveau
|
|
721
|
+
<section id="cli-upgrade">
|
|
722
|
+
<h2><code>upgrade</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
723
|
+
<p>Il vous permet d'intégrer en toute sécurité les nouvelles fonctionnalités de l'outil ArtiFrame CLI que vous avez mis à jour globalement via NPM dans votre projet existant.</p>
|
|
724
|
+
<pre><code>artiframe> <span class="fn">mise à niveau</span></code></pre>
|
|
725
|
+
<ul style="margin-left: 20px; margin-bottom: 15px; line-height: 1.6;">
|
|
726
|
+
<li>Seulement<code>app/</code>Et<code>bin/</code>avec des dossiers principaux<code>src/Service/</code>Met à jour les classes de service fixes (le cas échéant) en dessous.</li>
|
|
727
|
+
<li>Où se trouve votre logique métier<code>src/</code>, <code>public/</code>Et<code>config/</code>Certainement dans vos répertoires<strong>intouchable</strong>(pour que votre projet ne soit pas endommagé).</li>
|
|
728
|
+
<li><strong>Pare-feu :</strong>Si votre projet est v1.x et<code>public/index.php</code>Si votre fichier ne correspond pas à la nouvelle structure du routeur, il générera une erreur et vous demandera le nom de votre index.php existant.<code>landing.php</code>Il vous demande de le changer en .</li>
|
|
729
|
+
<li><strong>Avis de modification :</strong>si avant<code>bin/</code>Si vous avez modifié manuellement les fonctions principales sous<strong>entrer</strong>Il demande une confirmation manuelle (avertissement de sauvegarde) avec le bouton.</li>
|
|
730
|
+
<li><strong>Rapport de changement intelligent (Diff) :</strong>Une fois la mise à jour terminée, il imprime sur le terminal un rapport détaillé des fichiers nouvellement ajoutés ou modifiés (mis à jour) dans votre projet.</li>
|
|
731
|
+
<li><strong>Analyse au niveau des fonctions :</strong>Si le fichier mis à jour est un<code>.php</code>Le fichier compare les méthodes de l'ancien et du nouveau fichier. Si une nouvelle fonction est ajoutée, le rapport<code>[YENİ FONKSİYON] ad()</code>Il vous invite à lire la documentation avec un avertissement spécial.</li>
|
|
732
|
+
</ul>
|
|
710
733
|
</section>
|
|
711
|
-
|
|
734
|
+
créer:afficher
|
|
712
735
|
<section id="cli-view">
|
|
713
|
-
<h2><code>make:view</code> <span class="tag b-cli">CLI
|
|
714
|
-
<p>Crée un nouveau fichier de page (vue) et ses ressources CSS/JS personnalisées. Les ressources sont automatiquement liées à la page et
|
|
715
|
-
<pre><code>artiframe> <span class="fn">
|
|
736
|
+
<h2><code>make:view</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
737
|
+
<p>Crée un nouveau fichier de page (vue) et ses ressources CSS/JS personnalisées. Les ressources sont automatiquement liées à la page et<code class="ic">?v=APP_VERSION</code>Le contournement du cache est appliqué avec .</p>
|
|
738
|
+
<pre><code>artiframe> <span class="fn">créer:afficher</span> <span class="st">admin/utilisateurs.php</span></code></pre>
|
|
716
739
|
<p>Fichiers créés :</p>
|
|
717
|
-
<pre><code><span class="cm">✔
|
|
718
|
-
<span class="cm">✔
|
|
719
|
-
<span class="cm">✔
|
|
740
|
+
<pre><code><span class="cm">✔ public/admin/users.php</span>
|
|
741
|
+
<span class="cm">✔ public/assets/css/admin/users.css</span>
|
|
742
|
+
<span class="cm">✔ public/assets/js/admin/users.js</span></code></pre>
|
|
720
743
|
<p>Au début du fichier de vue créé, ViewControl est requis, les inclusions d'en-tête/en-tête/pied de page sont ajoutées et les liens CSS/JS sont connectés au contournement du cache.</p>
|
|
721
744
|
</section>
|
|
722
|
-
|
|
745
|
+
faire:API
|
|
723
746
|
<section id="cli-api">
|
|
724
|
-
<h2><code>make:api</code> <span class="tag b-cli">CLI
|
|
725
|
-
<p>Il crée un fichier de point de terminaison d'API en choisissant l'un des deux modèles différents. Avec chaque nouveau fichier API
|
|
747
|
+
<h2><code>make:api</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
748
|
+
<p>Il crée un fichier de point de terminaison d'API en choisissant l'un des deux modèles différents. Avec chaque nouveau fichier API<code class="ic">$allowedMethods</code>variable et<code class="ic">ApiControl.php</code>Il est livré avec l'exigence prête.</p>
|
|
726
749
|
<div class="card">
|
|
727
|
-
<h3><span class="badge b-api">
|
|
750
|
+
<h3><span class="badge b-api">standard</span>— API à action unique</h3>
|
|
728
751
|
<p>Pour les points de terminaison qui effectuent une seule tâche (connexion, envoi, suppression). La logique métier est écrite directement.</p>
|
|
729
|
-
<pre><code>artiframe> <span class="fn">
|
|
752
|
+
<pre><code>artiframe> <span class="fn">faire:API</span> <span class="st">standard</span> <span class="st">api/auth/login.php</span></code></pre>
|
|
730
753
|
<pre><code><span class="kw"><?php</span>
|
|
731
|
-
<span class="var">$
|
|
732
|
-
<span class="fn">require_once</span> <span class="var">$
|
|
733
|
-
|
|
734
|
-
<span class="
|
|
735
|
-
|
|
736
|
-
<span class="cm">// İş mantığı buraya...</span>
|
|
737
|
-
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>], <span class="nu">200</span>);</code></pre>
|
|
754
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'POSTE'</span>]; <span class="cm">// Accepte uniquement le POST</span>
|
|
755
|
+
<span class="fn">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
756
|
+
<span class="kw">utiliser</span> Bin\SystemMethod;
|
|
757
|
+
<span class="cm">//Logique métier ici...</span>
|
|
758
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>], <span class="nu">200</span>);</code></pre>
|
|
738
759
|
</div>
|
|
739
760
|
<div class="card">
|
|
740
|
-
<h3><span class="badge b-api">
|
|
741
|
-
<p>Une structure qui gère les opérations CRUD pour un module dans un seul point de terminaison
|
|
742
|
-
<pre><code>artiframe> <span class="fn">
|
|
761
|
+
<h3><span class="badge b-api">boîtier de commutation</span>— API multi-actions</h3>
|
|
762
|
+
<p>Une structure qui gère les opérations CRUD pour un module dans un seul point de terminaison.<code class="ic">action</code>Le paramètre détermine quelle opération sera effectuée.</p>
|
|
763
|
+
<pre><code>artiframe> <span class="fn">faire:API</span> <span class="st">boîtier de commutation</span> <span class="st">api/utilisateur/admin.php</span></code></pre>
|
|
743
764
|
<pre><code><span class="kw"><?php</span>
|
|
744
|
-
<span class="var">$
|
|
745
|
-
<span class="fn">require_once</span> <span class="var">$
|
|
746
|
-
|
|
747
|
-
<span class="
|
|
748
|
-
|
|
749
|
-
<span class="
|
|
750
|
-
|
|
751
|
-
<span class="kw">
|
|
752
|
-
<span class="kw">
|
|
753
|
-
<span class="fn">
|
|
754
|
-
<span class="kw">
|
|
755
|
-
<span class="kw">
|
|
756
|
-
<span class="fn">
|
|
757
|
-
<span class="kw">
|
|
758
|
-
<span class="kw">
|
|
759
|
-
<span class="fn">
|
|
760
|
-
<span class="kw">break</span>;
|
|
761
|
-
<span class="kw">default</span>:
|
|
762
|
-
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'error'</span>, <span class="st">'message'</span> => <span class="st">'Geçersiz action.'</span>], <span class="nu">400</span>);
|
|
765
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'POSTE'</span>];
|
|
766
|
+
<span class="fn">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
767
|
+
<span class="kw">utiliser</span> Bin\SystemMethod;
|
|
768
|
+
<span class="var">$action</span> = <span class="fn">désinfecterString</span>(<span class="var">$_POST</span>[<span class="st">'action'</span>] ?? <span class="st">''</span>);
|
|
769
|
+
<span class="kw">changer</span> (<span class="var">$action</span>) {
|
|
770
|
+
<span class="kw">cas</span> <span class="st">'créer'</span>:
|
|
771
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>, <span class="st">'message'</span> => <span class="st">'Créé.'</span>], <span class="nu">200</span>);
|
|
772
|
+
<span class="kw">casser</span>;
|
|
773
|
+
<span class="kw">cas</span> <span class="st">'mise à jour'</span>:
|
|
774
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>, <span class="st">'message'</span> => <span class="st">'Mis à jour.'</span>], <span class="nu">200</span>);
|
|
775
|
+
<span class="kw">casser</span>;
|
|
776
|
+
<span class="kw">cas</span> <span class="st">'supprimer'</span>:
|
|
777
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>, <span class="st">'message'</span> => <span class="st">« Supprimé. »</span>], <span class="nu">200</span>);
|
|
778
|
+
<span class="kw">casser</span>;
|
|
779
|
+
<span class="kw">défaut</span>:
|
|
780
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'erreur'</span>, <span class="st">'message'</span> => <span class="st">« Action invalide. »</span>], <span class="nu">400</span>);
|
|
763
781
|
}</code></pre>
|
|
764
782
|
</div>
|
|
765
783
|
</section>
|
|
766
|
-
|
|
784
|
+
faire:classe
|
|
767
785
|
<section id="cli-class">
|
|
768
|
-
<h2><code>make:class</code> <span class="tag b-cli">CLI
|
|
769
|
-
<p>Il crée un nouveau fichier de classe PHP avec l'espace de noms et le passe-partout de classe prêts. L'espace de noms est déterminé automatiquement en fonction du chemin de classe. Si
|
|
770
|
-
<pre><code>artiframe> <span class="fn">
|
|
771
|
-
<p>
|
|
772
|
-
<pre><code>artiframe> <span class="fn">
|
|
786
|
+
<h2><code>make:class</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
787
|
+
<p>Il crée un nouveau fichier de classe PHP avec l'espace de noms et le passe-partout de classe prêts. L'espace de noms est déterminé automatiquement en fonction du chemin de classe. Si<strong>application/</strong>Et<strong>src/</strong>à l'extérieur (par exemple<strong>privé/</strong>) si un répertoire est utilisé, l'outil CLI s'exécute en arrière-plan<code>composer dump-autoload</code>exécute automatiquement le script.</p>
|
|
788
|
+
<pre><code>artiframe> <span class="fn">faire:classe</span> <span class="st">src/Service/EmailService.php</span></code></pre>
|
|
789
|
+
<p>Si le répertoire de la classe n'est pas spécifié, la commande renvoie une erreur :</p>
|
|
790
|
+
<pre><code>artiframe> <span class="fn">faire:classe</span>
|
|
773
791
|
❌ Hata: Sınıfın oluşturulacağı dizin belirtilmeli! (örn: /app veya /src)
|
|
774
792
|
Example: /src/Service/PaymentService</code></pre>
|
|
775
793
|
</section>
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
`
|
|
794
|
-
`
|
|
795
|
-
`
|
|
796
|
-
`
|
|
797
|
-
`
|
|
798
|
-
`
|
|
799
|
-
`
|
|
800
|
-
`
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
`
|
|
810
|
-
`
|
|
811
|
-
`
|
|
812
|
-
`
|
|
813
|
-
`
|
|
814
|
-
`
|
|
815
|
-
`
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
`
|
|
827
|
-
`
|
|
828
|
-
`
|
|
829
|
-
`
|
|
830
|
-
`
|
|
831
|
-
`
|
|
832
|
-
`
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
<p><strong>Lister les tables :</strong> Pour voir tous les modèles de tables disponibles et leurs descriptions :</p>
|
|
862
|
-
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
863
|
-
|
|
864
|
-
<p><strong>Aperçu du contenu de la table :</strong> Pour inspecter le contenu SQL dans le terminal avant de l'ajouter au fichier <code>schema.sql</code>, vous pouvez ajouter le paramètre <code>check</code> :</p>
|
|
865
|
-
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
866
|
-
|
|
867
|
-
</section>
|
|
868
|
-
|
|
869
|
-
<!-- cli v -->
|
|
794
|
+
tableau:
|
|
795
|
+
<section id="cli-table">
|
|
796
|
+
<h2><code>table:</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
797
|
+
<p>dans votre projet<code>schema.sql</code>Il vous permet d'ajouter rapidement des tables de base de données standard et relationnelles au fichier. Modèles globaux<code>stubs/sql.stub</code>est lu à partir du fichier.</p>
|
|
798
|
+
<pre><code>artiframe> <span class="fn">tableau:</span><span class="st">utilisateurs</span></code></pre>
|
|
799
|
+
<p>Tableaux standards actuellement pris en charge :</p>
|
|
800
|
+
<div class="table-tabs-container" style="margin-top: 20px;">
|
|
801
|
+
<div class="tabs-header" style="display: flex; gap: 10px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 5px;">
|
|
802
|
+
<button class="table-tab-btn active" onclick="switchTableTab('tab-users', this)" style="white-space: nowrap; padding: 10px 20px; background: #00c88c; color: #000; font-weight: 600; border: none; border-radius: 5px; cursor: pointer;">utilisateurs</button>
|
|
803
|
+
<button class="table-tab-btn" onclick="switchTableTab('tab-sessions', this)" style="white-space: nowrap; padding: 10px 20px; background: #1c2128; color: #fff; border: 1px solid #30363d; border-radius: 5px; cursor: pointer;">sessions_utilisateur</button>
|
|
804
|
+
<button class="table-tab-btn" onclick="switchTableTab('tab-prefs', this)" style="white-space: nowrap; padding: 10px 20px; background: #1c2128; color: #fff; border: 1px solid #30363d; border-radius: 5px; cursor: pointer;">préférences_utilisateur</button>
|
|
805
|
+
</div>
|
|
806
|
+
Onglet : utilisateurs
|
|
807
|
+
<div class="table-tab-content" id="tab-users" style="display: block;">
|
|
808
|
+
<pre><code><span class="kw">CREATE TABLE `utilisateurs` (
|
|
809
|
+
`id` binaire (16) NON NULL,
|
|
810
|
+
`email` varchar(255) NON NULL,
|
|
811
|
+
`mot de passe` varchar(255) NON NULL,
|
|
812
|
+
`name` varchar(255) NULL PAR DÉFAUT,
|
|
813
|
+
`role` enum('user','admin','moderator') NOT NULL PAR DÉFAUT 'user',
|
|
814
|
+
`status` tinyint(1) NON NULL PAR DÉFAUT '1',
|
|
815
|
+
horodatage `created_at` NULL DEFAULT CURRENT_TIMESTAMP,
|
|
816
|
+
Horodatage `updated_at` NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
817
|
+
CLÉ PRIMAIRE (`id`),
|
|
818
|
+
CLÉ UNIQUE `email` (`email`)
|
|
819
|
+
) MOTEUR=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
820
|
+
</div>
|
|
821
|
+
Onglet : user_sessions
|
|
822
|
+
<div class="table-tab-content" id="tab-sessions" style="display: none;">
|
|
823
|
+
<pre><code><span class="kw">CREATE TABLE `user_sessions` (
|
|
824
|
+
`id` binaire (16) NON NULL,
|
|
825
|
+
`user_id` binaire(16) NON NULL,
|
|
826
|
+
`jeton` varchar(255) NON NULL,
|
|
827
|
+
`adresse_ip` varchar(45) NULL PAR DÉFAUT,
|
|
828
|
+
`user_agent` varchar(255) NULL PAR DÉFAUT,
|
|
829
|
+
`expires_at` horodatage NULL PAR DÉFAUT NULL,
|
|
830
|
+
horodatage `created_at` NULL DEFAULT CURRENT_TIMESTAMP,
|
|
831
|
+
CLÉ PRIMAIRE (`id`),
|
|
832
|
+
CLÉ UNIQUE `jeton` (`jeton`),
|
|
833
|
+
CLÉ `user_id` (`user_id`),
|
|
834
|
+
CONTRAINTE `fk_user_sessions_user_id` CLÉ ÉTRANGÈRE (`user_id`) RÉFÉRENCES `users` (`id`) SUR LA SUPPRESSION DE LA CASCADE SUR LA CASCADE DE MISE À JOUR
|
|
835
|
+
) MOTEUR=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
836
|
+
</div>
|
|
837
|
+
Onglet : préférences_utilisateur
|
|
838
|
+
<div class="table-tab-content" id="tab-prefs" style="display: none;">
|
|
839
|
+
<pre><code><span class="kw">CREATE TABLE `user_preferences` (
|
|
840
|
+
`id` binaire (16) NON NULL,
|
|
841
|
+
`user_id` binaire(16) NON NULL,
|
|
842
|
+
`langue` varchar(10) NON NULL PAR DÉFAUT 'tr',
|
|
843
|
+
`theme` varchar(20) NON NULL PAR DÉFAUT 'light',
|
|
844
|
+
`push_notifications` tinyint(1) NON NULL PAR DÉFAUT '1',
|
|
845
|
+
`email_notifications` tinyint(1) NON NULL PAR DÉFAUT '1',
|
|
846
|
+
horodatage `created_at` NULL DEFAULT CURRENT_TIMESTAMP,
|
|
847
|
+
Horodatage `updated_at` NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
848
|
+
CLÉ PRIMAIRE (`id`),
|
|
849
|
+
CLÉ UNIQUE `user_id` (`user_id`),
|
|
850
|
+
CONTRAINTE `fk_user_prefs_user_id` CLÉ ÉTRANGÈRE (`user_id`) RÉFÉRENCES `users` (`id`) SUR LA CASCADE DE SUPPRESSION SUR LA CASCADE DE MISE À JOUR
|
|
851
|
+
) MOTEUR=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
852
|
+
</div>
|
|
853
|
+
</div>
|
|
854
|
+
<script>
|
|
855
|
+
function switchTableTab(tabId, btn) {
|
|
856
|
+
const container = btn.closest('.table-tabs-container');
|
|
857
|
+
container.querySelectorAll('.table-tab-content').forEach(el => el.style.display = 'none');
|
|
858
|
+
container.querySelectorAll('.table-tab-btn').forEach(el => {
|
|
859
|
+
el.style.background = '#1c2128';
|
|
860
|
+
el.style.color = '#fff';
|
|
861
|
+
el.style.border = '1px solid #30363d';
|
|
862
|
+
el.style.fontWeight = '400';
|
|
863
|
+
});
|
|
864
|
+
container.querySelector('#' + tabId).style.display = 'block';
|
|
865
|
+
btn.style.background = '#00c88c';
|
|
866
|
+
btn.style.color = '#000';
|
|
867
|
+
btn.style.fontWeight = '600';
|
|
868
|
+
btn.style.border = 'none';
|
|
869
|
+
}
|
|
870
|
+
</script>
|
|
871
|
+
<h3 style="margin-top: 30px;">Commandes supplémentaires</h3>
|
|
872
|
+
<p><strong>Liste des tableaux :</strong>Pour voir tous les modèles et descriptions de tableaux disponibles :</p>
|
|
873
|
+
<pre><code>artiframe> <span class="fn">tableau</span> <span class="st">liste</span></code></pre>
|
|
874
|
+
<p><strong>Aperçu du contenu du tableau :</strong>une peinture<code>schema.sql</code>à la fin de la commande pour examiner le contenu SQL dans le terminal avant de l'ajouter au fichier.<code>check</code>Vous pouvez ajouter le paramètre :</p>
|
|
875
|
+
<pre><code>artiframe> <span class="fn">tableau:</span><span class="st">utilisateurs</span> <span class="st">vérifier</span></code></pre>
|
|
876
|
+
</section>
|
|
877
|
+
mise à niveau
|
|
878
|
+
cli v
|
|
870
879
|
<section id="cli-cliv">
|
|
871
|
-
<h2><code>cli v</code>
|
|
872
|
-
<p>
|
|
880
|
+
<h2><code>cli v</code>(ou<code>cli version</code>) <span class="tag b-cli">Commande CLI</span></h2>
|
|
881
|
+
<p>Contrôle la propre version (globale) de l'outil ArtiFrame CLI. Affiche non seulement la version actuelle,<strong>Registre NPM</strong>Il vérifie également si la version la plus récente est disponible. S'il existe une nouvelle version, elle peut se mettre à jour globalement en un seul clic (o/n).<code>npm install -g @artilingo/artiframe-cli@latest</code>).</p>
|
|
873
882
|
<pre><code>artiframe> <span class="fn">cli v</span>
|
|
874
|
-
<span class="cm">
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
<span class="cm"> Güncelleniyor...
|
|
881
|
-
✅ CLI başarıyla güncellendi!</span></code></pre>
|
|
883
|
+
<span class="cm">Version actuelle : v1.0.0
|
|
884
|
+
Version actuelle : v1.0.1
|
|
885
|
+
Une nouvelle mise à jour est disponible ! v1.0.0 → v1.0.1
|
|
886
|
+
Souhaitez-vous mettre à jour maintenant ? (o/n)</span> <span class="st">oui</span>
|
|
887
|
+
<span class="cm">Mise à jour...
|
|
888
|
+
✅ CLI mise à jour avec succès !</span></code></pre>
|
|
882
889
|
</section>
|
|
883
|
-
|
|
890
|
+
montrer
|
|
884
891
|
<section id="cli-show">
|
|
885
|
-
<h2><code>show</code> <span class="tag b-cli">CLI
|
|
886
|
-
<p>
|
|
887
|
-
<pre><code>artiframe> <span class="fn">
|
|
892
|
+
<h2><code>show</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
893
|
+
<p>Il affiche le répertoire de travail dans lequel se trouve actuellement la CLI. Utile pour la navigation.</p>
|
|
894
|
+
<pre><code>artiframe> <span class="fn">montrer</span>
|
|
888
895
|
📍 Mevcut Çalışma Dizini:
|
|
889
896
|
C:\projeler\benim_projem</code></pre>
|
|
890
897
|
</section>
|
|
891
|
-
|
|
898
|
+
liste
|
|
892
899
|
<section id="cli-list">
|
|
893
|
-
<h2><code>list</code> <span class="tag b-cli">CLI
|
|
900
|
+
<h2><code>list</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
894
901
|
<p>Il répertorie les fichiers et dossiers du répertoire courant dans une arborescence par ordre de priorité. Affiche le nombre d'éléments dans les dossiers et la taille des fichiers.</p>
|
|
895
|
-
<pre><code>artiframe> <span class="fn">
|
|
902
|
+
<pre><code>artiframe> <span class="fn">liste</span>
|
|
896
903
|
📂 benim_projem/
|
|
897
904
|
│ ├── 📂 src/ (5 öğe)
|
|
898
905
|
│ ├── 📂 public/ (4 öğe)
|
|
899
906
|
│ ├── 📄 composer.json [1.2 KB]
|
|
900
907
|
│ └── 📄 README.md [4.5 KB]</code></pre>
|
|
901
908
|
</section>
|
|
902
|
-
|
|
909
|
+
aller
|
|
903
910
|
<section id="cli-go">
|
|
904
|
-
<h2><code>go</code> <span class="tag b-cli">CLI
|
|
911
|
+
<h2><code>go</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
905
912
|
<p>Il vous permet de naviguer entre les répertoires dans le shell interactif de la CLI. Cela n'a pas d'effet permanent au niveau du système d'exploitation, mais cela modifie votre répertoire de travail tant que la CLI reste ouverte.</p>
|
|
906
|
-
<pre><code>artiframe> <span class="fn">
|
|
913
|
+
<pre><code>artiframe> <span class="fn">aller</span> <span class="st">publique</span>
|
|
907
914
|
✅ Dizin başarıyla değiştirildi.
|
|
908
915
|
C:\projeler\benim_projem\public
|
|
909
|
-
|
|
910
|
-
artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
916
|
+
artiframe> <span class="fn">aller</span> <span class="st">dos</span>
|
|
911
917
|
✅ Dizin başarıyla değiştirildi.
|
|
912
918
|
C:\projeler\benim_projem</code></pre>
|
|
913
919
|
</section>
|
|
914
|
-
|
|
920
|
+
retirer
|
|
915
921
|
<section id="cli-remove">
|
|
916
|
-
<h2><code>remove</code> <span class="tag b-cli">CLI
|
|
917
|
-
<p>Supprime en toute sécurité un fichier spécifi
|
|
922
|
+
<h2><code>remove</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
923
|
+
<p>Supprime en toute sécurité un fichier spécifié.<code>make</code>Il fonctionne à l'opposé des commandes et analyse les dépendances dans le projet et donne des avertissements avant suppression :</p>
|
|
918
924
|
<ul>
|
|
919
|
-
<li><strong>Si la vue est supprimée :</strong>
|
|
920
|
-
<li><strong>Si la classe est supprimée :</strong>
|
|
925
|
+
<li><strong>Si la vue est supprimée :</strong>si fichier<code>public/</code>et fichiers CSS/JS liés à ce fichier<code>public/assets</code>Si tel est le cas, il vous demandera si vous souhaitez également les nettoyer.</li>
|
|
926
|
+
<li><strong>Si la classe est supprimée :</strong>si fichier<code>src/</code>ou<code>app/</code>si ci-dessous,<code>public/api/</code>scanne le répertoire. Il vous avertit en imprimant les fins d'API et les numéros de ligne dans lesquelles la classe que vous avez supprimée est utilisée, mais il ne supprime pas automatiquement les API (pour des raisons de sécurité, vous devez modifier manuellement les API concernées).</li>
|
|
921
927
|
</ul>
|
|
922
|
-
<pre><code>artiframe> <span class="fn">
|
|
928
|
+
<pre><code>artiframe> <span class="fn">retirer</span> <span class="st">src/Auth/UserManager.php</span>
|
|
923
929
|
⚠️ Bu dosyayı KÖKTEN silmek üzeresiniz. Emin misiniz? C:\...\src\Auth\UserManager.php [y/N]: y
|
|
924
|
-
|
|
925
930
|
🚨 DİKKAT: Sildiğiniz UserManager sınıfı şu API dosyalarında kullanılıyor:
|
|
926
931
|
-> C:\...\public\api\auth\login.php (Satır: 12)
|
|
927
932
|
-> C:\...\public\api\auth\register.php (Satır: 15)
|
|
928
|
-
|
|
929
933
|
📌 Yukarıdaki API dosyalarındaki ilgili satırları kendiniz düzenlemeli veya silmelisiniz.
|
|
930
|
-
|
|
931
934
|
✅ Dosya başarıyla silindi: C:\...\src\Auth\UserManager.php</code></pre>
|
|
932
935
|
</section>
|
|
933
|
-
|
|
936
|
+
version
|
|
934
937
|
<section id="cli-version">
|
|
935
|
-
<h2><code>version</code> <span class="tag b-cli">CLI
|
|
936
|
-
<p><code class="ic">config/app-version.php</code>
|
|
938
|
+
<h2><code>version</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
939
|
+
<p><code class="ic">config/app-version.php</code>Il met à jour le numéro de version selon les règles de gestion des versions sémantiques (SemVer). Format des versions :<strong>PATCH MAJEUR.MINEUR.</strong></p>
|
|
937
940
|
<table class="sig-table">
|
|
938
941
|
<thead>
|
|
939
942
|
<tr><th>commande</th><th>Explication</th><th>Exemple</th></tr>
|
|
@@ -948,48 +951,72 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
948
951
|
</tbody>
|
|
949
952
|
</table>
|
|
950
953
|
<pre><code>artiframe> <span class="fn">version</span> upgrade minor
|
|
951
|
-
<span class="cm">✔
|
|
954
|
+
<span class="cm">✔ Mise à jour vers la version 1.2.0 → 1.3.0.</span></code></pre>
|
|
952
955
|
</section>
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
✅
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
956
|
+
mode
|
|
957
|
+
<section id="cli-mode">
|
|
958
|
+
<h2><code>mode</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
959
|
+
<p>Il permet de changer le mode de travail du projet (Développement ou Live) avec une seule commande. Cette commande peut être manuellement<code>config/app-version.php</code>Cela vous évite d'avoir à ouvrir et à modifier le fichier.</p>
|
|
960
|
+
<pre><code>artiframe> <span class="fn">mode</span> <span class="st">1</span>
|
|
961
|
+
✅ Prod modundan Debug moduna geçiş yapıldı.</code></pre>
|
|
962
|
+
<p>Pour passer à la version live<code>0</code>Vous pouvez utiliser le paramètre :</p>
|
|
963
|
+
<pre><code>artiframe> <span class="fn">mode</span> <span class="st">0</span></code></pre>
|
|
964
|
+
</section>
|
|
965
|
+
servir
|
|
963
966
|
<section id="cli-serve">
|
|
964
|
-
<h2><code>serve</code> <span class="tag b-cli">CLI
|
|
965
|
-
<p>
|
|
966
|
-
<pre><code>artiframe> <span class="fn">
|
|
967
|
-
🚀 Geliştirme sunucusu
|
|
968
|
-
Durdurmak için CTRL+C tuşlarına basın
|
|
967
|
+
<h2><code>serve</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
968
|
+
<p>Pour tester le projet, il démarre un serveur de développement local et l'ouvre au réseau local (Local Network) via 0.0.0.0 (toutes les interfaces réseau). Il lance votre projet en quelques secondes sans avoir besoin d'installer un serveur web supplémentaire (XAMPP, Nginx, etc.), ouvre automatiquement l'onglet localhost sur votre propre ordinateur et imprime l'IP de connexion des autres appareils du réseau (téléphone/tablette) sur l'écran.</p>
|
|
969
|
+
<pre><code>artiframe> <span class="fn">servir</span>
|
|
970
|
+
🚀 Geliştirme sunucusu başlatıldı: 0.0.0.0:8000
|
|
971
|
+
Durdurmak için CTRL+C tuşlarına basın.
|
|
972
|
+
|
|
973
|
+
Local: http://localhost:8000
|
|
974
|
+
Network: http://192.168.1.34:8000</code></pre>
|
|
969
975
|
<p>Vous pouvez spécifier un numéro de port différent si vous le souhaitez :</p>
|
|
970
|
-
<pre><code>artiframe> <span class="fn">
|
|
976
|
+
<pre><code>artiframe> <span class="fn">servir</span> <span class="st">8080</span></code></pre>
|
|
977
|
+
</section>
|
|
978
|
+
authentification
|
|
979
|
+
<section id="cli-auth">
|
|
980
|
+
<h2><code>auth</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
981
|
+
<p>Le problème autorise la CLI avec votre compte GitHub (via OAuth Device Flow) à pouvoir envoyer des suggestions et des rapports de bogues.</p>
|
|
982
|
+
<pre><code>artiframe> <span class="fn">authentification</span></code></pre>
|
|
983
|
+
<p>Cette commande imprime un code utilisateur et ouvre la page d'autorisation GitHub dans votre navigateur. Une fois l'autorisation confirmée, le token est stocké en toute sécurité.</p>
|
|
984
|
+
</section>
|
|
985
|
+
suggérer
|
|
986
|
+
<section id="cli-suggest">
|
|
987
|
+
<h2><code>suggest</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
988
|
+
<p>Il vous permet de soumettre des demandes de fonctionnalités, des rapports de bogues ou des suggestions directement à GitHub sans quitter le terminal. avant<code>auth</code>Il est obligatoire de se connecter avec la commande.</p>
|
|
989
|
+
<pre><code>artiframe> <span class="fn">suggérer</span></code></pre>
|
|
990
|
+
<p>Le script vous invite de manière interactive à sélectionner une catégorie, à rédiger un titre et à saisir une description détaillée. Une fois terminé, il est publié sous forme de numéro dans le référentiel officiel ArtiFrame.</p>
|
|
971
991
|
</section>
|
|
972
|
-
|
|
992
|
+
problèmes
|
|
993
|
+
<section id="cli-issues">
|
|
994
|
+
<h2><code>issues</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
995
|
+
<p>Listez les problèmes que vous avez soumis et lisez leurs commentaires directement depuis votre terminal.<code>auth</code>Cela nécessite de se connecter avec la commande.</p>
|
|
996
|
+
<pre><code>artiframe> <span class="fn">problèmes</span> [id]</code></pre>
|
|
997
|
+
<p>Pour voir une liste de vos problèmes<code>issues</code>exécutez-le. Pour voir les détails et commentaires du numéro 4<code>issues 4</code>exécutez-le.</p>
|
|
998
|
+
</section>
|
|
999
|
+
ajouter
|
|
973
1000
|
<section id="cli-add">
|
|
974
|
-
<h2><code>add</code> <span class="tag b-cli">CLI
|
|
975
|
-
<p>C'est la commande la plus puissante qui vous permet d'inclure des modules externes ou des intégrations prêtes à l'emploi dans votre projet. Classique
|
|
976
|
-
<pre><code>artiframe> <span class="fn">
|
|
1001
|
+
<h2><code>add</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
1002
|
+
<p>C'est la commande la plus puissante qui vous permet d'inclure des modules externes ou des intégrations prêtes à l'emploi dans votre projet. Classique<code>composer require</code>Au-delà du processus, il crée des classes de services automatiques (stubs) pour certains modules et<code>.env</code>Il crée automatiquement les définitions nécessaires pour vos fichiers.</p>
|
|
1003
|
+
<pre><code>artiframe> <span class="fn">ajouter</span> <span class="st">package_short_name</span></code></pre>
|
|
977
1004
|
<h3>1. Packages intégrés (en fonction de la classe)</h3>
|
|
978
|
-
<p>Lorsque ces packages sont installés, une classe de service est automatiquement créée et
|
|
1005
|
+
<p>Lorsque ces packages sont installés, une classe de service est automatiquement créée et<code>.env</code>Les clés de connexion sont ajoutées à votre fichier. Ces packages et les emplacements des classes qu'ils créent sont répertoriés ci-dessous :</p>
|
|
979
1006
|
<div class="table-wrapper">
|
|
980
1007
|
<table class="sig-table">
|
|
981
1008
|
<thead>
|
|
982
1009
|
<tr><th>commande</th><th>Forfait Compositeur</th><th>Fichier de classe généré</th></tr>
|
|
983
1010
|
</thead>
|
|
984
1011
|
<tbody>
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
<tr><td><code>add stripe</code></td><td>bande/
|
|
988
|
-
|
|
989
|
-
|
|
1012
|
+
<tr><td><code>add phpmailer</code></td><td>phpmailer/phpmailer</td><td><span class="tag b-core">src/Service/Mailer.php</span></td></tr>
|
|
1013
|
+
<tr><td><code>add iyzico</code></td><td>iyzipay/iyzipay-php</td><td><span class="tag b-core">src/Service/Iyzico.php</span></td></tr>
|
|
1014
|
+
<tr><td><code>add stripe</code></td><td>bande/rayure-php</td><td><span class="tag b-core">src/Service/Stripe.php</span></td></tr>
|
|
1015
|
+
<tr><td><code>add qrcode</code></td><td>endroid/qr-code</td><td><span class="tag b-core">src/Service/QrCode.php</span></td></tr>
|
|
1016
|
+
<tr><td><code>add jwt</code></td><td>firebase/php-jwt</td><td><span class="tag b-core">src/Auth/JwtAuth.php</span></td></tr>
|
|
990
1017
|
<tr><td><code>add image</code></td><td>intervention/image</td><td><span class="tag b-core">src/Service/ImageProcessor.php</span></td></tr>
|
|
991
1018
|
<tr><td><code>add s3</code></td><td>aws/aws-sdk-php</td><td><span class="tag b-core">src/Service/S3Storage.php</span></td></tr>
|
|
992
|
-
<tr><td><code>add sentry</code></td><td>
|
|
1019
|
+
<tr><td><code>add sentry</code></td><td>sentinelle / sentinelle</td><td><span class="tag b-core">src/Service/Sentry.php</span></td></tr>
|
|
993
1020
|
<tr><td><code>add redis</code></td><td>prédis/prédis</td><td><span class="tag b-core">src/Service/RedisCache.php</span></td></tr>
|
|
994
1021
|
<tr><td><code>add pusher</code></td><td>pusher/pusher-php-serveur</td><td><span class="tag b-core">src/Service/Pusher.php</span></td></tr>
|
|
995
1022
|
<tr><td><code>add twilio</code></td><td>twilio/sdk</td><td><span class="tag b-core">src/Service/Twilio.php</span></td></tr>
|
|
@@ -1004,11 +1031,9 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
1004
1031
|
<tr><th>commande</th><th>Forfait Compositeur</th></tr>
|
|
1005
1032
|
</thead>
|
|
1006
1033
|
<tbody>
|
|
1007
|
-
<tr><td><code>add phpmailer</code></td><td>phpmailer/phpmailer</td></tr>
|
|
1008
1034
|
<tr><td><code>add mpdf</code></td><td>mpdf/mpdf</td></tr>
|
|
1009
1035
|
<tr><td><code>add dompdf</code></td><td>dompdf/dompdf</td></tr>
|
|
1010
1036
|
<tr><td><code>add spreadsheet</code></td><td>phpoffice/phpspreadsheet</td></tr>
|
|
1011
|
-
|
|
1012
1037
|
<tr><td><code>add guzzle</code></td><td>avalerhttp/avaler</td></tr>
|
|
1013
1038
|
<tr><td><code>add uuid</code></td><td>ramsey/uuid</td></tr>
|
|
1014
1039
|
<tr><td><code>add carbon</code></td><td>nesbot/carbone</td></tr>
|
|
@@ -1017,101 +1042,87 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
1017
1042
|
</table>
|
|
1018
1043
|
</div>
|
|
1019
1044
|
<div class="alert a-info">
|
|
1020
|
-
<strong>ℹ️ Astuce :</strong>
|
|
1021
|
-
</div>
|
|
1045
|
+
<strong>ℹ️ Astuce :</strong>Pour voir la liste complète des installés ou pris en charge, ouvrez simplement le terminal<code>add list</code>tu peux écrire. Vous pouvez retrouver l'utilisation du code des modules dans le menu "Services intégrés" à droite.</div>
|
|
1022
1046
|
</section>
|
|
1023
|
-
|
|
1047
|
+
====== SERVICES INTÉGRÉS ======
|
|
1024
1048
|
<section id="entegre-servisler">
|
|
1025
|
-
<h2>Services intégrés (Wrapper)
|
|
1026
|
-
<p>Au lieu d'utiliser directement les packages populaires, ArtiFrame
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
<span class="
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
<span class="
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
<
|
|
1062
|
-
<
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
<span class="cm">//
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
<
|
|
1094
|
-
<span class="
|
|
1095
|
-
|
|
1096
|
-
<span class="cm">// 3. Envoi de l'e-mail</span>
|
|
1097
|
-
<span class="var">Mailer</span>::create()
|
|
1098
|
-
-><span class="fn">to</span>(<span class="st">'musteri@mail.com'</span>, <span class="st">'Ahmet Yılmaz'</span>)
|
|
1099
|
-
-><span class="fn">bcc</span>(<span class="st">'arsiv@sirket.com'</span>) <span class="cm">// Le client ne peut pas voir cela</span>
|
|
1100
|
-
-><span class="fn">subject</span>(<span class="st">'Siparişiniz Onaylandı: '</span> . <span class="var">$siparisNo</span>)
|
|
1101
|
-
-><span class="fn">html</span>(<span class="var">$htmlIcerik</span>)
|
|
1102
|
-
-><span class="fn">attach</span>(<span class="var">$pdfDosyasi</span>, <span class="st">'Siparis_Faturasi.pdf'</span>)
|
|
1103
|
-
-><span class="fn">send</span>();</code></pre>
|
|
1104
|
-
</div>
|
|
1105
|
-
|
|
1106
|
-
<div class="card" id="svc-iyzico">
|
|
1107
|
-
<h2>Iyzico <span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Ücretli/Lisanslı Servis">$</span></h2>
|
|
1108
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong> Pour utiliser l'infrastructure de paiement Iyzico <a href="https://www.iyzico.com" style="color: var(--green); font-weight: bold;" target="_blank">iyzico.com</a> (en direct) ou <a href="https://sandbox-merchants.iyzipay.com/" style="color: var(--green); font-weight: bold;" target="_blank">bac à sable.iyzipay.com</a> Vous devez créer un compte vendeur via (test) et obtenir vos clés API/Secret.</div>
|
|
1049
|
+
<h2>Services intégrés (Wrapper)<span class="tag b-core">bouts</span></h2>
|
|
1050
|
+
<p>Au lieu d'utiliser directement les packages populaires, ArtiFrame<strong>Wrapper préconfiguré</strong>Il propose des cours pour votre usage.</p>
|
|
1051
|
+
<div class="card" id="svc-qrcode">
|
|
1052
|
+
<h2>Code QR</h2>
|
|
1053
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Cours Immersif :</strong> <code>add qrcode</code>quand vous exécutez la commande<code>endroid/qr-code</code>la bibliothèque est chargée et<code>src/Service/QrCode.php</code>La classe wrapper est créée.</div>
|
|
1054
|
+
<p>Il s'agit d'une classe moderne et fluide qui cache les processus difficiles de production d'objets (Builder/Writer) de la bibliothèque Endroid QR Code, où vous pouvez créer un code QR sur une seule ligne et y intégrer un logo.</p>
|
|
1055
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Méthodes et utilisations</h3>
|
|
1056
|
+
<ul style="line-height: 1.6; margin-bottom: 20px;">
|
|
1057
|
+
<li><code>->generate('Metin')</code>: Spécifie le texte ou l'URL à convertir en code QR et démarre la chaîne.</li>
|
|
1058
|
+
<li><code>->size(300)</code>: Détermine la largeur/hauteur du QR code en pixels (ex : 300).</li>
|
|
1059
|
+
<li><code>->margin(10)</code>: Détermine l'espace blanc autour du code QR.</li>
|
|
1060
|
+
<li><code>->color('#000000', '#ffffff')</code>: Spécifie les couleurs de premier plan (lignes) et d’arrière-plan sous forme de code HEX. (par exemple :<code>#000000, #ffffff</code>).</li>
|
|
1061
|
+
<li><code>->logo('/path/logo.png', 50, true)</code>: Incorpore une image (logo) au milieu du QR code. Récupère le chemin physique vers le logo, sa taille et si son arrière-plan sera perforé.</li>
|
|
1062
|
+
<li><code>->format('png')</code>: Détermine le format de sortie.<code>png</code>ou<code>svg</code>est pris en charge. Par défaut : png.</li>
|
|
1063
|
+
<li><code>->save('/path/save.png')</code>: Enregistre le code QR créé dans un fichier physique sur le serveur.</li>
|
|
1064
|
+
<li><code>->base64()</code>: Code QR HTML<code><img src="..."></code>Il le renvoie sous forme de chaîne base64 afin que vous puissiez l'utiliser directement dans la balise.</li>
|
|
1065
|
+
<li><code>->output()</code>: Imprime le code QR directement sur le navigateur avec les en-têtes HTTP appropriés.</li>
|
|
1066
|
+
</ul>
|
|
1067
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Exemples d'utilisation</h3>
|
|
1068
|
+
<pre><code><span class="kw">utiliser</span> <span class="var">Application\Service\QrCode</span>;
|
|
1069
|
+
<span class="cm">// Exemple 1 : Impression d'une image HTML à l'écran</span>
|
|
1070
|
+
<span class="var">$base64</span> = <span class="var">Code QR</span>::generate(<span class="st">'https://artiframe.dev'</span>)
|
|
1071
|
+
-><span class="fn">toi</span>(400)
|
|
1072
|
+
-><span class="fn">logo</span>(<span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/actifs/logo.png'</span>)
|
|
1073
|
+
-><span class="fn">base64</span>();
|
|
1074
|
+
<span class="kw">écho</span> <span class="st">'<img src="'</span> . <span class="var">$base64</span> . <span class="st">'"alt="QR">'</span>;
|
|
1075
|
+
<span class="cm">// Exemple 2 : Enregistrement au format PNG physique</span>
|
|
1076
|
+
<span class="var">Code QR</span>::generate(<span class="st">« Informations sur la carte VCARD »</span>)
|
|
1077
|
+
-><span class="fn">couleur</span>(<span class="st">'#ff0000'</span>, <span class="st">'#ffffff'</span>)
|
|
1078
|
+
-><span class="fn">sauvegarder</span>(<span class="st">'/temp/user_card.png'</span>);
|
|
1079
|
+
<span class="cm">// Exemple 3 : Transférer l'image vers le navigateur en tant que point de terminaison de l'API</span>
|
|
1080
|
+
<span class="var">Code QR</span>::generate(<span class="st">'https://artilingo.com'</span>)-><span class="fn">sortir</span>();</code></pre>
|
|
1081
|
+
</div>
|
|
1082
|
+
<div class="card" id="svc-phpmailer">
|
|
1083
|
+
<h2>PHPMailer (Courrier)</h2>
|
|
1084
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Installation automatique de .env :</strong> <code>add phpmailer</code>Paramètres SMTP lorsque vous exécutez la commande<code>.env</code>automatiquement ajouté à votre dossier et<code>src/Service/Mailer.php</code>la classe est créée.</div>
|
|
1085
|
+
<p>Il s'agit d'une classe Wrapper beaucoup plus moderne, fluide et sécurisée (protégée par CRLF) qui s'exécute sur la bibliothèque PHPMailer. Toutes les méthodes proposées par la classe sont chaînables.</p>
|
|
1086
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Méthodes et utilisations</h3>
|
|
1087
|
+
<ul style="line-height: 1.6; margin-bottom: 20px;">
|
|
1088
|
+
<li><code>->to('mail@adres.com', 'İsim')</code>: Détermine à qui l'e-mail sera envoyé.</li>
|
|
1089
|
+
<li><code>->cc('mail@adres.com')</code>: Ajoute des destinataires d'informations (copie carbone).</li>
|
|
1090
|
+
<li><code>->bcc('mail@adres.com')</code>: Ajoute des destinataires Blind Carbon Copy. Les destinataires principaux ne peuvent pas voir ces adresses.</li>
|
|
1091
|
+
<li><code>->subject('Konu')</code>: Détermine le titre (sujet) de l'e-mail.</li>
|
|
1092
|
+
<li><code>->attach('/path/fatura.pdf', 'Isim.pdf')</code>: Il place un fichier physique sur le serveur (ou temporaire) dans l'e-mail en pièce jointe.</li>
|
|
1093
|
+
<li><code>->embedImage('/path/logo.png', 'logo_cid')</code>: À utiliser en HTML dans l'e-mail (<code><img src="cid:logo_cid"></code>) intègre des images.</li>
|
|
1094
|
+
<li><code>->html('HTML Kodu')</code>: Définit le contenu HTML de l'e-mail. Crée automatiquement une version en texte brut (AltBody) pour des raisons de sécurité.</li>
|
|
1095
|
+
<li><code>->text('Düz Metin')</code>: Utilisé si vous souhaitez envoyer l'e-mail uniquement en texte brut.</li>
|
|
1096
|
+
<li><code>->send()</code>: termine toutes les transactions de la chaîne et envoie l'e-mail via SMTP. S'il y a une erreur, il lève une exception.</li>
|
|
1097
|
+
</ul>
|
|
1098
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Exemple avancé : modèle PHP (affichage) et soumission de fichiers dynamiques</h3>
|
|
1099
|
+
<p>Si vous ne souhaitez pas écrire le contenu HTML de l'e-mail dans une chaîne comme du code spaghetti,<code>ob_start()</code>Vous pouvez importer un fichier modèle PHP externe (avec des variables à l'intérieur) et intégrer un PDF généré par le système directement dans l'e-mail en utilisant :</p>
|
|
1100
|
+
<pre><code><span class="kw">utiliser</span> <span class="var">Application\Service\Mailer</span>;
|
|
1101
|
+
<span class="cm">// 1. Vos données dynamiques</span>
|
|
1102
|
+
<span class="var">$commandeNon</span> = <span class="st">'#90210'</span>;
|
|
1103
|
+
<span class="var">$pdfFichier</span> = <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/temp/facture_90210.pdf'</span>;
|
|
1104
|
+
<span class="cm">// 2. Chargement du modèle HTML depuis l'extérieur (Output Buffering)</span>
|
|
1105
|
+
<span class="fn">ob_start</span>();
|
|
1106
|
+
<span class="kw">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/views/email/order.php'</span>;
|
|
1107
|
+
<span class="var">$htmlContenu</span> = <span class="fn">ob_get_clean</span>();
|
|
1108
|
+
<span class="cm">// 3. Envoi de l'e-mail</span>
|
|
1109
|
+
<span class="var">Courrier</span>::create()
|
|
1110
|
+
-><span class="fn">à</span>(<span class="st">'custeri@mail.com'</span>, <span class="st">'Ahmet Yilmaz'</span>)
|
|
1111
|
+
-><span class="fn">Cci</span>(<span class="st">'archive@entreprise.com'</span>) <span class="cm">// Le client ne peut pas voir ceci</span>
|
|
1112
|
+
-><span class="fn">sujet</span>(<span class="st">'Votre commande confirmée :'</span> . <span class="var">$commandeNon</span>)
|
|
1113
|
+
-><span class="fn">HTML</span>(<span class="var">$htmlContenu</span>)
|
|
1114
|
+
-><span class="fn">attacher</span>(<span class="var">$pdfFichier</span>, <span class="st">'Commande_Facture.pdf'</span>)
|
|
1115
|
+
-><span class="fn">envoyer</span>();</code></pre>
|
|
1116
|
+
</div>
|
|
1117
|
+
<div class="card" id="svc-iyzico">
|
|
1118
|
+
<h2>Iyzico<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
1119
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour utiliser l'infrastructure de paiement Iyzico<a href="https://www.iyzico.com" style="color: var(--green); font-weight: bold;" target="_blank">iyzico.com</a>(en direct) ou<a href="https://sandbox-merchants.iyzipay.com/" style="color: var(--green); font-weight: bold;" target="_blank">bac à sable.iyzipay.com</a>Vous devez créer un compte vendeur via (test) et obtenir vos clés API/Secret.</div>
|
|
1109
1120
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
1110
1121
|
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/Iyzico.php</code>
|
|
1111
1122
|
</div>
|
|
1112
1123
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service de paiement Iyzico<br/>Fournit un wrapper propre autour du SDK iyzipay-php pour le traitement des paiements,<br/>Flux 3D Secure, remboursements, annulations, coffre-fort de cartes et sous-marchands de la marketplace.<br/>Variables d'environnement requises :<br/>IYZICO_API_KEY — Votre clé API iyzico<br/>IYZICO_SECRET_KEY — Votre clé secrète iyzico<br/>IYZICO_BASE_URL — URL de base de l'API (https://sandbox-api.iyzipay.com ou https://api.iyzipay.com)</p>
|
|
1113
1124
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1114
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
1125
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
1115
1126
|
</div>
|
|
1116
1127
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
1117
1128
|
<div class="accordion-group">
|
|
@@ -1153,7 +1164,6 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
1153
1164
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1154
1165
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1155
1166
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1156
|
-
|
|
1157
1167
|
$response = $iyzico->pay([
|
|
1158
1168
|
'price' => 150.50,
|
|
1159
1169
|
'paidPrice' => 160.00,
|
|
@@ -1186,7 +1196,6 @@ $response = $iyzico->pay([
|
|
|
1186
1196
|
]
|
|
1187
1197
|
]
|
|
1188
1198
|
]);
|
|
1189
|
-
|
|
1190
1199
|
if ($response['status'] === 'success') {
|
|
1191
1200
|
$paymentId = $response['data']['paymentId'];
|
|
1192
1201
|
echo "Ödeme başarılı! ID: " . $paymentId;
|
|
@@ -1219,7 +1228,6 @@ if ($response['status'] === 'success') {
|
|
|
1219
1228
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1220
1229
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1221
1230
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1222
|
-
|
|
1223
1231
|
$response = $iyzico->threeDSecureInit([
|
|
1224
1232
|
'price' => 500.00,
|
|
1225
1233
|
'paidPrice' => 500.00,
|
|
@@ -1253,7 +1261,6 @@ $response = $iyzico->threeDSecureInit([
|
|
|
1253
1261
|
]
|
|
1254
1262
|
]
|
|
1255
1263
|
]);
|
|
1256
|
-
|
|
1257
1264
|
if ($response['status'] === 'success') {
|
|
1258
1265
|
// Bankanın 3D doğrulama sayfasına yönlendirecek HTML formu
|
|
1259
1266
|
echo $response['data']['threeDSHtmlContent'];
|
|
@@ -1285,10 +1292,8 @@ if ($response['status'] === 'success') {
|
|
|
1285
1292
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1286
1293
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1287
1294
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1288
|
-
|
|
1289
1295
|
// Bankadan dönen POST verisi (paymentId ve conversationData vb.)
|
|
1290
1296
|
$response = $iyzico->threeDSecureComplete($_POST);
|
|
1291
|
-
|
|
1292
1297
|
if ($response['status'] === 'success') {
|
|
1293
1298
|
echo "3D Doğrulama başarılı, ödeme çekildi: " . $response['data']['paymentId'];
|
|
1294
1299
|
}</code></pre>
|
|
@@ -1319,9 +1324,7 @@ if ($response['status'] === 'success') {
|
|
|
1319
1324
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1320
1325
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1321
1326
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1322
|
-
|
|
1323
1327
|
$response = $iyzico->refund('dummy_data', $price);
|
|
1324
|
-
|
|
1325
1328
|
if ($response['status'] === 'success') {
|
|
1326
1329
|
// Başarılı
|
|
1327
1330
|
}</code></pre>
|
|
@@ -1350,9 +1353,7 @@ if ($response['status'] === 'success') {
|
|
|
1350
1353
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1351
1354
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1352
1355
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1353
|
-
|
|
1354
1356
|
$response = $iyzico->cancel('dummy_data');
|
|
1355
|
-
|
|
1356
1357
|
if ($response['status'] === 'success') {
|
|
1357
1358
|
// Başarılı
|
|
1358
1359
|
}</code></pre>
|
|
@@ -1388,9 +1389,7 @@ if ($response['status'] === 'success') {
|
|
|
1388
1389
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1389
1390
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1390
1391
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1391
|
-
|
|
1392
1392
|
$response = $iyzico->saveCard($cardData, $email);
|
|
1393
|
-
|
|
1394
1393
|
if ($response['status'] === 'success') {
|
|
1395
1394
|
// Başarılı
|
|
1396
1395
|
}</code></pre>
|
|
@@ -1421,9 +1420,7 @@ if ($response['status'] === 'success') {
|
|
|
1421
1420
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1422
1421
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1423
1422
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1424
|
-
|
|
1425
1423
|
$response = $iyzico->listCards($cardUserKey);
|
|
1426
|
-
|
|
1427
1424
|
if ($response['status'] === 'success') {
|
|
1428
1425
|
// Başarılı
|
|
1429
1426
|
}</code></pre>
|
|
@@ -1452,9 +1449,7 @@ if ($response['status'] === 'success') {
|
|
|
1452
1449
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1453
1450
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1454
1451
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1455
|
-
|
|
1456
1452
|
$response = $iyzico->checkPayment('dummy_data');
|
|
1457
|
-
|
|
1458
1453
|
if ($response['status'] === 'success') {
|
|
1459
1454
|
// Başarılı
|
|
1460
1455
|
}</code></pre>
|
|
@@ -1495,9 +1490,7 @@ if ($response['status'] === 'success') {
|
|
|
1495
1490
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1496
1491
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1497
1492
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$iyzico = new \Service\Iyzico();
|
|
1498
|
-
|
|
1499
1493
|
$response = $iyzico->createSubMerchant($data);
|
|
1500
|
-
|
|
1501
1494
|
if ($response['status'] === 'success') {
|
|
1502
1495
|
// Başarılı
|
|
1503
1496
|
}</code></pre>
|
|
@@ -1515,14 +1508,14 @@ if ($response['status'] === 'success') {
|
|
|
1515
1508
|
</div>
|
|
1516
1509
|
</div>
|
|
1517
1510
|
<div class="card" id="svc-stripe">
|
|
1518
|
-
<h2>Bande
|
|
1519
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>
|
|
1511
|
+
<h2>Bande<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
1512
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour utiliser l'infrastructure de paiement mondiale Stripe<a href="https://stripe.com" style="color: var(--green); font-weight: bold;" target="_blank">stripe.com</a>Vous devez créer un compte via et obtenir vos clés Publique et Secrète depuis le panel développeur.</div>
|
|
1520
1513
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
1521
1514
|
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/Stripe.php</code>
|
|
1522
1515
|
</div>
|
|
1523
1516
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service de paiement Stripe<br/>Fournit un wrapper propre autour du SDK stripe-php pour le traitement des paiements,<br/>gestion des clients, abonnements, création de produits et gestion des webhooks.<br/>Variables d'environnement requises :<br/>STRIPE_SECRET_KEY — Votre clé API secrète Stripe<br/>STRIPE_PUBLISHABLE_KEY — Votre clé publiable Stripe (pour référence frontale)<br/>STRIPE_WEBHOOK_SECRET — Secret de signature du point de terminaison du Webhook</p>
|
|
1524
1517
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1525
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
1518
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
1526
1519
|
</div>
|
|
1527
1520
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
1528
1521
|
<div class="accordion-group">
|
|
@@ -1541,12 +1534,10 @@ if ($response['status'] === 'success') {
|
|
|
1541
1534
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1542
1535
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1543
1536
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1544
|
-
|
|
1545
1537
|
$response = $stripe->createPaymentIntent(199.50, 'usd', [
|
|
1546
1538
|
'order_id' => 'ORD-54321',
|
|
1547
1539
|
'customer_email' => 'utku@artilingo.com'
|
|
1548
1540
|
]);
|
|
1549
|
-
|
|
1550
1541
|
if ($response['status'] === 'success') {
|
|
1551
1542
|
$clientSecret = $response['data']['clientSecret'];
|
|
1552
1543
|
echo json_encode(['clientSecret' => $clientSecret]);
|
|
@@ -1576,9 +1567,7 @@ if ($response['status'] === 'success') {
|
|
|
1576
1567
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1577
1568
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1578
1569
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1579
|
-
|
|
1580
1570
|
$response = $stripe->confirmPayment('dummy_data');
|
|
1581
|
-
|
|
1582
1571
|
if ($response['status'] === 'success') {
|
|
1583
1572
|
// Başarılı
|
|
1584
1573
|
}</code></pre>
|
|
@@ -1610,9 +1599,7 @@ if ($response['status'] === 'success') {
|
|
|
1610
1599
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1611
1600
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1612
1601
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1613
|
-
|
|
1614
1602
|
$response = $stripe->charge($amount, $source);
|
|
1615
|
-
|
|
1616
1603
|
if ($response['status'] === 'success') {
|
|
1617
1604
|
// Başarılı
|
|
1618
1605
|
}</code></pre>
|
|
@@ -1642,9 +1629,7 @@ if ($response['status'] === 'success') {
|
|
|
1642
1629
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1643
1630
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1644
1631
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1645
|
-
|
|
1646
1632
|
$response = $stripe->refund('dummy_data');
|
|
1647
|
-
|
|
1648
1633
|
if ($response['status'] === 'success') {
|
|
1649
1634
|
// Başarılı
|
|
1650
1635
|
}</code></pre>
|
|
@@ -1675,9 +1660,7 @@ if ($response['status'] === 'success') {
|
|
|
1675
1660
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1676
1661
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1677
1662
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1678
|
-
|
|
1679
1663
|
$response = $stripe->createCustomer($email);
|
|
1680
|
-
|
|
1681
1664
|
if ($response['status'] === 'success') {
|
|
1682
1665
|
// Başarılı
|
|
1683
1666
|
}</code></pre>
|
|
@@ -1706,9 +1689,7 @@ if ($response['status'] === 'success') {
|
|
|
1706
1689
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1707
1690
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1708
1691
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1709
|
-
|
|
1710
1692
|
$response = $stripe->subscribe('dummy_data', 'dummy_data');
|
|
1711
|
-
|
|
1712
1693
|
if ($response['status'] === 'success') {
|
|
1713
1694
|
// Başarılı
|
|
1714
1695
|
}</code></pre>
|
|
@@ -1737,9 +1718,7 @@ if ($response['status'] === 'success') {
|
|
|
1737
1718
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1738
1719
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1739
1720
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1740
|
-
|
|
1741
1721
|
$response = $stripe->cancelSubscription('dummy_data');
|
|
1742
|
-
|
|
1743
1722
|
if ($response['status'] === 'success') {
|
|
1744
1723
|
// Başarılı
|
|
1745
1724
|
}</code></pre>
|
|
@@ -1770,9 +1749,7 @@ if ($response['status'] === 'success') {
|
|
|
1770
1749
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1771
1750
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1772
1751
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1773
|
-
|
|
1774
1752
|
$response = $stripe->createProduct('dummy_data', $price);
|
|
1775
|
-
|
|
1776
1753
|
if ($response['status'] === 'success') {
|
|
1777
1754
|
// Başarılı
|
|
1778
1755
|
}</code></pre>
|
|
@@ -1802,9 +1779,7 @@ if ($response['status'] === 'success') {
|
|
|
1802
1779
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1803
1780
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1804
1781
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1805
|
-
|
|
1806
1782
|
$response = $stripe->webhook($payload, $signature);
|
|
1807
|
-
|
|
1808
1783
|
if ($response['status'] === 'success') {
|
|
1809
1784
|
// Başarılı
|
|
1810
1785
|
}</code></pre>
|
|
@@ -1833,9 +1808,7 @@ if ($response['status'] === 'success') {
|
|
|
1833
1808
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1834
1809
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1835
1810
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$stripe = new \Service\Stripe();
|
|
1836
|
-
|
|
1837
1811
|
$response = $stripe->listPayments();
|
|
1838
|
-
|
|
1839
1812
|
if ($response['status'] === 'success') {
|
|
1840
1813
|
// Başarılı
|
|
1841
1814
|
}</code></pre>
|
|
@@ -1860,7 +1833,7 @@ if ($response['status'] === 'success') {
|
|
|
1860
1833
|
</div>
|
|
1861
1834
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service d'authentification JWT<br/>Fournit un wrapper propre autour de firebase/php-jwt pour la génération de jetons,<br/>vérification, actualisation et intégration du middleware HTTP.<br/>Variables d'environnement requises :<br/>JWT_SECRET_KEY — Clé secrète utilisée pour signer et vérifier les jetons<br/>JWT_ALGORITHM — Algorithme de signature (par exemple HS256, HS384, HS512)<br/>JWT_EXPIRY — Durée de vie du jeton par défaut en secondes (par exemple 3 600)</p>
|
|
1862
1835
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1863
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
1836
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
1864
1837
|
</div>
|
|
1865
1838
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
1866
1839
|
<div class="accordion-group">
|
|
@@ -1878,13 +1851,11 @@ if ($response['status'] === 'success') {
|
|
|
1878
1851
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1879
1852
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1880
1853
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
1881
|
-
|
|
1882
1854
|
$payload = [
|
|
1883
1855
|
'user_id' => 1453,
|
|
1884
1856
|
'role' => 'admin',
|
|
1885
1857
|
'email' => 'utku@artilingo.com'
|
|
1886
1858
|
];
|
|
1887
|
-
|
|
1888
1859
|
$token = $jwt->generate($payload, 7200);
|
|
1889
1860
|
echo "Bearer " . $token;</code></pre>
|
|
1890
1861
|
</div>
|
|
@@ -1916,9 +1887,7 @@ echo "Bearer " . $token;</code></pre>
|
|
|
1916
1887
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1917
1888
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1918
1889
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
1919
|
-
|
|
1920
1890
|
$response = $jwt->verify('dummy_data');
|
|
1921
|
-
|
|
1922
1891
|
if ($response['status'] === 'success') {
|
|
1923
1892
|
// Başarılı
|
|
1924
1893
|
}</code></pre>
|
|
@@ -1950,9 +1919,7 @@ if ($response['status'] === 'success') {
|
|
|
1950
1919
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1951
1920
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1952
1921
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
1953
|
-
|
|
1954
1922
|
$response = $jwt->payload('dummy_data');
|
|
1955
|
-
|
|
1956
1923
|
if ($response['status'] === 'success') {
|
|
1957
1924
|
// Başarılı
|
|
1958
1925
|
}</code></pre>
|
|
@@ -1982,9 +1949,7 @@ if ($response['status'] === 'success') {
|
|
|
1982
1949
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
1983
1950
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
1984
1951
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
1985
|
-
|
|
1986
1952
|
$response = $jwt->refresh('dummy_data');
|
|
1987
|
-
|
|
1988
1953
|
if ($response['status'] === 'success') {
|
|
1989
1954
|
// Başarılı
|
|
1990
1955
|
}</code></pre>
|
|
@@ -2013,9 +1978,7 @@ if ($response['status'] === 'success') {
|
|
|
2013
1978
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2014
1979
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2015
1980
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
2016
|
-
|
|
2017
1981
|
$response = $jwt->isExpired('dummy_data');
|
|
2018
|
-
|
|
2019
1982
|
if ($response['status'] === 'success') {
|
|
2020
1983
|
// Başarılı
|
|
2021
1984
|
}</code></pre>
|
|
@@ -2042,9 +2005,7 @@ true</code></pre>
|
|
|
2042
2005
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2043
2006
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2044
2007
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
2045
|
-
|
|
2046
2008
|
$response = $jwt->getUserId('dummy_data');
|
|
2047
|
-
|
|
2048
2009
|
if ($response['status'] === 'success') {
|
|
2049
2010
|
// Başarılı
|
|
2050
2011
|
}</code></pre>
|
|
@@ -2072,9 +2033,7 @@ if ($response['status'] === 'success') {
|
|
|
2072
2033
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2073
2034
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2074
2035
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
2075
|
-
|
|
2076
2036
|
$response = $jwt->generateRefreshToken($payload);
|
|
2077
|
-
|
|
2078
2037
|
if ($response['status'] === 'success') {
|
|
2079
2038
|
// Başarılı
|
|
2080
2039
|
}</code></pre>
|
|
@@ -2097,9 +2056,7 @@ if ($response['status'] === 'success') {
|
|
|
2097
2056
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2098
2057
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2099
2058
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$jwt = new \Auth\JwtAuth();
|
|
2100
|
-
|
|
2101
2059
|
$response = $jwt->middleware();
|
|
2102
|
-
|
|
2103
2060
|
if ($response['status'] === 'success') {
|
|
2104
2061
|
// Başarılı
|
|
2105
2062
|
}</code></pre>
|
|
@@ -2124,7 +2081,7 @@ if ($response['status'] === 'success') {
|
|
|
2124
2081
|
</div>
|
|
2125
2082
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">ImageProcessor — Wrapper pour l'image d'intervention v3.<br/>Fournit des méthodes simples pour les opérations courantes sur les images telles que<br/>redimensionnement, recadrage, filigrane, conversion de format et compression.<br/>Variables ENV requises :<br/>IMAGE_DRIVER — "gd" ou "imagick" (par défaut : gd)<br/>IMAGE_QUALITY — Qualité JPEG/WebP par défaut 1-100 (par défaut : 80)</p>
|
|
2126
2083
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2127
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
2084
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
2128
2085
|
</div>
|
|
2129
2086
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
2130
2087
|
<div class="accordion-group">
|
|
@@ -2144,7 +2101,6 @@ if ($response['status'] === 'success') {
|
|
|
2144
2101
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2145
2102
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2146
2103
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$img = new \Service\ImageProcessor();
|
|
2147
|
-
|
|
2148
2104
|
$success = $img->resize(
|
|
2149
2105
|
'/var/www/uploads/orijinal.jpg',
|
|
2150
2106
|
'/var/www/uploads/resized.jpg',
|
|
@@ -2179,9 +2135,7 @@ true</code></pre>
|
|
|
2179
2135
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2180
2136
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2181
2137
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2182
|
-
|
|
2183
2138
|
$response = $image->crop($inputPath, $outputPath, 'dummy_data', $height);
|
|
2184
|
-
|
|
2185
2139
|
if ($response['status'] === 'success') {
|
|
2186
2140
|
// Başarılı
|
|
2187
2141
|
}</code></pre>
|
|
@@ -2210,9 +2164,7 @@ true</code></pre>
|
|
|
2210
2164
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2211
2165
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2212
2166
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2213
|
-
|
|
2214
2167
|
$response = $image->thumbnail($inputPath, $outputPath);
|
|
2215
|
-
|
|
2216
2168
|
if ($response['status'] === 'success') {
|
|
2217
2169
|
// Başarılı
|
|
2218
2170
|
}</code></pre>
|
|
@@ -2250,9 +2202,7 @@ left, center, right, bottom-left, bottom, bottom-right.
|
|
|
2250
2202
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2251
2203
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2252
2204
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2253
|
-
|
|
2254
2205
|
$response = $image->watermark($inputPath, $outputPath, $watermarkPath);
|
|
2255
|
-
|
|
2256
2206
|
if ($response['status'] === 'success') {
|
|
2257
2207
|
// Başarılı
|
|
2258
2208
|
}</code></pre>
|
|
@@ -2281,9 +2231,7 @@ true</code></pre>
|
|
|
2281
2231
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2282
2232
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2283
2233
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2284
|
-
|
|
2285
2234
|
$response = $image->toWebp($inputPath);
|
|
2286
|
-
|
|
2287
2235
|
if ($response['status'] === 'success') {
|
|
2288
2236
|
// Başarılı
|
|
2289
2237
|
}</code></pre>
|
|
@@ -2312,9 +2260,7 @@ true</code></pre>
|
|
|
2312
2260
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2313
2261
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2314
2262
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2315
|
-
|
|
2316
2263
|
$response = $image->compress($inputPath);
|
|
2317
|
-
|
|
2318
2264
|
if ($response['status'] === 'success') {
|
|
2319
2265
|
// Başarılı
|
|
2320
2266
|
}</code></pre>
|
|
@@ -2343,9 +2289,7 @@ Returns an array with an 'error' key on failure.</code></pre>
|
|
|
2343
2289
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2344
2290
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2345
2291
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2346
|
-
|
|
2347
2292
|
$response = $image->info($path);
|
|
2348
|
-
|
|
2349
2293
|
if ($response['status'] === 'success') {
|
|
2350
2294
|
// Başarılı
|
|
2351
2295
|
}</code></pre>
|
|
@@ -2366,7 +2310,7 @@ if ($response['status'] === 'success') {
|
|
|
2366
2310
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
2367
2311
|
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">rotate(string $inputPath, string $outputPath, float $angle)</code></summary>
|
|
2368
2312
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
2369
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Faites pivoter une image d
|
|
2313
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Faites pivoter une image d’un angle donné (dans le sens inverse des aiguilles d’une montre).</p>
|
|
2370
2314
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
2371
2315
|
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2372
2316
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
@@ -2378,9 +2322,7 @@ if ($response['status'] === 'success') {
|
|
|
2378
2322
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2379
2323
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2380
2324
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2381
|
-
|
|
2382
2325
|
$response = $image->rotate($inputPath, $outputPath, $angle);
|
|
2383
|
-
|
|
2384
2326
|
if ($response['status'] === 'success') {
|
|
2385
2327
|
// Başarılı
|
|
2386
2328
|
}</code></pre>
|
|
@@ -2408,9 +2350,7 @@ true</code></pre>
|
|
|
2408
2350
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2409
2351
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2410
2352
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$image = new \Service\ImageProcessor();
|
|
2411
|
-
|
|
2412
2353
|
$response = $image->greyscale($inputPath, $outputPath);
|
|
2413
|
-
|
|
2414
2354
|
if ($response['status'] === 'success') {
|
|
2415
2355
|
// Başarılı
|
|
2416
2356
|
}</code></pre>
|
|
@@ -2427,14 +2367,14 @@ true</code></pre>
|
|
|
2427
2367
|
</div>
|
|
2428
2368
|
</div>
|
|
2429
2369
|
<div class="card" id="svc-s3">
|
|
2430
|
-
<h2>AWS S3
|
|
2431
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>
|
|
2370
|
+
<h2>AWS S3<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
2371
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour utiliser le compartiment S3<a href="https://aws.amazon.com/s3/" style="color: var(--green); font-weight: bold;" target="_blank">aws.amazon.com/s3</a>Vous devez ouvrir un compte AWS via , créer un bucket et obtenir une clé d'accès et une clé secrète avec une autorisation d'accès par programmation via IAM.</div>
|
|
2432
2372
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
2433
2373
|
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/S3Storage.php</code>
|
|
2434
2374
|
</div>
|
|
2435
2375
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">S3Storage — Wrapper pour le SDK AWS S3.<br/>Fournit des méthodes simples pour télécharger, télécharger, supprimer, répertorier,<br/>et la gestion des fichiers sur Amazon S3, MinIO, DigitalOcean Spaces ou tout autre<br/>Stockage d'objets compatible S3.<br/>Variables ENV requises :<br/>AWS_ACCESS_KEY_ID — Clé d'accès IAM<br/>AWS_SECRET_ACCESS_KEY — Clé secrète IAM<br/>AWS_DEFAULT_REGION — par exemple. "eu-central-1"<br/>AWS_BUCKET — Nom du compartiment par défaut<br/>Variables ENV facultatives :<br/>AWS_ENDPOINT — URL de point de terminaison personnalisée (MinIO, Espaces, etc.)</p>
|
|
2436
2376
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2437
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
2377
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
2438
2378
|
</div>
|
|
2439
2379
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
2440
2380
|
<div class="accordion-group">
|
|
@@ -2453,9 +2393,7 @@ true</code></pre>
|
|
|
2453
2393
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2454
2394
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2455
2395
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2456
|
-
|
|
2457
2396
|
$response = $s3->upload($localPath, $remotePath);
|
|
2458
|
-
|
|
2459
2397
|
if ($response['status'] === 'success') {
|
|
2460
2398
|
// Başarılı
|
|
2461
2399
|
}</code></pre>
|
|
@@ -2487,9 +2425,7 @@ if ($response['status'] === 'success') {
|
|
|
2487
2425
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2488
2426
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2489
2427
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2490
|
-
|
|
2491
2428
|
$response = $s3->uploadFromString($content, $remotePath, $contentType);
|
|
2492
|
-
|
|
2493
2429
|
if ($response['status'] === 'success') {
|
|
2494
2430
|
// Başarılı
|
|
2495
2431
|
}</code></pre>
|
|
@@ -2519,9 +2455,7 @@ if ($response['status'] === 'success') {
|
|
|
2519
2455
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2520
2456
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2521
2457
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2522
|
-
|
|
2523
2458
|
$response = $s3->download($remotePath, $localPath);
|
|
2524
|
-
|
|
2525
2459
|
if ($response['status'] === 'success') {
|
|
2526
2460
|
// Başarılı
|
|
2527
2461
|
}</code></pre>
|
|
@@ -2548,9 +2482,7 @@ true</code></pre>
|
|
|
2548
2482
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2549
2483
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2550
2484
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2551
|
-
|
|
2552
2485
|
$response = $s3->delete($remotePath);
|
|
2553
|
-
|
|
2554
2486
|
if ($response['status'] === 'success') {
|
|
2555
2487
|
// Başarılı
|
|
2556
2488
|
}</code></pre>
|
|
@@ -2571,15 +2503,13 @@ true</code></pre>
|
|
|
2571
2503
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
2572
2504
|
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2573
2505
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
2574
|
-
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>@param array<string
|
|
2506
|
+
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>@param array<string>$remotePaths Liste des clés d'objet à supprimer.</string></code></pre>
|
|
2575
2507
|
</div>
|
|
2576
2508
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
2577
2509
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2578
2510
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2579
2511
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2580
|
-
|
|
2581
2512
|
$response = $s3->deleteMany($remotePaths);
|
|
2582
|
-
|
|
2583
2513
|
if ($response['status'] === 'success') {
|
|
2584
2514
|
// Başarılı
|
|
2585
2515
|
}</code></pre>
|
|
@@ -2606,9 +2536,7 @@ true</code></pre>
|
|
|
2606
2536
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2607
2537
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2608
2538
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2609
|
-
|
|
2610
2539
|
$response = $s3->url($remotePath);
|
|
2611
|
-
|
|
2612
2540
|
if ($response['status'] === 'success') {
|
|
2613
2541
|
// Başarılı
|
|
2614
2542
|
}</code></pre>
|
|
@@ -2636,9 +2564,7 @@ if ($response['status'] === 'success') {
|
|
|
2636
2564
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2637
2565
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2638
2566
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2639
|
-
|
|
2640
2567
|
$response = $s3->signedUrl($remotePath);
|
|
2641
|
-
|
|
2642
2568
|
if ($response['status'] === 'success') {
|
|
2643
2569
|
// Başarılı
|
|
2644
2570
|
}</code></pre>
|
|
@@ -2655,7 +2581,7 @@ if ($response['status'] === 'success') {
|
|
|
2655
2581
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
2656
2582
|
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">exists(string $remotePath)</code></summary>
|
|
2657
2583
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
2658
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Vérifiez si un objet existe dans le
|
|
2584
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Vérifiez si un objet existe dans le compartiment.</p>
|
|
2659
2585
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
2660
2586
|
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2661
2587
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
@@ -2665,9 +2591,7 @@ if ($response['status'] === 'success') {
|
|
|
2665
2591
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2666
2592
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2667
2593
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2668
|
-
|
|
2669
2594
|
$response = $s3->exists($remotePath);
|
|
2670
|
-
|
|
2671
2595
|
if ($response['status'] === 'success') {
|
|
2672
2596
|
// Başarılı
|
|
2673
2597
|
}</code></pre>
|
|
@@ -2694,9 +2618,7 @@ true</code></pre>
|
|
|
2694
2618
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2695
2619
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2696
2620
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2697
|
-
|
|
2698
2621
|
$response = $s3->list();
|
|
2699
|
-
|
|
2700
2622
|
if ($response['status'] === 'success') {
|
|
2701
2623
|
// Başarılı
|
|
2702
2624
|
}</code></pre>
|
|
@@ -2726,9 +2648,7 @@ if ($response['status'] === 'success') {
|
|
|
2726
2648
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2727
2649
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2728
2650
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2729
|
-
|
|
2730
2651
|
$response = $s3->copy($from, $to);
|
|
2731
|
-
|
|
2732
2652
|
if ($response['status'] === 'success') {
|
|
2733
2653
|
// Başarılı
|
|
2734
2654
|
}</code></pre>
|
|
@@ -2756,9 +2676,7 @@ true</code></pre>
|
|
|
2756
2676
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2757
2677
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2758
2678
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2759
|
-
|
|
2760
2679
|
$response = $s3->move($from, $to);
|
|
2761
|
-
|
|
2762
2680
|
if ($response['status'] === 'success') {
|
|
2763
2681
|
// Başarılı
|
|
2764
2682
|
}</code></pre>
|
|
@@ -2785,9 +2703,7 @@ true</code></pre>
|
|
|
2785
2703
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2786
2704
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2787
2705
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$s3 = new \Service\S3Storage();
|
|
2788
|
-
|
|
2789
2706
|
$response = $s3->size($remotePath);
|
|
2790
|
-
|
|
2791
2707
|
if ($response['status'] === 'success') {
|
|
2792
2708
|
// Başarılı
|
|
2793
2709
|
}</code></pre>
|
|
@@ -2810,7 +2726,7 @@ if ($response['status'] === 'success') {
|
|
|
2810
2726
|
</div>
|
|
2811
2727
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service de cache Redis<br/>Fournit une interface claire et simple pour les opérations de mise en cache Redis<br/>en utilisant le SDK predis/predis. Toute la configuration est lue depuis $_ENV.<br/>Variables d'environnement requises :<br/>REDIS_HOST — Nom d'hôte du serveur Redis (par défaut : 127.0.0.1)<br/>REDIS_PORT — Port du serveur Redis (par défaut : 6379)<br/>REDIS_PASSWORD — Mot de passe d'authentification Redis (par défaut : null)<br/>REDIS_DATABASE — Index de la base de données Redis (par défaut : 0)</p>
|
|
2812
2728
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2813
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
2729
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
2814
2730
|
</div>
|
|
2815
2731
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
2816
2732
|
<div class="accordion-group">
|
|
@@ -2828,9 +2744,7 @@ if ($response['status'] === 'success') {
|
|
|
2828
2744
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2829
2745
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2830
2746
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2831
|
-
|
|
2832
2747
|
$response = $redis->get($key);
|
|
2833
|
-
|
|
2834
2748
|
if ($response['status'] === 'success') {
|
|
2835
2749
|
// Başarılı
|
|
2836
2750
|
}</code></pre>
|
|
@@ -2859,9 +2773,7 @@ if ($response['status'] === 'success') {
|
|
|
2859
2773
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2860
2774
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2861
2775
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2862
|
-
|
|
2863
2776
|
$response = $redis->set($key, $value);
|
|
2864
|
-
|
|
2865
2777
|
if ($response['status'] === 'success') {
|
|
2866
2778
|
// Başarılı
|
|
2867
2779
|
}</code></pre>
|
|
@@ -2888,9 +2800,7 @@ true</code></pre>
|
|
|
2888
2800
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2889
2801
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2890
2802
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2891
|
-
|
|
2892
2803
|
$response = $redis->has($key);
|
|
2893
|
-
|
|
2894
2804
|
if ($response['status'] === 'success') {
|
|
2895
2805
|
// Başarılı
|
|
2896
2806
|
}</code></pre>
|
|
@@ -2917,9 +2827,7 @@ true</code></pre>
|
|
|
2917
2827
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2918
2828
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2919
2829
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2920
|
-
|
|
2921
2830
|
$response = $redis->forget($key);
|
|
2922
|
-
|
|
2923
2831
|
if ($response['status'] === 'success') {
|
|
2924
2832
|
// Başarılı
|
|
2925
2833
|
}</code></pre>
|
|
@@ -2948,9 +2856,7 @@ true</code></pre>
|
|
|
2948
2856
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2949
2857
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2950
2858
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2951
|
-
|
|
2952
2859
|
$response = $redis->remember($key, $ttl, $callback);
|
|
2953
|
-
|
|
2954
2860
|
if ($response['status'] === 'success') {
|
|
2955
2861
|
// Başarılı
|
|
2956
2862
|
}</code></pre>
|
|
@@ -2980,9 +2886,7 @@ if ($response['status'] === 'success') {
|
|
|
2980
2886
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2981
2887
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
2982
2888
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
2983
|
-
|
|
2984
2889
|
$response = $redis->increment($key);
|
|
2985
|
-
|
|
2986
2890
|
if ($response['status'] === 'success') {
|
|
2987
2891
|
// Başarılı
|
|
2988
2892
|
}</code></pre>
|
|
@@ -3010,9 +2914,7 @@ true</code></pre>
|
|
|
3010
2914
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3011
2915
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3012
2916
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3013
|
-
|
|
3014
2917
|
$response = $redis->decrement($key);
|
|
3015
|
-
|
|
3016
2918
|
if ($response['status'] === 'success') {
|
|
3017
2919
|
// Başarılı
|
|
3018
2920
|
}</code></pre>
|
|
@@ -3035,9 +2937,7 @@ true</code></pre>
|
|
|
3035
2937
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3036
2938
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3037
2939
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3038
|
-
|
|
3039
2940
|
$response = $redis->flush();
|
|
3040
|
-
|
|
3041
2941
|
if ($response['status'] === 'success') {
|
|
3042
2942
|
// Başarılı
|
|
3043
2943
|
}</code></pre>
|
|
@@ -3064,9 +2964,7 @@ true</code></pre>
|
|
|
3064
2964
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3065
2965
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3066
2966
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3067
|
-
|
|
3068
2967
|
$response = $redis->keys();
|
|
3069
|
-
|
|
3070
2968
|
if ($response['status'] === 'success') {
|
|
3071
2969
|
// Başarılı
|
|
3072
2970
|
}</code></pre>
|
|
@@ -3095,9 +2993,7 @@ if ($response['status'] === 'success') {
|
|
|
3095
2993
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3096
2994
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3097
2995
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3098
|
-
|
|
3099
2996
|
$response = $redis->ttl($key);
|
|
3100
|
-
|
|
3101
2997
|
if ($response['status'] === 'success') {
|
|
3102
2998
|
// Başarılı
|
|
3103
2999
|
}</code></pre>
|
|
@@ -3125,9 +3021,7 @@ if ($response['status'] === 'success') {
|
|
|
3125
3021
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3126
3022
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3127
3023
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3128
|
-
|
|
3129
3024
|
$response = $redis->expire($key, $seconds);
|
|
3130
|
-
|
|
3131
3025
|
if ($response['status'] === 'success') {
|
|
3132
3026
|
// Başarılı
|
|
3133
3027
|
}</code></pre>
|
|
@@ -3156,9 +3050,7 @@ true</code></pre>
|
|
|
3156
3050
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3157
3051
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3158
3052
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3159
|
-
|
|
3160
3053
|
$response = $redis->hSet($hash, $field, $value);
|
|
3161
|
-
|
|
3162
3054
|
if ($response['status'] === 'success') {
|
|
3163
3055
|
// Başarılı
|
|
3164
3056
|
}</code></pre>
|
|
@@ -3187,9 +3079,7 @@ true</code></pre>
|
|
|
3187
3079
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3188
3080
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3189
3081
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3190
|
-
|
|
3191
3082
|
$response = $redis->hGet($hash, $field);
|
|
3192
|
-
|
|
3193
3083
|
if ($response['status'] === 'success') {
|
|
3194
3084
|
// Başarılı
|
|
3195
3085
|
}</code></pre>
|
|
@@ -3218,9 +3108,7 @@ if ($response['status'] === 'success') {
|
|
|
3218
3108
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3219
3109
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3220
3110
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3221
|
-
|
|
3222
3111
|
$response = $redis->hGetAll($hash);
|
|
3223
|
-
|
|
3224
3112
|
if ($response['status'] === 'success') {
|
|
3225
3113
|
// Başarılı
|
|
3226
3114
|
}</code></pre>
|
|
@@ -3250,9 +3138,7 @@ if ($response['status'] === 'success') {
|
|
|
3250
3138
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3251
3139
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3252
3140
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$redis = new \Service\RedisCache();
|
|
3253
|
-
|
|
3254
3141
|
$response = $redis->hDel($hash, $field);
|
|
3255
|
-
|
|
3256
3142
|
if ($response['status'] === 'success') {
|
|
3257
3143
|
// Başarılı
|
|
3258
3144
|
}</code></pre>
|
|
@@ -3269,14 +3155,14 @@ true</code></pre>
|
|
|
3269
3155
|
</div>
|
|
3270
3156
|
</div>
|
|
3271
3157
|
<div class="card" id="svc-pusher">
|
|
3272
|
-
<h2>poussoir
|
|
3273
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>
|
|
3158
|
+
<h2>poussoir<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
3159
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour communiquer en temps réel via WebSocket<a href="https://pusher.com" style="color: var(--green); font-weight: bold;" target="_blank">pusher.com</a>Vous devez créer une application de chaînes gratuite via et obtenir votre identifiant d'application, votre clé et vos informations secrètes.</div>
|
|
3274
3160
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
3275
3161
|
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/Pusher.php</code>
|
|
3276
3162
|
</div>
|
|
3277
3163
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service en temps réel Pusher<br/>Fournit une interface claire pour les canaux Pusher - diffusion d'événements,<br/>authentifier les canaux privés/de présence et interroger l'état du canal.<br/>Utilise le SDK pusher/pusher-php-server. Toute la configuration à partir de $_ENV.<br/>Variables d'environnement requises :<br/>PUSHER_APP_ID — Votre identifiant d'application Pusher<br/>PUSHER_APP_KEY — Votre clé d'application Pusher<br/>PUSHER_APP_SECRET — Le secret de votre application Pusher<br/>PUSHER_CLUSTER — Région du cluster pusher (par exemple, 'eu', 'us2', 'ap1')</p>
|
|
3278
3164
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3279
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
3165
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
3280
3166
|
</div>
|
|
3281
3167
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
3282
3168
|
<div class="accordion-group">
|
|
@@ -3295,9 +3181,7 @@ true</code></pre>
|
|
|
3295
3181
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3296
3182
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3297
3183
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3298
|
-
|
|
3299
3184
|
$response = $pusher->broadcast($channel, $event, $data);
|
|
3300
|
-
|
|
3301
3185
|
if ($response['status'] === 'success') {
|
|
3302
3186
|
// Başarılı
|
|
3303
3187
|
}</code></pre>
|
|
@@ -3326,9 +3210,7 @@ true</code></pre>
|
|
|
3326
3210
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3327
3211
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3328
3212
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3329
|
-
|
|
3330
3213
|
$response = $pusher->broadcastToMany($channels, $event, $data);
|
|
3331
|
-
|
|
3332
3214
|
if ($response['status'] === 'success') {
|
|
3333
3215
|
// Başarılı
|
|
3334
3216
|
}</code></pre>
|
|
@@ -3357,9 +3239,7 @@ true</code></pre>
|
|
|
3357
3239
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3358
3240
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3359
3241
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3360
|
-
|
|
3361
3242
|
$response = $pusher->toUser('dummy_data', $event, $data);
|
|
3362
|
-
|
|
3363
3243
|
if ($response['status'] === 'success') {
|
|
3364
3244
|
// Başarılı
|
|
3365
3245
|
}</code></pre>
|
|
@@ -3387,9 +3267,7 @@ Returns empty array on failure</code></pre>
|
|
|
3387
3267
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3388
3268
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3389
3269
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3390
|
-
|
|
3391
3270
|
$response = $pusher->channelInfo($channel);
|
|
3392
|
-
|
|
3393
3271
|
if ($response['status'] === 'success') {
|
|
3394
3272
|
// Başarılı
|
|
3395
3273
|
}</code></pre>
|
|
@@ -3419,9 +3297,7 @@ if ($response['status'] === 'success') {
|
|
|
3419
3297
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3420
3298
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3421
3299
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3422
|
-
|
|
3423
3300
|
$response = $pusher->channels();
|
|
3424
|
-
|
|
3425
3301
|
if ($response['status'] === 'success') {
|
|
3426
3302
|
// Başarılı
|
|
3427
3303
|
}</code></pre>
|
|
@@ -3451,9 +3327,7 @@ if ($response['status'] === 'success') {
|
|
|
3451
3327
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3452
3328
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3453
3329
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3454
|
-
|
|
3455
3330
|
$response = $pusher->auth('dummy_data', 'dummy_data');
|
|
3456
|
-
|
|
3457
3331
|
if ($response['status'] === 'success') {
|
|
3458
3332
|
// Başarılı
|
|
3459
3333
|
}</code></pre>
|
|
@@ -3483,9 +3357,7 @@ if ($response['status'] === 'success') {
|
|
|
3483
3357
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3484
3358
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3485
3359
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$pusher = new \Service\Pusher();
|
|
3486
|
-
|
|
3487
3360
|
$response = $pusher->presenceAuth('dummy_data', 'dummy_data', 'dummy_data');
|
|
3488
|
-
|
|
3489
3361
|
if ($response['status'] === 'success') {
|
|
3490
3362
|
// Başarılı
|
|
3491
3363
|
}</code></pre>
|
|
@@ -3502,14 +3374,14 @@ if ($response['status'] === 'success') {
|
|
|
3502
3374
|
</div>
|
|
3503
3375
|
</div>
|
|
3504
3376
|
<div class="card" id="svc-twilio">
|
|
3505
|
-
<h2>Gazouillement
|
|
3506
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>
|
|
3377
|
+
<h2>Gazouillement<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
3378
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour envoyer des messages SMS et WhatsApp<a href="https://www.twilio.com" style="color: var(--green); font-weight: bold;" target="_blank">twilio.com</a>Vous devez ouvrir un compte sur , louer un numéro de téléphone disponible et obtenir les informations de votre compte SID et de votre jeton d'authentification à partir du panneau.</div>
|
|
3507
3379
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
3508
3380
|
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/Twilio.php</code>
|
|
3509
3381
|
</div>
|
|
3510
3382
|
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Service de communication Twilio<br/>Fournit une interface simplifiée pour la messagerie, la voix,<br/>et des API de vérification à l'aide de twilio/sdk. Toute la configuration<br/>est lu à partir de $_ENV.<br/>Variables d'environnement requises :<br/>TWILIO_SID – SID de votre compte Twilio<br/>TWILIO_AUTH_TOKEN — Votre jeton d'authentification Twilio<br/>TWILIO_FROM_NUMBER — Numéro de téléphone « de » par défaut (format E.164, par exemple +15551234567)<br/>Variables d'environnement facultatives :<br/>TWILIO_VERIFY_SID — Vérifier le SID du service (obligatoire pour verifyStart/verifyCheck)</p>
|
|
3511
3383
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3512
|
-
<strong>ℹ️ Retour standard :</strong>
|
|
3384
|
+
<strong>ℹ️ Retour standard :</strong>Toutes les méthodes<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Convertit une chaîne standard au format (avec exceptions).<strong>dans le tableau renvoyé dans la section « Retour attendu » ci-dessous.<code>data</code>La structure détaillée de la clé est affichée.</strong>
|
|
3513
3385
|
</div>
|
|
3514
3386
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
3515
3387
|
<div class="accordion-group">
|
|
@@ -3522,15 +3394,13 @@ if ($response['status'] === 'success') {
|
|
|
3522
3394
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
3523
3395
|
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>@param string $to Recipient phone number in E.164 format (e.g., +905551234567)
|
|
3524
3396
|
@param string $message The SMS body text (max 1600 characters)
|
|
3525
|
-
On error: 'status'
|
|
3397
|
+
On error: 'status' => 'error', 'message' => error description</code></pre>
|
|
3526
3398
|
</div>
|
|
3527
3399
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3528
3400
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3529
3401
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3530
3402
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3531
|
-
|
|
3532
3403
|
$response = $twilio->sendSms($to, $message);
|
|
3533
|
-
|
|
3534
3404
|
if ($response['status'] === 'success') {
|
|
3535
3405
|
// Başarılı
|
|
3536
3406
|
}</code></pre>
|
|
@@ -3560,9 +3430,7 @@ if ($response['status'] === 'success') {
|
|
|
3560
3430
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3561
3431
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3562
3432
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3563
|
-
|
|
3564
3433
|
$response = $twilio->sendWhatsApp($to, $message);
|
|
3565
|
-
|
|
3566
3434
|
if ($response['status'] === 'success') {
|
|
3567
3435
|
// Başarılı
|
|
3568
3436
|
}</code></pre>
|
|
@@ -3581,7 +3449,7 @@ if ($response['status'] === 'success') {
|
|
|
3581
3449
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
3582
3450
|
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">call(string $to, string $twimlUrl)</code></summary>
|
|
3583
3451
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
3584
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Lancez un appel vocal. Passe un appel sortant vers le numéro spécifié. Le comportement de l'appel est défini par le document TwiML à l'URL donnée. L'URL TwiML doit renvoyer des instructions telles que
|
|
3452
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Lancez un appel vocal. Passe un appel sortant vers le numéro spécifié. Le comportement de l'appel est défini par le document TwiML à l'URL donnée. L'URL TwiML doit renvoyer des instructions telles que<say>, <play>, <gather>, etc.</gather></play></say></p>
|
|
3585
3453
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3586
3454
|
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3587
3455
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
@@ -3592,9 +3460,7 @@ if ($response['status'] === 'success') {
|
|
|
3592
3460
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3593
3461
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3594
3462
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3595
|
-
|
|
3596
3463
|
$response = $twilio->call($to, $twimlUrl);
|
|
3597
|
-
|
|
3598
3464
|
if ($response['status'] === 'success') {
|
|
3599
3465
|
// Başarılı
|
|
3600
3466
|
}</code></pre>
|
|
@@ -3625,9 +3491,7 @@ status will be 'pending' on success</code></pre>
|
|
|
3625
3491
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3626
3492
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3627
3493
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3628
|
-
|
|
3629
3494
|
$response = $twilio->verifyStart($to);
|
|
3630
|
-
|
|
3631
3495
|
if ($response['status'] === 'success') {
|
|
3632
3496
|
// Başarılı
|
|
3633
3497
|
}</code></pre>
|
|
@@ -3658,9 +3522,7 @@ status will be 'approved' on successful verification</code></pre>
|
|
|
3658
3522
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3659
3523
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3660
3524
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3661
|
-
|
|
3662
3525
|
$response = $twilio->verifyCheck($to, $code);
|
|
3663
|
-
|
|
3664
3526
|
if ($response['status'] === 'success') {
|
|
3665
3527
|
// Başarılı
|
|
3666
3528
|
}</code></pre>
|
|
@@ -3690,9 +3552,7 @@ if ($response['status'] === 'success') {
|
|
|
3690
3552
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3691
3553
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3692
3554
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3693
|
-
|
|
3694
3555
|
$response = $twilio->getMessageStatus('dummy_data');
|
|
3695
|
-
|
|
3696
3556
|
if ($response['status'] === 'success') {
|
|
3697
3557
|
// Başarılı
|
|
3698
3558
|
}</code></pre>
|
|
@@ -3722,9 +3582,7 @@ if ($response['status'] === 'success') {
|
|
|
3722
3582
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3723
3583
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3724
3584
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3725
|
-
|
|
3726
3585
|
$response = $twilio->listMessages();
|
|
3727
|
-
|
|
3728
3586
|
if ($response['status'] === 'success') {
|
|
3729
3587
|
// Başarılı
|
|
3730
3588
|
}</code></pre>
|
|
@@ -3755,9 +3613,7 @@ if ($response['status'] === 'success') {
|
|
|
3755
3613
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3756
3614
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3757
3615
|
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$twilio = new \Service\Twilio();
|
|
3758
|
-
|
|
3759
3616
|
$response = $twilio->sendBulkSms($recipients, $message);
|
|
3760
|
-
|
|
3761
3617
|
if ($response['status'] === 'success') {
|
|
3762
3618
|
// Başarılı
|
|
3763
3619
|
}</code></pre>
|
|
@@ -3776,85 +3632,25 @@ if ($response['status'] === 'success') {
|
|
|
3776
3632
|
</div>
|
|
3777
3633
|
</div>
|
|
3778
3634
|
<div class="card" id="svc-sentry">
|
|
3779
|
-
<h2>
|
|
3780
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>
|
|
3635
|
+
<h2>sentinelle<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Service payant/sous licence">$</span></h2>
|
|
3636
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Adhésion et clés API :</strong>Pour activer le suivi des erreurs et des performances<a href="https://sentry.io" style="color: var(--green); font-weight: bold;" target="_blank">sentinelle.io</a>Vous devez créer votre compte gratuit via , ajouter un projet PHP et copier l'adresse DSN (Client Key) qui vous a été fournie.</div>
|
|
3781
3637
|
<div class="code-badge" style="margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; font-family: monospace;">
|
|
3782
|
-
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">
|
|
3638
|
+
<strong>Lieu de la classe :</strong> <code style="color: #4ade80;">src/Service/Sentry.php</code>
|
|
3783
3639
|
</div>
|
|
3784
|
-
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;"
|
|
3640
|
+
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Il vous permet de collecter les erreurs et les avertissements de votre projet dans un système de journalisation central. Au début de votre candidature (par ex.<code>ApiControl.php</code>ou<code>ViewControl.php</code>Il est recommandé de commencer en .</p>
|
|
3785
3641
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3786
|
-
<strong>ℹ️
|
|
3787
|
-
</div>
|
|
3642
|
+
<strong>ℹ️ Classe statique :</strong>Cette classe de service est utilisée directement avec les méthodes statiques, vous n'avez pas besoin de créer une nouvelle instance.</div>
|
|
3788
3643
|
<h3>Méthodes et exemples d'utilisation</h3>
|
|
3789
3644
|
<div class="accordion-group">
|
|
3790
3645
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
3791
|
-
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">
|
|
3646
|
+
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">init()</code></summary>
|
|
3792
3647
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
3793
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">
|
|
3648
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Initialise le SDK Sentry en fonction de variables d'environnement. Il doit être appelé une seule fois au tout début de la candidature.</p>
|
|
3794
3649
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3795
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3796
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
3797
|
-
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>}
|
|
3798
|
-
// Capture an informational message
|
|
3799
|
-
captureMessage('Deployment completed', 'info');
|
|
3800
|
-
/
|
|
3801
|
-
// ---------------------------------------------------------------
|
|
3802
|
-
// Guard — only initialize when a DSN is available
|
|
3803
|
-
// ---------------------------------------------------------------
|
|
3804
|
-
if (empty($_ENV['SENTRY_DSN'])) {
|
|
3805
|
-
/**
|
|
3806
|
-
No-op fallback when Sentry is not configured.
|
|
3807
|
-
@param \Throwable $e The exception (ignored).</code></pre>
|
|
3808
|
-
</div>
|
|
3809
3650
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3810
3651
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3811
3652
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3812
|
-
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code
|
|
3813
|
-
|
|
3814
|
-
$response = $sentry->captureError($e);
|
|
3815
|
-
|
|
3816
|
-
if ($response['status'] === 'success') {
|
|
3817
|
-
// Başarılı
|
|
3818
|
-
}</code></pre>
|
|
3819
|
-
</div>
|
|
3820
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3821
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Rendement attendu ($response['data']) :</h4>
|
|
3822
|
-
<pre style="background: rgba(69,26,3,0.4); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #facc15; border: 1px solid rgba(250,204,21,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>[
|
|
3823
|
-
'id' => '...',
|
|
3824
|
-
'success' => true
|
|
3825
|
-
]</code></pre>
|
|
3826
|
-
</div>
|
|
3827
|
-
</div>
|
|
3828
|
-
</div>
|
|
3829
|
-
</div>
|
|
3830
|
-
</details>
|
|
3831
|
-
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
3832
|
-
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">captureMessage(string $message, string $level = 'info')</code></summary>
|
|
3833
|
-
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
3834
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Repli sans opération lorsque Sentry n’est pas configuré.</p>
|
|
3835
|
-
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3836
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3837
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
3838
|
-
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>@param string $message The message (ignored).
|
|
3839
|
-
@param string $level Severity level (ignored).</code></pre>
|
|
3840
|
-
</div>
|
|
3841
|
-
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3842
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3843
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3844
|
-
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$sentry = new \Service\sentry();
|
|
3845
|
-
|
|
3846
|
-
$response = $sentry->captureMessage($message);
|
|
3847
|
-
|
|
3848
|
-
if ($response['status'] === 'success') {
|
|
3849
|
-
// Başarılı
|
|
3850
|
-
}</code></pre>
|
|
3851
|
-
</div>
|
|
3852
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3853
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Rendement attendu ($response['data']) :</h4>
|
|
3854
|
-
<pre style="background: rgba(69,26,3,0.4); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #facc15; border: 1px solid rgba(250,204,21,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>[
|
|
3855
|
-
'id' => '...',
|
|
3856
|
-
'success' => true
|
|
3857
|
-
]</code></pre>
|
|
3653
|
+
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>\Src\Service\Sentry::init();</code></pre>
|
|
3858
3654
|
</div>
|
|
3859
3655
|
</div>
|
|
3860
3656
|
</div>
|
|
@@ -3863,36 +3659,20 @@ if ($response['status'] === 'success') {
|
|
|
3863
3659
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
3864
3660
|
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">captureError(\Throwable $e)</code></summary>
|
|
3865
3661
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
3866
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;"
|
|
3662
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Envoie une exception interceptée ou un objet jetable à Sentry.</p>
|
|
3867
3663
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3868
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3869
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
3870
|
-
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>}
|
|
3871
|
-
\Sentry\init($options);
|
|
3872
|
-
// ---------------------------------------------------------------
|
|
3873
|
-
// Helper functions
|
|
3874
|
-
// ---------------------------------------------------------------
|
|
3875
|
-
/**
|
|
3876
|
-
Capture a Throwable and send it to Sentry.
|
|
3877
|
-
@param \Throwable $e The exception or error to report.</code></pre>
|
|
3878
|
-
</div>
|
|
3879
3664
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3880
3665
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3881
3666
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3882
|
-
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
if ($response['status'] === 'success') {
|
|
3887
|
-
// Başarılı
|
|
3667
|
+
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>try {
|
|
3668
|
+
// Hata yapabilecek işlemler...
|
|
3669
|
+
} catch (\Throwable $e) {
|
|
3670
|
+
$eventId = \Src\Service\Sentry::captureError($e);
|
|
3888
3671
|
}</code></pre>
|
|
3889
3672
|
</div>
|
|
3890
3673
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3891
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">
|
|
3892
|
-
<pre style="background: rgba(69,26,3,0.4); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #facc15; border: 1px solid rgba(250,204,21,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>
|
|
3893
|
-
'id' => '...',
|
|
3894
|
-
'success' => true
|
|
3895
|
-
]</code></pre>
|
|
3674
|
+
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Retour attendu (chaîne | null) :</h4>
|
|
3675
|
+
<pre style="background: rgba(69,26,3,0.4); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #facc15; border: 1px solid rgba(250,204,21,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>"dfb9370...b86" // Sentry Olay ID'si</code></pre>
|
|
3896
3676
|
</div>
|
|
3897
3677
|
</div>
|
|
3898
3678
|
</div>
|
|
@@ -3901,30 +3681,12 @@ if ($response['status'] === 'success') {
|
|
|
3901
3681
|
<details class="accordion" style="margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 5px; background: rgba(0,0,0,0.1); box-sizing: border-box; max-width: 100%;">
|
|
3902
3682
|
<summary style="cursor: pointer; padding: 10px; font-weight: bold; background: rgba(255,255,255,0.05); color: #fff; border-radius: 4px; box-sizing: border-box; max-width: 100%; word-break: break-all;"><code style="background: transparent; color: #60a5fa; font-size: 1.1em; white-space: pre-wrap; word-break: break-all;">captureMessage(string $message, string $level = 'info')</code></summary>
|
|
3903
3683
|
<div class="accordion-content" style="padding: 15px; border-top: 1px solid rgba(255,255,255,0.05); box-sizing: border-box; max-width: 100%; overflow-x: hidden;">
|
|
3904
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">
|
|
3684
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Envoie un texte spécifié à Sentry sous forme de message d'information/d'avertissement. Niveaux valides :<code>fatal</code>, <code>error</code>, <code>warning</code>, <code>info</code>, <code>debug</code>.</p>
|
|
3905
3685
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3906
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3907
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Structure des paramètres :</h4>
|
|
3908
|
-
<pre style="background: rgba(0,0,0,0.3); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #a78bfa; border: 1px solid rgba(255,255,255,0.05); margin: 0; box-sizing: border-box; max-width: 100%;"><code>@param string $message Human-readable message to log.
|
|
3909
|
-
@param string $level Sentry severity level (default: info).</code></pre>
|
|
3910
|
-
</div>
|
|
3911
3686
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3912
3687
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3913
3688
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Exemple d'utilisation :</h4>
|
|
3914
|
-
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$
|
|
3915
|
-
|
|
3916
|
-
$response = $sentry->captureMessage($message);
|
|
3917
|
-
|
|
3918
|
-
if ($response['status'] === 'success') {
|
|
3919
|
-
// Başarılı
|
|
3920
|
-
}</code></pre>
|
|
3921
|
-
</div>
|
|
3922
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3923
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Rendement attendu ($response['data']) :</h4>
|
|
3924
|
-
<pre style="background: rgba(69,26,3,0.4); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #facc15; border: 1px solid rgba(250,204,21,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>[
|
|
3925
|
-
'id' => '...',
|
|
3926
|
-
'success' => true
|
|
3927
|
-
]</code></pre>
|
|
3689
|
+
<pre style="background: rgba(15,23,42,0.6); padding: 10px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; color: #34d399; border: 1px solid rgba(52,211,153,0.2); margin: 0; height: 100%; box-sizing: border-box; max-width: 100%;"><code>$eventId = \Src\Service\Sentry::captureMessage('Sipariş başarıyla tamamlandı.', 'info');</code></pre>
|
|
3928
3690
|
</div>
|
|
3929
3691
|
</div>
|
|
3930
3692
|
</div>
|
|
@@ -3933,63 +3695,55 @@ if ($response['status'] === 'success') {
|
|
|
3933
3695
|
</div>
|
|
3934
3696
|
</div>
|
|
3935
3697
|
</section>
|
|
3936
|
-
|
|
3698
|
+
====== VOIR LES AIDE ======
|
|
3937
3699
|
<section id="vh-display">
|
|
3938
|
-
<h2>ViewHelpers
|
|
3939
|
-
<p>Lors de l'impression de données à partir de la base de données ou d'une entrée utilisateur dans le DOM
|
|
3940
|
-
<span class="ret">
|
|
3700
|
+
<h2>ViewHelpers—<code>display()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3701
|
+
<p>Lors de l'impression de données à partir de la base de données ou d'une entrée utilisateur dans le DOM<strong>protection XSS obligatoire</strong>met en œuvre. Au lieu de générer une erreur sur les valeurs nulles ou vides, la valeur par défaut est renvoyée.</p>
|
|
3702
|
+
<span class="ret">affichage de la chaîne (données $ mixtes, chaîne $default = '')</span>
|
|
3941
3703
|
<div class="alert a-info" style="margin-top: 10px; margin-bottom: 24px; padding: 12px 20px;">
|
|
3942
|
-
<strong>💡 Astuce
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
<
|
|
3946
|
-
<h1><?= <span class="var">$
|
|
3947
|
-
|
|
3948
|
-
<span class="cm"><!-- ✅ ArtiFrame Güvenli Kullanımı --></span>
|
|
3949
|
-
<h1><?= <span class="fn">display</span>(<span class="var">$user</span>[<span class="st">'isim'</span>], <span class="st">'İsimsiz Kullanıcı'</span>) ?></h1></code></pre>
|
|
3704
|
+
<strong>💡 Astuce :<code>$default</code>Usage</strong><br/>Deuxième paramètre (<code>$default</code>) est le texte de secours qui sera imprimé à l'écran lorsque les données provenant de la base de données sont vides (nulle, fausse, chaîne vide). Par exemple, pour un utilisateur dont les données de nom ne sont pas saisies<code>display($isim, 'İsimsiz')</code>Si vous l'utilisez, votre page présentera un contenu significatif au lieu d'espaces laids.</div>
|
|
3705
|
+
<pre><code><span class="cm"><!-- ❌ Non sécurisé — Crée une vulnérabilité XSS --></span>
|
|
3706
|
+
<h1><?= <span class="var">$utilisateur</span>[<span class="st">'nom'</span>] ?></h1>
|
|
3707
|
+
<span class="cm"><!-- ✅ Utilisation sécurisée d'ArtiFrame --></span>
|
|
3708
|
+
<h1><?= <span class="fn">afficher</span>(<span class="var">$utilisateur</span>[<span class="st">'nom'</span>], <span class="st">« Utilisateur anonyme »</span>) ?></h1></code></pre>
|
|
3950
3709
|
</section>
|
|
3951
3710
|
<section id="vh-escapeurl">
|
|
3952
|
-
<h2>ViewHelpers
|
|
3953
|
-
<p>Liens reçus des utilisateurs (par exemple, sites Web de profils)
|
|
3954
|
-
<span class="ret">
|
|
3955
|
-
<pre><code><span class="cm"><!-- ❌
|
|
3956
|
-
<a href="<?= <span class="var">$
|
|
3957
|
-
|
|
3958
|
-
<span class="
|
|
3959
|
-
<a href="<?= <span class="fn">escapeUrl</span>(<span class="var">$user</span>[<span class="st">'website'</span>]) ?>">Siteyi Ziyaret Et</a></code></pre>
|
|
3711
|
+
<h2>ViewHelpers—<code>escapeUrl()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3712
|
+
<p>Liens reçus des utilisateurs (par exemple, sites Web de profils)<code><a href="..."></code>ou<code><img src="..."></code>Il est utilisé en appuyant sur l'intérieur.<code>javascript:alert(1)</code>Il empêche l'exécution de code via la connexion en rendant inoffensives les charges utiles dangereuses telles que (Stored XSS).</p>
|
|
3713
|
+
<span class="ret">chaîne escapeUrl(chaîne $url)</span>
|
|
3714
|
+
<pre><code><span class="cm"><!-- ❌ Non sécurisé — Le code JS peut être divulgué via une URL --></span>
|
|
3715
|
+
<a href="<?= <span class="var">$utilisateur</span>[<span class="st">'site web'</span>] ?>">Siteyi Ziyaret Et</a>
|
|
3716
|
+
<span class="cm"><!-- ✅ Utilisation sécurisée d'ArtiFrame --></span>
|
|
3717
|
+
<a href="<?= <span class="fn">URL d'évasion</span>(<span class="var">$utilisateur</span>[<span class="st">'site web'</span>]) ?>">Siteyi Ziyaret Et</a></code></pre>
|
|
3960
3718
|
</section>
|
|
3961
3719
|
<section id="vh-csrf">
|
|
3962
|
-
<h2>ViewHelpers
|
|
3963
|
-
<p>Ajoute un champ de jeton caché aux formulaires HTML contre les attaques CSRF
|
|
3964
|
-
<span class="ret">
|
|
3965
|
-
<p>Cette méthode imprime automatiquement la sortie HTML suivante dans votre formulaire
|
|
3720
|
+
<h2>ViewHelpers—<code>csrfField()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3721
|
+
<p>Ajoute un champ de jeton caché aux formulaires HTML contre les attaques CSRF.<strong>Il est obligatoire de l'utiliser sur chaque page contenant un formulaire POST.</strong></p>
|
|
3722
|
+
<span class="ret">chaîne csrfField()</span>
|
|
3723
|
+
<p>Cette méthode imprime automatiquement la sortie HTML suivante dans votre formulaire :<code><input type="hidden" name="csrf_token" value="..."></code>. Si vous ne souhaitez pas utiliser la méthode, vous pouvez utiliser cette entrée masquée comme valeur.<code>display()</code>Vous pouvez également l'ajouter manuellement en l'enveloppant avec .</p>
|
|
3966
3724
|
<pre><code><span class="cm"><!-- Frontend (HTML) --></span>
|
|
3967
3725
|
<form data-js="kaydet-form">
|
|
3968
|
-
<?= <span class="fn">csrfField</span>() ?> <span class="cm"><!--
|
|
3969
|
-
|
|
3970
|
-
<span class="cm"><!-- VEYA Manuel Kullanım:
|
|
3726
|
+
<?= <span class="fn">csrfField</span>() ?> <span class="cm"><!-- Génère automatiquement une entrée masquée --></span>
|
|
3727
|
+
<span class="cm"><!-- OU Utilisation manuelle :
|
|
3971
3728
|
<input type="hidden" name="csrf_token" value="<?= display($_SESSION['csrf_token'] ?? '') ?>">
|
|
3972
3729
|
--></span>
|
|
3973
|
-
|
|
3974
3730
|
<input type="text" name="ad" placeholder="Adınız">
|
|
3975
3731
|
<button type="submit">Kaydet</button>
|
|
3976
3732
|
</form>
|
|
3977
|
-
|
|
3978
|
-
<span class="
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
<span class="
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
<span class="kw">method</span>: <span class="st">'POST'</span>,
|
|
3986
|
-
<span class="kw">body</span>: <span class="var">formData</span>
|
|
3733
|
+
<span class="cm">// Frontend (JavaScript) - Capture et envoi de données</span>
|
|
3734
|
+
<span class="fn">document</span>.<span class="fn">sélecteur de requête</span>(<span class="st">'[data-js="save-form"]'</span>).<span class="fn">addEventListener</span>(<span class="st">'soumettre'</span>, (e) => {
|
|
3735
|
+
e.<span class="fn">prévenirDefault</span>();
|
|
3736
|
+
<span class="kw">const</span> <span class="var">formulaireDonnées</span> = <span class="kw">nouveau</span> <span class="fn">Données de formulaire</span>(e.target);
|
|
3737
|
+
<span class="cm">// csrf_token est automatiquement inclus dans formData</span>
|
|
3738
|
+
<span class="fn">aller chercher</span>(<span class="st">'/api/save.php'</span>, {
|
|
3739
|
+
<span class="kw">méthode</span>: <span class="st">'POSTE'</span>,
|
|
3740
|
+
<span class="kw">corps</span>: <span class="var">formulaireDonnées</span>
|
|
3987
3741
|
});
|
|
3988
3742
|
});</code></pre>
|
|
3989
3743
|
</section>
|
|
3990
3744
|
<section id="vh-dates">
|
|
3991
|
-
<h2>Afficher les assistants – Fonctions de date
|
|
3992
|
-
<p>dans la base de données
|
|
3745
|
+
<h2>Afficher les assistants – Fonctions de date<span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3746
|
+
<p>dans la base de données<code class="ic">Y-m-d H:i:s</code>Traite les chaînes de date ou les valeurs d'horodatage UNIX au format. Toutes les sorties textuelles par langue (<code class="ic">tr</code>, <code class="ic">en</code>, <code class="ic">de</code>, <code class="ic">fr</code>, <code class="ic">es</code>) est localisé.</p>
|
|
3993
3747
|
<table class="sig-table">
|
|
3994
3748
|
<thead><tr><th>Fonction</th><th>Exemple de sortie</th><th>Explication</th></tr></thead>
|
|
3995
3749
|
<tbody>
|
|
@@ -4005,66 +3759,63 @@ if ($response['status'] === 'success') {
|
|
|
4005
3759
|
</tbody>
|
|
4006
3760
|
</table>
|
|
4007
3761
|
<div class="alert a-info" style="margin-top: 0; margin-bottom: 24px;">
|
|
4008
|
-
<strong>💡 Comprendre les paramètres
|
|
3762
|
+
<strong>💡 Comprendre les paramètres :<code>$format</code>Et<code>$lang</code></strong>
|
|
4009
3763
|
<ul style="margin-top: 10px; margin-bottom: 0;">
|
|
4010
|
-
<li style="margin-bottom: 8px;"><strong><code>$format</code>
|
|
4011
|
-
<li style="margin-bottom: 0;"><strong><code>$lang</code>
|
|
3764
|
+
<li style="margin-bottom: 8px;"><strong><code>$format</code>(Format):</strong>Seulement<code>formatDate()</code>Il est utilisé avec la fonction. Il accepte les lettres de date PHP standard. (Par exemple:<code>'d/m/Y'</code>➔ 24/07/2026, ou<code>'H:i'</code>➔ 15h30). Il vous permet de créer votre propre modèle de date lorsque d'autres fonctions prédéfinies (jour, année, etc.) sont insuffisantes.</li>
|
|
3765
|
+
<li style="margin-bottom: 0;"><strong><code>$lang</code>(Langue):</strong>Il est utilisé dans les fonctions qui contiennent du texte (nom du mois, mot « avant ») dans leur sortie. Si vous laissez ce paramètre vide, le système<strong>par défaut<code>'tr'</code>(Turc)</strong>Ça marche. Si vous réalisez un projet multilingue, saisissez le code de langue (<code>tr, en, de, fr, es</code>) suffit pour entrer. (Ex:<code>timeAgo($tarih, 'en')</code>➔ il y a 5 minutes)</li>
|
|
4012
3766
|
</ul>
|
|
4013
3767
|
</div>
|
|
4014
|
-
<pre><code><span class="cm"><!--
|
|
4015
|
-
<span class="kw"><?php</span> <span class="var">$
|
|
4016
|
-
|
|
4017
|
-
<span class="
|
|
4018
|
-
|
|
4019
|
-
<span class="cm"><!--
|
|
4020
|
-
|
|
4021
|
-
<span class="cm"><!--
|
|
4022
|
-
<span><?= <span class="fn">
|
|
4023
|
-
<span class="cm"><!--
|
|
4024
|
-
|
|
4025
|
-
<span><?= <span class="fn">timeAgo</span>(<span class="var">$tarih</span>, <span class="st">'de'</span>) ?></span>
|
|
4026
|
-
<span class="cm"><!-- Çıktı: vor 5 Minuten --></span></code></pre>
|
|
3768
|
+
<pre><code><span class="cm"><!-- Supposons qu'il s'agisse d'un horodatage UNIX récupéré avec la fonction time() --></span>
|
|
3769
|
+
<span class="kw"><?php</span> <span class="var">$date</span> = <span class="fn">temps</span>(); <span class="kw">?></span>
|
|
3770
|
+
<span class="cm"><!-- Date exacte par langue --></span>
|
|
3771
|
+
<span><?= <span class="fn">nom_datecomplète</span>(<span class="var">$date</span>, <span class="st">'tr'</span>) ?></span>
|
|
3772
|
+
<span class="cm"><!-- Sortie : 24 juillet 2026 --></span>
|
|
3773
|
+
<span class="cm"><!-- Affichage de l'heure dans le style des réseaux sociaux --></span>
|
|
3774
|
+
<span><?= <span class="fn">il y a du temps</span>(<span class="var">$date</span>, <span class="st">'la plupart'</span>) ?></span>
|
|
3775
|
+
<span class="cm"><!-- Sortie : il y a 5 minutes --></span>
|
|
3776
|
+
<span><?= <span class="fn">il y a du temps</span>(<span class="var">$date</span>, <span class="st">'aussi'</span>) ?></span>
|
|
3777
|
+
<span class="cm"><!-- Sortie : avant 5 minutes --></span></code></pre>
|
|
4027
3778
|
</section>
|
|
4028
3779
|
<section id="vh-truncate">
|
|
4029
|
-
<h2>ViewHelpers
|
|
4030
|
-
<span class="ret">
|
|
3780
|
+
<h2>ViewHelpers—<code>truncate()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3781
|
+
<span class="ret">chaîne tronquée (chaîne $texte, int $longueur = 100, chaîne $append = '...')</span>
|
|
4031
3782
|
<p>Il coupe les textes longs à la limite de caractères souhaitée sans couper le dernier mot et ajoute le suffixe spécifié à la fin.</p>
|
|
4032
|
-
<pre><code><p><?= <span class="fn">
|
|
3783
|
+
<pre><code><p><?= <span class="fn">tronquer</span>(<span class="var">$poster</span>[<span class="st">'contenu'</span>], <span class="nu">160</span>, <span class="st">'...'</span>) ?></p></code></pre>
|
|
4033
3784
|
</section>
|
|
4034
3785
|
<section id="vh-activeclass">
|
|
4035
|
-
<h2>ViewHelpers
|
|
4036
|
-
<span class="ret">
|
|
3786
|
+
<h2>ViewHelpers—<code>activeClass()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3787
|
+
<span class="ret">chaîne activeClass (chaîne $currentPath, chaîne $targetPath, chaîne $className = 'active')</span>
|
|
4037
3788
|
<p>Si la page actuelle et le lien de menu coché correspondent, la classe CSS est renvoyée. Parfait pour la barre de navigation.</p>
|
|
4038
|
-
<pre><code><li class="<?= <span class="fn">
|
|
3789
|
+
<pre><code><li class="<?= <span class="fn">classe active</span>(<span class="var">$url_actuelle</span>, <span class="st">'/communication'</span>, <span class="st">'page actuelle'</span>) ?>"></code></pre>
|
|
4039
3790
|
</section>
|
|
4040
3791
|
<section id="vh-formatsize">
|
|
4041
|
-
<h2>ViewHelpers
|
|
4042
|
-
<span class="ret">
|
|
3792
|
+
<h2>ViewHelpers—<code>formatSize()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3793
|
+
<span class="ret">format de chaîneTaille(int $octets)</span>
|
|
4043
3794
|
<p>Convertit la taille de fichier donnée en octets en unités B, Ko, Mo, Go à l'aide d'un calcul logarithmique.</p>
|
|
4044
|
-
<pre><code><span><?= <span class="fn">
|
|
3795
|
+
<pre><code><span><?= <span class="fn">formatTaille</span>(<span class="nu">10485760</span>) ?></span> <span class="cm"><!-- 10,00 Mo --></span></code></pre>
|
|
4045
3796
|
</section>
|
|
4046
3797
|
<section id="vh-maskemail">
|
|
4047
|
-
<h2>ViewHelpers
|
|
4048
|
-
<span class="ret">
|
|
4049
|
-
<p>Masque les adresses e-mail conformément à la conformité KVKK / GDPR.
|
|
4050
|
-
<pre><code><td><?= <span class="fn">
|
|
3798
|
+
<h2>ViewHelpers—<code>maskEmail()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3799
|
+
<span class="ret">chaîne masqueEmail(?string $email)</span>
|
|
3800
|
+
<p>Masque les adresses e-mail conformément à la conformité KVKK / GDPR. Stars from the first letter to the @ sign.</p>
|
|
3801
|
+
<pre><code><td><?= <span class="fn">masqueEmail</span>(<span class="st">'utku@artilingo.com'</span>) ?></td> <span class="cm"><!-- u***@artilingo.com --></span></code></pre>
|
|
4051
3802
|
</section>
|
|
4052
3803
|
<section id="vh-maskphone">
|
|
4053
|
-
<h2>ViewHelpers
|
|
4054
|
-
<span class="ret">
|
|
3804
|
+
<h2>ViewHelpers—<code>maskPhone()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3805
|
+
<span class="ret">chaîne masqueTéléphone(chaîne $téléphone)</span>
|
|
4055
3806
|
<p>Masquage avancé des numéros de téléphone. Il empêche les violations de données en masquant complètement les chiffres critiques.</p>
|
|
4056
|
-
<pre><code><td><?= <span class="fn">
|
|
3807
|
+
<pre><code><td><?= <span class="fn">masqueTéléphone</span>(<span class="st">'05551234567'</span>) ?></td> <span class="cm"><!-- 0555 *** ** 67 --></span></code></pre>
|
|
4057
3808
|
</section>
|
|
4058
3809
|
<section id="vh-slugify">
|
|
4059
|
-
<h2>ViewHelpers
|
|
4060
|
-
<span class="ret">
|
|
3810
|
+
<h2>ViewHelpers—<code>slugify()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3811
|
+
<span class="ret">chaîne slugify(chaîne ...$textes)</span>
|
|
4061
3812
|
<p>Générateur de liens SEO convivial pour les URL. Il n'y a pas de limite de paramètre (Variadic). Vous pouvez écrire la sortie directement dans href.</p>
|
|
4062
|
-
<pre><code><a href="/yazi/<?= <span class="fn">
|
|
3813
|
+
<pre><code><a href="/yazi/<?= <span class="fn">slugifier</span>(<span class="var">$kat</span>, <span class="var">$titre</span>) ?>">Oku</a> <span class="cm"><!-- /text/technology/artificial-intelligence --></span></code></pre>
|
|
4063
3814
|
</section>
|
|
4064
3815
|
<section id="vh-money">
|
|
4065
|
-
<h2>ViewHelpers
|
|
4066
|
-
<p>Formate le montant avec le symbole monétaire. Le code de la devise (ISO) détermine automatiquement l'emplacement des symboles. Devise par défaut
|
|
4067
|
-
<span class="ret">
|
|
3816
|
+
<h2>ViewHelpers—<code>money()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3817
|
+
<p>Formate le montant avec le symbole monétaire. Le code de la devise (ISO) détermine automatiquement l'emplacement des symboles. Devise par défaut<code class="ic">usd</code>est.</p>
|
|
3818
|
+
<span class="ret">chaîne argent (float $montant, chaîne $currency = 'usd')</span>
|
|
4068
3819
|
<table class="sig-table">
|
|
4069
3820
|
<thead><tr><th>Code</th><th>Sortir</th><th>Devise</th></tr></thead>
|
|
4070
3821
|
<tbody>
|
|
@@ -4080,449 +3831,397 @@ if ($response['status'] === 'success') {
|
|
|
4080
3831
|
<tr><td>aed</td><td>1.250,00 د.إ</td><td>Dirham des Émirats Arabes Unis</td></tr>
|
|
4081
3832
|
</tbody>
|
|
4082
3833
|
</table>
|
|
4083
|
-
<pre><code><span><?= <span class="fn">
|
|
4084
|
-
<span class="cm"><!--
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
</section>
|
|
4096
|
-
|
|
4097
|
-
<!-- ====== SYSTEM HELPERS ====== -->
|
|
3834
|
+
<pre><code><span><?= <span class="fn">argent</span>(<span class="var">$produit</span>[<span class="st">'prix'</span>], <span class="st">'essayer'</span>) ?></span>
|
|
3835
|
+
<span class="cm"><!-- Sortie : ₺ 1 250,00 --></span>
|
|
3836
|
+
<span><?= <span class="fn">argent</span>(<span class="var">$produit</span>[<span class="st">'prix'</span>], <span class="st">'USD'</span>) ?></span>
|
|
3837
|
+
<span class="cm"><!-- Sortie : 1 250,00 $ --></span></code></pre>
|
|
3838
|
+
</section>
|
|
3839
|
+
<section id="vh-uuid">
|
|
3840
|
+
<h2>Afficher les assistants -<code>uuid()</code> <span class="tag b-view">Méthode d'affichage</span></h2>
|
|
3841
|
+
<p>Il convertit les données UUID binaires de 16 octets provenant de la base de données au format 36 caractères et les imprime à l'écran avec protection XSS.</p>
|
|
3842
|
+
<pre><code><span class="cm"><!-- Sortie : 0190ed84-3f12-7a91-8bc4-91823741abcd --></span>
|
|
3843
|
+
<div><span class="kw"><?=</span> <span class="fn">uuide</span>(<span class="var">$ tirer</span>[<span class="st">'IDENTIFIANT'</span>]) <span class="kw">?></span></div></code></pre>
|
|
3844
|
+
</section>
|
|
3845
|
+
====== AIDE SYSTÈME ======
|
|
4098
3846
|
<section id="sh-apiresponse">
|
|
4099
|
-
<h2>Aides système
|
|
4100
|
-
<p>Cette fonction s'utilise entre le Frontend (JS/Mobile) et le Backend (PHP) de votre application
|
|
4101
|
-
<span class="ret">void apiResponse(string $status, string $message, array $data = [], \Throwable $exception = null)</span>
|
|
4102
|
-
<p style="margin-top: 15px;"><strong>Code d'état (code HTTP) :</strong>
|
|
4103
|
-
<p><strong>Sensibilité de l'environnement en direct/test (APP_ENV) :</strong>
|
|
3847
|
+
<h2>Aides système—<code>apiResponse()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3848
|
+
<p>Cette fonction s'utilise entre le Frontend (JS/Mobile) et le Backend (PHP) de votre application.<strong>C'est la constitution de la communication.</strong>Clés dans les données JSON renvoyées en tant que réponse<code>status</code>, <code>message</code>Et<code>data</code>aspect<strong>est absolument corrigé (doit être en anglais)</strong>.</p>
|
|
3849
|
+
<span class="ret">void apiResponse (string $status, string $message, array $data = [], \Throwable $exception = null)</span>
|
|
3850
|
+
<p style="margin-top: 15px;"><strong>Code d'état (code HTTP) :</strong>Côté PHP, le premier paramètre<code>'success'</code>S'il est tapé, HTTP 200 est automatiquement renvoyé, pour tout le reste (par exemple : 'erreur', 'ok') 400 Bad Request est renvoyé.</p>
|
|
3851
|
+
<p><strong>Sensibilité de l'environnement en direct/test (APP_ENV) :</strong>Si le quatrième paramètre est<code>Exception</code>Si vous le donnez et que votre système est en mode Développement (APP_ENV = 1), il écrasera le message que vous avez écrit et imprimera l'erreur SQL/le numéro de ligne sur l'écran tel quel. En mode live (APP_ENV = 0), il masque les erreurs et affiche uniquement le message clair que vous avez tapé.</p>
|
|
4104
3852
|
<h3>Soumission PHP (backend)</h3>
|
|
4105
|
-
<pre><code><span class="cm">// 1.
|
|
4106
|
-
<span class="fn">
|
|
4107
|
-
|
|
4108
|
-
<span class="
|
|
4109
|
-
<span class="
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
<span class="fn">apiResponse</span>(<span class="st">'error'</span>, <span class="st">'Bir sorun oluştu.'</span>, [], <span class="var">$e</span>);
|
|
3853
|
+
<pre><code><span class="cm">// 1. Expédition standard</span>
|
|
3854
|
+
<span class="fn">apiRéponse</span>(<span class="st">'succès'</span>, <span class="st">"L'opération s'est terminée avec succès."</span>, [<span class="st">'IDENTIFIANT'</span> => <span class="nu">1453</span>]);
|
|
3855
|
+
<span class="cm">// 2. Soumission d'erreur (avec exception)</span>
|
|
3856
|
+
<span class="kw">essayer</span> {
|
|
3857
|
+
<span class="cm">// Requêtes de base de données...</span>
|
|
3858
|
+
} <span class="kw">attraper</span> (\Exception <span class="var">$e</span>) {
|
|
3859
|
+
<span class="fn">apiRéponse</span>(<span class="st">'erreur'</span>, <span class="st">« Quelque chose s'est mal passé. »</span>, [], <span class="var">$e</span>);
|
|
4113
3860
|
}</code></pre>
|
|
4114
3861
|
<h3>Capture JavaScript (frontend)</h3>
|
|
4115
|
-
<pre><code><span class="fn">
|
|
3862
|
+
<pre><code><span class="fn">aller chercher</span>(<span class="st">'/api/point de terminaison'</span>, { method: <span class="st">'POSTE'</span> })
|
|
4116
3863
|
.then(res => res.json())
|
|
4117
3864
|
.then(response => {
|
|
4118
|
-
<span class="cm">//
|
|
4119
|
-
<span class="cm">//
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
console.log(<span class="st"
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
<span class="fn">alert</span>(<span class="st">"Hata oluştu: "</span> + response.message);
|
|
3865
|
+
<span class="cm">// AVERTISSEMENT : réponse.status ou réponse.message NE fonctionneront PAS !</span>
|
|
3866
|
+
<span class="cm">// Peu importe ce que vous envoyez depuis PHP, les clés sont toujours le statut, le message et les données.</span>
|
|
3867
|
+
<span class="kw">si</span> (response.status === <span class="st">'succès'</span>) { <span class="cm">// Tout ce qui vient de PHP ("succès", "ok", "réussi", etc.)</span>
|
|
3868
|
+
console.log(<span class="st">"Message:"</span>, response.message);
|
|
3869
|
+
console.log(<span class="st">« Données entrantes : »</span>, response.data);
|
|
3870
|
+
} <span class="kw">autre</span> {
|
|
3871
|
+
<span class="fn">alerte</span>(<span class="st">"Une erreur s'est produite : "</span> + response.message);
|
|
4126
3872
|
}
|
|
4127
3873
|
});</code></pre>
|
|
4128
3874
|
</section>
|
|
4129
3875
|
<section id="sh-json">
|
|
4130
|
-
<h2>Aides système
|
|
4131
|
-
<p>Il définit l'en-tête JSON, renvoie le code d'état HTTP et imprime en toute sécurité la sortie avec json_encode, puis termine le script
|
|
4132
|
-
<span class="ret">void jsonResponse(
|
|
4133
|
-
<pre><code><span class="cm">//
|
|
4134
|
-
<span class="fn">
|
|
4135
|
-
|
|
4136
|
-
<span class="
|
|
4137
|
-
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'error'</span>, <span class="st">'message'</span> => <span class="st">'Yetkisiz erişim.'</span>], <span class="nu">401</span>);</code></pre>
|
|
3876
|
+
<h2>Aides système—<code>jsonResponse()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3877
|
+
<p>Il définit l'en-tête JSON, renvoie le code d'état HTTP et imprime en toute sécurité la sortie avec json_encode, puis termine le script.<strong>Toutes les réponses API doivent être données via cette fonction.</strong></p>
|
|
3878
|
+
<span class="ret">void jsonResponse (tableau $data, int $statusCode = 200)</span>
|
|
3879
|
+
<pre><code><span class="cm">// Réponse réussie</span>
|
|
3880
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>, <span class="st">'données'</span> => <span class="var">$utilisateur</span>], <span class="nu">200</span>);
|
|
3881
|
+
<span class="cm">// Réponse d'erreur</span>
|
|
3882
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'erreur'</span>, <span class="st">'message'</span> => <span class="st">« Accès non autorisé. »</span>], <span class="nu">401</span>);</code></pre>
|
|
4138
3883
|
</section>
|
|
4139
|
-
|
|
4140
3884
|
<section id="sh-dd">
|
|
4141
|
-
<h2>Aides système
|
|
4142
|
-
<p>Dump & Die. Pendant la phase de développement, les variables étaient affichées à l’écran en mode sombre, lisible et élégant
|
|
4143
|
-
<span class="ret">void dd(
|
|
4144
|
-
<pre><code><span class="fn">
|
|
4145
|
-
<span class="cm">//
|
|
3885
|
+
<h2>Aides système—<code>dd()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3886
|
+
<p>Dump & Die. Pendant la phase de développement, les variables étaient affichées à l’écran en mode sombre, lisible et élégant.<code><pre></code>tag et arrête l’exécution du code sur cette ligne (exit). Il peut prendre des paramètres illimités (Variadic).</p>
|
|
3887
|
+
<span class="ret">void dd(mixte...$vars)</span>
|
|
3888
|
+
<pre><code><span class="fn">jj</span>(<span class="var">$_POST</span>, <span class="var">$user_id</span>);
|
|
3889
|
+
<span class="cm">// Imprime les valeurs à l'écran et arrête le système.</span></code></pre>
|
|
4146
3890
|
</section>
|
|
4147
|
-
|
|
3891
|
+
====== GÉNÉRATION D'ID ET UTILITAIRES ======
|
|
4148
3892
|
<section id="id-generation-utilities">
|
|
4149
|
-
</section>
|
|
4150
|
-
|
|
4151
|
-
|
|
3893
|
+
</section>
|
|
4152
3894
|
<section id="sh-redirect">
|
|
4153
|
-
<h2>Aides système
|
|
4154
|
-
<span class="ret">
|
|
4155
|
-
<p>vers la page souhaitée
|
|
4156
|
-
<pre><code><span class="kw">
|
|
4157
|
-
<span class="fn">
|
|
3895
|
+
<h2>Aides système—<code>redirect()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3896
|
+
<span class="ret">redirection vide (chaîne $url)</span>
|
|
3897
|
+
<p>vers la page souhaitée<code>header("Location: ...")</code>Il redirige instantanément et cesse de fonctionner avec (<code>exit</code>).</p>
|
|
3898
|
+
<pre><code><span class="kw">si</span> (!<span class="var">$isLoggedIn</span>) {
|
|
3899
|
+
<span class="fn">réorienter</span>(<span class="st">'/se connecter'</span>);
|
|
4158
3900
|
}</code></pre>
|
|
4159
|
-
</section>
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
<
|
|
4163
|
-
<
|
|
4164
|
-
<span class="
|
|
4165
|
-
<
|
|
4166
|
-
<span class="fn">generateCsrf</span>(); <span class="cm">// Oturum başlatıldığında CSRF üretilir</span>
|
|
3901
|
+
</section>
|
|
3902
|
+
<section id="sh-generatecsrf">
|
|
3903
|
+
<h2>Aides système—<code>generateCsrf()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3904
|
+
<p>Il génère un tout nouveau jeton CSRF sécurisé basé sur une session, d'une longueur de 32 octets. Pour ajouter comme entrée masquée aux formulaires<code>csrfField()</code>Il est recommandé d'utiliser (View Helper).</p>
|
|
3905
|
+
<span class="ret">chaîne générerCsrf()</span>
|
|
3906
|
+
<pre><code><span class="kw">si</span> (<span class="var">$_SESSION</span>[<span class="st">'utilisateur'</span>]) {
|
|
3907
|
+
<span class="fn">générerCsrf</span>(); <span class="cm">// CSRF est généré au démarrage de la session</span>
|
|
4167
3908
|
}</code></pre>
|
|
4168
3909
|
</section>
|
|
4169
3910
|
<section id="sh-csrf">
|
|
4170
|
-
<h2>Aides système
|
|
4171
|
-
<p>Vérifie que la requête POST entrante provient d’un formulaire légitime. sous la forme
|
|
4172
|
-
<span class="ret">bool verifyCsrf(string $token)</span>
|
|
4173
|
-
<pre><code><span class="kw">
|
|
4174
|
-
<span class="fn">
|
|
3911
|
+
<h2>Aides système—<code>verifyCsrf()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3912
|
+
<p>Vérifie que la requête POST entrante provient d’un formulaire légitime. sous la forme<code class="ic">csrfField()</code>Renvoie false s'il n'est pas ajouté ou si le jeton n'est pas valide.</p>
|
|
3913
|
+
<span class="ret">bool verifyCsrf (string $token)</span>
|
|
3914
|
+
<pre><code><span class="kw">si</span> (!<span class="fn">vérifierCsrf</span>(<span class="var">$_POST</span>[<span class="st">'csrf_token'</span>] ?? <span class="st">''</span>)) {
|
|
3915
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'erreur'</span>, <span class="st">'message'</span> => <span class="st">"Jeton CSRF invalide."</span>], <span class="nu">403</span>);
|
|
4175
3916
|
}</code></pre>
|
|
4176
3917
|
</section>
|
|
4177
3918
|
<section id="sh-sanitizeint">
|
|
4178
|
-
<h2>Aides système
|
|
4179
|
-
<span class="ret">int sanitizeInt(
|
|
4180
|
-
<p>Il fait disparaître toutes les lettres, symboles et virgules qu'il contient
|
|
4181
|
-
<pre><code><span class="var">$id</span> = <span class="fn">
|
|
3919
|
+
<h2>Aides système—<code>sanitizeInt()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3920
|
+
<span class="ret">int sanitizeInt (valeur $ mixte)</span>
|
|
3921
|
+
<p>Il fait disparaître toutes les lettres, symboles et virgules qu'il contient,<strong>juste un entier</strong>laisse les chiffres. Utilisé pour l'ID ou les limites (valeurs entières de la base de données).</p>
|
|
3922
|
+
<pre><code><span class="var">$id</span> = <span class="fn">désinfecterInt</span>(<span class="var">$_GET</span>[<span class="st">'IDENTIFIANT'</span>] ?? <span class="nu">0</span>);</code></pre>
|
|
4182
3923
|
</section>
|
|
4183
3924
|
<section id="sh-sanitizefloat">
|
|
4184
|
-
<h2>Aides système
|
|
4185
|
-
<span class="ret">float sanitizeFloat(
|
|
3925
|
+
<h2>Aides système—<code>sanitizeFloat()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3926
|
+
<span class="ret">float sanitizeFloat (valeur $ mixte)</span>
|
|
4186
3927
|
<p>Efface tout sauf les nombres fractionnaires (décimaux). Il peut être utilisé en toute sécurité pour les montants monétaires, les calculs de ratios ou les mesures.</p>
|
|
4187
|
-
<pre><code><span class="var"
|
|
3928
|
+
<pre><code><span class="var">prix en $</span> = <span class="fn">désinfecterFlotteur</span>(<span class="var">$_POST</span>[<span class="st">'prix'</span>]);</code></pre>
|
|
4188
3929
|
</section>
|
|
4189
3930
|
<section id="sh-sanitizestring">
|
|
4190
|
-
<h2>Aides système
|
|
4191
|
-
<span class="ret">
|
|
4192
|
-
<p>Pour empêcher XSS et les attaques similaires, tous
|
|
4193
|
-
<pre><code><span class="var">$
|
|
3931
|
+
<h2>Aides système—<code>sanitizeString()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3932
|
+
<span class="ret">chaîne sanitizeString (chaîne $valeur)</span>
|
|
3933
|
+
<p>Pour empêcher XSS et les attaques similaires, tous<strong>Balises HTML et PHP (<code><script></code>, <code><iframe></code>etc.) détruit</strong>. Il doit être utilisé avant d'enregistrer String dans la base de données.</p>
|
|
3934
|
+
<pre><code><span class="var">$nom</span> = <span class="fn">désinfecterString</span>(<span class="var">$_POST</span>[<span class="st">'nom'</span>]);</code></pre>
|
|
4194
3935
|
</section>
|
|
4195
3936
|
<section id="sh-sanitizeemail">
|
|
4196
|
-
<h2>Aides système
|
|
4197
|
-
<span class="ret">
|
|
4198
|
-
<p>Il filtre tous les caractères invalides et dangereux qui ne respectent pas le format de l'e-mail. (Attention : cela efface uniquement l'exactitude du format
|
|
4199
|
-
<pre><code><span class="var">$email</span> = <span class="fn">
|
|
3937
|
+
<h2>Aides système—<code>sanitizeEmail()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3938
|
+
<span class="ret">chaîne sanitizeEmail(chaîne $email)</span>
|
|
3939
|
+
<p>Il filtre tous les caractères invalides et dangereux qui ne respectent pas le format de l'e-mail. (Attention : cela efface uniquement l'exactitude du format.<code>verifyEmail()</code>Il faudrait vérifier auprès de ).</p>
|
|
3940
|
+
<pre><code><span class="var">$email</span> = <span class="fn">désinfecterEmail</span>(<span class="var">$_POST</span>[<span class="st">'e-mail'</span>] ?? <span class="st">''</span>);</code></pre>
|
|
4200
3941
|
</section>
|
|
4201
3942
|
<section id="sh-ispost">
|
|
4202
|
-
<h2>Aides système
|
|
3943
|
+
<h2>Aides système—<code>isPost()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4203
3944
|
<span class="ret">bool isPost()</span>
|
|
4204
3945
|
<p>Il vérifie si la requête entrante (HTTP Request) est effectuée avec la méthode POST. Il est utilisé pour empêcher l’accès direct à la page, notamment lors des soumissions de formulaires.</p>
|
|
4205
|
-
<pre><code><span class="kw">
|
|
4206
|
-
<span class="cm">//
|
|
3946
|
+
<pre><code><span class="kw">si</span> (<span class="fn">estPost</span>()) {
|
|
3947
|
+
<span class="cm">// Fonctionne si la requête est POST (Soumission de formulaire)</span>
|
|
4207
3948
|
}</code></pre>
|
|
4208
3949
|
</section>
|
|
4209
3950
|
<section id="sh-isget">
|
|
4210
|
-
<h2>Aides système
|
|
4211
|
-
<span class="ret">bool
|
|
3951
|
+
<h2>Aides système—<code>isGet()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3952
|
+
<span class="ret">bool estGet()</span>
|
|
4212
3953
|
<p>Il vérifie si la requête entrante est effectuée avec la méthode GET. Il est utilisé uniquement à des fins de contrôle lors de la lecture des paramètres ou de la visualisation des pages via URL.</p>
|
|
4213
|
-
<pre><code><span class="kw">
|
|
4214
|
-
<span class="cm">//
|
|
3954
|
+
<pre><code><span class="kw">si</span> (<span class="fn">estObtenir</span>()) {
|
|
3955
|
+
<span class="cm">// Fonctionne si la page est visitée normalement</span>
|
|
4215
3956
|
}</code></pre>
|
|
4216
3957
|
</section>
|
|
4217
3958
|
<section id="sh-isput">
|
|
4218
|
-
<h2>Aides système
|
|
3959
|
+
<h2>Aides système—<code>isPut()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4219
3960
|
<span class="ret">bool isPut()</span>
|
|
4220
3961
|
<p>Il vérifie que la requête entrante est effectuée avec la méthode PUT. Il est généralement préféré pour les opérations de mise à jour des données dans les architectures API REST.</p>
|
|
4221
|
-
<pre><code><span class="kw">
|
|
4222
|
-
<span class="cm">//
|
|
3962
|
+
<pre><code><span class="kw">si</span> (<span class="fn">estPut</span>()) {
|
|
3963
|
+
<span class="cm">//Demande de mise à jour d'une ressource via API</span>
|
|
4223
3964
|
}</code></pre>
|
|
4224
3965
|
</section>
|
|
4225
3966
|
<section id="sh-isdelete">
|
|
4226
|
-
<h2>Aides système
|
|
3967
|
+
<h2>Aides système—<code>isDelete()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4227
3968
|
<span class="ret">bool isDelete()</span>
|
|
4228
3969
|
<p>Il vérifie que la requête entrante a été effectuée avec la méthode DELETE. Il est utilisé pour protéger les routes de suppression dans les API REST.</p>
|
|
4229
|
-
<pre><code><span class="kw">
|
|
4230
|
-
<span class="cm">//
|
|
3970
|
+
<pre><code><span class="kw">si</span> (<span class="fn">estSupprimer</span>()) {
|
|
3971
|
+
<span class="cm">// Demande de suppression d'une ressource via API</span>
|
|
4231
3972
|
}</code></pre>
|
|
4232
3973
|
</section>
|
|
4233
3974
|
<section id="sh-isajax">
|
|
4234
|
-
<h2>Aides système
|
|
4235
|
-
<span class="ret">bool
|
|
4236
|
-
<p>Votre demande entrante
|
|
4237
|
-
<pre><code><span class="kw">
|
|
4238
|
-
<span class="fn">
|
|
3975
|
+
<h2>Aides système—<code>isAjax()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3976
|
+
<span class="ret">bool estAjax()</span>
|
|
3977
|
+
<p>Votre demande entrante<code>XMLHttpRequest</code>Vérifie si cela est fait via (AJAX) ou une API Fetch moderne (<code>HTTP_X_REQUESTED_WITH</code>regarde la valeur de l'en-tête).</p>
|
|
3978
|
+
<pre><code><span class="kw">si</span> (!<span class="fn">estAjax</span>()) {
|
|
3979
|
+
<span class="fn">réorienter</span>(<span class="st">'/erreur'</span>); <span class="cm">// Autoriser uniquement AJAX</span>
|
|
4239
3980
|
}</code></pre>
|
|
4240
3981
|
</section>
|
|
4241
3982
|
<section id="sh-getclientip">
|
|
4242
|
-
<h2>Aides système
|
|
4243
|
-
<span class="ret">
|
|
3983
|
+
<h2>Aides système—<code>getClientIp()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3984
|
+
<span class="ret">chaîne getClientIp()</span>
|
|
4244
3985
|
<p>Détecte la véritable adresse IP de l'utilisateur. Flare nuageuse (<code>HTTP_CF_CONNECTING_IP</code>), procuration (<code>HTTP_X_FORWARDED_FOR</code>) et standard (<code>REMOTE_ADDR</code>) résout automatiquement toutes les connexions.</p>
|
|
4245
|
-
<pre><code><span class="var">$ip</span> = <span class="fn">
|
|
3986
|
+
<pre><code><span class="var">$ip</span> = <span class="fn">obtenirClientIp</span>(); <span class="cm">//Ex : 192.168.1.1</span></code></pre>
|
|
4246
3987
|
</section>
|
|
4247
|
-
|
|
4248
3988
|
<section id="sh-verifyemail">
|
|
4249
|
-
<h2>Aides système
|
|
3989
|
+
<h2>Aides système—<code>verifyEmail()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4250
3990
|
<p>Il vérifie si l'adresse e-mail donnée est réellement une adresse e-mail valide basée sur le DNS ou le format.</p>
|
|
4251
3991
|
<span class="ret">bool verifyEmail(string $email)</span>
|
|
4252
|
-
<pre><code><span class="kw">
|
|
4253
|
-
<span class="fn">
|
|
3992
|
+
<pre><code><span class="kw">si</span> (!<span class="fn">vérifierE-mail</span>(<span class="var">$_POST</span>[<span class="st">'e-mail'</span>])) {
|
|
3993
|
+
<span class="fn">apiRéponse</span>(<span class="st">'erreur'</span>, <span class="st">« Adresse e-mail invalide. »</span>);
|
|
4254
3994
|
}</code></pre>
|
|
4255
3995
|
</section>
|
|
4256
3996
|
<section id="sh-generatetoken">
|
|
4257
|
-
<h2>Aides système
|
|
4258
|
-
<span class="ret">
|
|
4259
|
-
<p>Génère un jeton aléatoire cryptographiquement sécurisé (Ex : réinitialisation du mot de passe, clé API)
|
|
4260
|
-
<pre><code><span class="var">$
|
|
3997
|
+
<h2>Aides système—<code>generateToken()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
3998
|
+
<span class="ret">chaîne generateToken (int $length = 32)</span>
|
|
3999
|
+
<p>Génère un jeton aléatoire cryptographiquement sécurisé (Ex : réinitialisation du mot de passe, clé API).<strong>Remarque : Chaque octet saisi produit 2 caractères (hexadécimaux) de sortie.</strong>La longueur par défaut de 32 octets renvoie une chaîne de 64 caractères exactement.</p>
|
|
4000
|
+
<pre><code><span class="var">$jeton</span> = <span class="fn">générerJeton</span>(<span class="nu">16</span>); <span class="cm">// Jeton de 32 caractères</span></code></pre>
|
|
4261
4001
|
</section>
|
|
4262
4002
|
<section id="sh-hashpassword">
|
|
4263
|
-
<h2>Aides système
|
|
4264
|
-
<span class="ret">
|
|
4265
|
-
<p>PHP
|
|
4266
|
-
<pre><code><span class="var">$
|
|
4003
|
+
<h2>Aides système—<code>hashPassword()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4004
|
+
<span class="ret">chaîne hashPassword(?string $mot de passe)</span>
|
|
4005
|
+
<p>PHP intégré<code>password_hash</code>Il hache en toute sécurité les mots de passe avec l'algorithme bcrypt en utilisant la méthode.<strong>Vérification nulle :</strong>Si le paramètre est vide ou<code>null</code>Si c'est le cas, il lève une exception pour éviter de violer la sécurité.</p>
|
|
4006
|
+
<pre><code><span class="var">$haché</span> = <span class="fn">hashMot de passe</span>(<span class="var">$_POST</span>[<span class="st">'mot de passe'</span>]);</code></pre>
|
|
4267
4007
|
</section>
|
|
4268
4008
|
<section id="sh-verifypassword">
|
|
4269
|
-
<h2>Aides système
|
|
4009
|
+
<h2>Aides système—<code>verifyPassword()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4270
4010
|
<span class="ret">bool verifyPassword(?string $password, ?string $hash)</span>
|
|
4271
|
-
<p>Il compare le mot de passe en clair saisi par l'utilisateur avec le hachage dans la base de données
|
|
4272
|
-
<pre><code><span class="kw">
|
|
4273
|
-
<span class="cm">//
|
|
4011
|
+
<p>Il compare le mot de passe en clair saisi par l'utilisateur avec le hachage dans la base de données.<strong>Vérification nulle :</strong>Soit le mot de passe ou le hachage est vide, soit<code>null</code>directement sans aucune action<code>false</code>rotatif.</p>
|
|
4012
|
+
<pre><code><span class="kw">si</span> (<span class="fn">vérifier le mot de passe</span>(<span class="var">$_POST</span>[<span class="st">'mot de passe'</span>], <span class="var">$utilisateur</span>[<span class="st">'mot de passe'</span>])) {
|
|
4013
|
+
<span class="cm">// Connexion réussie</span>
|
|
4274
4014
|
}</code></pre>
|
|
4275
4015
|
</section>
|
|
4276
4016
|
<section id="sh-slugify">
|
|
4277
|
-
<h2>Aides système
|
|
4017
|
+
<h2>Aides système—<code>slugify()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4278
4018
|
<p>Lors de l'inscription à la base de données côté backend, il génère automatiquement une URL/Slug optimisée pour le référencement à partir de champs tels que le titre ou le nom. Il prend des paramètres illimités (Variadic).</p>
|
|
4279
|
-
<span class="ret">
|
|
4280
|
-
<pre><code><span class="var">$
|
|
4019
|
+
<span class="ret">chaîne slugify(chaîne ...$textes)</span>
|
|
4020
|
+
<pre><code><span class="var">$limace</span> = <span class="fn">slugifier</span>(<span class="var">$_POST</span>[<span class="st">'titre'</span>]); <span class="cm">// 'ma-belle-écriture'</span></code></pre>
|
|
4281
4021
|
</section>
|
|
4282
4022
|
<section id="sh-arrayonly">
|
|
4283
|
-
<h2>Aides système
|
|
4284
|
-
<p>Un grand ensemble de données (par ex
|
|
4285
|
-
<span class="ret">
|
|
4286
|
-
<pre><code><span class="var">$postData</span> = <span class="fn">
|
|
4287
|
-
<span class="cm">//
|
|
4023
|
+
<h2>Aides système—<code>arrayOnly()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4024
|
+
<p>Un grand ensemble de données (par ex.<code>$_POST</code>) filtre uniquement les données avec les clés spécifiées (liste blanche). Il est utilisé juste avant les opérations d’enregistrement de la base de données pour éviter les failles de sécurité liées aux affectations massives.</p>
|
|
4025
|
+
<span class="ret">tableau tableauOnly (tableau $tableau, tableau $keys)</span>
|
|
4026
|
+
<pre><code><span class="var">$postData</span> = <span class="fn">tableau uniquement</span>(<span class="var">$_POST</span>, [<span class="st">'nom d'utilisateur'</span>, <span class="st">'mot de passe'</span>, <span class="st">'e-mail'</span>]);
|
|
4027
|
+
<span class="cm">// Les valeurs manipulées en externe telles que l'ID et le rôle sont automatiquement détruites.</span></code></pre>
|
|
4288
4028
|
</section>
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
<div class="info-box">
|
|
4294
|
-
16 octets bruts natifs, hautes performances et ordonnés dans le temps <strong>UUIDv7</strong> produit.
|
|
4295
|
-
</div>
|
|
4296
|
-
<p>Colonnes d'ID dans la base de données <code>BINARY(16)</code> Lorsque vous souhaitez obtenir d'énormes performances d'indexation et de JOIN en le conservant sous la forme , vous créez de nouveaux enregistrements avec cette fonction.</p>
|
|
4029
|
+
<section id="sh-byteid">
|
|
4030
|
+
<h2>Aides système -<code>byteId()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4031
|
+
<div class="info-box">16 octets bruts natifs, hautes performances et ordonnés dans le temps<strong>UUIDv7</strong>produit.</div>
|
|
4032
|
+
<p>Colonnes d'ID dans la base de données<code>BINARY(16)</code>Lorsque vous souhaitez obtenir une énorme indexation et des performances JOIN en le gardant tel quel, vous créez de nouveaux enregistrements avec cette fonction.</p>
|
|
4297
4033
|
<div class="code-block">
|
|
4298
4034
|
<div class="code-header">
|
|
4299
4035
|
<span class="code-lang">PHP</span>
|
|
4300
4036
|
</div>
|
|
4301
|
-
<pre><code><span class="kw">
|
|
4302
|
-
|
|
4303
|
-
<span class="
|
|
4304
|
-
<span class="
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
</
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
<h2>Aides système - <code>makeId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4312
|
-
<div class="info-box">
|
|
4313
|
-
Natif, standard 36 caractères <strong>UUIDv7</strong> produit la chaîne.
|
|
4314
|
-
</div>
|
|
4315
|
-
<p>dans la base de données <code>CHAR(36)</code> ou <code>VARCHAR(36)</code> Si vous comptez l'utiliser et ne souhaitez pas traiter de données binaires brutes, vous pouvez générer l'UUID directement au format chaîne avec cette fonction.</p>
|
|
4037
|
+
<pre><code><span class="kw">utiliser</span> Bin\SystemMethod;
|
|
4038
|
+
<span class="var">$identifiantbrut</span> = SystemMethod::<span class="fn">ID d'octet</span>();
|
|
4039
|
+
<span class="cm">// Ou helper global : byteId();</span>
|
|
4040
|
+
<span class="var">$db</span>-><span class="fn">préparer</span>(<span class="st">"INSÉRER DANS LES VALEURS des utilisateurs (identifiant, nom) (?, ?)"</span>)-><span class="fn">exécuter</span>([<span class="var">$identifiantbrut</span>, <span class="st">'Triomphe'</span>]);</code></pre>
|
|
4041
|
+
</div>
|
|
4042
|
+
</section>
|
|
4043
|
+
<section id="sh-makeid">
|
|
4044
|
+
<h2>Aides système -<code>makeId()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4045
|
+
<div class="info-box">Natif, standard 36 caractères<strong>UUIDv7</strong>produit la chaîne.</div>
|
|
4046
|
+
<p>dans la base de données<code>CHAR(36)</code>ou<code>VARCHAR(36)</code>Si vous comptez l'utiliser et ne souhaitez pas traiter de données binaires brutes, vous pouvez générer l'UUID directement au format chaîne avec cette fonction.</p>
|
|
4316
4047
|
<div class="code-block">
|
|
4317
4048
|
<div class="code-header">
|
|
4318
4049
|
<span class="code-lang">PHP</span>
|
|
4319
4050
|
</div>
|
|
4320
|
-
<pre><code><span class="kw">
|
|
4321
|
-
|
|
4051
|
+
<pre><code><span class="kw">utiliser</span> Bin\SystemMethod;
|
|
4322
4052
|
<span class="var">$stringId</span> = SystemMethod::<span class="fn">makeId</span>();
|
|
4323
|
-
<span class="cm">//
|
|
4324
|
-
</div>
|
|
4325
|
-
</section>
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
<
|
|
4330
|
-
Convertit les UUID binaires bruts de 16 octets en une chaîne standard de 36 caractères.
|
|
4331
|
-
</div>
|
|
4332
|
-
<p>Ce que vous avez extrait de la base de données <code>BINARY(16)</code> Il met les données dans un format lisible avant de les envoyer à l'interface (API/JSON).</p>
|
|
4053
|
+
<span class="cm">// Exemple de sortie : 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4054
|
+
</div>
|
|
4055
|
+
</section>
|
|
4056
|
+
<section id="sh-formatid">
|
|
4057
|
+
<h2>Aides système -<code>formatId()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4058
|
+
<div class="info-box">Convertit les UUID binaires bruts de 16 octets en une chaîne standard de 36 caractères.</div>
|
|
4059
|
+
<p>Ce que vous avez extrait de la base de données<code>BINARY(16)</code>Il met les données dans un format lisible avant de les envoyer à l'interface (API/JSON).</p>
|
|
4333
4060
|
<div class="code-block">
|
|
4334
4061
|
<div class="code-header">
|
|
4335
4062
|
<span class="code-lang">PHP</span>
|
|
4336
4063
|
</div>
|
|
4337
|
-
<pre><code><span class="kw">
|
|
4338
|
-
|
|
4339
|
-
<span class="var">$
|
|
4340
|
-
<span class="
|
|
4341
|
-
|
|
4342
|
-
</
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
<h2>Aides système - <code>intId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4347
|
-
<div class="info-box">
|
|
4348
|
-
Sûr, aléatoire <code>INT</code> ID üretir. (Max 9 Hane)
|
|
4349
|
-
</div>
|
|
4064
|
+
<pre><code><span class="kw">utiliser</span> Bin\SystemMethod;
|
|
4065
|
+
<span class="var">$utilisateur</span> = <span class="var">$db</span>-><span class="fn">requête</span>(<span class="st">"SELECT id FROM utilisateurs LIMITE 1"</span>)-><span class="fn">aller chercher</span>();
|
|
4066
|
+
<span class="var">$identifiant lisible</span> = SystemMethod::<span class="fn">formatId</span>(<span class="var">$utilisateur</span>[<span class="st">'IDENTIFIANT'</span>]);
|
|
4067
|
+
<span class="cm">// Exemple de sortie : 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4068
|
+
</div>
|
|
4069
|
+
</section>
|
|
4070
|
+
<section id="sh-intid">
|
|
4071
|
+
<h2>Aides système -<code>intId()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4072
|
+
<div class="info-box">Sûr, aléatoire<code>INT</code>Génère un identifiant. (9 chiffres maximum)</div>
|
|
4350
4073
|
<p>Il s'agit du générateur d'entiers traditionnel que vous pouvez utiliser si vous ne souhaitez pas renoncer aux performances des bases de données traditionnelles.</p>
|
|
4351
4074
|
<div class="code-block">
|
|
4352
4075
|
<div class="code-header">
|
|
4353
4076
|
<span class="code-lang">PHP</span>
|
|
4354
4077
|
</div>
|
|
4355
4078
|
<pre><code><span class="var">$id</span> = <span class="fn">intId</span>(8);
|
|
4356
|
-
<span class="cm">//
|
|
4357
|
-
</div>
|
|
4358
|
-
</section>
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
<
|
|
4363
|
-
Sûr, aléatoire <code>BIGINT</code> ID üretir. (Varsayılan 15 hane - JS için güvenli sınır)
|
|
4364
|
-
</div>
|
|
4365
|
-
<p>Si vous envisagez d'utiliser d'énormes identifiants numériques comme Snowflake (Twilio), cette fonction vous sauvera la vie. Si vous souhaitez un texte supérieur à 15 chiffres, vous pouvez l'importer sous forme de chaîne pour éviter la perte de données.</p>
|
|
4079
|
+
<span class="cm">// Exemple de sortie : 49201834</span></code></pre>
|
|
4080
|
+
</div>
|
|
4081
|
+
</section>
|
|
4082
|
+
<section id="sh-bigintid">
|
|
4083
|
+
<h2>Aides système -<code>bigintId()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4084
|
+
<div class="info-box">Sûr, aléatoire<code>BIGINT</code>Génère un identifiant. (15 chiffres par défaut - limite de sécurité pour JS)</div>
|
|
4085
|
+
<p>Si vous envisagez d'utiliser d'énormes identifiants numériques comme Snowflake (Twitter), cette fonction vous sauvera la vie. Si vous souhaitez un texte supérieur à 15 chiffres, vous pouvez l'importer sous forme de chaîne pour éviter la perte de données.</p>
|
|
4366
4086
|
<div class="code-block">
|
|
4367
4087
|
<div class="code-header">
|
|
4368
4088
|
<span class="code-lang">PHP</span>
|
|
4369
4089
|
</div>
|
|
4370
|
-
<pre><code><span class="var">$id</span> = <span class="fn">bigintId</span>(); <span class="cm">//
|
|
4371
|
-
<span class="var">$massiveId</span> = <span class="fn">bigintId</span>(18, <span class="kw">
|
|
4372
|
-
</div>
|
|
4373
|
-
</section>
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
<
|
|
4378
|
-
Encapsule les valeurs dans des chaînes pour se protéger contre l'insensibilité aux nombres énormes (BIGINT) de Javascript.
|
|
4379
|
-
</div>
|
|
4380
|
-
<p>Il protège les variables numériques (BigInt, etc.) de plus de 15 chiffres contre les erreurs d'arrondi de Javascript (perte de précision) lors de leur impression sur le DOM dans la couche View.</p>
|
|
4090
|
+
<pre><code><span class="var">$id</span> = <span class="fn">bigintId</span>(); <span class="cm">// Renvoie un INT à 15 chiffres</span>
|
|
4091
|
+
<span class="var">$massiveId</span> = <span class="fn">bigintId</span>(18, <span class="kw">vrai</span>); <span class="cm">// renvoie une CHAÎNE à 18 chiffres (coffre-fort JS)</span></code></pre>
|
|
4092
|
+
</div>
|
|
4093
|
+
</section>
|
|
4094
|
+
<section id="sh-stringer">
|
|
4095
|
+
<h2>Aides système -<code>stringer()</code> <span class="tag b-api">MéthodeSystème</span></h2>
|
|
4096
|
+
<div class="info-box">Encapsule les valeurs dans des chaînes pour se protéger contre l'insensibilité aux nombres énormes (BIGINT) de Javascript.</div>
|
|
4097
|
+
<p>Il protège les variables numériques (BigInt, etc.) de plus de 15 chiffres des erreurs d'arrondi de Javascript (perte de précision) lors de leur impression dans le DOM dans la couche View.</p>
|
|
4381
4098
|
<div class="code-block">
|
|
4382
4099
|
<div class="code-header">
|
|
4383
4100
|
<span class="code-lang">HTML/PHP</span>
|
|
4384
4101
|
</div>
|
|
4385
|
-
<pre><code><span class="cm"><!--
|
|
4386
|
-
<button data-id=<span class="st">"<?=</span> <span class="fn">
|
|
4387
|
-
</div>
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
<span class="var">$code</span> = <span class="fn">
|
|
4396
|
-
|
|
4397
|
-
<span class="
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
</div>
|
|
4403
|
-
</section>
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
</section>
|
|
4407
|
-
<!-- ====== API GÜVENLİĞİ ====== -->
|
|
4102
|
+
<pre><code><span class="cm"><!-- Nous l'enveloppons avec un stringer pour empêcher JS de le corrompre --></span>
|
|
4103
|
+
<button data-id=<span class="st">"<?=</span> <span class="fn">Raidisseur</span>(<span class="var">$données</span>[<span class="st">'IDENTIFIANT'</span>]) <span class="st">?>"</span>>Sil</button></code></pre>
|
|
4104
|
+
</div>
|
|
4105
|
+
<section id="sh-otpcoder">
|
|
4106
|
+
<h2>Aides système - Codeur OTP<span class="tag b-api">MéthodeSystème</span></h2>
|
|
4107
|
+
<div class="info-box">Génère des codes d'authentification (OTP) aléatoires et cryptographiquement sécurisés.</div>
|
|
4108
|
+
<div class="code-block">
|
|
4109
|
+
<pre><code><span class="cm">// Nombre aléatoire à 6 chiffres</span>
|
|
4110
|
+
<span class="var">$code</span> = <span class="fn">otpInt</span>(<span class="nu">6</span>); <span class="cm">// 482910</span>
|
|
4111
|
+
<span class="cm">// Lettre à 8 chiffres uniquement ('c' : minuscule, 'C' : majuscule, 'cC' : mixte)</span>
|
|
4112
|
+
<span class="var">$code</span> = <span class="fn">otpStr</span>(<span class="nu">8</span>, <span class="st">'C'</span>); <span class="cm">// PKLMDZRA</span>
|
|
4113
|
+
<span class="cm">// Lettre+chiffre à 6 chiffres (Alphanumérique)</span>
|
|
4114
|
+
<span class="var">$code</span> = <span class="fn">otpMix</span>(<span class="nu">6</span>, <span class="st">'C'</span>); <span class="cm">//9A4X2Z</span></code></pre>
|
|
4115
|
+
</div>
|
|
4116
|
+
</section>
|
|
4117
|
+
</section>
|
|
4118
|
+
====== SÉCURITÉ DES API ======
|
|
4408
4119
|
<section id="api-methods">
|
|
4409
|
-
<h2>API — Contrôle de méthode HTTP
|
|
4410
|
-
<p><code class="ic">$allowedMethods</code>
|
|
4411
|
-
<pre><code><span class="cm">//
|
|
4412
|
-
<span class="var">$
|
|
4120
|
+
<h2>API — Contrôle de méthode HTTP<span class="tag b-sec">APIContrôle</span></h2>
|
|
4121
|
+
<p><code class="ic">$allowedMethods</code>tableau d'ApiControl nécessite<strong>avant</strong>doit être défini. ApiControl bloque automatiquement les requêtes des méthodes non autorisées en lisant cette chaîne.<code class="ic">405 Method Not Allowed</code>Il le rejette avec .</p>
|
|
4122
|
+
<pre><code><span class="cm">// Un point de terminaison qui accepte uniquement GET et POST</span>
|
|
4123
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'OBTENIR'</span>, <span class="st">'POSTE'</span>];
|
|
4413
4124
|
<span class="fn">require_once</span> ... . <span class="st">'/../app/ApiControl.php'</span>;
|
|
4414
|
-
|
|
4415
|
-
<span class="
|
|
4416
|
-
<span class="var">$allowedMethods</span> = [<span class="st">'DELETE'</span>];
|
|
4125
|
+
<span class="cm">// Un point de terminaison qui accepte uniquement DELETE</span>
|
|
4126
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'SUPPRIMER'</span>];
|
|
4417
4127
|
<span class="fn">require_once</span> ... . <span class="st">'/../app/ApiControl.php'</span>;</code></pre>
|
|
4418
|
-
<p>Contrôle en amont
|
|
4128
|
+
<p>Contrôle en amont<code class="ic">OPTIONS</code>requêtes automatiques pour CORS<code class="ic">200</code>revient et le script se termine – aucune intervention manuelle n’est requise.</p>
|
|
4419
4129
|
</section>
|
|
4420
4130
|
<section id="api-cors">
|
|
4421
|
-
<h2>API – CORS
|
|
4422
|
-
<p>Si vous souhaitez autoriser l'accès à l'API à partir d'autres domaines ou applications mobiles
|
|
4423
|
-
<pre><code><span class="cm">// ApiControl.php
|
|
4424
|
-
header(<span class="st">"Access-Control-Allow-Origin: https://
|
|
4425
|
-
header(<span class="st">"
|
|
4426
|
-
header(<span class="st">"Access-Control-Allow-Headers:
|
|
4131
|
+
<h2>API – CORS<span class="tag b-api">ApiControl (ligne de commentaire)</span></h2>
|
|
4132
|
+
<p>Si vous souhaitez autoriser l'accès à l'API à partir d'autres domaines ou applications mobiles<code class="ic">ApiControl.php</code>Activez le bloc CORS dedans.</p>
|
|
4133
|
+
<pre><code><span class="cm">// Dans ApiControl.php — activé en supprimant le commentaire</span>
|
|
4134
|
+
header(<span class="st">"Access-Control-Allow-Origin : https://votre-domaine.com"</span>);
|
|
4135
|
+
header(<span class="st">"Méthodes d'autorisation de contrôle d'accès : GET, POST, OPTIONS"</span>);
|
|
4136
|
+
header(<span class="st">"Access-Control-Allow-Headers : type de contenu, autorisation"</span>);</code></pre>
|
|
4427
4137
|
<div class="alert a-warn">
|
|
4428
|
-
<strong>⚠️</strong>
|
|
4429
|
-
</div>
|
|
4138
|
+
<strong>⚠️</strong>En environnement de production<code class="ic">*</code>Ne pas utiliser (tous les domaines). Spécifiez clairement l'adresse du domaine.</div>
|
|
4430
4139
|
</section>
|
|
4431
4140
|
<section id="api-rate">
|
|
4432
|
-
<h2>API
|
|
4433
|
-
<p>Pour empêcher des utilisateurs ou des robots malveillants d'inonder l'API
|
|
4141
|
+
<h2>API : Limitation de débit<span class="tag b-api">ApiControl (ligne de commentaire)</span></h2>
|
|
4142
|
+
<p>Pour empêcher des utilisateurs ou des robots malveillants d'inonder l'API<code class="ic">ApiControl.php</code>Vous pouvez y activer le bloc Rate Limiting. Règle par défaut :<strong>60 requêtes/IP en 60 secondes</strong>.</p>
|
|
4434
4143
|
<div class="alert a-warn" style="margin-top: 10px; margin-bottom: 20px;">
|
|
4435
|
-
<strong>⚠️ Serveur Redis requis :</strong>
|
|
4436
|
-
|
|
4437
|
-
<
|
|
4438
|
-
|
|
4439
|
-
echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok fazla istek. Lütfen bekleyin.'</span>]);</code></pre>
|
|
4144
|
+
<strong>⚠️ Serveur Redis requis :</strong>Fonction de limitation de débit<code>\Src\Service\RedisService::getInstance()</code>Cela fonctionne en utilisant la classe Redis. Avant d'ouvrir ce bloc de code, assurez-vous d'avoir configuré un service Redis dans votre projet et<code>src/Service/</code>Assurez-vous de créer une classe de connexion sous</div>
|
|
4145
|
+
<pre><code><span class="cm">// Si plus de 60 requêtes proviennent de la même IP en 60 secondes :</span>
|
|
4146
|
+
http_response_code(<span class="nu">429</span>); <span class="cm">//Trop de demandes</span>
|
|
4147
|
+
echo json_encode([<span class="st">'erreur'</span> => <span class="st">« Trop de demandes. S'il vous plaît, attendez.'</span>]);</code></pre>
|
|
4440
4148
|
</section>
|
|
4441
|
-
|
|
4149
|
+
====== FLUX DE TRAVAIL ======
|
|
4442
4150
|
<section id="workflow">
|
|
4443
4151
|
<h2>Flux de travail complet : formulaire de contact (de bout en bout)</h2>
|
|
4444
|
-
<p>Un
|
|
4152
|
+
<p>Un<strong>Formulaire de contact</strong>Examinons étape par étape comment développer la fonctionnalité dans les standards ArtiFrame du début à la fin.</p>
|
|
4445
4153
|
<ol class="steps">
|
|
4446
4154
|
<li>
|
|
4447
4155
|
<div>
|
|
4448
4156
|
<strong>Créer un fichier de vue</strong>
|
|
4449
|
-
<pre><code>artiframe> <span class="fn">
|
|
4450
|
-
<span class="cm">✔
|
|
4451
|
-
<span class="cm">✔
|
|
4452
|
-
<span class="cm">✔
|
|
4157
|
+
<pre><code>artiframe> <span class="fn">créer:afficher</span> <span class="st">contact.php</span>
|
|
4158
|
+
<span class="cm">✔ public/contact.php</span>
|
|
4159
|
+
<span class="cm">✔ public/actifs/css/contact.css</span>
|
|
4160
|
+
<span class="cm">✔ public/assets/js/contact.js</span></code></pre>
|
|
4453
4161
|
</div>
|
|
4454
4162
|
</li>
|
|
4455
4163
|
<li>
|
|
4456
4164
|
<div>
|
|
4457
4165
|
<strong>Créer un point de terminaison d'API</strong>
|
|
4458
|
-
<pre><code>artiframe> <span class="fn">
|
|
4166
|
+
<pre><code>artiframe> <span class="fn">faire:API</span> <span class="st">standard</span> <span class="st">api/contact/envoyer.php</span></code></pre>
|
|
4459
4167
|
</div>
|
|
4460
4168
|
</li>
|
|
4461
4169
|
<li>
|
|
4462
4170
|
<div>
|
|
4463
4171
|
<strong>Coder le formulaire HTML</strong><br/>
|
|
4464
|
-
<code class="ic">public/iletisim.php</code>
|
|
4465
|
-
<pre><code><form action="/api/iletisim/gonder.php" method="POST">
|
|
4172
|
+
<code class="ic">public/iletisim.php</code>Ajoutez le formulaire suivant au fichier :<pre><code><form action="/api/iletisim/gonder.php" method="POST">
|
|
4466
4173
|
<?= <span class="fn">csrfField</span>() ?>
|
|
4467
4174
|
<input type="text" name="ad" placeholder="Adınız">
|
|
4468
4175
|
<input type="email" name="eposta" placeholder="E-posta">
|
|
4469
4176
|
<textarea name="mesaj" placeholder="Mesajınız"></textarea>
|
|
4470
|
-
<button type="submit" data-js="<span class="st">
|
|
4177
|
+
<button type="submit" data-js="<span class="st">contact-envoyer</span>">Gönder</button>
|
|
4471
4178
|
</form></code></pre>
|
|
4472
4179
|
</div>
|
|
4473
4180
|
</li>
|
|
4474
4181
|
<li>
|
|
4475
4182
|
<div>
|
|
4476
4183
|
<strong>Connectez l'API Fetch avec JavaScript</strong><br/>
|
|
4477
|
-
<code class="ic">public/assets/js/iletisim.js</code>
|
|
4478
|
-
|
|
4479
|
-
e.<span class="fn">
|
|
4480
|
-
<span class="kw">const</span>
|
|
4481
|
-
|
|
4482
|
-
method: <span class="st">'POST'</span>,
|
|
4184
|
+
<code class="ic">public/assets/js/iletisim.js</code>déposer :<pre><code>document.<span class="fn">sélecteur de requête</span>(<span class="st">'[data-js="contact-envoyer"]'</span>).<span class="fn">addEventListener</span>(<span class="st">'cliquez'</span>, async (e) => {
|
|
4185
|
+
e.<span class="fn">prévenirDefault</span>();
|
|
4186
|
+
<span class="kw">const</span> formData = <span class="kw">nouveau</span> <span class="fn">Données de formulaire</span>(e.target.<span class="fn">le plus proche</span>(<span class="st">'formulaire'</span>));
|
|
4187
|
+
<span class="kw">const</span> res = <span class="kw">attendre</span> <span class="fn">aller chercher</span>(<span class="st">'/api/contact/expéditeur.php'</span>, {
|
|
4188
|
+
method: <span class="st">'POSTE'</span>,
|
|
4483
4189
|
body: formData
|
|
4484
4190
|
});
|
|
4485
|
-
<span class="kw">const</span> data = <span class="kw">
|
|
4486
|
-
<span class="fn">console</span>.<span class="fn">
|
|
4191
|
+
<span class="kw">const</span> data = <span class="kw">attendre</span> res.<span class="fn">json</span>();
|
|
4192
|
+
<span class="fn">console</span>.<span class="fn">enregistrer</span>(data);
|
|
4487
4193
|
});</code></pre>
|
|
4488
4194
|
</div>
|
|
4489
4195
|
</li>
|
|
4490
4196
|
<li>
|
|
4491
4197
|
<div>
|
|
4492
4198
|
<strong>Logique de serveur complète (backend)</strong><br/>
|
|
4493
|
-
<code class="ic">public/api/iletisim/gonder.php</code>
|
|
4494
|
-
|
|
4495
|
-
<span class="var">$
|
|
4496
|
-
<span class="
|
|
4497
|
-
<span class="
|
|
4498
|
-
|
|
4499
|
-
<span class="
|
|
4500
|
-
<span class="kw">if</span> (!<span class="fn">verifyCsrf</span>(<span class="var">$_POST</span>[<span class="st">'csrf_token'</span>] ?? <span class="st">''</span>)) {
|
|
4501
|
-
<span class="fn">jsonResponse</span>([<span class="st">'error'</span> => <span class="st">'Geçersiz token.'</span>], <span class="nu">403</span>);
|
|
4199
|
+
<code class="ic">public/api/iletisim/gonder.php</code>dans le fichier :<pre><code><span class="kw"><?php</span>
|
|
4200
|
+
<span class="var">$Méthodes autorisées</span> = [<span class="st">'POSTE'</span>];
|
|
4201
|
+
<span class="fn">require_once</span> <span class="var">$_SERVEUR</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
4202
|
+
<span class="kw">utiliser</span> Bin\SystemMethod;
|
|
4203
|
+
<span class="cm">// 1. Vérification CSRF</span>
|
|
4204
|
+
<span class="kw">si</span> (!<span class="fn">vérifierCsrf</span>(<span class="var">$_POST</span>[<span class="st">'csrf_token'</span>] ?? <span class="st">''</span>)) {
|
|
4205
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'erreur'</span> => <span class="st">"Jeton invalide."</span>], <span class="nu">403</span>);
|
|
4502
4206
|
}
|
|
4503
|
-
|
|
4504
|
-
<span class="
|
|
4505
|
-
<span class="var">$
|
|
4506
|
-
<span class="var">$
|
|
4507
|
-
<span class="
|
|
4508
|
-
|
|
4509
|
-
<span class="cm">//
|
|
4510
|
-
<span class="
|
|
4511
|
-
|
|
4512
|
-
<span class="cm">// 4. Yanıt Ver</span>
|
|
4513
|
-
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>, <span class="st">'message'</span> => <span class="st">'Mesajınız alındı.'</span>], <span class="nu">200</span>);</code></pre>
|
|
4207
|
+
<span class="cm">// 2. Effacer les données</span>
|
|
4208
|
+
<span class="var">$nom</span> = <span class="fn">désinfecterString</span>(<span class="var">$_POST</span>[<span class="st">'nom'</span>] ?? <span class="st">''</span>);
|
|
4209
|
+
<span class="var">$email</span> = <span class="fn">désinfecterEmail</span>(<span class="var">$_POST</span>[<span class="st">'e-mail'</span>] ?? <span class="st">''</span>);
|
|
4210
|
+
<span class="var">$message</span> = <span class="fn">désinfecterString</span>(<span class="var">$_POST</span>[<span class="st">'message'</span>] ?? <span class="st">''</span>);
|
|
4211
|
+
<span class="cm">// 3. Logique métier (envoyer un e-mail, enregistrer dans la base de données, etc.)</span>
|
|
4212
|
+
<span class="cm">//...</span>
|
|
4213
|
+
<span class="cm">// 4. Répondre</span>
|
|
4214
|
+
<span class="fn">jsonRéponse</span>([<span class="st">'statut'</span> => <span class="st">'succès'</span>, <span class="st">'message'</span> => <span class="st">« Votre message a été reçu. »</span>], <span class="nu">200</span>);</code></pre>
|
|
4514
4215
|
</div>
|
|
4515
4216
|
</li>
|
|
4516
4217
|
</ol>
|
|
4517
4218
|
<div class="alert a-success">
|
|
4518
|
-
<strong>✅ Terminé !</strong>
|
|
4519
|
-
</div>
|
|
4219
|
+
<strong>✅ Terminé !</strong>Vous avez créé un flux de formulaires entièrement sécurisé et conforme aux standards avec protection XSS, validation CSRF, restriction de méthode HTTP et architecture data-js.</div>
|
|
4520
4220
|
</section>
|
|
4521
4221
|
</main>
|
|
4522
4222
|
<script>
|
|
4523
4223
|
const sections = document.querySelectorAll('section[id], header[id], div.card[id]');
|
|
4524
4224
|
const links = document.querySelectorAll('.sidebar nav a');
|
|
4525
|
-
|
|
4526
4225
|
const observer = new IntersectionObserver((entries) => {
|
|
4527
4226
|
entries.forEach(entry => {
|
|
4528
4227
|
if (entry.isIntersecting) {
|
|
@@ -4532,7 +4231,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4532
4231
|
}
|
|
4533
4232
|
});
|
|
4534
4233
|
}, { rootMargin: '-20% 0px -70% 0px' });
|
|
4535
|
-
|
|
4536
4234
|
sections.forEach(s => observer.observe(s));
|
|
4537
4235
|
</script>
|
|
4538
4236
|
<script>
|
|
@@ -4541,7 +4239,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4541
4239
|
const ctx = canvas.getContext('2d');
|
|
4542
4240
|
const cw = canvas.width;
|
|
4543
4241
|
const ch = canvas.height;
|
|
4544
|
-
|
|
4545
4242
|
function drawRoundedRect(x, y, w, h, r, fill, stroke) {
|
|
4546
4243
|
ctx.beginPath();
|
|
4547
4244
|
ctx.moveTo(x + r, y);
|
|
@@ -4562,7 +4259,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4562
4259
|
ctx.stroke();
|
|
4563
4260
|
}
|
|
4564
4261
|
}
|
|
4565
|
-
|
|
4566
4262
|
function drawLine(x1, y1, x2, y2, color) {
|
|
4567
4263
|
ctx.beginPath();
|
|
4568
4264
|
ctx.moveTo(x1, y1);
|
|
@@ -4578,7 +4274,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4578
4274
|
ctx.fillStyle = color;
|
|
4579
4275
|
ctx.fill();
|
|
4580
4276
|
}
|
|
4581
|
-
|
|
4582
4277
|
function drawPath(points, color) {
|
|
4583
4278
|
if(points.length < 2) return;
|
|
4584
4279
|
ctx.beginPath();
|
|
@@ -4599,7 +4294,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4599
4294
|
ctx.fillStyle = color;
|
|
4600
4295
|
ctx.fill();
|
|
4601
4296
|
}
|
|
4602
|
-
|
|
4603
4297
|
function drawText(text, x, y, color, font = "14px Inter", align = "center") {
|
|
4604
4298
|
ctx.fillStyle = color;
|
|
4605
4299
|
ctx.font = font;
|
|
@@ -4607,40 +4301,31 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4607
4301
|
ctx.textBaseline = "middle";
|
|
4608
4302
|
ctx.fillText(text, x, y);
|
|
4609
4303
|
}
|
|
4610
|
-
|
|
4611
4304
|
const nodes = [
|
|
4612
|
-
{ id: 'n1', x: 20, y: 220, w: 170, h: 50, text: "
|
|
4613
|
-
{ id: 'n2_local', x: 250, y: 80, w: 220, h: 50, text: "
|
|
4614
|
-
{ id: 'n2_net', x: 250, y: 320, w: 200, h: 50, text: "
|
|
4615
|
-
{ id: 'n3_free', x: 550, y: 85, w: 140, h: 40, text: "✅
|
|
4616
|
-
{ id: 'n4_agpl', x: 510, y: 320, w: 180, h: 50, text: "
|
|
4617
|
-
{ id: 'n5_yes', x: 760, y: 220, w: 220, h: 50, text: "✅
|
|
4618
|
-
{ id: 'n6_no', x: 760, y: 400, w: 140, h: 40, text: "
|
|
4619
|
-
{ id: 'n7_sell', x: 960, y: 340, w: 160, h: 50, text: "❌
|
|
4620
|
-
{ id: 'n8_corp', x: 960, y: 440, w: 180, h: 50, text: "💼
|
|
4305
|
+
{ id: 'n1', x: 20, y: 220, w: 170, h: 50, text: "Proje Nerede Çalışacak?", bg: "#1c2128", border: "#58a6ff", textColor: "#e6edf3" },
|
|
4306
|
+
{ id: 'n2_local', x: 250, y: 80, w: 220, h: 50, text: "Sadece Localhost / Bireysel\n(Dış Ağ Bağlantısı Yok)", bg: "#1c2128", border: "#30363d", textColor: "#e6edf3" },
|
|
4307
|
+
{ id: 'n2_net', x: 250, y: 320, w: 200, h: 50, text: "Ağa / İnternete Açık\n(SaaS, İntranet, Web)", bg: "#1c2128", border: "#30363d", textColor: "#e6edf3" },
|
|
4308
|
+
{ id: 'n3_free', x: 550, y: 85, w: 140, h: 40, text: "✅ Özgürsün", bg: "rgba(0,157,108,0.12)", border: "#00c88c", textColor: "#00c88c" },
|
|
4309
|
+
{ id: 'n4_agpl', x: 510, y: 320, w: 180, h: 50, text: "AGPLv3 Açık Kaynak\nYayınlanacak Mı?", bg: "#1c2128", border: "#30363d", textColor: "#e6edf3" },
|
|
4310
|
+
{ id: 'n5_yes', x: 760, y: 220, w: 220, h: 50, text: "✅ Özgürsün\n(İsim & Github Reposu Şart)", bg: "rgba(0,157,108,0.12)", border: "#00c88c", textColor: "#00c88c" },
|
|
4311
|
+
{ id: 'n6_no', x: 760, y: 400, w: 140, h: 40, text: "Amacı Nedir?", bg: "#1c2128", border: "#30363d", textColor: "#e6edf3" },
|
|
4312
|
+
{ id: 'n7_sell', x: 960, y: 340, w: 160, h: 50, text: "❌ İmkansız\n(AGPLv3 İhlali)", bg: "rgba(248,81,73,0.12)", border: "#f85149", textColor: "#f85149" },
|
|
4313
|
+
{ id: 'n8_corp', x: 960, y: 440, w: 180, h: 50, text: "💼 Ticari Çift-Lisans\n(Artilingo İletişim)", bg: "rgba(227,179,65,0.12)", border: "#e3b341", textColor: "#e3b341" }
|
|
4621
4314
|
];
|
|
4622
|
-
|
|
4623
4315
|
ctx.fillStyle = "#0d1117";
|
|
4624
4316
|
ctx.fillRect(0, 0, cw, ch);
|
|
4625
|
-
|
|
4626
4317
|
drawPath([{x:190, y:245}, {x:220, y:245}, {x:220, y:105}, {x:250, y:105}], "#30363d");
|
|
4627
4318
|
drawPath([{x:190, y:245}, {x:220, y:245}, {x:220, y:345}, {x:250, y:345}], "#30363d");
|
|
4628
|
-
|
|
4629
4319
|
drawLine(470, 105, 550, 105, "#30363d");
|
|
4630
4320
|
drawLine(450, 345, 510, 345, "#30363d");
|
|
4631
|
-
|
|
4632
4321
|
drawPath([{x:690, y:345}, {x:725, y:345}, {x:725, y:245}, {x:760, y:245}], "#30363d");
|
|
4633
|
-
drawText("
|
|
4634
|
-
|
|
4322
|
+
drawText("Evet", 740, 235, "#00c88c", "12px Inter");
|
|
4635
4323
|
drawPath([{x:690, y:345}, {x:725, y:345}, {x:725, y:420}, {x:760, y:420}], "#30363d");
|
|
4636
|
-
drawText("
|
|
4637
|
-
|
|
4324
|
+
drawText("Hayır", 740, 410, "#f85149", "12px Inter");
|
|
4638
4325
|
drawPath([{x:900, y:420}, {x:930, y:420}, {x:930, y:365}, {x:960, y:365}], "#30363d");
|
|
4639
|
-
drawText("
|
|
4640
|
-
|
|
4326
|
+
drawText("Satmak/Dağıtmak", 945, 355, "#f85149", "11px Inter");
|
|
4641
4327
|
drawPath([{x:900, y:420}, {x:930, y:420}, {x:930, y:465}, {x:960, y:465}], "#30363d");
|
|
4642
|
-
drawText("
|
|
4643
|
-
|
|
4328
|
+
drawText("Kendi Projem (SaaS)", 945, 455, "#e3b341", "11px Inter");
|
|
4644
4329
|
nodes.forEach(n => {
|
|
4645
4330
|
drawRoundedRect(n.x, n.y, n.w, n.h, 6, n.bg, n.border);
|
|
4646
4331
|
const lines = n.text.split('\n');
|
|
@@ -4653,14 +4338,10 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Çok f
|
|
|
4653
4338
|
});
|
|
4654
4339
|
}
|
|
4655
4340
|
</script>
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
Home
|
|
4660
|
-
</a>
|
|
4661
|
-
<style>
|
|
4341
|
+
<a class="btn-back-home" href="../../public/index.html" style="position: fixed; bottom: 20px; left: 20px; z-index: 9999; background: var(--surface, #111); color: var(--text-primary, #fff); border: 1px solid var(--border, #333); padding: 10px 15px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); transition: all 0.2s;">
|
|
4342
|
+
<svg fill="none" height="16" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" width="16"><path d="M19 12H5M12 19l-7-7 7-7"></path></svg>Maison</a>
|
|
4343
|
+
<style>
|
|
4662
4344
|
.btn-back-home:hover { border-color: var(--accent, #00E599) !important; color: var(--accent, #00E599) !important; transform: translateY(-2px); }
|
|
4663
4345
|
</style>
|
|
4664
|
-
|
|
4665
4346
|
</body>
|
|
4666
4347
|
</html>
|