@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/en.html
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
|
|
1
|
+
html
|
|
4
2
|
<html lang="en">
|
|
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>Official Developer Documentation — ArtiFrame PHP Framework</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
|
+
Open Graph / Social Media
|
|
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
|
+
SIDEBAR
|
|
259
244
|
<aside class="sidebar">
|
|
260
245
|
<div class="sb-logo">
|
|
261
246
|
<strong>ArtiFrame</strong>
|
|
@@ -268,36 +253,40 @@
|
|
|
268
253
|
<a href="#kurulum">Setup</a>
|
|
269
254
|
<a href="#dizin">Directory Structure</a>
|
|
270
255
|
<div class="sb-cat">Architectural</div>
|
|
256
|
+
<a href="#v2-routing">Zero-Config Routing (v2.0)</a>
|
|
271
257
|
<a href="#bootstrapper">Bootstrapper Architecture</a>
|
|
272
258
|
<a href="#kurallar">Rule Set</a>
|
|
273
259
|
<div class="sb-cat">CLI Tool</div>
|
|
274
260
|
<a href="#cli-giris">Introduction to CLI</a>
|
|
275
261
|
<a href="#cli-new">new</a>
|
|
262
|
+
<a href="#cli-upgrade">upgrade</a>
|
|
276
263
|
<a href="#cli-view">make:view</a>
|
|
277
264
|
<a href="#cli-api">make:api</a>
|
|
278
|
-
<a href="#cli-class">make:class</a>
|
|
279
|
-
|
|
265
|
+
<a href="#cli-class">make:class</a>
|
|
266
|
+
<a href="#cli-table">table:</a>
|
|
280
267
|
<a href="#cli-cliv">cli v</a>
|
|
281
268
|
<a href="#cli-show">show</a>
|
|
282
269
|
<a href="#cli-list">list</a>
|
|
283
270
|
<a href="#cli-go">go</a>
|
|
284
271
|
<a href="#cli-remove">remove</a>
|
|
285
272
|
<a href="#cli-version">version</a>
|
|
286
|
-
<a href="#cli-mode">mode</a>
|
|
287
|
-
|
|
273
|
+
<a href="#cli-mode">mode</a>
|
|
274
|
+
<a href="#cli-serve">serve</a>
|
|
275
|
+
<a href="#cli-auth">auth</a>
|
|
276
|
+
<a href="#cli-suggest">suggest</a>
|
|
288
277
|
<a href="#cli-add">add</a>
|
|
289
278
|
<div class="sb-cat">Integrated Services</div>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
<a href="#svc-stripe">Stripe
|
|
279
|
+
<a href="#svc-qrcode">QR Code</a>
|
|
280
|
+
<a href="#svc-phpmailer">PHPMailer (Mail)</a>
|
|
281
|
+
<a href="#svc-iyzico">Iyzico<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
282
|
+
<a href="#svc-stripe">Stripe<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
294
283
|
<a href="#svc-jwt">J.W.T.</a>
|
|
295
284
|
<a href="#svc-image">Image Processing</a>
|
|
296
|
-
<a href="#svc-s3">AWS S3
|
|
285
|
+
<a href="#svc-s3">AWS S3<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
297
286
|
<a href="#svc-redis">Redis</a>
|
|
298
|
-
<a href="#svc-pusher">pusher
|
|
299
|
-
<a href="#svc-twilio">Twitter
|
|
300
|
-
<a href="#svc-sentry">sentry
|
|
287
|
+
<a href="#svc-pusher">pusher<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
288
|
+
<a href="#svc-twilio">Twitter<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
289
|
+
<a href="#svc-sentry">sentry<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></a>
|
|
301
290
|
<div class="sb-cat">View Helpers</div>
|
|
302
291
|
<a href="#vh-display">display()</a>
|
|
303
292
|
<a href="#vh-escapeurl">escapeUrl()</a>
|
|
@@ -309,8 +298,8 @@
|
|
|
309
298
|
<a href="#vh-maskemail">maskEmail()</a>
|
|
310
299
|
<a href="#vh-maskphone">maskPhone()</a>
|
|
311
300
|
<a href="#vh-slugify">slugify()</a>
|
|
312
|
-
<a href="#vh-money">money()</a>
|
|
313
|
-
|
|
301
|
+
<a href="#vh-money">money()</a>
|
|
302
|
+
<a href="#vh-uuid">uuid()</a>
|
|
314
303
|
<div class="sb-cat">System Helpers</div>
|
|
315
304
|
<div class="sb-subcat">Response & Debug</div>
|
|
316
305
|
<a href="#sh-apiresponse">apiResponse()</a>
|
|
@@ -346,8 +335,8 @@
|
|
|
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">stringer()</a>
|
|
350
|
-
|
|
338
|
+
<a href="#sh-stringer">stringer()</a>
|
|
339
|
+
<a href="#sh-otpcoder">OTP Coder</a>
|
|
351
340
|
<div class="sb-cat">API Security</div>
|
|
352
341
|
<a href="#api-methods">HTTP Method Control</a>
|
|
353
342
|
<a href="#api-cors">CORS</a>
|
|
@@ -356,17 +345,17 @@
|
|
|
356
345
|
<a href="#workflow">Full Workflow</a>
|
|
357
346
|
</nav>
|
|
358
347
|
</aside>
|
|
359
|
-
|
|
348
|
+
MAIN CONTENT
|
|
360
349
|
<main class="content">
|
|
361
|
-
|
|
350
|
+
====== LOGIN ======
|
|
362
351
|
<header id="page-header">
|
|
363
|
-
<h1>ArtiFrame
|
|
352
|
+
<h1>ArtiFrame<span>Documentation</span></h1>
|
|
364
353
|
<p class="lead">Framework for scalable native PHP projects managed with zero external dependencies, strict rules and a powerful CLI. No dependencies, a lightweight and fast ecosystem free from composer package soup, allowing you to focus on your business logic.</p>
|
|
365
354
|
</header>
|
|
366
|
-
|
|
355
|
+
====== INTRODUCTION & PHILOSOPHY ======
|
|
367
356
|
<section id="giris">
|
|
368
357
|
<h2>Introduction & Philosophy</h2>
|
|
369
|
-
<p>ArtiFrame
|
|
358
|
+
<p>ArtiFrame,<strong>"Convention over Configuration"</strong>It is based on the principle of (Rules Before Configuration). The power of a framework comes not from the richness of the tools it offers, but from the consistency of the order it establishes.</p>
|
|
370
359
|
<div class="grid-2">
|
|
371
360
|
<div class="card highlight">
|
|
372
361
|
<h3>Zero Overhead</h3>
|
|
@@ -378,32 +367,30 @@
|
|
|
378
367
|
</div>
|
|
379
368
|
<div class="card highlight">
|
|
380
369
|
<h3>Strict Rule Set</h3>
|
|
381
|
-
<p>A junior developer who just joined the project
|
|
370
|
+
<p>A junior developer who just joined the project,<code class="ic">data-js</code>Understands the architecture and directory structure in minutes. Team compatibility is guaranteed at the framework level.</p>
|
|
382
371
|
</div>
|
|
383
372
|
<div class="card highlight">
|
|
384
373
|
<h3>CLI Priority</h3>
|
|
385
|
-
<p>There is no need to create view, API, class files manually. The CLI generates stub files, links
|
|
374
|
+
<p>There is no need to create view, API, class files manually. The CLI generates stub files, establishes asset links, and keeps the project consistent.</p>
|
|
386
375
|
</div>
|
|
387
376
|
</div>
|
|
388
377
|
<div class="alert a-info">
|
|
389
|
-
<strong>💡 Addiction Philosophy:</strong>
|
|
390
|
-
</div>
|
|
378
|
+
<strong>💡 Addiction Philosophy:</strong>When creating a new project, world-standard composer packages such as phpmailer, redis, ramsey/uuid come installed. However, the ArtiFrame core does not depend on them. You can delete it whenever you want, download your own packages, and rewrite your functions according to your own architecture. ArtiFrame preserves your architectural freedom while reducing external dependency to zero.</div>
|
|
391
379
|
<div class="alert a-info">
|
|
392
|
-
<strong>ℹ️ AGPLv3 License:</strong>
|
|
393
|
-
</div>
|
|
380
|
+
<strong>ℹ️ AGPLv3 License:</strong>ArtiFrame is open source. Derivative works you produce may be freely used, provided that the source code remains open. The copyright notice cannot be removed.</div>
|
|
394
381
|
</section>
|
|
395
|
-
|
|
382
|
+
====== LICENSE AND USE ======
|
|
396
383
|
<section id="lisans">
|
|
397
384
|
<h2>License and Terms of Use</h2>
|
|
398
385
|
<p>ArtiFrame is an open source framework with AGPLv3 license. However, flexible usage scenarios have been designed so that developers can commercialize their projects and sell them as closed source.</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 (End User Projects)</h3>
|
|
402
|
-
<p>In your customers' websites, B2B in-house panels, E-Commerce infrastructures or any SaaS/PaaS project that serves the end user
|
|
389
|
+
<p>In your customers' websites, B2B in-house panels, E-Commerce infrastructures or any SaaS/PaaS project that serves the end user.<strong>you are free</strong>You can hide your code, sell it and copyright it.</p>
|
|
403
390
|
</div>
|
|
404
391
|
<div class="card highlight" style="border-left-color: var(--yellow);">
|
|
405
392
|
<h3>🔄 Fork and New Framework</h3>
|
|
406
|
-
<p>ArtiFrame's core files (<code>bin/</code>
|
|
393
|
+
<p>ArtiFrame's core files (<code>bin/</code>And<code>app/</code>) If you are producing a new framework, CMS infrastructure or coding tool for yourself or others, you can also use this new product.<strong>Open Source</strong>You have to publish it as .</p>
|
|
407
394
|
</div>
|
|
408
395
|
<div class="card highlight" style="border-left-color: var(--red); grid-column: span 2;">
|
|
409
396
|
<h3>⚖️ Legal Enforcement and Violation Situation</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;">End User Project</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;">Core Change (Framework/CMS)</button>
|
|
419
406
|
</div>
|
|
420
|
-
|
|
407
|
+
tab 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>✅ You are completely free</h3>
|
|
424
|
-
<p>If you use ArtiFrame infrastructure in your customers' websites, B2B in-house panels, E-Commerce infrastructures or SaaS projects
|
|
411
|
+
<p>If you use ArtiFrame infrastructure in your customers' websites, B2B in-house panels, E-Commerce infrastructures or SaaS projects<strong>You are not subject to any licensing restrictions.</strong></p>
|
|
425
412
|
<ul>
|
|
426
413
|
<li>You can encrypt and hide your code.</li>
|
|
427
414
|
<li>You can sell your project at any price you want.</li>
|
|
@@ -429,11 +416,10 @@
|
|
|
429
416
|
</ul>
|
|
430
417
|
</div>
|
|
431
418
|
</div>
|
|
432
|
-
|
|
419
|
+
tab 2
|
|
433
420
|
<div class="tab-content" id="tab-core" style="display: none;">
|
|
434
421
|
<div class="alert a-info">
|
|
435
|
-
<strong>ℹ️ Kernel Modification:</strong>
|
|
436
|
-
</div>
|
|
422
|
+
<strong>ℹ️ Kernel Modification:</strong>ArtiFrame's own source codes (<code>bin/</code>And<code>app/</code>) and change this<strong>a new framework, CMS or coding tool</strong>If you are using as , the following decision tree applies:</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,105 +434,147 @@
|
|
|
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;">Additional Commands</h3>
|
|
445
|
+
<p><strong>Listing Tables:</strong>To see all available table templates and descriptions:</p>
|
|
446
|
+
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
447
|
+
<p><strong>Previewing Table Content:</strong>a painting<code>schema.sql</code>at the end of the command to examine the SQL content in the terminal before adding it to the file.<code>check</code>You can add the parameter:</p>
|
|
448
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
449
|
+
</section>
|
|
450
|
+
====== INSTALLATION ======
|
|
470
451
|
<section id="kurulum">
|
|
471
452
|
<h2>Setup</h2>
|
|
472
453
|
<p>ArtiFrame CLI is installed as a global PHP tool. Installed once, used in every project.</p>
|
|
473
454
|
<h3>1. Install CLI Tool Globally</h3>
|
|
474
455
|
<pre><code><span class="cm"># Global installation via NPM</span>
|
|
475
456
|
npm install -g @artilingo/artiframe-cli
|
|
476
|
-
|
|
477
457
|
<span class="cm"># Verify installation</span>
|
|
478
458
|
artiframe</code></pre>
|
|
479
459
|
<h3>2. Interactive Shell</h3>
|
|
480
|
-
<p>To the terminal only
|
|
460
|
+
<p>To the terminal only<code class="ic">artiframe</code>Type it and press Enter. CLI does not close; An interactive shell opens, constantly listening for commands:</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. Start a New Project</h3>
|
|
488
467
|
<pre><code>artiframe> new benim-projem</code></pre>
|
|
489
|
-
<p>this command
|
|
468
|
+
<p>this command<code class="ic">benim-projem/</code>directory and copies the entire skeleton structure into it:<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>and first<code class="ic">index.php</code>page.</p>
|
|
490
469
|
<h3>4. Environment Settings</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>Open your file and fill in the database and application information. This file never goes into version control.</p>
|
|
493
472
|
<div class="alert a-warn">
|
|
494
|
-
<strong>⚠️ Web Server Setting:</strong>
|
|
495
|
-
</div>
|
|
473
|
+
<strong>⚠️ Web Server Setting:</strong>Apache/Nginx's document root<code class="ic">/public/</code>redirect to folder. Other directories should never be open to the outside.</div>
|
|
496
474
|
</section>
|
|
497
|
-
|
|
475
|
+
====== DIRECTORY STRUCTURE ======
|
|
498
476
|
<section id="dizin">
|
|
499
477
|
<h2>Directory Structure</h2>
|
|
500
478
|
<p>The architecture created when the project was started; Provides clear separation of responsibilities (SoC).</p>
|
|
501
479
|
<div class="tree">
|
|
502
480
|
<span class="dir">project-name/</span>
|
|
503
|
-
├── <span class="dir">app/</span> <span class="note"># Infrastructure layer</span>
|
|
504
|
-
│ ├── <span class="file">ViewControl.php</span> <span class="note"># View (HTML page) bootstrapper</span>
|
|
505
|
-
│ ├── <span class="file">ApiControl.php</span> <span class="note"># API endpoint bootstrapper</span>
|
|
506
|
-
│ ├── <span class="file">database.php</span> <span class="note"># PDO based database connection</span>
|
|
507
|
-
│ ├── <span class="file">DotEnv.php</span> <span class="note"># .env reader</span>
|
|
508
|
-
│ └── <span class="file">R2Manager.php</span> <span class="note"># Cloudflare R2 file manager</span>
|
|
481
|
+
├── <span class="dir">app/</span> <span class="note"># Infrastructure layer</span>│ ├──<span class="file">ViewControl.php</span> <span class="note"># View (HTML page) bootstrapper</span>│ ├──<span class="file">ApiControl.php</span> <span class="note"># API endpoint bootstrapper</span>│ ├──<span class="file">database.php</span> <span class="note"># PDO based database connection</span>│ └──<span class="file">DotEnv.php</span> <span class="note"># .env reader</span>
|
|
509
482
|
│
|
|
510
|
-
├── <span class="dir warn">thousand/</span> <span class="note"># ⚠️ Core system — do not edit directly</span>
|
|
511
|
-
│ ├── <span class="file">SystemMethod.php</span> <span class="note"># API/Backend global helpers</span>
|
|
512
|
-
│ ├── <span class="file">ViewMethod.php</span> <span class="note"># View/Frontend global helpers</span>
|
|
513
|
-
│ └── <span class="dir">stubs/</span> <span class="note"># Template files used by CLI</span>
|
|
514
|
-
│ ├── view.stub
|
|
483
|
+
├── <span class="dir warn">thousand/</span> <span class="note"># ⚠️ Core system — do not edit directly</span>│ ├──<span class="file">SystemMethod.php</span> <span class="note"># API/Backend global helpers</span>│ ├──<span class="file">ViewMethod.php</span> <span class="note"># View/Frontend global helpers</span>│ └──<span class="dir">stubs/</span> <span class="note"># Template files used by CLI</span>│ ├── view.stub
|
|
515
484
|
│ ├── api-standard.stub
|
|
516
485
|
│ ├── api-switch-case.stub
|
|
517
486
|
│ └── class.stub
|
|
518
487
|
│
|
|
519
|
-
|
|
520
|
-
│ └── <span class="file">app-version.php</span> <span class="note"># APP_VERSION and APP_ENV constants</span>
|
|
488
|
+
├──<span class="dir">config/</span> <span class="note"># Configuration files</span>│ └──<span class="file">app-version.php</span> <span class="note"># APP_VERSION and APP_ENV constants</span>
|
|
521
489
|
│
|
|
522
|
-
├── <span class="dir">public/</span> <span class="note"># ← The only open directory of the web server</span>
|
|
523
|
-
│
|
|
524
|
-
│ │ ├── <span class="dir">css/</span> <span class="note"># View specific CSS files</span>
|
|
525
|
-
│ │ └── <span class="dir">js/</span> <span class="note"># View specific JS files</span>
|
|
526
|
-
│ ├── <span class="dir">includes/</span> <span class="note"># Paylaşılan bileşenler</span>
|
|
527
|
-
│ │ ├── head.php
|
|
528
|
-
│ │ ├── header.php
|
|
529
|
-
│ │ └── footer.php
|
|
530
|
-
│ ├── <span class="dir">api/</span> <span class="note"># API endpoint dosyaları</span>
|
|
531
|
-
│ └── <span class="file">index.php</span> <span class="note"># Homepage</span>
|
|
490
|
+
├── <span class="dir">public/</span> <span class="note"># ← The only open directory of the web server</span>│ ├──<span class="dir safe">assets/</span>│ │ ├──<span class="dir">css/</span> <span class="note"># View specific CSS files</span>│ │ └──<span class="dir">js/</span> <span class="note"># View specific JS files</span>│ ├──<span class="dir">includes/</span> <span class="note"># Shared components</span>│ │ ├── head.php
|
|
491
|
+
│ ├──<span class="file">head.php</span>│ ├──<span class="file">header.php</span>│ └──<span class="file">footer.php</span>│ ├──<span class="dir">api/</span> <span class="note"># API endpoint files</span>│ └──<span class="file">index.php</span> <span class="note"># Home page</span>
|
|
532
492
|
│
|
|
533
493
|
├── <span class="dir">src/</span> <span class="note"># Business logic and classes</span>
|
|
534
|
-
├── <span class="file">.env</span> <span class="note">#
|
|
494
|
+
├── <span class="file">.env</span> <span class="note"># Environment variables (not included in git)</span>
|
|
535
495
|
├── <span class="file">.env.example</span> <span class="note"># Template — goes into git</span>
|
|
536
|
-
└── <span class="file">
|
|
496
|
+
└── <span class="file">guide.html</span> <span class="note"># This document</span>
|
|
537
497
|
</div>
|
|
538
498
|
<div class="alert a-danger">
|
|
539
|
-
<strong>🚫 Do not touch the bin/ directory:</strong> <code class="ic">bin/</code>
|
|
540
|
-
</div>
|
|
499
|
+
<strong>🚫 Do not touch the bin/ directory:</strong> <code class="ic">bin/</code>The files inside are the core of the framework. Project-specific business logic is not added here. Classes and services you will add<code class="ic">src/</code>Under infrastructure components<code class="ic">app/</code>is located below.</div>
|
|
541
500
|
</section>
|
|
542
|
-
|
|
501
|
+
====== V2.0 ROUTING & ARCHITECTURE ======
|
|
502
|
+
<section id="v2-routing">
|
|
503
|
+
<h2>Zero-Config Routing & v2.0.0 Innovations<span class="tag b-cli">NEW</span></h2>
|
|
504
|
+
<p class="lead">With ArtiFrame v2.0.0, the core structure of the framework has gained a much lighter, faster and developer-friendly "Zero-Config" file-based routing architecture.</p>
|
|
505
|
+
<h3>1. File-Based Automatic Routing (routeLink)</h3>
|
|
506
|
+
<p>Unlike traditional frameworks, ArtiFrame allows individual configuration for each route (e.g.<code>web.php</code>It doesn't want you to add a route to it. All requests<code>public/index.php</code>in the file<strong>to a single Gateway</strong>falls and<code>routeLink()</code>It is magically managed through the method.</p>
|
|
507
|
+
<div class="card highlight">
|
|
508
|
+
<h4>How Does It Work?</h4>
|
|
509
|
+
<p>If from browser<code>/kategori/elektronik/15</code>If the address is entered, the system<code>DOCUMENT_ROOT</code>Searches the directory from bottom to top for the longest matching PHP file:</p>
|
|
510
|
+
<ol>
|
|
511
|
+
<li><code>/kategori/elektronik/15.php</code>(Not found)</li>
|
|
512
|
+
<li><code>/kategori/elektronik.php</code>(Not Found)</li>
|
|
513
|
+
<li><code>/kategori.php</code>(Found!)</li>
|
|
514
|
+
</ol>
|
|
515
|
+
<p>When running the matching file, the remaining URL fragments are automatically<code>$_GET</code>converted to parameters:</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>💡 Backward Compatibility (ID):</strong>In order not to break the habits of old versions<code>$_GET['param1']</code>Always<code>$_GET['id']</code>It is also synchronized into . Thus, directly on the detail pages<code>$_GET['id']</code>you can use</div>
|
|
522
|
+
<div class="card">
|
|
523
|
+
<h4>Link (a) How Should Labels Be?</h4>
|
|
524
|
+
<p>In the new routing system, old style query string parameters (<code>?id=...&token=...</code>) in its place<strong>Clean URL</strong>structure is used. In this way, your links will be both more readable and SEO friendly.</p>
|
|
525
|
+
<pre><code><span class="cm"><!-- ❌ OLD BUILDING (Should not be used) --></span>
|
|
526
|
+
<a href="user.php?id=123456&token=123j54m23k">Profili Gör</a>
|
|
527
|
+
|
|
528
|
+
<span class="cm"><!-- ✅ NEW STRUCTURE (ArtiFrame Standard) --></span>
|
|
529
|
+
<a href="/user/123456/123j54m23k">Profili Gör</a></code></pre>
|
|
530
|
+
<p>In the new structure above, accessing the data on the relevant page is quite simple:</p>
|
|
531
|
+
<pre><code><span class="cm">// in public/user.php:</span>
|
|
532
|
+
$userId = sanitizeInt($_GET['param1']); <span class="cm">// 123456 (or $_GET['id'])</span>
|
|
533
|
+
$token = sanitizeString($_GET['param2']); <span class="cm">// 123j54m23k</span></code></pre>
|
|
534
|
+
</div>
|
|
535
|
+
<h3>2. Global Helpers</h3>
|
|
536
|
+
<p>In older versions<code>\Bin\SystemMethod::generateToken()</code>or<code>\Bin\ViewMethod::display()</code>Long namespace calls like this were required. With v2.0.0, all of these functions are available in global namespace (<code>namespace { }</code>) was included.</p>
|
|
537
|
+
<p>Now you can call it from anywhere in your application just like this:</p>
|
|
538
|
+
<pre><code>$token = generateToken();
|
|
539
|
+
echo display($user['name']);
|
|
540
|
+
echo csrfField();</code></pre>
|
|
541
|
+
<h3>3. Structural Changes (Breaking Changes)</h3>
|
|
542
|
+
<div class="alert a-success">
|
|
543
|
+
<strong>🕊️ No More Refactor Fear:</strong>Unlike other frameworks, you will not experience "refactor" crises that last for days in your projects when ArtiFrame core updates are released.<code>artiframe new</code>As soon as you say, all the core files of that version are copied to your project. New versions released (e.g. v3, v4) will never break your existing projects; It continues to work stably for years, regardless of the requirements of the version installed in the project.</div>
|
|
544
|
+
<div class="alert a-danger">
|
|
545
|
+
<strong>⚠️ Important:</strong>In your old projects<code>public/index.php</code>a welcome page contained HTML. As of v2.0.0<code>index.php</code>It is just a Router file. Your old homepage design is now the default<code>public/landing.php</code>It is offered via. (When an empty URL arrives, the system defaults to<code>landing.php</code>redirects to the file).</div>
|
|
546
|
+
<p>Also in new projects<code>artiframe new</code>so that the system can automatically fallback when you run it.<code>public/404.php</code>And<code>public/503.php</code>error pages are produced.</p>
|
|
547
|
+
<div class="card">
|
|
548
|
+
<h4>Smart API Error Management</h4>
|
|
549
|
+
<p>If 404 (Page Not Found) or 503 (Maintenance Mode) errors<strong>to API endpoint</strong>(for example<code>/api/user/get</code>) comes; Instead of showing an HTML page to the HTTP client (mobile application, frontend), the system sets the status code and automatically creates a standard<strong>JSON error</strong>returns. This ensures that your API can always respond JSON without crashing.</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>💡 Note: Frontend Error Trapping</strong><br/>The error code (404, 503, etc.) is not included in the JSON data, but directly in the standard<strong>In HTTP Network Response (Status Code)</strong>rotary. This way, you can catch errors at the network layer without having to parse the JSON content:</div>
|
|
557
|
+
<pre><code><span class="cm">// Fetch API Example:</span>
|
|
558
|
+
fetch('/api/user/get').then(response => {
|
|
559
|
+
if (!response.ok) {
|
|
560
|
+
console.error("HTTP Hatası:", response.status); <span class="cm">// 404 or 503</span>
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
<span class="cm">// Axios Example:</span>
|
|
565
|
+
axios.get('/api/user/get').catch(error => {
|
|
566
|
+
console.error("HTTP Hatası:", error.response.status); <span class="cm">// 404 or 503</span>
|
|
567
|
+
});</code></pre>
|
|
568
|
+
</div>
|
|
569
|
+
</section>
|
|
570
|
+
====== BOOTSTRAPPER ======
|
|
543
571
|
<section id="bootstrapper">
|
|
544
|
-
<h2>Bootstrapper Architecture
|
|
545
|
-
<p>ArtiFrame uses two completely independent bootstrappers. This architecture
|
|
572
|
+
<h2>Bootstrapper Architecture<span class="tag b-core">Critical</span></h2>
|
|
573
|
+
<p>ArtiFrame uses two completely independent bootstrappers. This architecture<strong>HTML header problems and security vulnerabilities</strong>radically prevents it.</p>
|
|
546
574
|
<div class="grid-2">
|
|
547
575
|
<div class="card highlight">
|
|
548
|
-
<h3><span class="badge b-view">
|
|
549
|
-
<p>It is used for HTML pages (view files). Session starts
|
|
576
|
+
<h3><span class="badge b-view">view</span>ViewControl.php</h3>
|
|
577
|
+
<p>It is used for HTML pages (view files). Session starts,<code class="ic">ViewMethod</code>Installs .</p>
|
|
550
578
|
<pre><code><span class="cm">// public/profile.php — TO THE TOP, before printing HTML</span>
|
|
551
579
|
<span class="kw"><?php</span>
|
|
552
580
|
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>]
|
|
@@ -557,43 +585,38 @@ artiframe> </code></pre>
|
|
|
557
585
|
...</code></pre>
|
|
558
586
|
</div>
|
|
559
587
|
<div class="card highlight">
|
|
560
|
-
<h3><span class="badge b-api">API</span>
|
|
561
|
-
<p>
|
|
588
|
+
<h3><span class="badge b-api">API</span>ApiControl.php</h3>
|
|
589
|
+
<p>API is used for endpoint files. Sets JSON header, performs HTTP method control,<code class="ic">SystemMethod</code>Installs .</p>
|
|
562
590
|
<pre><code><span class="cm">// public/api/user/getir.php</span>
|
|
563
591
|
<span class="kw"><?php</span>
|
|
564
592
|
<span class="cm">// $allowedMethods MUST be defined before require</span>
|
|
565
593
|
<span class="var">$allowedMethods</span> = [<span class="st">'GET'</span>];
|
|
566
|
-
|
|
567
594
|
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>]
|
|
568
595
|
. <span class="st">'/../app/ApiControl.php'</span>;
|
|
569
|
-
|
|
570
596
|
<span class="kw">use</span> Bin\SystemMethod;</code></pre>
|
|
571
597
|
</div>
|
|
572
598
|
</div>
|
|
573
599
|
<div class="alert a-danger">
|
|
574
|
-
<strong>🚫 ViewControl and ApiControl are never mixed:</strong>
|
|
575
|
-
</div>
|
|
600
|
+
<strong>🚫 ViewControl and ApiControl are never mixed:</strong>If ViewControl is required to an API file, HTML header may be returned instead of JSON header and the entire API response will be corrupted. If ApiControl is required on an HTML page, the session will not start and the page will break.</div>
|
|
576
601
|
</section>
|
|
577
|
-
|
|
602
|
+
====== RULES ======
|
|
578
603
|
<section id="kurallar">
|
|
579
|
-
<h2>Rule Set
|
|
604
|
+
<h2>Rule Set<span class="tag b-core">Standard</span></h2>
|
|
580
605
|
<div class="card">
|
|
581
|
-
<h3>Rule 1: data-js Architecture
|
|
582
|
-
<p>JavaScript events are never
|
|
606
|
+
<h3>Rule 1: data-js Architecture<span class="badge b-sec">Critical</span></h3>
|
|
607
|
+
<p>JavaScript events are never<code class="ic">class</code>or<code class="ic">id</code>cannot be listened to over it. These are visual/style identities. All JS interactions<code class="ic">data-js</code>It is managed by the attribute. JavaScript never crashes when CSS deletes a class.</p>
|
|
583
608
|
<pre><code><span class="cm"><!-- ❌ Anti-Pattern — not supported --></span>
|
|
584
609
|
<button id="submitBtn" class="btn">Gönder</button>
|
|
585
610
|
<span class="cm">// JS: document.getElementById('submitBtn').addEventListener(...)</span>
|
|
586
|
-
|
|
587
611
|
<span class="cm"><!-- ✅ ArtiFrame Standard --></span>
|
|
588
612
|
<button class="btn btn-primary" <span class="var">data-js</span>="login-submit">Gönder</button>
|
|
589
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>Rule 2: Theme Architecture</h3>
|
|
593
|
-
<p>Dark/Light mode and themes
|
|
617
|
+
<p>Dark/Light mode and themes,<code class="ic"><html></code>of the label<code class="ic">data-theme</code>And<code class="ic">data-mode</code>It is managed through its attributes. Body classes are not used.</p>
|
|
594
618
|
<pre><code><span class="cm"><!-- HTML opening tag from view.stub template --></span>
|
|
595
619
|
<html lang="tr" data-theme="default" data-mode="light">
|
|
596
|
-
|
|
597
620
|
<span class="cm">/* theme definition in app.css */</span>
|
|
598
621
|
html[data-theme="default"][data-mode="dark"] {
|
|
599
622
|
--bg-color: #0b0c0e;
|
|
@@ -606,14 +629,13 @@ html[data-theme="default"][data-mode="light"] {
|
|
|
606
629
|
</div>
|
|
607
630
|
<div class="card">
|
|
608
631
|
<h3>Rule 3: Secure Data Flow</h3>
|
|
609
|
-
<p>Every data coming from the database is processed before being pushed to the DOM
|
|
632
|
+
<p>Every data coming from the database is processed before being pushed to the DOM.<code class="ic">display()</code>It is wrapped with. Every data coming to the API is processed before it is processed.<code class="ic">sanitizeString()</code>or<code class="ic">sanitizeInt()</code>It is cleaned with .</p>
|
|
610
633
|
</div>
|
|
611
634
|
<div class="card">
|
|
612
635
|
<h3>Rule 4: Error Handling with APP_ENV</h3>
|
|
613
|
-
<p><code class="ic">.env</code>
|
|
636
|
+
<p><code class="ic">.env</code>in the file<code class="ic">APP_ENV</code>The value determines error visibility. In Production, no error message is shown to the user.</p>
|
|
614
637
|
<pre><code><span class="cm">//config/app-version.php</span>
|
|
615
638
|
define(<span class="st">'APP_ENV'</span>, (int)<span class="var">$_ENV</span>[<span class="st">'APP_ENV'</span>]); <span class="cm">// 1=Debug, 0=Production</span>
|
|
616
|
-
|
|
617
639
|
<span class="kw">if</span> (APP_ENV === <span class="nu">1</span>) {
|
|
618
640
|
ini_set(<span class="st">'display_errors'</span>, <span class="nu">1</span>);
|
|
619
641
|
error_reporting(E_ALL);
|
|
@@ -622,64 +644,54 @@ define(<span class="st">'APP_ENV'</span>, (int)<span class="var">$_ENV</span>[<s
|
|
|
622
644
|
}</code></pre>
|
|
623
645
|
</div>
|
|
624
646
|
</section>
|
|
625
|
-
|
|
647
|
+
====== CLI LOGIN ======
|
|
626
648
|
<section id="cli-giris">
|
|
627
649
|
<h2>CLI Ecosystem</h2>
|
|
628
|
-
<p>ArtiFrame CLI to terminal
|
|
650
|
+
<p>ArtiFrame CLI to terminal<code class="ic">artiframe</code>Opens an interactive shell when typed. All commands run within this shell. Commands can also be run one time.</p>
|
|
629
651
|
<pre><code><span class="cm"># Interactive mode (recommended)</span>
|
|
630
652
|
artiframe
|
|
631
653
|
artiframe> make:view admin/kullanicilar.php
|
|
632
|
-
|
|
633
654
|
<span class="cm"># One-time mode</span>
|
|
634
655
|
artiframe make:view admin/kullanicilar.php</code></pre>
|
|
635
656
|
</section>
|
|
636
|
-
|
|
657
|
+
new
|
|
637
658
|
<section id="cli-new">
|
|
638
|
-
<h2><code>new</code> <span class="tag b-cli">CLI
|
|
639
|
-
<p>Creates a new ArtiFrame project. When this command is run, an interactive wizard is launched and your project
|
|
659
|
+
<h2><code>new</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
660
|
+
<p>Creates a new ArtiFrame project. When this command is run, an interactive wizard is launched and your project<code>composer.json</code>It asks you for the basic information required for its configuration (package name, author, license type, etc.). Once all files are copied, dependencies are installed automatically.</p>
|
|
640
661
|
<pre><code>artiframe> <span class="fn">new</span> <span class="st">my-project</span>
|
|
641
|
-
|
|
642
|
-
<span class="cm"> ╔═════════════════════════ ═════════════════════════╗
|
|
662
|
+
<span class="cm">╔═════════════════════════ ═════════════════════════╗
|
|
643
663
|
║ ArtiFrame Project Builder ║
|
|
644
664
|
╚═════════════════════════ ═════════════════════════╝
|
|
645
|
-
|
|
646
665
|
Project: my-project
|
|
647
666
|
Location: C:/artiframe/my-project</span>
|
|
648
|
-
|
|
649
667
|
<span class="kw">?</span> Package name (e.g. vendor/project) <span class="st">[artiframe/my-project]</span>:
|
|
650
668
|
<span class="kw">?</span> Description <span class="st">[ArtiFrame Core PHP Application]</span>:
|
|
651
669
|
<span class="kw">?</span> Author name <span class="st">[Artilingo]</span>:
|
|
652
670
|
<span class="kw">?</span> Author homepage <span class="st">[https://artilingo.com]</span>:
|
|
653
671
|
<span class="kw">?</span> Type (project, library, composer-plugin) <span class="st">[project]</span>:
|
|
654
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-or-later]</span>:
|
|
655
|
-
|
|
656
|
-
<span class="cm"> ┌──────────────────────── ─────────────────────────┐
|
|
673
|
+
<span class="cm">┌──────────────────────── ─────────────────────────┐
|
|
657
674
|
│ 📂 Phase 1/4 — Copying... │
|
|
658
675
|
│ Files to be Processed: 42 Pieces │
|
|
659
676
|
└──────────────────────── ─────────────────────────┘
|
|
660
677
|
[████████████████████] 100% (42/42) docs/guide.html...
|
|
661
|
-
|
|
662
678
|
┌──────────────────────── ─────────────────────────┐
|
|
663
679
|
│ 📂 Phase 2/4 — Creating Directories... │
|
|
664
680
|
│ Files to be Processed: 10 Pieces │
|
|
665
681
|
└──────────────────────── ─────────────────────────┘
|
|
666
682
|
[████████████████████] 100% (52/52) public/assets/images/...
|
|
667
|
-
|
|
668
683
|
┌──────────────────────── ─────────────────────────┐
|
|
669
684
|
│ 📂 Phase 3/4 — Generating Dynamic Files... │
|
|
670
685
|
│ Files to be Processed: 14 Pieces │
|
|
671
686
|
└──────────────────────── ─────────────────────────┘
|
|
672
687
|
[████████████████████] 100% (66/66) .agents/AGENTS.md...
|
|
673
|
-
|
|
674
688
|
┌──────────────────────── ─────────────────────────┐
|
|
675
689
|
│ 📦 Phase 4/4 — Installing Dependencies (Composer)│
|
|
676
690
|
└──────────────────────── ─────────────────────────┘</span>
|
|
677
691
|
<span class="cm">Installing dependencies from lock file (including require-dev)...</span>
|
|
678
|
-
|
|
679
|
-
<span class="cm"> ╔═════════════════════════ ═════════════════════════╗
|
|
692
|
+
<span class="cm">╔═════════════════════════ ═════════════════════════╗
|
|
680
693
|
║ Congratulations! The project has been created successfully. ║
|
|
681
694
|
╚═════════════════════════ ═════════════════════════╝</span>
|
|
682
|
-
|
|
683
695
|
📂 benim-projem/
|
|
684
696
|
│ ├── 📂 bin/
|
|
685
697
|
│ ├── 📂 config/
|
|
@@ -693,25 +705,36 @@ 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>Once the project is created, ArtiFrame CLI runs it for you
|
|
709
|
+
<p>Once the project is created, ArtiFrame CLI runs it for you.<strong>automatically opens a new terminal window</strong>, goes to that directory and restarts the tool focused on that project. You can close the old terminal window.</p>
|
|
699
710
|
<p>Skeletal structure created:</p>
|
|
700
|
-
<div class="tree" style="font-size:0.82rem; line-height:1.7">
|
|
701
|
-
project-name/
|
|
711
|
+
<div class="tree" style="font-size:0.82rem; line-height:1.7">project-name/
|
|
702
712
|
├── app/ (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, assets/, includes/, api/)
|
|
706
716
|
├── src/
|
|
707
717
|
├── .env.example
|
|
708
|
-
└── guide.html
|
|
709
|
-
|
|
718
|
+
└── guide.html</div>
|
|
719
|
+
</section>
|
|
720
|
+
upgrade
|
|
721
|
+
<section id="cli-upgrade">
|
|
722
|
+
<h2><code>upgrade</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
723
|
+
<p>It allows you to safely integrate new features in the ArtiFrame CLI tool that you have updated globally via NPM into your existing project.</p>
|
|
724
|
+
<pre><code>artiframe> <span class="fn">upgrade</span></code></pre>
|
|
725
|
+
<ul style="margin-left: 20px; margin-bottom: 15px; line-height: 1.6;">
|
|
726
|
+
<li>Only<code>app/</code>And<code>bin/</code>with core folders<code>src/Service/</code>Updates the fixed service classes (if any) under it.</li>
|
|
727
|
+
<li>Where your business logic is located<code>src/</code>, <code>public/</code>And<code>config/</code>Definitely in your directories<strong>untouchable</strong>(so your project won't be damaged).</li>
|
|
728
|
+
<li><strong>Firewall:</strong>If your project is v1.x and<code>public/index.php</code>If your file does not fit the new router structure, it will give an error and ask you for the name of your existing index.php.<code>landing.php</code>It asks you to change it to .</li>
|
|
729
|
+
<li><strong>Modification Notice:</strong>if before<code>bin/</code>If you have manually changed the core functions under<strong>enter</strong>It asks for manual confirmation (backup warning) with the button.</li>
|
|
730
|
+
<li><strong>Smart Change Report (Diff):</strong>When the update is finished, it prints to the terminal a detailed report of the newly added or modified (updated) files in your project.</li>
|
|
731
|
+
<li><strong>Function Level Analysis:</strong>If the updated file is a<code>.php</code>The file compares the methods in the old and new file. If a new function is added, the report<code>[YENİ FONKSİYON] ad()</code>It directs you to read the documentation with a special warning.</li>
|
|
732
|
+
</ul>
|
|
710
733
|
</section>
|
|
711
|
-
|
|
734
|
+
make:view
|
|
712
735
|
<section id="cli-view">
|
|
713
|
-
<h2><code>make:view</code> <span class="tag b-cli">CLI
|
|
714
|
-
<p>Creates a new page (view) file and its
|
|
736
|
+
<h2><code>make:view</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
737
|
+
<p>Creates a new page (view) file and its custom CSS/JS assets. Assets are automatically linked to the page and<code class="ic">?v=APP_VERSION</code>Cache-busting is applied with .</p>
|
|
715
738
|
<pre><code>artiframe> <span class="fn">make:view</span> <span class="st">admin/users.php</span></code></pre>
|
|
716
739
|
<p>Created files:</p>
|
|
717
740
|
<pre><code><span class="cm">✔ public/admin/users.php</span>
|
|
@@ -719,35 +742,30 @@ project-name/
|
|
|
719
742
|
<span class="cm">✔ public/assets/js/admin/users.js</span></code></pre>
|
|
720
743
|
<p>At the beginning of the created view file, ViewControl is required, head/header/footer includes are added, and CSS/JS links are connected with cache-busting.</p>
|
|
721
744
|
</section>
|
|
722
|
-
|
|
745
|
+
make:api
|
|
723
746
|
<section id="cli-api">
|
|
724
|
-
<h2><code>make:api</code> <span class="tag b-cli">CLI
|
|
725
|
-
<p>It creates an API endpoint file by choosing one of two different templates. With every new API file
|
|
747
|
+
<h2><code>make:api</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
748
|
+
<p>It creates an API endpoint file by choosing one of two different templates. With every new API file<code class="ic">$allowedMethods</code>variable and<code class="ic">ApiControl.php</code>It comes with require ready.</p>
|
|
726
749
|
<div class="card">
|
|
727
|
-
<h3><span class="badge b-api">
|
|
750
|
+
<h3><span class="badge b-api">standard</span>— Single Action API</h3>
|
|
728
751
|
<p>For endpoints that do a single job (login, send, delete). Business logic is written directly.</p>
|
|
729
752
|
<pre><code>artiframe> <span class="fn">make: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
754
|
<span class="var">$allowedMethods</span> = [<span class="st">'POST'</span>]; <span class="cm">// Accept POST only</span>
|
|
732
755
|
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
733
|
-
|
|
734
756
|
<span class="kw">use</span> Bin\SystemMethod;
|
|
735
|
-
|
|
736
757
|
<span class="cm">//Business logic here...</span>
|
|
737
758
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>], <span class="nu">200</span>);</code></pre>
|
|
738
759
|
</div>
|
|
739
760
|
<div class="card">
|
|
740
|
-
<h3><span class="badge b-api">switch-case</span
|
|
741
|
-
<p>A structure that manages CRUD operations for a module in a single endpoint
|
|
761
|
+
<h3><span class="badge b-api">switch-case</span>— Multi-Action API</h3>
|
|
762
|
+
<p>A structure that manages CRUD operations for a module in a single endpoint.<code class="ic">action</code>The parameter determines which operation will be performed.</p>
|
|
742
763
|
<pre><code>artiframe> <span class="fn">make:api</span> <span class="st">switch-case</span> <span class="st">api/user/admin.php</span></code></pre>
|
|
743
764
|
<pre><code><span class="kw"><?php</span>
|
|
744
765
|
<span class="var">$allowedMethods</span> = [<span class="st">'POST'</span>];
|
|
745
766
|
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
746
|
-
|
|
747
767
|
<span class="kw">use</span> Bin\SystemMethod;
|
|
748
|
-
|
|
749
768
|
<span class="var">$action</span> = <span class="fn">sanitizeString</span>(<span class="var">$_POST</span>[<span class="st">'action'</span>] ?? <span class="st">''</span>);
|
|
750
|
-
|
|
751
769
|
<span class="kw">switch</span> (<span class="var">$action</span>) {
|
|
752
770
|
<span class="kw">case</span> <span class="st">'create'</span>:
|
|
753
771
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>, <span class="st">'message'</span> => <span class="st">'Created.'</span>], <span class="nu">200</span>);
|
|
@@ -763,134 +781,123 @@ project-name/
|
|
|
763
781
|
}</code></pre>
|
|
764
782
|
</div>
|
|
765
783
|
</section>
|
|
766
|
-
|
|
784
|
+
make:class
|
|
767
785
|
<section id="cli-class">
|
|
768
|
-
<h2><code>make:class</code> <span class="tag b-cli">CLI
|
|
769
|
-
<p>It creates a new PHP class file with the namespace and class boilerplate ready. The namespace is determined automatically according to the class path. If
|
|
786
|
+
<h2><code>make:class</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
787
|
+
<p>It creates a new PHP class file with the namespace and class boilerplate ready. The namespace is determined automatically according to the class path. If<strong>app/</strong>And<strong>src/</strong>outside (for example<strong>private/</strong>) if a directory is used, the CLI tool runs in the background<code>composer dump-autoload</code>automatically executes the script.</p>
|
|
770
788
|
<pre><code>artiframe> <span class="fn">make:class</span> <span class="st">src/Service/EmailService.php</span></code></pre>
|
|
771
789
|
<p>If the class directory is not specified, the command returns an error:</p>
|
|
772
790
|
<pre><code>artiframe> <span class="fn">make:class</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>List Tables:</strong> To see all available table templates and their descriptions:</p>
|
|
862
|
-
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
863
|
-
|
|
864
|
-
<p><strong>Preview Table Content:</strong> To inspect the SQL content in the terminal before adding it to the <code>schema.sql</code> file, you can append the <code>check</code> parameter:</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
|
+
table:
|
|
795
|
+
<section id="cli-table">
|
|
796
|
+
<h2><code>table:</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
797
|
+
<p>in your project<code>schema.sql</code>It allows you to quickly add standard and relational database tables to the file. Templates global<code>stubs/sql.stub</code>is read from the file.</p>
|
|
798
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span></code></pre>
|
|
799
|
+
<p>Currently supported standard tables:</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;">users</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;">user_sessions</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;">user_preferences</button>
|
|
805
|
+
</div>
|
|
806
|
+
Tab: users
|
|
807
|
+
<div class="table-tab-content" id="tab-users" style="display: block;">
|
|
808
|
+
<pre><code><span class="kw">CREATE TABLE `users` (
|
|
809
|
+
`id` binary(16) NOT NULL,
|
|
810
|
+
`email` varchar(255) NOT NULL,
|
|
811
|
+
`password` varchar(255) NOT NULL,
|
|
812
|
+
`name` varchar(255) DEFAULT NULL,
|
|
813
|
+
`role` enum('user','admin','moderator') NOT NULL DEFAULT 'user',
|
|
814
|
+
`status` tinyint(1) NOT NULL DEFAULT '1',
|
|
815
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
816
|
+
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
817
|
+
PRIMARY KEY (`id`),
|
|
818
|
+
UNIQUE KEY `email` (`email`)
|
|
819
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
820
|
+
</div>
|
|
821
|
+
Tab: 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` binary(16) NOT NULL,
|
|
825
|
+
`user_id` binary(16) NOT NULL,
|
|
826
|
+
`token` varchar(255) NOT NULL,
|
|
827
|
+
`ip_address` varchar(45) DEFAULT NULL,
|
|
828
|
+
`user_agent` varchar(255) DEFAULT NULL,
|
|
829
|
+
`expires_at` timestamp NULL DEFAULT NULL,
|
|
830
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
831
|
+
PRIMARY KEY (`id`),
|
|
832
|
+
UNIQUE KEY `token` (`token`),
|
|
833
|
+
KEY `user_id` (`user_id`),
|
|
834
|
+
CONSTRAINT `fk_user_sessions_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
835
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
836
|
+
</div>
|
|
837
|
+
Tab: user_preferences
|
|
838
|
+
<div class="table-tab-content" id="tab-prefs" style="display: none;">
|
|
839
|
+
<pre><code><span class="kw">CREATE TABLE `user_preferences` (
|
|
840
|
+
`id` binary(16) NOT NULL,
|
|
841
|
+
`user_id` binary(16) NOT NULL,
|
|
842
|
+
`language` varchar(10) NOT NULL DEFAULT 'tr',
|
|
843
|
+
`theme` varchar(20) NOT NULL DEFAULT 'light',
|
|
844
|
+
`push_notifications` tinyint(1) NOT NULL DEFAULT '1',
|
|
845
|
+
`email_notifications` tinyint(1) NOT NULL DEFAULT '1',
|
|
846
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
847
|
+
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
848
|
+
PRIMARY KEY (`id`),
|
|
849
|
+
UNIQUE KEY `user_id` (`user_id`),
|
|
850
|
+
CONSTRAINT `fk_user_prefs_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
851
|
+
) ENGINE=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;">Additional Commands</h3>
|
|
872
|
+
<p><strong>Listing Tables:</strong>To see all available table templates and descriptions:</p>
|
|
873
|
+
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
874
|
+
<p><strong>Previewing Table Content:</strong>a painting<code>schema.sql</code>at the end of the command to examine the SQL content in the terminal before adding it to the file.<code>check</code>You can add the parameter:</p>
|
|
875
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
876
|
+
</section>
|
|
877
|
+
upgrade
|
|
878
|
+
cli v
|
|
870
879
|
<section id="cli-cliv">
|
|
871
|
-
<h2><code>cli v</code>
|
|
872
|
-
<p>ArtiFrame CLI controls its own (global) version of the tool. Not only shows the current version
|
|
880
|
+
<h2><code>cli v</code>(or<code>cli version</code>) <span class="tag b-cli">CLI Command</span></h2>
|
|
881
|
+
<p>ArtiFrame CLI controls its own (global) version of the tool. Not only shows the current version,<strong>NPM Registry</strong>It also checks whether the most up-to-date version is available. If there is a new version, it can update itself globally with one click (y/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">
|
|
883
|
+
<span class="cm">Current Version: v1.0.0
|
|
875
884
|
Current Version: v1.0.1
|
|
876
|
-
|
|
877
885
|
A new update is available! v1.0.0 → v1.0.1
|
|
878
886
|
Would you like to update now? (y/n)</span> <span class="st">y</span>
|
|
879
|
-
|
|
880
|
-
<span class="cm"> Updating...
|
|
887
|
+
<span class="cm">Updating...
|
|
881
888
|
✅ CLI updated successfully!</span></code></pre>
|
|
882
889
|
</section>
|
|
883
|
-
|
|
890
|
+
show
|
|
884
891
|
<section id="cli-show">
|
|
885
|
-
<h2><code>show</code> <span class="tag b-cli">CLI
|
|
892
|
+
<h2><code>show</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
886
893
|
<p>It displays which working directory the CLI is currently in. Useful for navigation.</p>
|
|
887
894
|
<pre><code>artiframe> <span class="fn">show</span>
|
|
888
895
|
📍 Mevcut Çalışma Dizini:
|
|
889
896
|
C:\projeler\benim_projem</code></pre>
|
|
890
897
|
</section>
|
|
891
|
-
|
|
898
|
+
list
|
|
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">CLI Command</span></h2>
|
|
894
901
|
<p>It lists the files and folders in the current directory in a tree structure in order of priority. Shows the number of items inside folders and the sizes of files.</p>
|
|
895
902
|
<pre><code>artiframe> <span class="fn">list</span>
|
|
896
903
|
📂 benim_projem/
|
|
@@ -899,41 +906,37 @@ Example: /src/Service/PaymentService</code></pre>
|
|
|
899
906
|
│ ├── 📄 composer.json [1.2 KB]
|
|
900
907
|
│ └── 📄 README.md [4.5 KB]</code></pre>
|
|
901
908
|
</section>
|
|
902
|
-
|
|
909
|
+
go
|
|
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">CLI Command</span></h2>
|
|
905
912
|
<p>It allows you to navigate between directories while in the CLI's interactive shell. It doesn't have a permanent effect at the operating system level, but it does change your working directory as long as the CLI remains open.</p>
|
|
906
913
|
<pre><code>artiframe> <span class="fn">go</span> <span class="st">public</span>
|
|
907
914
|
✅ Dizin başarıyla değiştirildi.
|
|
908
915
|
C:\projeler\benim_projem\public
|
|
909
|
-
|
|
910
916
|
artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
911
917
|
✅ Dizin başarıyla değiştirildi.
|
|
912
918
|
C:\projeler\benim_projem</code></pre>
|
|
913
919
|
</section>
|
|
914
|
-
|
|
920
|
+
remove
|
|
915
921
|
<section id="cli-remove">
|
|
916
|
-
<h2><code>remove</code> <span class="tag b-cli">CLI
|
|
917
|
-
<p>Safely deletes a specified file
|
|
922
|
+
<h2><code>remove</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
923
|
+
<p>Safely deletes a specified file.<code>make</code>It works opposite to the commands and analyzes the dependencies in the project and gives warnings before deletion:</p>
|
|
918
924
|
<ul>
|
|
919
|
-
<li><strong>If View is Deleted:</strong>
|
|
920
|
-
<li><strong>If Class is Deleted:</strong>
|
|
925
|
+
<li><strong>If View is Deleted:</strong>if file<code>public/</code>and CSS/JS files linked to this file<code>public/assets</code>If there are, it will ask you if you want to clean them too.</li>
|
|
926
|
+
<li><strong>If Class is Deleted:</strong>if file<code>src/</code>or<code>app/</code>if below,<code>public/api/</code>scans the directory. It warns you by printing the API ends and line numbers in which the class you deleted is used, but it does not delete the APIs automatically (for security reasons, you must manually edit the relevant APIs).</li>
|
|
921
927
|
</ul>
|
|
922
928
|
<pre><code>artiframe> <span class="fn">remove</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">CLI Command</span></h2>
|
|
939
|
+
<p><code class="ic">config/app-version.php</code>It updates the version number in it according to semantic versioning (SemVer) rules. Version format:<strong>MAJOR.MINOR.PATCH</strong></p>
|
|
937
940
|
<table class="sig-table">
|
|
938
941
|
<thead>
|
|
939
942
|
<tr><th>command</th><th>Explanation</th><th>Example</th></tr>
|
|
@@ -950,46 +953,70 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
950
953
|
<pre><code>artiframe> <span class="fn">version</span> upgrade minor
|
|
951
954
|
<span class="cm">✔ Updated to 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">CLI Command</span></h2>
|
|
959
|
+
<p>It allows you to change the project's working mode (Development or Live) with a single command. This command can be manually<code>config/app-version.php</code>It saves you the trouble of opening and editing the file.</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>To switch to the live version<code>0</code>You can use the parameter:</p>
|
|
963
|
+
<pre><code>artiframe> <span class="fn">mode</span> <span class="st">0</span></code></pre>
|
|
964
|
+
</section>
|
|
965
|
+
serve
|
|
963
966
|
<section id="cli-serve">
|
|
964
|
-
<h2><code>serve</code> <span class="tag b-cli">CLI
|
|
965
|
-
<p>
|
|
967
|
+
<h2><code>serve</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
968
|
+
<p>To test the project, it starts a local development server and opens it to the local network (Local Network) via 0.0.0.0 (all network interfaces). It launches your project in seconds without the need to install an additional web server (XAMPP, Nginx, etc.), automatically opens the localhost tab on your own computer and prints the connection IP for other devices on the network (phone / tablet) on the screen.</p>
|
|
966
969
|
<pre><code>artiframe> <span class="fn">serve</span>
|
|
967
|
-
🚀 Geliştirme sunucusu
|
|
968
|
-
Durdurmak için CTRL+C tuşlarına basın
|
|
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>You can specify a different port number if you want:</p>
|
|
970
976
|
<pre><code>artiframe> <span class="fn">serve</span> <span class="st">8080</span></code></pre>
|
|
971
977
|
</section>
|
|
972
|
-
|
|
978
|
+
auth
|
|
979
|
+
<section id="cli-auth">
|
|
980
|
+
<h2><code>auth</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
981
|
+
<p>Issue authorizes the CLI with your GitHub account (via OAuth Device Flow) to be able to send suggestions and bug reports.</p>
|
|
982
|
+
<pre><code>artiframe> <span class="fn">auth</span></code></pre>
|
|
983
|
+
<p>This command prints a user code and opens the GitHub authorization page in your browser. Once the authorization is confirmed, the token is securely stored.</p>
|
|
984
|
+
</section>
|
|
985
|
+
suggest
|
|
986
|
+
<section id="cli-suggest">
|
|
987
|
+
<h2><code>suggest</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
988
|
+
<p>It allows you to submit feature requests, bug reports, or suggestions directly to GitHub without leaving the terminal. before<code>auth</code>It is mandatory to log in with the command.</p>
|
|
989
|
+
<pre><code>artiframe> <span class="fn">suggest</span></code></pre>
|
|
990
|
+
<p>The script interactively prompts you to select a category, write a title, and enter a detailed description. Once completed, it is published as an Issue in the official ArtiFrame repository.</p>
|
|
991
|
+
</section>
|
|
992
|
+
issues
|
|
993
|
+
<section id="cli-issues">
|
|
994
|
+
<h2><code>issues</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
995
|
+
<p>List the issues you've submitted and read their comments directly from your terminal.<code>auth</code>It requires logging in with the command.</p>
|
|
996
|
+
<pre><code>artiframe> <span class="fn">issues</span> [id]</code></pre>
|
|
997
|
+
<p>To see a list of your issues<code>issues</code>run it. To see the details and comments of issue number 4<code>issues 4</code>run it.</p>
|
|
998
|
+
</section>
|
|
999
|
+
add
|
|
973
1000
|
<section id="cli-add">
|
|
974
|
-
<h2><code>add</code> <span class="tag b-cli">CLI
|
|
975
|
-
<p>It is the most powerful command that allows you to include external modules or ready-made integrations in your project. Classical
|
|
1001
|
+
<h2><code>add</code> <span class="tag b-cli">CLI Command</span></h2>
|
|
1002
|
+
<p>It is the most powerful command that allows you to include external modules or ready-made integrations in your project. Classical<code>composer require</code>Going beyond the process, it creates automatic service classes (stubs) for some modules and<code>.env</code>It automatically makes the necessary definitions for your files.</p>
|
|
976
1003
|
<pre><code>artiframe> <span class="fn">add</span> <span class="st">package_short_name</span></code></pre>
|
|
977
1004
|
<h3>1. Integrated Packages (Class Dependent)</h3>
|
|
978
|
-
<p>When these packages are installed, a service class is automatically created and
|
|
1005
|
+
<p>When these packages are installed, a service class is automatically created and<code>.env</code>Connection keys are added to your file. These packages and the locations of the classes they create are listed below:</p>
|
|
979
1006
|
<div class="table-wrapper">
|
|
980
1007
|
<table class="sig-table">
|
|
981
1008
|
<thead>
|
|
982
1009
|
<tr><th>command</th><th>Composer Package</th><th>Generated Class File</th></tr>
|
|
983
1010
|
</thead>
|
|
984
1011
|
<tbody>
|
|
985
|
-
|
|
986
|
-
|
|
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>
|
|
987
1014
|
<tr><td><code>add stripe</code></td><td>stripe/stripe-php</td><td><span class="tag b-core">src/Service/Stripe.php</span></td></tr>
|
|
988
|
-
|
|
989
|
-
|
|
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>sentry/sentry</td><td><span class="tag b-core">
|
|
1019
|
+
<tr><td><code>add sentry</code></td><td>sentry/sentry</td><td><span class="tag b-core">src/Service/Sentry.php</span></td></tr>
|
|
993
1020
|
<tr><td><code>add redis</code></td><td>predis/predis</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-server</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>command</th><th>Composer Package</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>guzzlehttp/guzzle</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/carbon</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>ℹ️ Tip:</strong>
|
|
1021
|
-
</div>
|
|
1045
|
+
<strong>ℹ️ Tip:</strong>To see the entire list of installed or supported just open the terminal<code>add list</code>you can write. You can find the code usage of the modules in the "Integrated Services" menu on the right.</div>
|
|
1022
1046
|
</section>
|
|
1023
|
-
|
|
1047
|
+
====== INTEGRATED SERVICES ======
|
|
1024
1048
|
<section id="entegre-servisler">
|
|
1025
|
-
<h2>Integrated Services (Wrapper)
|
|
1026
|
-
<p>Instead of using popular packages directly, 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. Sending the 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">// Customer cannot see this</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="Paid/Licensed Service">$</span></h2>
|
|
1108
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong> To use Iyzico payment infrastructure <a href="https://www.iyzico.com" style="color: var(--green); font-weight: bold;" target="_blank">iyzico.com</a> (live) or <a href="https://sandbox-merchants.iyzipay.com/" style="color: var(--green); font-weight: bold;" target="_blank">sandbox.iyzipay.com</a> You need to create a seller account via (test) and get your API/Secret keys.</div>
|
|
1049
|
+
<h2>Integrated Services (Wrapper)<span class="tag b-core">stubs</span></h2>
|
|
1050
|
+
<p>Instead of using popular packages directly, ArtiFrame<strong>pre-configured Wrapper</strong>It offers classes for your use.</p>
|
|
1051
|
+
<div class="card" id="svc-qrcode">
|
|
1052
|
+
<h2>QR Code</h2>
|
|
1053
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Immersive Class:</strong> <code>add qrcode</code>when you run the command<code>endroid/qr-code</code>library is loaded and<code>src/Service/QrCode.php</code>The wrapper class is created.</div>
|
|
1054
|
+
<p>It is a modern and fluent class that hides the difficult object production (Builder/Writer) processes of the Endroid QR Code library, where you can create a QR code in a single line and embed a logo in it.</p>
|
|
1055
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Methods and Uses</h3>
|
|
1056
|
+
<ul style="line-height: 1.6; margin-bottom: 20px;">
|
|
1057
|
+
<li><code>->generate('Metin')</code>: Specifies the text or URL to be converted into a QR code and starts the chain.</li>
|
|
1058
|
+
<li><code>->size(300)</code>: Determines the width/height of the QR code in pixels (eg: 300).</li>
|
|
1059
|
+
<li><code>->margin(10)</code>: Determines the white space around the QR code.</li>
|
|
1060
|
+
<li><code>->color('#000000', '#ffffff')</code>: Specifies the Foreground (lines) and Background colors as HEX code. (eg:<code>#000000, #ffffff</code>).</li>
|
|
1061
|
+
<li><code>->logo('/path/logo.png', 50, true)</code>: Embeds an image (logo) in the middle of the QR code. Retrieves the physical path to the logo, its size, and whether its background will be punched out.</li>
|
|
1062
|
+
<li><code>->format('png')</code>: Determines the output format.<code>png</code>or<code>svg</code>is supported. Default: png.</li>
|
|
1063
|
+
<li><code>->save('/path/save.png')</code>: Saves the created QR code to a physical file on the server.</li>
|
|
1064
|
+
<li><code>->base64()</code>: QR code HTML<code><img src="..."></code>It returns it as a base64 string so you can use it directly within the tag.</li>
|
|
1065
|
+
<li><code>->output()</code>: Prints the QR code directly to the browser with appropriate HTTP headers.</li>
|
|
1066
|
+
</ul>
|
|
1067
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Usage Examples</h3>
|
|
1068
|
+
<pre><code><span class="kw">use</span> <span class="var">App\Service\QrCode</span>;
|
|
1069
|
+
<span class="cm">// Example 1: Printing HTML Img to the screen</span>
|
|
1070
|
+
<span class="var">$base64</span> = <span class="var">QrCode</span>::generate(<span class="st">'https://artiframe.dev'</span>)
|
|
1071
|
+
-><span class="fn">you</span>(400)
|
|
1072
|
+
-><span class="fn">logo</span>(<span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/assets/logo.png'</span>)
|
|
1073
|
+
-><span class="fn">base64</span>();
|
|
1074
|
+
<span class="kw">echo</span> <span class="st">'<img src="'</span> . <span class="var">$base64</span> . <span class="st">'" alt="QR">'</span>;
|
|
1075
|
+
<span class="cm">// Example 2: Saving as Physical PNG</span>
|
|
1076
|
+
<span class="var">QrCode</span>::generate(<span class="st">'VCARD Information'</span>)
|
|
1077
|
+
-><span class="fn">color</span>(<span class="st">'#ff0000'</span>, <span class="st">'#ffffff'</span>)
|
|
1078
|
+
-><span class="fn">save</span>(<span class="st">'/temp/user_card.png'</span>);
|
|
1079
|
+
<span class="cm">// Example 3: Pushing image to browser as API Endpoint</span>
|
|
1080
|
+
<span class="var">QrCode</span>::generate(<span class="st">'https://artilingo.com'</span>)-><span class="fn">output</span>();</code></pre>
|
|
1081
|
+
</div>
|
|
1082
|
+
<div class="card" id="svc-phpmailer">
|
|
1083
|
+
<h2>PHPMailer (Mail)</h2>
|
|
1084
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Automatic .env Installation:</strong> <code>add phpmailer</code>SMTP settings when you run the command<code>.env</code>automatically added to your file and<code>src/Service/Mailer.php</code>class is created.</div>
|
|
1085
|
+
<p>It is a much more modern, fluent and secure (CRLF protected) Wrapper class that runs on the PHPMailer library. All methods offered by the class are chainable.</p>
|
|
1086
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Methods and Uses</h3>
|
|
1087
|
+
<ul style="line-height: 1.6; margin-bottom: 20px;">
|
|
1088
|
+
<li><code>->to('mail@adres.com', 'İsim')</code>: Determines who the e-mail will be sent to.</li>
|
|
1089
|
+
<li><code>->cc('mail@adres.com')</code>: Adds Information (Carbon Copy) recipients.</li>
|
|
1090
|
+
<li><code>->bcc('mail@adres.com')</code>: Adds Blind Carbon Copy recipients. Primary recipients cannot see these addresses.</li>
|
|
1091
|
+
<li><code>->subject('Konu')</code>: Determines the title (subject) of the e-mail.</li>
|
|
1092
|
+
<li><code>->attach('/path/fatura.pdf', 'Isim.pdf')</code>: It puts a physical file on the server (or temp) into the e-mail as an attachment.</li>
|
|
1093
|
+
<li><code>->embedImage('/path/logo.png', 'logo_cid')</code>: To be used in HTML within e-mail (<code><img src="cid:logo_cid"></code>) embeds images.</li>
|
|
1094
|
+
<li><code>->html('HTML Kodu')</code>: Sets the HTML content of the email. Automatically creates plain text (AltBody) version for security.</li>
|
|
1095
|
+
<li><code>->text('Düz Metin')</code>: Used if you want to send the e-mail only in plain text.</li>
|
|
1096
|
+
<li><code>->send()</code>: Completes all transactions in the chain and sends the e-mail via SMTP. If there is an error, it throws an Exception.</li>
|
|
1097
|
+
</ul>
|
|
1098
|
+
<h3 style="margin-top:20px; margin-bottom:10px; font-size: 1.1em; color: var(--text-color);">Advanced Example: PHP Template (View) and Dynamic File Submission</h3>
|
|
1099
|
+
<p>If you do not want to write the HTML content of the email into a string like spaghetti code,<code>ob_start()</code>You can import an external PHP template file (with variables inside) and embed a system-generated PDF directly into the email using:</p>
|
|
1100
|
+
<pre><code><span class="kw">use</span> <span class="var">App\Service\Mailer</span>;
|
|
1101
|
+
<span class="cm">// 1. Your dynamic data</span>
|
|
1102
|
+
<span class="var">$orderNo</span> = <span class="st">'#90210'</span>;
|
|
1103
|
+
<span class="var">$pdfFile</span> = <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/temp/invoice_90210.pdf'</span>;
|
|
1104
|
+
<span class="cm">// 2. Loading the HTML Template from outside (Output Buffering)</span>
|
|
1105
|
+
<span class="fn">ob_start</span>();
|
|
1106
|
+
<span class="kw">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/views/email/order.php'</span>;
|
|
1107
|
+
<span class="var">$htmlContent</span> = <span class="fn">ob_get_clean</span>();
|
|
1108
|
+
<span class="cm">// 3. Sending the Email</span>
|
|
1109
|
+
<span class="var">Mailer</span>::create()
|
|
1110
|
+
-><span class="fn">to</span>(<span class="st">'custeri@mail.com'</span>, <span class="st">'Ahmet Yilmaz'</span>)
|
|
1111
|
+
-><span class="fn">bcc</span>(<span class="st">'archive@company.com'</span>) <span class="cm">// Client cannot see this</span>
|
|
1112
|
+
-><span class="fn">subject</span>(<span class="st">'Your Order Confirmed:'</span> . <span class="var">$orderNo</span>)
|
|
1113
|
+
-><span class="fn">html</span>(<span class="var">$htmlContent</span>)
|
|
1114
|
+
-><span class="fn">attach</span>(<span class="var">$pdfFile</span>, <span class="st">'Order_Invoice.pdf'</span>)
|
|
1115
|
+
-><span class="fn">send</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="Paid/Licensed Service">$</span></h2>
|
|
1119
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To use Iyzico payment infrastructure<a href="https://www.iyzico.com" style="color: var(--green); font-weight: bold;" target="_blank">iyzico.com</a>(live) or<a href="https://sandbox-merchants.iyzipay.com/" style="color: var(--green); font-weight: bold;" target="_blank">sandbox.iyzipay.com</a>You need to create a seller account via (test) and get your API/Secret keys.</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>Class Location:</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;">Iyzico Payment Service<br/>Provides a clean wrapper around the iyzipay-php SDK for payment processing,<br/>3D Secure flows, refunds, cancellations, card vault, and marketplace sub-merchants.<br/>Required environment variables:<br/>IYZICO_API_KEY — Your iyzico API key<br/>IYZICO_SECRET_KEY — Your iyzico secret key<br/>IYZICO_BASE_URL — API base URL (https://sandbox-api.iyzipay.com or https://api.iyzipay.com)</p>
|
|
1113
1124
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1114
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
1125
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
1115
1126
|
</div>
|
|
1116
1127
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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>Stripe
|
|
1519
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>
|
|
1511
|
+
<h2>Stripe<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></h2>
|
|
1512
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To use the Stripe global payment infrastructure<a href="https://stripe.com" style="color: var(--green); font-weight: bold;" target="_blank">stripe.com</a>You must create an account via and obtain your Public and Secret keys from the developer panel.</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>Class Location:</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;">Stripe Payment Service<br/>Provides a clean wrapper around the stripe-php SDK for payment processing,<br/>customer management, subscriptions, product creation, and webhook handling.<br/>Required environment variables:<br/>STRIPE_SECRET_KEY — Your Stripe secret API key<br/>STRIPE_PUBLISHABLE_KEY — Your Stripe publishable key (for front-end reference)<br/>STRIPE_WEBHOOK_SECRET — Webhook endpoint signing secret</p>
|
|
1524
1517
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1525
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
1518
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
1526
1519
|
</div>
|
|
1527
1520
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">JWT Authentication Service<br/>Provides a clean wrapper around firebase/php-jwt for token generation,<br/>verification, refresh, and HTTP middleware integration.<br/>Required environment variables:<br/>JWT_SECRET_KEY — Secret key used for signing and verifying tokens<br/>JWT_ALGORITHM — Signing algorithm (e.g. HS256, HS384, HS512)<br/>JWT_EXPIRY — Default token lifetime in seconds (e.g. 3600)</p>
|
|
1862
1835
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
1863
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
1836
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
1864
1837
|
</div>
|
|
1865
1838
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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 for Intervention Image v3.<br/>Provides simple methods for common image operations such as<br/>resizing, cropping, watermarking, format conversion, and compression.<br/>Required ENV variables:<br/>IMAGE_DRIVER — "gd" or "imagick" (default: gd)<br/>IMAGE_QUALITY — Default JPEG/WebP quality 1-100 (default: 80)</p>
|
|
2126
2083
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2127
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
2084
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
2128
2085
|
</div>
|
|
2129
2086
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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>
|
|
@@ -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;">Example Usage:</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;">Example Usage:</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>📌 Membership & API Keys:</strong>
|
|
2370
|
+
<h2>AWS S3<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></h2>
|
|
2371
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To use S3 Bucket<a href="https://aws.amazon.com/s3/" style="color: var(--green); font-weight: bold;" target="_blank">aws.amazon.com/s3</a>You must open an AWS account via , create a Bucket and obtain an Access Key and Secret Key with programmatic access permission 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>Class Location:</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 for AWS S3 SDK.<br/>Provides simple methods for uploading, downloading, deleting, listing,<br/>and managing files on Amazon S3, MinIO, DigitalOcean Spaces, or any<br/>S3-compatible object storage.<br/>Required ENV variables:<br/>AWS_ACCESS_KEY_ID — IAM access key<br/>AWS_SECRET_ACCESS_KEY — IAM secret key<br/>AWS_DEFAULT_REGION — e.g. "eu-central-1"<br/>AWS_BUCKET — Default bucket name<br/>Optional ENV variables:<br/>AWS_ENDPOINT — Custom endpoint URL (MinIO, Spaces, etc.)</p>
|
|
2436
2376
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2437
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
2377
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
2438
2378
|
</div>
|
|
2439
2379
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Parameter Structure:</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 List of object keys to delete.</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;">Example Usage:</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>
|
|
@@ -2599,16 +2529,14 @@ true</code></pre>
|
|
|
2599
2529
|
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Get the public URL for an object.</p>
|
|
2600
2530
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
2601
2531
|
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
2602
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">
|
|
2532
|
+
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Parameter Structure:</h4>
|
|
2603
2533
|
<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 $remotePath Object key in the bucket.</code></pre>
|
|
2604
2534
|
</div>
|
|
2605
2535
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
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;">Example Usage:</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;">Example Usage:</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>
|
|
@@ -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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Redis Cache Service<br/>Provides a clean, simple interface for Redis caching operations<br/>using the predis/predis SDK. All configuration is read from $_ENV.<br/>Required environment variables:<br/>REDIS_HOST — Redis server hostname (default: 127.0.0.1)<br/>REDIS_PORT — Redis server port (default: 6379)<br/>REDIS_PASSWORD — Redis authentication password (default: null)<br/>REDIS_DATABASE — Redis database index (default: 0)</p>
|
|
2812
2728
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
2813
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
2729
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
2814
2730
|
</div>
|
|
2815
2731
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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>pusher
|
|
3273
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>
|
|
3158
|
+
<h2>pusher<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></h2>
|
|
3159
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To communicate in real time via WebSocket<a href="https://pusher.com" style="color: var(--green); font-weight: bold;" target="_blank">pusher.com</a>You should create a free Channels application via and get your App ID, Key and Secret information.</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>Class Location:</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;">Pusher Realtime Service<br/>Provides a clean interface for Pusher Channels — broadcasting events,<br/>authenticating private/presence channels, and querying channel state.<br/>Uses the pusher/pusher-php-server SDK. All configuration from $_ENV.<br/>Required environment variables:<br/>PUSHER_APP_ID — Your Pusher application ID<br/>PUSHER_APP_KEY — Your Pusher application key<br/>PUSHER_APP_SECRET — Your Pusher application secret<br/>PUSHER_CLUSTER — Pusher cluster region (e.g., 'eu', 'us2', 'ap1')</p>
|
|
3278
3164
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3279
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
3165
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
3280
3166
|
</div>
|
|
3281
3167
|
<h3>Methods and Usage Examples</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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>Twitter
|
|
3506
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>
|
|
3377
|
+
<h2>Twitter<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></h2>
|
|
3378
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To send SMS and WhatsApp messages<a href="https://www.twilio.com" style="color: var(--green); font-weight: bold;" target="_blank">twilio.com</a>You must open an account on , rent an available phone number and get your Account SID and Auth Token information from the panel.</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>Class Location:</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;">Twilio Communications Service<br/>Provides a simplified interface for Twilio's messaging, voice,<br/>and verification APIs using the twilio/sdk. All configuration<br/>is read from $_ENV.<br/>Required environment variables:<br/>TWILIO_SID — Your Twilio Account SID<br/>TWILIO_AUTH_TOKEN — Your Twilio Auth Token<br/>TWILIO_FROM_NUMBER — Default "from" phone number (E.164 format, e.g., +15551234567)<br/>Optional environment variables:<br/>TWILIO_VERIFY_SID — Verify Service SID (required for verifyStart/verifyCheck)</p>
|
|
3511
3383
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3512
|
-
<strong>ℹ️ Standard Return:</strong>
|
|
3384
|
+
<strong>ℹ️ Standard Return:</strong>All methods<code>['status' => 'success|error', 'message' => '...', 'data' => [...]]</code>Converts a standard string in the format (with exceptions).<strong>in the array returned in the "Expected Return" section below.<code>data</code>The detailed structure of the key is shown.</strong>
|
|
3513
3385
|
</div>
|
|
3514
3386
|
<h3>Methods and Usage Examples</h3>
|
|
3515
3387
|
<div class="accordion-group">
|
|
@@ -3528,9 +3400,7 @@ On error: 'status' => 'error', 'message' => error description</code></pre>
|
|
|
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;">Example Usage:</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;">Example Usage:</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;">Initiate a voice call. Places an outbound call to the specified number. The call behavior is defined by the TwiML document at the given URL. The TwiML URL should return instructions like
|
|
3452
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Initiate a voice call. Places an outbound call to the specified number. The call behavior is defined by the TwiML document at the given URL. The TwiML URL should return instructions like<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;">Parameter Structure:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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;">Example Usage:</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>sentry
|
|
3780
|
-
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>
|
|
3635
|
+
<h2>sentry<span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Paid/Licensed Service">$</span></h2>
|
|
3636
|
+
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Membership & API Keys:</strong>To enable error and performance tracking<a href="https://sentry.io" style="color: var(--green); font-weight: bold;" target="_blank">sentry.io</a>You must create your free account via , add a PHP project and copy the DSN (Client Key) address given to you.</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>Class Location:</strong> <code style="color: #4ade80;">
|
|
3638
|
+
<strong>Class Location:</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;">It allows you to collect errors and warnings in your project in a central log system. At the start of your application (e.g.<code>ApiControl.php</code>or<code>ViewControl.php</code>It is recommended to start in .</p>
|
|
3785
3641
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3786
|
-
<strong>ℹ️
|
|
3787
|
-
</div>
|
|
3642
|
+
<strong>ℹ️ Static Class:</strong>This service class is used directly with static methods, you do not need to create a new instance.</div>
|
|
3788
3643
|
<h3>Methods and Usage Examples</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;">Initializes the Sentry SDK based on environment variables. It must be called once at the very beginning of the application.</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;">Parameter Structure:</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;">Example Usage:</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;">Expected Return ($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;">No-op fallback when Sentry is not configured.</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;">Parameter Structure:</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;">Example Usage:</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;">Expected Return ($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;">Sends a caught Exception or Throwable object to 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;">Parameter Structure:</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;">Example Usage:</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;">Expected Return (
|
|
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;">Expected Return (string|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;">Sends a specified text to Sentry as an information/warning message. Valid levels:<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;">Parameter Structure:</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;">Example Usage:</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;">Expected Return ($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,53 +3695,45 @@ if ($response['status'] === 'success') {
|
|
|
3933
3695
|
</div>
|
|
3934
3696
|
</div>
|
|
3935
3697
|
</section>
|
|
3936
|
-
|
|
3698
|
+
====== VIEW HELPERS ======
|
|
3937
3699
|
<section id="vh-display">
|
|
3938
|
-
<h2>ViewHelpers
|
|
3939
|
-
<p>When printing data from the database or user input to the DOM
|
|
3700
|
+
<h2>ViewHelpers—<code>display()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
3701
|
+
<p>When printing data from the database or user input to the DOM<strong>mandatory XSS protection</strong>implements. Instead of throwing an error on null or empty values, the default value is returned.</p>
|
|
3940
3702
|
<span class="ret">string display(mixed $data, string $default = '')</span>
|
|
3941
3703
|
<div class="alert a-info" style="margin-top: 10px; margin-bottom: 24px; padding: 12px 20px;">
|
|
3942
|
-
<strong>💡 Tip
|
|
3943
|
-
Second parameter (<code>$default</code>) is the rescue text that will be printed on the screen when the data coming from the database is empty (null, false, empty string). For example, for a user whose name data is not entered <code>display($isim, 'İsimsiz')</code> If you use it, your page will present meaningful content instead of ugly whitespace.
|
|
3944
|
-
</div>
|
|
3704
|
+
<strong>💡 Tip:<code>$default</code>Usage</strong><br/>Second parameter (<code>$default</code>) is the rescue text that will be printed on the screen when the data coming from the database is empty (null, false, empty string). For example, for a user whose name data is not entered<code>display($isim, 'İsimsiz')</code>If you use it, your page will present meaningful content instead of ugly whitespace.</div>
|
|
3945
3705
|
<pre><code><span class="cm"><!-- ❌ Insecure — Creates an XSS vulnerability --></span>
|
|
3946
3706
|
<h1><?= <span class="var">$user</span>[<span class="st">'name'</span>] ?></h1>
|
|
3947
|
-
|
|
3948
3707
|
<span class="cm"><!-- ✅ Safe Use of ArtiFrame --></span>
|
|
3949
3708
|
<h1><?= <span class="fn">display</span>(<span class="var">$user</span>[<span class="st">'name'</span>], <span class="st">'Anonymous User'</span>) ?></h1></code></pre>
|
|
3950
3709
|
</section>
|
|
3951
3710
|
<section id="vh-escapeurl">
|
|
3952
|
-
<h2>ViewHelpers
|
|
3953
|
-
<p>Links received from users (e.g. profile websites)
|
|
3711
|
+
<h2>ViewHelpers—<code>escapeUrl()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
3712
|
+
<p>Links received from users (e.g. profile websites)<code><a href="..."></code>or<code><img src="..."></code>It is used when pressing inside.<code>javascript:alert(1)</code>It prevents code execution over the connection by rendering dangerous payloads such as (Stored XSS) harmless.</p>
|
|
3954
3713
|
<span class="ret">string escapeUrl(string $url)</span>
|
|
3955
3714
|
<pre><code><span class="cm"><!-- ❌ Insecure — JS code may be leaked via URL --></span>
|
|
3956
3715
|
<a href="<?= <span class="var">$user</span>[<span class="st">'website'</span>] ?>">Siteyi Ziyaret Et</a>
|
|
3957
|
-
|
|
3958
3716
|
<span class="cm"><!-- ✅ Safe Use of ArtiFrame --></span>
|
|
3959
3717
|
<a href="<?= <span class="fn">escapeUrl</span>(<span class="var">$user</span>[<span class="st">'website'</span>]) ?>">Siteyi Ziyaret Et</a></code></pre>
|
|
3960
3718
|
</section>
|
|
3961
3719
|
<section id="vh-csrf">
|
|
3962
|
-
<h2>ViewHelpers
|
|
3963
|
-
<p>Adds a hidden token field to HTML forms against CSRF attacks
|
|
3720
|
+
<h2>ViewHelpers—<code>csrfField()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
3721
|
+
<p>Adds a hidden token field to HTML forms against CSRF attacks.<strong>It is mandatory to use it on every page containing a POST form.</strong></p>
|
|
3964
3722
|
<span class="ret">string csrfField()</span>
|
|
3965
|
-
<p>This method automatically prints the following HTML output into your form
|
|
3723
|
+
<p>This method automatically prints the following HTML output into your form:<code><input type="hidden" name="csrf_token" value="..."></code>. If you do not want to use the method, you can use this hidden input as its value.<code>display()</code>You can also add it manually by wrapping it with .</p>
|
|
3966
3724
|
<pre><code><span class="cm"><!-- Frontend (HTML) --></span>
|
|
3967
3725
|
<form data-js="kaydet-form">
|
|
3968
3726
|
<?= <span class="fn">csrfField</span>() ?> <span class="cm"><!-- Automatically generates hidden input --></span>
|
|
3969
|
-
|
|
3970
3727
|
<span class="cm"><!-- OR Manual Usage:
|
|
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
3733
|
<span class="cm">// Frontend (JavaScript) - Capturing and Sending Data</span>
|
|
3979
3734
|
<span class="fn">document</span>.<span class="fn">querySelector</span>(<span class="st">'[data-js="save-form"]'</span>).<span class="fn">addEventListener</span>(<span class="st">'submit'</span>, (e) => {
|
|
3980
3735
|
e.<span class="fn">preventDefault</span>();
|
|
3981
3736
|
<span class="kw">const</span> <span class="var">formData</span> = <span class="kw">new</span> <span class="fn">FormData</span>(e.target);
|
|
3982
|
-
|
|
3983
3737
|
<span class="cm">// csrf_token is automatically included in formData</span>
|
|
3984
3738
|
<span class="fn">fetch</span>(<span class="st">'/api/save.php'</span>, {
|
|
3985
3739
|
<span class="kw">method</span>: <span class="st">'POST'</span>,
|
|
@@ -3988,8 +3742,8 @@ if ($response['status'] === 'success') {
|
|
|
3988
3742
|
});</code></pre>
|
|
3989
3743
|
</section>
|
|
3990
3744
|
<section id="vh-dates">
|
|
3991
|
-
<h2>View Helpers — Date Functions
|
|
3992
|
-
<p>in database
|
|
3745
|
+
<h2>View Helpers — Date Functions<span class="tag b-view">ViewMethod</span></h2>
|
|
3746
|
+
<p>in database<code class="ic">Y-m-d H:i:s</code>Processes date strings or UNIX timestamp values in format. All textual output by language (<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>) is localized.</p>
|
|
3993
3747
|
<table class="sig-table">
|
|
3994
3748
|
<thead><tr><th>Function</th><th>Output Example</th><th>Explanation</th></tr></thead>
|
|
3995
3749
|
<tbody>
|
|
@@ -4005,65 +3759,62 @@ 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>💡 Understanding Parameters
|
|
3762
|
+
<strong>💡 Understanding Parameters:<code>$format</code>And<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>Only<code>formatDate()</code>It is used with the function. It accepts standard PHP date letters. (For example:<code>'d/m/Y'</code>➔ 24/07/2026, or<code>'H:i'</code>➔ 15:30). It allows you to create your own date pattern when other ready-made functions (day, year, etc.) are insufficient.</li>
|
|
3765
|
+
<li style="margin-bottom: 0;"><strong><code>$lang</code>(Language):</strong>It is used in functions that contain text (month name, word "before") in their output. If you leave this parameter empty, the system<strong>by default<code>'tr'</code>(Turkish)</strong>it works. If you are doing a multilingual project, enter the language code (<code>tr, en, de, fr, es</code>) is enough to enter. (Ex:<code>timeAgo($tarih, 'en')</code>➔ 5 minutes ago)</li>
|
|
4012
3766
|
</ul>
|
|
4013
3767
|
</div>
|
|
4014
3768
|
<pre><code><span class="cm"><!-- Assume it is a UNIX timestamp retrieved with the time() function --></span>
|
|
4015
3769
|
<span class="kw"><?php</span> <span class="var">$date</span> = <span class="fn">time</span>(); <span class="kw">?></span>
|
|
4016
|
-
|
|
4017
3770
|
<span class="cm"><!-- Exact date by language --></span>
|
|
4018
3771
|
<span><?= <span class="fn">fulldateName</span>(<span class="var">$date</span>, <span class="st">'tr'</span>) ?></span>
|
|
4019
3772
|
<span class="cm"><!-- Released: July 24, 2026 --></span>
|
|
4020
|
-
|
|
4021
3773
|
<span class="cm"><!-- Social media style time display --></span>
|
|
4022
3774
|
<span><?= <span class="fn">timeAgo</span>(<span class="var">$date</span>, <span class="st">'most'</span>) ?></span>
|
|
4023
3775
|
<span class="cm"><!-- Released: 5 minutes ago --></span>
|
|
4024
|
-
|
|
4025
3776
|
<span><?= <span class="fn">timeAgo</span>(<span class="var">$date</span>, <span class="st">'also'</span>) ?></span>
|
|
4026
3777
|
<span class="cm"><!-- Output: vor 5 Minutes --></span></code></pre>
|
|
4027
3778
|
</section>
|
|
4028
3779
|
<section id="vh-truncate">
|
|
4029
|
-
<h2>ViewHelpers
|
|
3780
|
+
<h2>ViewHelpers—<code>truncate()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4030
3781
|
<span class="ret">string truncate(string $text, int $length = 100, string $append = '...')</span>
|
|
4031
3782
|
<p>It trims long texts to the desired character limit without cutting the last word and adds the specified suffix at the end.</p>
|
|
4032
3783
|
<pre><code><p><?= <span class="fn">truncate</span>(<span class="var">$post</span>[<span class="st">'contents'</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
|
|
3786
|
+
<h2>ViewHelpers—<code>activeClass()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4036
3787
|
<span class="ret">string activeClass(string $currentPath, string $targetPath, string $className = 'active')</span>
|
|
4037
3788
|
<p>If the current page and the checked menu link match, it returns the CSS class. Perfect for navbar.</p>
|
|
4038
3789
|
<pre><code><li class="<?= <span class="fn">activeClass</span>(<span class="var">$current_url</span>, <span class="st">'/communication'</span>, <span class="st">'current-page'</span>) ?>"></code></pre>
|
|
4039
3790
|
</section>
|
|
4040
3791
|
<section id="vh-formatsize">
|
|
4041
|
-
<h2>ViewHelpers
|
|
3792
|
+
<h2>ViewHelpers—<code>formatSize()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4042
3793
|
<span class="ret">string formatSize(int $bytes)</span>
|
|
4043
3794
|
<p>Converts the given file size in bytes to B, KB, MB, GB units using logarithmic calculation.</p>
|
|
4044
3795
|
<pre><code><span><?= <span class="fn">formatSize</span>(<span class="nu">10485760</span>) ?></span> <span class="cm"><!-- 10.00 MB --></span></code></pre>
|
|
4045
3796
|
</section>
|
|
4046
3797
|
<section id="vh-maskemail">
|
|
4047
|
-
<h2>ViewHelpers
|
|
3798
|
+
<h2>ViewHelpers—<code>maskEmail()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4048
3799
|
<span class="ret">string maskEmail(?string $email)</span>
|
|
4049
3800
|
<p>Masks e-mail addresses in accordance with KVKK / GDPR compliance. Stars from the first letter to the @ sign.</p>
|
|
4050
3801
|
<pre><code><td><?= <span class="fn">maskEmail</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
|
|
3804
|
+
<h2>ViewHelpers—<code>maskPhone()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4054
3805
|
<span class="ret">string maskPhone(string $phone)</span>
|
|
4055
3806
|
<p>Advanced phone number masking. It prevents data breaches by completely hiding critical digits.</p>
|
|
4056
3807
|
<pre><code><td><?= <span class="fn">maskPhone</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
|
|
3810
|
+
<h2>ViewHelpers—<code>slugify()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4060
3811
|
<span class="ret">string slugify(string ...$texts)</span>
|
|
4061
3812
|
<p>URL friendly SEO link builder. There is no parameter limit (Variadic). You can write the output directly into href.</p>
|
|
4062
3813
|
<pre><code><a href="/yazi/<?= <span class="fn">slugify</span>(<span class="var">$kat</span>, <span class="var">$title</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>Formats the amount with the currency symbol. The currency code (ISO) automatically determines symbol placement. Default currency
|
|
3816
|
+
<h2>ViewHelpers—<code>money()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
3817
|
+
<p>Formats the amount with the currency symbol. The currency code (ISO) automatically determines symbol placement. Default currency<code class="ic">usd</code>is.</p>
|
|
4067
3818
|
<span class="ret">string money(float $amount, string $currency = 'usd')</span>
|
|
4068
3819
|
<table class="sig-table">
|
|
4069
3820
|
<thead><tr><th>Code</th><th>Output</th><th>Currency</th></tr></thead>
|
|
@@ -4082,29 +3833,25 @@ if ($response['status'] === 'success') {
|
|
|
4082
3833
|
</table>
|
|
4083
3834
|
<pre><code><span><?= <span class="fn">money</span>(<span class="var">$product</span>[<span class="st">'price'</span>], <span class="st">'try'</span>) ?></span>
|
|
4084
3835
|
<span class="cm"><!-- Output: ₺ 1,250.00 --></span>
|
|
4085
|
-
|
|
4086
3836
|
<span><?= <span class="fn">money</span>(<span class="var">$product</span>[<span class="st">'price'</span>], <span class="st">'usd'</span>) ?></span>
|
|
4087
3837
|
<span class="cm"><!-- Output: $1,250.00 --></span></code></pre>
|
|
4088
|
-
</section>
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
<!-- ====== SYSTEM HELPERS ====== -->
|
|
3838
|
+
</section>
|
|
3839
|
+
<section id="vh-uuid">
|
|
3840
|
+
<h2>ViewHelpers -<code>uuid()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
3841
|
+
<p>It converts the 16-byte binary UUID data coming from the database into 36-character format and prints it on the screen with XSS protection.</p>
|
|
3842
|
+
<pre><code><span class="cm"><!-- Output: 0190ed84-3f12-7a91-8bc4-91823741abcd --></span>
|
|
3843
|
+
<div><span class="kw"><?=</span> <span class="fn">uuid</span>(<span class="var">$pull</span>[<span class="st">'ID'</span>]) <span class="kw">?></span></div></code></pre>
|
|
3844
|
+
</section>
|
|
3845
|
+
====== SYSTEM HELPERS ======
|
|
4098
3846
|
<section id="sh-apiresponse">
|
|
4099
|
-
<h2>System Helpers
|
|
4100
|
-
<p>This function
|
|
3847
|
+
<h2>System Helpers—<code>apiResponse()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
3848
|
+
<p>This function allows you to connect your application's Frontend (JS/Mobile) to Backend (PHP).<strong>It is the constitution of communication.</strong>Keys in the JSON data returned as Response<code>status</code>, <code>message</code>And<code>data</code>aspect<strong>is absolutely fixed (must be in English)</strong>.</p>
|
|
4101
3849
|
<span class="ret">void apiResponse(string $status, string $message, array $data = [], \Throwable $exception = null)</span>
|
|
4102
|
-
<p style="margin-top: 15px;"><strong>Status Code (HTTP Code):</strong>
|
|
4103
|
-
<p><strong>Live/Test Environment Sensitivity (APP_ENV):</strong>
|
|
3850
|
+
<p style="margin-top: 15px;"><strong>Status Code (HTTP Code):</strong>On the PHP side, the first parameter<code>'success'</code>If typed, HTTP 200 is automatically returned, for everything else (eg: 'error', 'ok') 400 Bad Request is returned.</p>
|
|
3851
|
+
<p><strong>Live/Test Environment Sensitivity (APP_ENV):</strong>If the fourth parameter is<code>Exception</code>If you give it and your system is in Development (APP_ENV = 1) mode, it will crush the message you wrote and print the SQL error/line number on the screen as it is. If in live (APP_ENV = 0) mode, it hides errors and shows only the clear message you typed.</p>
|
|
4104
3852
|
<h3>PHP (Backend) Submission</h3>
|
|
4105
3853
|
<pre><code><span class="cm">// 1. Standard Shipping</span>
|
|
4106
3854
|
<span class="fn">apiResponse</span>(<span class="st">'success'</span>, <span class="st">'The operation completed successfully.'</span>, [<span class="st">'ID'</span> => <span class="nu">1453</span>]);
|
|
4107
|
-
|
|
4108
3855
|
<span class="cm">// 2. Error Submission (with Exception)</span>
|
|
4109
3856
|
<span class="kw">try</span> {
|
|
4110
3857
|
<span class="cm">// Database queries...</span>
|
|
@@ -4117,7 +3864,6 @@ if ($response['status'] === 'success') {
|
|
|
4117
3864
|
.then(response => {
|
|
4118
3865
|
<span class="cm">// WARNING: response.status or response.message WILL NOT work!</span>
|
|
4119
3866
|
<span class="cm">// No matter what you send from PHP, the keys are always status, message and data.</span>
|
|
4120
|
-
|
|
4121
3867
|
<span class="kw">if</span> (response.status === <span class="st">'success'</span>) { <span class="cm">// Whatever comes from PHP ('success', 'ok', 'successful' etc.)</span>
|
|
4122
3868
|
console.log(<span class="st">"Message:"</span>, response.message);
|
|
4123
3869
|
console.log(<span class="st">"Incoming Data:"</span>, response.data);
|
|
@@ -4127,79 +3873,74 @@ if ($response['status'] === 'success') {
|
|
|
4127
3873
|
});</code></pre>
|
|
4128
3874
|
</section>
|
|
4129
3875
|
<section id="sh-json">
|
|
4130
|
-
<h2>System Helpers
|
|
4131
|
-
<p>It sets the JSON header, returns the HTTP status code, and securely prints the output with json_encode, then terminates the script
|
|
3876
|
+
<h2>System Helpers—<code>jsonResponse()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
3877
|
+
<p>It sets the JSON header, returns the HTTP status code, and securely prints the output with json_encode, then terminates the script.<strong>All API responses must be given through this function.</strong></p>
|
|
4132
3878
|
<span class="ret">void jsonResponse(array $data, int $statusCode = 200)</span>
|
|
4133
3879
|
<pre><code><span class="cm">// Successful response</span>
|
|
4134
3880
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>, <span class="st">'data'</span> => <span class="var">$user</span>], <span class="nu">200</span>);
|
|
4135
|
-
|
|
4136
3881
|
<span class="cm">// Error response</span>
|
|
4137
3882
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'error'</span>, <span class="st">'message'</span> => <span class="st">'Unauthorized access.'</span>], <span class="nu">401</span>);</code></pre>
|
|
4138
3883
|
</section>
|
|
4139
|
-
|
|
4140
3884
|
<section id="sh-dd">
|
|
4141
|
-
<h2>System Helpers
|
|
4142
|
-
<p>Dump & Die. During the development phase, the variables were displayed on the screen in a dark mode, readable and stylish way
|
|
3885
|
+
<h2>System Helpers—<code>dd()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
3886
|
+
<p>Dump & Die. During the development phase, the variables were displayed on the screen in a dark mode, readable and stylish way.<code><pre></code>tag and stops the execution of the code at that line (exit). It can take unlimited parameters (Variadic).</p>
|
|
4143
3887
|
<span class="ret">void dd(mixed ...$vars)</span>
|
|
4144
3888
|
<pre><code><span class="fn">dd</span>(<span class="var">$_POST</span>, <span class="var">$user_id</span>);
|
|
4145
3889
|
<span class="cm">// Prints the values to the screen and stops the system.</span></code></pre>
|
|
4146
3890
|
</section>
|
|
4147
|
-
|
|
3891
|
+
====== ID GENERATION & UTILITIES ======
|
|
4148
3892
|
<section id="id-generation-utilities">
|
|
4149
|
-
</section>
|
|
4150
|
-
|
|
4151
|
-
|
|
3893
|
+
</section>
|
|
4152
3894
|
<section id="sh-redirect">
|
|
4153
|
-
<h2>System Helpers
|
|
3895
|
+
<h2>System Helpers—<code>redirect()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4154
3896
|
<span class="ret">void redirect(string $url)</span>
|
|
4155
|
-
<p>to the desired page
|
|
3897
|
+
<p>to the desired page<code>header("Location: ...")</code>It instantly redirects and stops working with (<code>exit</code>).</p>
|
|
4156
3898
|
<pre><code><span class="kw">if</span> (!<span class="var">$isLoggedIn</span>) {
|
|
4157
3899
|
<span class="fn">redirect</span>(<span class="st">'/login'</span>);
|
|
4158
3900
|
}</code></pre>
|
|
4159
|
-
</section>
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
<
|
|
4163
|
-
<p>It generates a brand new session-based secure CSRF token, 32 bytes long. To add as hidden input to forms <code>csrfField()</code> It is recommended to use (View Helper).</p>
|
|
3901
|
+
</section>
|
|
3902
|
+
<section id="sh-generatecsrf">
|
|
3903
|
+
<h2>System Helpers—<code>generateCsrf()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
3904
|
+
<p>It generates a brand new session-based secure CSRF token, 32 bytes long. To add as hidden input to forms<code>csrfField()</code>It is recommended to use (View Helper).</p>
|
|
4164
3905
|
<span class="ret">string generateCsrf()</span>
|
|
4165
3906
|
<pre><code><span class="kw">if</span> (<span class="var">$_SESSION</span>[<span class="st">'user'</span>]) {
|
|
4166
3907
|
<span class="fn">generateCsrf</span>(); <span class="cm">// CSRF is generated when the session is started</span>
|
|
4167
3908
|
}</code></pre>
|
|
4168
3909
|
</section>
|
|
4169
3910
|
<section id="sh-csrf">
|
|
4170
|
-
<h2>System Helpers
|
|
4171
|
-
<p>Verifies that the incoming POST request comes from a legitimate form. into the form
|
|
3911
|
+
<h2>System Helpers—<code>verifyCsrf()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
3912
|
+
<p>Verifies that the incoming POST request comes from a legitimate form. into the form<code class="ic">csrfField()</code>Returns false if not added or if the token is invalid.</p>
|
|
4172
3913
|
<span class="ret">bool verifyCsrf(string $token)</span>
|
|
4173
3914
|
<pre><code><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>)) {
|
|
4174
3915
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'error'</span>, <span class="st">'message'</span> => <span class="st">'Invalid CSRF token.'</span>], <span class="nu">403</span>);
|
|
4175
3916
|
}</code></pre>
|
|
4176
3917
|
</section>
|
|
4177
3918
|
<section id="sh-sanitizeint">
|
|
4178
|
-
<h2>System Helpers
|
|
3919
|
+
<h2>System Helpers—<code>sanitizeInt()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4179
3920
|
<span class="ret">int sanitizeInt(mixed $value)</span>
|
|
4180
|
-
<p>It blows away all the letters, symbols and commas in it
|
|
3921
|
+
<p>It blows away all the letters, symbols and commas in it,<strong>just integer</strong>leaves the numbers. Used for ID or limits (database int values).</p>
|
|
4181
3922
|
<pre><code><span class="var">$id</span> = <span class="fn">sanitizeInt</span>(<span class="var">$_GET</span>[<span class="st">'ID'</span>] ?? <span class="nu">0</span>);</code></pre>
|
|
4182
3923
|
</section>
|
|
4183
3924
|
<section id="sh-sanitizefloat">
|
|
4184
|
-
<h2>System Helpers
|
|
3925
|
+
<h2>System Helpers—<code>sanitizeFloat()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4185
3926
|
<span class="ret">float sanitizeFloat(mixed $value)</span>
|
|
4186
|
-
<p>Clears
|
|
3927
|
+
<p>Clears all except fractional (decimal) numbers. It is safe to use for monetary amounts, ratio calculations or metrics.</p>
|
|
4187
3928
|
<pre><code><span class="var">$price</span> = <span class="fn">sanitizeFloat</span>(<span class="var">$_POST</span>[<span class="st">'price'</span>]);</code></pre>
|
|
4188
3929
|
</section>
|
|
4189
3930
|
<section id="sh-sanitizestring">
|
|
4190
|
-
<h2>System Helpers
|
|
3931
|
+
<h2>System Helpers—<code>sanitizeString()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4191
3932
|
<span class="ret">string sanitizeString(string $value)</span>
|
|
4192
|
-
<p>To prevent XSS and similar attacks, all
|
|
3933
|
+
<p>To prevent XSS and similar attacks, all<strong>HTML and PHP tags (<code><script></code>, <code><iframe></code>etc.) destroys</strong>. It must be used before saving String to the database.</p>
|
|
4193
3934
|
<pre><code><span class="var">$name</span> = <span class="fn">sanitizeString</span>(<span class="var">$_POST</span>[<span class="st">'name'</span>]);</code></pre>
|
|
4194
3935
|
</section>
|
|
4195
3936
|
<section id="sh-sanitizeemail">
|
|
4196
|
-
<h2>System Helpers
|
|
3937
|
+
<h2>System Helpers—<code>sanitizeEmail()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4197
3938
|
<span class="ret">string sanitizeEmail(string $email)</span>
|
|
4198
|
-
<p>It filters out all invalid and dangerous characters that do not comply with the email format. (Attention: It only clears the correctness of the format
|
|
3939
|
+
<p>It filters out all invalid and dangerous characters that do not comply with the email format. (Attention: It only clears the correctness of the format.<code>verifyEmail()</code>You should check with ).</p>
|
|
4199
3940
|
<pre><code><span class="var">$email</span> = <span class="fn">sanitizeEmail</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>System Helpers
|
|
3943
|
+
<h2>System Helpers—<code>isPost()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4203
3944
|
<span class="ret">bool isPost()</span>
|
|
4204
3945
|
<p>It verifies whether the incoming request (HTTP Request) is made with the POST method. It is used to prevent direct access to the page, especially in form submissions.</p>
|
|
4205
3946
|
<pre><code><span class="kw">if</span> (<span class="fn">isPost</span>()) {
|
|
@@ -4207,7 +3948,7 @@ if ($response['status'] === 'success') {
|
|
|
4207
3948
|
}</code></pre>
|
|
4208
3949
|
</section>
|
|
4209
3950
|
<section id="sh-isget">
|
|
4210
|
-
<h2>System Helpers
|
|
3951
|
+
<h2>System Helpers—<code>isGet()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4211
3952
|
<span class="ret">bool isGet()</span>
|
|
4212
3953
|
<p>It verifies whether the incoming request is made with the GET method. It is used only for control purposes when reading parameters or viewing pages via URL.</p>
|
|
4213
3954
|
<pre><code><span class="kw">if</span> (<span class="fn">isGet</span>()) {
|
|
@@ -4215,7 +3956,7 @@ if ($response['status'] === 'success') {
|
|
|
4215
3956
|
}</code></pre>
|
|
4216
3957
|
</section>
|
|
4217
3958
|
<section id="sh-isput">
|
|
4218
|
-
<h2>System Helpers
|
|
3959
|
+
<h2>System Helpers—<code>isPut()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4219
3960
|
<span class="ret">bool isPut()</span>
|
|
4220
3961
|
<p>It verifies that the incoming request is made with the PUT method. It is generally preferred for data update operations in REST API architectures.</p>
|
|
4221
3962
|
<pre><code><span class="kw">if</span> (<span class="fn">isPut</span>()) {
|
|
@@ -4223,7 +3964,7 @@ if ($response['status'] === 'success') {
|
|
|
4223
3964
|
}</code></pre>
|
|
4224
3965
|
</section>
|
|
4225
3966
|
<section id="sh-isdelete">
|
|
4226
|
-
<h2>System Helpers
|
|
3967
|
+
<h2>System Helpers—<code>isDelete()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4227
3968
|
<span class="ret">bool isDelete()</span>
|
|
4228
3969
|
<p>It verifies that the incoming request was made with the DELETE method. It is used to protect deletion routes in REST APIs.</p>
|
|
4229
3970
|
<pre><code><span class="kw">if</span> (<span class="fn">isDelete</span>()) {
|
|
@@ -4231,22 +3972,21 @@ if ($response['status'] === 'success') {
|
|
|
4231
3972
|
}</code></pre>
|
|
4232
3973
|
</section>
|
|
4233
3974
|
<section id="sh-isajax">
|
|
4234
|
-
<h2>System Helpers
|
|
3975
|
+
<h2>System Helpers—<code>isAjax()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4235
3976
|
<span class="ret">bool isAjax()</span>
|
|
4236
|
-
<p>Your incoming request
|
|
3977
|
+
<p>Your incoming request<code>XMLHttpRequest</code>Checks whether it is done via (AJAX) or modern Fetch API (<code>HTTP_X_REQUESTED_WITH</code>looks at the header value).</p>
|
|
4237
3978
|
<pre><code><span class="kw">if</span> (!<span class="fn">isAjax</span>()) {
|
|
4238
3979
|
<span class="fn">redirect</span>(<span class="st">'/mistake'</span>); <span class="cm">// Only allow AJAX</span>
|
|
4239
3980
|
}</code></pre>
|
|
4240
3981
|
</section>
|
|
4241
3982
|
<section id="sh-getclientip">
|
|
4242
|
-
<h2>System Helpers
|
|
3983
|
+
<h2>System Helpers—<code>getClientIp()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4243
3984
|
<span class="ret">string getClientIp()</span>
|
|
4244
3985
|
<p>Detects the user's real IP address. Cloudflare (<code>HTTP_CF_CONNECTING_IP</code>), Proxy (<code>HTTP_X_FORWARDED_FOR</code>) and standard (<code>REMOTE_ADDR</code>) resolves all connections automatically.</p>
|
|
4245
3986
|
<pre><code><span class="var">$ip</span> = <span class="fn">getClientIp</span>(); <span class="cm">// Ex: 192.168.1.1</span></code></pre>
|
|
4246
3987
|
</section>
|
|
4247
|
-
|
|
4248
3988
|
<section id="sh-verifyemail">
|
|
4249
|
-
<h2>System Helpers
|
|
3989
|
+
<h2>System Helpers—<code>verifyEmail()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4250
3990
|
<p>It verifies whether the given email address is actually a valid email address based on DNS or format.</p>
|
|
4251
3991
|
<span class="ret">bool verifyEmail(string $email)</span>
|
|
4252
3992
|
<pre><code><span class="kw">if</span> (!<span class="fn">verifyEmail</span>(<span class="var">$_POST</span>[<span class="st">'email'</span>])) {
|
|
@@ -4254,99 +3994,82 @@ if ($response['status'] === 'success') {
|
|
|
4254
3994
|
}</code></pre>
|
|
4255
3995
|
</section>
|
|
4256
3996
|
<section id="sh-generatetoken">
|
|
4257
|
-
<h2>System Helpers
|
|
3997
|
+
<h2>System Helpers—<code>generateToken()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4258
3998
|
<span class="ret">string generateToken(int $length = 32)</span>
|
|
4259
|
-
<p>Generates a cryptographically secure, random token (Ex: Password reset, API Key)
|
|
3999
|
+
<p>Generates a cryptographically secure, random token (Ex: Password reset, API Key).<strong>Note: Each 1 byte entered produces 2 characters (hex) of output.</strong>The default length of 32 bytes returns a string that is exactly 64 characters long.</p>
|
|
4260
4000
|
<pre><code><span class="var">$token</span> = <span class="fn">generateToken</span>(<span class="nu">16</span>); <span class="cm">// 32 character token</span></code></pre>
|
|
4261
4001
|
</section>
|
|
4262
4002
|
<section id="sh-hashpassword">
|
|
4263
|
-
<h2>System Helpers
|
|
4003
|
+
<h2>System Helpers—<code>hashPassword()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4264
4004
|
<span class="ret">string hashPassword(?string $password)</span>
|
|
4265
|
-
<p>PHP's built-in
|
|
4005
|
+
<p>PHP's built-in<code>password_hash</code>It securely hashes passwords with the bcrypt algorithm using the method.<strong>Null Check:</strong>If the parameter is empty or<code>null</code>If it does, it throws an Exception to avoid violating security.</p>
|
|
4266
4006
|
<pre><code><span class="var">$hashed</span> = <span class="fn">hashPassword</span>(<span class="var">$_POST</span>[<span class="st">'password'</span>]);</code></pre>
|
|
4267
4007
|
</section>
|
|
4268
4008
|
<section id="sh-verifypassword">
|
|
4269
|
-
<h2>System Helpers
|
|
4009
|
+
<h2>System Helpers—<code>verifyPassword()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4270
4010
|
<span class="ret">bool verifyPassword(?string $password, ?string $hash)</span>
|
|
4271
|
-
<p>It compares the plaintext password entered by the user with the hash in the database
|
|
4011
|
+
<p>It compares the plaintext password entered by the user with the hash in the database.<strong>Null Check:</strong>Either the password or hash is empty or<code>null</code>directly without any action<code>false</code>rotary.</p>
|
|
4272
4012
|
<pre><code><span class="kw">if</span> (<span class="fn">verifyPassword</span>(<span class="var">$_POST</span>[<span class="st">'password'</span>], <span class="var">$user</span>[<span class="st">'password'</span>])) {
|
|
4273
4013
|
<span class="cm">// Login successful</span>
|
|
4274
4014
|
}</code></pre>
|
|
4275
4015
|
</section>
|
|
4276
4016
|
<section id="sh-slugify">
|
|
4277
|
-
<h2>System Helpers
|
|
4017
|
+
<h2>System Helpers—<code>slugify()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4278
4018
|
<p>When registering to the database on the backend side, it automatically generates SEO-friendly URL/Slug from fields such as title or name. It takes unlimited parameters (Variadic).</p>
|
|
4279
4019
|
<span class="ret">string slugify(string ...$texts)</span>
|
|
4280
4020
|
<pre><code><span class="var">$slug</span> = <span class="fn">slugify</span>(<span class="var">$_POST</span>[<span class="st">'title'</span>]); <span class="cm">// 'my-beautiful-writing'</span></code></pre>
|
|
4281
4021
|
</section>
|
|
4282
4022
|
<section id="sh-arrayonly">
|
|
4283
|
-
<h2>System Helpers
|
|
4284
|
-
<p>A large data set (e.g
|
|
4023
|
+
<h2>System Helpers—<code>arrayOnly()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4024
|
+
<p>A large data set (e.g.<code>$_POST</code>) filters only the data with the specified keys (whitelist). It is used just before database registration operations to prevent mass-assignment security vulnerabilities.</p>
|
|
4285
4025
|
<span class="ret">array arrayOnly(array $array, array $keys)</span>
|
|
4286
4026
|
<pre><code><span class="var">$postData</span> = <span class="fn">arrayOnly</span>(<span class="var">$_POST</span>, [<span class="st">'user_name'</span>, <span class="st">'password'</span>, <span class="st">'e-mail'</span>]);
|
|
4287
4027
|
<span class="cm">// Externally manipulated values such as ID and role are automatically destroyed.</span></code></pre>
|
|
4288
4028
|
</section>
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
<div class="info-box">
|
|
4294
|
-
Native, high-performance and time-ordered raw 16-byte <strong>UUIDv7</strong> produces.
|
|
4295
|
-
</div>
|
|
4296
|
-
<p>ID columns in the database <code>BINARY(16)</code> When you want to achieve huge indexing and JOIN performance by keeping it as , you create new records with this function.</p>
|
|
4029
|
+
<section id="sh-byteid">
|
|
4030
|
+
<h2>System Helpers -<code>byteId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4031
|
+
<div class="info-box">Native, high-performance and time-ordered raw 16-byte<strong>UUIDv7</strong>produces.</div>
|
|
4032
|
+
<p>ID columns in the database<code>BINARY(16)</code>When you want to achieve huge indexing and JOIN performance by keeping it as , you create new records with this function.</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
4037
|
<pre><code><span class="kw">use</span> Bin\SystemMethod;
|
|
4302
|
-
|
|
4303
4038
|
<span class="var">$rawId</span> = SystemMethod::<span class="fn">byteId</span>();
|
|
4304
4039
|
<span class="cm">// Or global helper: byteId();</span>
|
|
4305
|
-
|
|
4306
4040
|
<span class="var">$db</span>-><span class="fn">prepare</span>(<span class="st">"INSERT INTO users (id, name) VALUES (?, ?)"</span>)-><span class="fn">execute</span>([<span class="var">$rawId</span>, <span class="st">'Triumph'</span>]);</code></pre>
|
|
4307
4041
|
</div>
|
|
4308
|
-
</section>
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
<
|
|
4313
|
-
Native, standard 36 characters <strong>UUIDv7</strong> produces the string.
|
|
4314
|
-
</div>
|
|
4315
|
-
<p>in database <code>CHAR(36)</code> or <code>VARCHAR(36)</code> If you are going to use it and do not want to deal with raw binary data, you can generate UUID directly in string format with this function.</p>
|
|
4042
|
+
</section>
|
|
4043
|
+
<section id="sh-makeid">
|
|
4044
|
+
<h2>System Helpers -<code>makeId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4045
|
+
<div class="info-box">Native, standard 36 characters<strong>UUIDv7</strong>produces the string.</div>
|
|
4046
|
+
<p>in database<code>CHAR(36)</code>or<code>VARCHAR(36)</code>If you are going to use it and do not want to deal with raw binary data, you can generate UUID directly in string format with this function.</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
4051
|
<pre><code><span class="kw">use</span> Bin\SystemMethod;
|
|
4321
|
-
|
|
4322
4052
|
<span class="var">$stringId</span> = SystemMethod::<span class="fn">makeId</span>();
|
|
4323
4053
|
<span class="cm">// Sample Output: 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4324
4054
|
</div>
|
|
4325
|
-
</section>
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
<
|
|
4330
|
-
Converts raw 16-byte binary UUIDs to a standard 36-character string.
|
|
4331
|
-
</div>
|
|
4332
|
-
<p>What you pulled from the database <code>BINARY(16)</code> It puts the data into a readable format before sending it to the interface (API/JSON).</p>
|
|
4055
|
+
</section>
|
|
4056
|
+
<section id="sh-formatid">
|
|
4057
|
+
<h2>System Helpers -<code>formatId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4058
|
+
<div class="info-box">Converts raw 16-byte binary UUIDs to a standard 36-character string.</div>
|
|
4059
|
+
<p>What you pulled from the database<code>BINARY(16)</code>It puts the data into a readable format before sending it to the 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
4064
|
<pre><code><span class="kw">use</span> Bin\SystemMethod;
|
|
4338
|
-
|
|
4339
4065
|
<span class="var">$user</span> = <span class="var">$db</span>-><span class="fn">query</span>(<span class="st">"SELECT id FROM users LIMIT 1"</span>)-><span class="fn">fetch</span>();
|
|
4340
4066
|
<span class="var">$readableId</span> = SystemMethod::<span class="fn">formatId</span>(<span class="var">$user</span>[<span class="st">'ID'</span>]);
|
|
4341
4067
|
<span class="cm">// Sample Output: 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4342
4068
|
</div>
|
|
4343
|
-
</section>
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
<div class="info-box">
|
|
4348
|
-
Safe, random <code>INT</code> Generates ID. (Max 9 Digits)
|
|
4349
|
-
</div>
|
|
4069
|
+
</section>
|
|
4070
|
+
<section id="sh-intid">
|
|
4071
|
+
<h2>System Helpers -<code>intId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4072
|
+
<div class="info-box">Safe, random<code>INT</code>Generates ID. (Max 9 Digits)</div>
|
|
4350
4073
|
<p>It is the traditional Integer generator that you can use if you do not want to give up traditional database performance.</p>
|
|
4351
4074
|
<div class="code-block">
|
|
4352
4075
|
<div class="code-header">
|
|
@@ -4355,13 +4078,10 @@ if ($response['status'] === 'success') {
|
|
|
4355
4078
|
<pre><code><span class="var">$id</span> = <span class="fn">intId</span>(8);
|
|
4356
4079
|
<span class="cm">// Sample Output: 49201834</span></code></pre>
|
|
4357
4080
|
</div>
|
|
4358
|
-
</section>
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
<div class="info-box">
|
|
4363
|
-
Safe, random <code>BIGINT</code> Generates ID. (Default 15 digits - safe limit for JS)
|
|
4364
|
-
</div>
|
|
4081
|
+
</section>
|
|
4082
|
+
<section id="sh-bigintid">
|
|
4083
|
+
<h2>System Helpers -<code>bigintId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4084
|
+
<div class="info-box">Safe, random<code>BIGINT</code>Generates ID. (Default 15 digits - safe limit for JS)</div>
|
|
4365
4085
|
<p>If you are going to use huge numerical IDs like Snowflake (Twitter), this function will save your life. If you want larger than 15 digits, you can import it as a string to prevent data loss.</p>
|
|
4366
4086
|
<div class="code-block">
|
|
4367
4087
|
<div class="code-header">
|
|
@@ -4370,14 +4090,11 @@ if ($response['status'] === 'success') {
|
|
|
4370
4090
|
<pre><code><span class="var">$id</span> = <span class="fn">bigintId</span>(); <span class="cm">// Returns 15 digit INT</span>
|
|
4371
4091
|
<span class="var">$massiveId</span> = <span class="fn">bigintId</span>(18, <span class="kw">true</span>); <span class="cm">// returns 18 digit STRING (JS safe)</span></code></pre>
|
|
4372
4092
|
</div>
|
|
4373
|
-
</section>
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
<
|
|
4378
|
-
Wraps values into strings to protect against Javascript's huge number (BIGINT) insensitivity.
|
|
4379
|
-
</div>
|
|
4380
|
-
<p>It protects numeric (BigInt etc.) variables larger than 15 digits from Javascript's rounding errors (Precision Loss) when printing them to the DOM in the View layer.</p>
|
|
4093
|
+
</section>
|
|
4094
|
+
<section id="sh-stringer">
|
|
4095
|
+
<h2>System Helpers -<code>stringer()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4096
|
+
<div class="info-box">Wraps values into strings to protect against Javascript's huge number (BIGINT) insensitivity.</div>
|
|
4097
|
+
<p>It protects numeric (BigInt, etc.) variables larger than 15 digits from Javascript's rounding errors (Precision Loss) when printing them to the DOM in the View layer.</p>
|
|
4381
4098
|
<div class="code-block">
|
|
4382
4099
|
<div class="code-header">
|
|
4383
4100
|
<span class="code-lang">HTML/PHP</span>
|
|
@@ -4385,63 +4102,54 @@ if ($response['status'] === 'success') {
|
|
|
4385
4102
|
<pre><code><span class="cm"><!-- We wrap it with a stringer to prevent JS from corrupting it --></span>
|
|
4386
4103
|
<button data-id=<span class="st">"<?=</span> <span class="fn">Stringer</span>(<span class="var">$data</span>[<span class="st">'ID'</span>]) <span class="st">?>"</span>>Sil</button></code></pre>
|
|
4387
4104
|
</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İĞİ ====== -->
|
|
4105
|
+
<section id="sh-otpcoder">
|
|
4106
|
+
<h2>System Helpers - OTP Coder<span class="tag b-api">SystemMethod</span></h2>
|
|
4107
|
+
<div class="info-box">Generates random, cryptographically secure Authentication Codes (OTP).</div>
|
|
4108
|
+
<div class="code-block">
|
|
4109
|
+
<pre><code><span class="cm">// 6 digit random number</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">// 8 digit letter only ('c': lowercase, 'C': uppercase, 'cC': mixed)</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">// 6 digit letter+number (Alphanumeric)</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
|
+
====== API SECURITY ======
|
|
4408
4119
|
<section id="api-methods">
|
|
4409
|
-
<h2>API — HTTP Method Control
|
|
4410
|
-
<p><code class="ic">$allowedMethods</code>
|
|
4120
|
+
<h2>API — HTTP Method Control<span class="tag b-sec">ApiControl</span></h2>
|
|
4121
|
+
<p><code class="ic">$allowedMethods</code>array from ApiControl require<strong>before</strong>must be defined. ApiControl automatically blocks requests from disallowed methods by reading this string.<code class="ic">405 Method Not Allowed</code>He rejects it with .</p>
|
|
4411
4122
|
<pre><code><span class="cm">// An endpoint that accepts only GET and POST</span>
|
|
4412
4123
|
<span class="var">$allowedMethods</span> = [<span class="st">'GET'</span>, <span class="st">'POST'</span>];
|
|
4413
4124
|
<span class="fn">require_once</span> ... . <span class="st">'/../app/ApiControl.php'</span>;
|
|
4414
|
-
|
|
4415
4125
|
<span class="cm">// An endpoint that only accepts DELETE</span>
|
|
4416
4126
|
<span class="var">$allowedMethods</span> = [<span class="st">'DELETE'</span>];
|
|
4417
4127
|
<span class="fn">require_once</span> ... . <span class="st">'/../app/ApiControl.php'</span>;</code></pre>
|
|
4418
|
-
<p>Preflight
|
|
4128
|
+
<p>Preflight<code class="ic">OPTIONS</code>automatic requests for CORS<code class="ic">200</code>returns and the script terminates — no manual intervention required.</p>
|
|
4419
4129
|
</section>
|
|
4420
4130
|
<section id="api-cors">
|
|
4421
|
-
<h2>API—CORS
|
|
4422
|
-
<p>If you want to allow API access from other domains or mobile applications
|
|
4131
|
+
<h2>API—CORS<span class="tag b-api">ApiControl (Comment Line)</span></h2>
|
|
4132
|
+
<p>If you want to allow API access from other domains or mobile applications<code class="ic">ApiControl.php</code>Activate the CORS block in it.</p>
|
|
4423
4133
|
<pre><code><span class="cm">// In ApiControl.php — activated by removing the comment</span>
|
|
4424
4134
|
header(<span class="st">"Access-Control-Allow-Origin: https://your-domain.com"</span>);
|
|
4425
4135
|
header(<span class="st">"Access-Control-Allow-Methods: GET, POST, OPTIONS"</span>);
|
|
4426
4136
|
header(<span class="st">"Access-Control-Allow-Headers: Content-Type, Authorization"</span>);</code></pre>
|
|
4427
4137
|
<div class="alert a-warn">
|
|
4428
|
-
<strong>⚠️</strong>
|
|
4429
|
-
</div>
|
|
4138
|
+
<strong>⚠️</strong>In production environment<code class="ic">*</code>Do not use (all domains). Specify the domain address clearly.</div>
|
|
4430
4139
|
</section>
|
|
4431
4140
|
<section id="api-rate">
|
|
4432
|
-
<h2>API
|
|
4433
|
-
<p>To prevent malicious users or bots from flooding the API
|
|
4141
|
+
<h2>API—Rate Limiting<span class="tag b-api">ApiControl (Comment Line)</span></h2>
|
|
4142
|
+
<p>To prevent malicious users or bots from flooding the API<code class="ic">ApiControl.php</code>You can activate the Rate Limiting block in it. Default rule:<strong>60 requests/IP in 60 seconds</strong>.</p>
|
|
4434
4143
|
<div class="alert a-warn" style="margin-top: 10px; margin-bottom: 20px;">
|
|
4435
|
-
<strong>⚠️ Redis Server Required:</strong>
|
|
4436
|
-
</div>
|
|
4144
|
+
<strong>⚠️ Redis Server Required:</strong>Rate Limiting feature<code>\Src\Service\RedisService::getInstance()</code>It works using Redis class. Before opening this code block, make sure you have set up a Redis service in your project and<code>src/Service/</code>Make sure you create a connection class under</div>
|
|
4437
4145
|
<pre><code><span class="cm">// If more than 60 requests come from the same IP in 60 seconds:</span>
|
|
4438
4146
|
http_response_code(<span class="nu">429</span>); <span class="cm">//Too Many Requests</span>
|
|
4439
4147
|
echo json_encode([<span class="st">'error'</span> => <span class="st">'Too many requests. Please wait.'</span>]);</code></pre>
|
|
4440
4148
|
</section>
|
|
4441
|
-
|
|
4149
|
+
====== WORKFLOW ======
|
|
4442
4150
|
<section id="workflow">
|
|
4443
4151
|
<h2>Full Workflow: Contact Form (End-to-End)</h2>
|
|
4444
|
-
<p>One
|
|
4152
|
+
<p>One<strong>Contact Form</strong>Let's examine step by step how to develop the feature in ArtiFrame standards from start to finish.</p>
|
|
4445
4153
|
<ol class="steps">
|
|
4446
4154
|
<li>
|
|
4447
4155
|
<div>
|
|
@@ -4461,8 +4169,7 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Too ma
|
|
|
4461
4169
|
<li>
|
|
4462
4170
|
<div>
|
|
4463
4171
|
<strong>Code HTML Form</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>Add the following form to the file:<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">
|
|
@@ -4474,8 +4181,7 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Too ma
|
|
|
4474
4181
|
<li>
|
|
4475
4182
|
<div>
|
|
4476
4183
|
<strong>Connect Fetch API with JavaScript</strong><br/>
|
|
4477
|
-
<code class="ic">public/assets/js/iletisim.js</code>
|
|
4478
|
-
<pre><code>document.<span class="fn">querySelector</span>(<span class="st">'[data-js="contact-send"]'</span>).<span class="fn">addEventListener</span>(<span class="st">'click'</span>, async (e) => {
|
|
4184
|
+
<code class="ic">public/assets/js/iletisim.js</code>to file:<pre><code>document.<span class="fn">querySelector</span>(<span class="st">'[data-js="contact-send"]'</span>).<span class="fn">addEventListener</span>(<span class="st">'click'</span>, async (e) => {
|
|
4479
4185
|
e.<span class="fn">preventDefault</span>();
|
|
4480
4186
|
<span class="kw">const</span> formData = <span class="kw">new</span> <span class="fn">FormData</span>(e.target.<span class="fn">closest</span>(<span class="st">'form'</span>));
|
|
4481
4187
|
<span class="kw">const</span> res = <span class="kw">await</span> <span class="fn">fetch</span>(<span class="st">'/api/contact/sender.php'</span>, {
|
|
@@ -4490,39 +4196,32 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Too ma
|
|
|
4490
4196
|
<li>
|
|
4491
4197
|
<div>
|
|
4492
4198
|
<strong>Complete Server Logic (Backend)</strong><br/>
|
|
4493
|
-
<code class="ic">public/api/iletisim/gonder.php</code>
|
|
4494
|
-
<pre><code><span class="kw"><?php</span>
|
|
4199
|
+
<code class="ic">public/api/iletisim/gonder.php</code>in the file:<pre><code><span class="kw"><?php</span>
|
|
4495
4200
|
<span class="var">$allowedMethods</span> = [<span class="st">'POST'</span>];
|
|
4496
4201
|
<span class="fn">require_once</span> <span class="var">$_SERVER</span>[<span class="st">'DOCUMENT_ROOT'</span>] . <span class="st">'/../app/ApiControl.php'</span>;
|
|
4497
4202
|
<span class="kw">use</span> Bin\SystemMethod;
|
|
4498
|
-
|
|
4499
4203
|
<span class="cm">// 1. CSRF Verification</span>
|
|
4500
4204
|
<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
4205
|
<span class="fn">jsonResponse</span>([<span class="st">'error'</span> => <span class="st">'Invalid token.'</span>], <span class="nu">403</span>);
|
|
4502
4206
|
}
|
|
4503
|
-
|
|
4504
4207
|
<span class="cm">// 2. Clear Data</span>
|
|
4505
4208
|
<span class="var">$name</span> = <span class="fn">sanitizeString</span>(<span class="var">$_POST</span>[<span class="st">'name'</span>] ?? <span class="st">''</span>);
|
|
4506
4209
|
<span class="var">$email</span> = <span class="fn">sanitizeEmail</span>(<span class="var">$_POST</span>[<span class="st">'email'</span>] ?? <span class="st">''</span>);
|
|
4507
4210
|
<span class="var">$message</span> = <span class="fn">sanitizeString</span>(<span class="var">$_POST</span>[<span class="st">'message'</span>] ?? <span class="st">''</span>);
|
|
4508
|
-
|
|
4509
4211
|
<span class="cm">// 3. Business Logic (Send e-mail, save to DB, etc.)</span>
|
|
4510
4212
|
<span class="cm">//...</span>
|
|
4511
|
-
|
|
4512
4213
|
<span class="cm">// 4. Reply</span>
|
|
4513
4214
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'success'</span>, <span class="st">'message'</span> => <span class="st">'Your message has been received.'</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>✅ Completed!</strong>
|
|
4519
|
-
</div>
|
|
4219
|
+
<strong>✅ Completed!</strong>You have created a fully secure and standards-compliant form flow with XSS protection, CSRF validation, HTTP method restriction and data-js architecture.</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">'Too ma
|
|
|
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">'Too ma
|
|
|
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">'Too ma
|
|
|
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">'Too ma
|
|
|
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">'Too ma
|
|
|
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,7 +4301,6 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Too ma
|
|
|
4607
4301
|
ctx.textBaseline = "middle";
|
|
4608
4302
|
ctx.fillText(text, x, y);
|
|
4609
4303
|
}
|
|
4610
|
-
|
|
4611
4304
|
const nodes = [
|
|
4612
4305
|
{ id: 'n1', x: 20, y: 220, w: 170, h: 50, text: "Proje Nerede Çalışacak?", bg: "#1c2128", border: "#58a6ff", textColor: "#e6edf3" },
|
|
4613
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" },
|
|
@@ -4619,28 +4312,20 @@ echo json_encode([<span class="st">'error'</span> => <span class="st">'Too ma
|
|
|
4619
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" },
|
|
4620
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
4322
|
drawText("Evet", 740, 235, "#00c88c", "12px Inter");
|
|
4634
|
-
|
|
4635
4323
|
drawPath([{x:690, y:345}, {x:725, y:345}, {x:725, y:420}, {x:760, y:420}], "#30363d");
|
|
4636
4324
|
drawText("Hayır", 740, 410, "#f85149", "12px Inter");
|
|
4637
|
-
|
|
4638
4325
|
drawPath([{x:900, y:420}, {x:930, y:420}, {x:930, y:365}, {x:960, y:365}], "#30363d");
|
|
4639
4326
|
drawText("Satmak/Dağıtmak", 945, 355, "#f85149", "11px Inter");
|
|
4640
|
-
|
|
4641
4327
|
drawPath([{x:900, y:420}, {x:930, y:420}, {x:930, y:465}, {x:960, y:465}], "#30363d");
|
|
4642
4328
|
drawText("Kendi Projem (SaaS)", 945, 455, "#e3b341", "11px Inter");
|
|
4643
|
-
|
|
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">'Too ma
|
|
|
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>Home</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>
|