@artilingo/artiframe-cli 1.2.1 → 1.3.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 +106 -10
- package/core-stubs/bin/ViewMethod.php +16 -0
- package/core-stubs/docs/de.html +185 -31
- package/core-stubs/docs/en.html +185 -31
- package/core-stubs/docs/es.html +185 -31
- package/core-stubs/docs/fr.html +185 -31
- package/core-stubs/docs/tr.html +184 -30
- package/package.json +1 -1
- package/src/App.php +18 -1
- package/src/Commands/TableCommand.php +82 -0
- package/src/Lang/de.php +12 -0
- package/src/Lang/en.php +12 -0
- package/src/Lang/es.php +12 -0
- package/src/Lang/fr.php +12 -0
- package/src/Lang/tr.php +12 -0
- package/stubs/sql.stub +46 -0
package/core-stubs/docs/fr.html
CHANGED
|
@@ -275,7 +275,8 @@
|
|
|
275
275
|
<a href="#cli-new">new</a>
|
|
276
276
|
<a href="#cli-view">make:view</a>
|
|
277
277
|
<a href="#cli-api">make:api</a>
|
|
278
|
-
<a href="#cli-class">make:class</a>
|
|
278
|
+
<a href="#cli-class">make:class</a>
|
|
279
|
+
<a href="#cli-table">table:</a>
|
|
279
280
|
<a href="#cli-cliv">cli v</a>
|
|
280
281
|
<a href="#cli-show">show</a>
|
|
281
282
|
<a href="#cli-list">list</a>
|
|
@@ -308,7 +309,8 @@
|
|
|
308
309
|
<a href="#vh-maskemail">maskEmail()</a>
|
|
309
310
|
<a href="#vh-maskphone">maskPhone()</a>
|
|
310
311
|
<a href="#vh-slugify">slugify()</a>
|
|
311
|
-
<a href="#vh-money">money()</a>
|
|
312
|
+
<a href="#vh-money">money()</a>
|
|
313
|
+
<a href="#vh-uuid">uuid()</a>
|
|
312
314
|
<div class="sb-cat">Aides système</div>
|
|
313
315
|
<div class="sb-subcat">Réponse et débogage</div>
|
|
314
316
|
<a href="#sh-apiresponse">apiResponse()</a>
|
|
@@ -344,7 +346,8 @@
|
|
|
344
346
|
<a href="#sh-formatid">formatId()</a>
|
|
345
347
|
<a href="#sh-intid">intId()</a>
|
|
346
348
|
<a href="#sh-bigintid">bigintId()</a>
|
|
347
|
-
<a href="#sh-stringer">stringer()</a>
|
|
349
|
+
<a href="#sh-stringer">stringer()</a>
|
|
350
|
+
<a href="#sh-otpcoder">OTP Coder</a>
|
|
348
351
|
<div class="sb-cat">Sécurité des API</div>
|
|
349
352
|
<a href="#api-methods">Contrôle de méthode HTTP</a>
|
|
350
353
|
<a href="#api-cors">CORS</a>
|
|
@@ -454,7 +457,15 @@
|
|
|
454
457
|
btn.style.border = 'none';
|
|
455
458
|
}
|
|
456
459
|
</script>
|
|
457
|
-
|
|
460
|
+
|
|
461
|
+
<h3 style="margin-top: 30px;">Commandes supplémentaires</h3>
|
|
462
|
+
<p><strong>Lister les tables :</strong> Pour voir tous les modèles de tables disponibles et leurs descriptions :</p>
|
|
463
|
+
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
464
|
+
|
|
465
|
+
<p><strong>Aperçu du contenu de la table :</strong> Pour inspecter le contenu SQL dans le terminal avant de l'ajouter au fichier <code>schema.sql</code>, vous pouvez ajouter le paramètre <code>check</code> :</p>
|
|
466
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
467
|
+
|
|
468
|
+
</section>
|
|
458
469
|
<!-- ====== KURULUM ====== -->
|
|
459
470
|
<section id="kurulum">
|
|
460
471
|
<h2>Installation</h2>
|
|
@@ -762,7 +773,100 @@ nom-du-projet/
|
|
|
762
773
|
❌ Hata: Sınıfın oluşturulacağı dizin belirtilmeli! (örn: /app veya /src)
|
|
763
774
|
Example: /src/Service/PaymentService</code></pre>
|
|
764
775
|
</section>
|
|
765
|
-
|
|
776
|
+
|
|
777
|
+
<!-- table: -->
|
|
778
|
+
<section id="cli-table">
|
|
779
|
+
<h2><code>table:</code> <span class="tag b-cli">Commande CLI</span></h2>
|
|
780
|
+
<p>Vous permet d'ajouter rapidement des tables de base de données standard et relationnelles au fichier <code>schema.sql</code> de votre projet. Les modèles sont lus à partir du fichier global <code>stubs/sql.stub</code>.</p>
|
|
781
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span></code></pre>
|
|
782
|
+
<p>Tables standard actuellement prises en charge :</p>
|
|
783
|
+
<div class="table-tabs-container" style="margin-top: 20px;">
|
|
784
|
+
<div class="tabs-header" style="display: flex; gap: 10px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 5px;">
|
|
785
|
+
<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>
|
|
786
|
+
<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>
|
|
787
|
+
<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>
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
<!-- Tab: users -->
|
|
791
|
+
<div id="tab-users" class="table-tab-content" style="display: block;">
|
|
792
|
+
<pre><code><span class="kw">CREATE TABLE `users` (
|
|
793
|
+
`id` binary(16) NOT NULL,
|
|
794
|
+
`email` varchar(255) NOT NULL,
|
|
795
|
+
`password` varchar(255) NOT NULL,
|
|
796
|
+
`name` varchar(255) DEFAULT NULL,
|
|
797
|
+
`role` enum('user','admin','moderator') NOT NULL DEFAULT 'user',
|
|
798
|
+
`status` tinyint(1) NOT NULL DEFAULT '1',
|
|
799
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
800
|
+
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
801
|
+
PRIMARY KEY (`id`),
|
|
802
|
+
UNIQUE KEY `email` (`email`)
|
|
803
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
804
|
+
</div>
|
|
805
|
+
|
|
806
|
+
<!-- Tab: user_sessions -->
|
|
807
|
+
<div id="tab-sessions" class="table-tab-content" style="display: none;">
|
|
808
|
+
<pre><code><span class="kw">CREATE TABLE `user_sessions` (
|
|
809
|
+
`id` binary(16) NOT NULL,
|
|
810
|
+
`user_id` binary(16) NOT NULL,
|
|
811
|
+
`token` varchar(255) NOT NULL,
|
|
812
|
+
`ip_address` varchar(45) DEFAULT NULL,
|
|
813
|
+
`user_agent` varchar(255) DEFAULT NULL,
|
|
814
|
+
`expires_at` timestamp NULL DEFAULT NULL,
|
|
815
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
816
|
+
PRIMARY KEY (`id`),
|
|
817
|
+
UNIQUE KEY `token` (`token`),
|
|
818
|
+
KEY `user_id` (`user_id`),
|
|
819
|
+
CONSTRAINT `fk_user_sessions_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
820
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
821
|
+
</div>
|
|
822
|
+
|
|
823
|
+
<!-- Tab: user_preferences -->
|
|
824
|
+
<div id="tab-prefs" class="table-tab-content" style="display: none;">
|
|
825
|
+
<pre><code><span class="kw">CREATE TABLE `user_preferences` (
|
|
826
|
+
`id` binary(16) NOT NULL,
|
|
827
|
+
`user_id` binary(16) NOT NULL,
|
|
828
|
+
`language` varchar(10) NOT NULL DEFAULT 'tr',
|
|
829
|
+
`theme` varchar(20) NOT NULL DEFAULT 'light',
|
|
830
|
+
`push_notifications` tinyint(1) NOT NULL DEFAULT '1',
|
|
831
|
+
`email_notifications` tinyint(1) NOT NULL DEFAULT '1',
|
|
832
|
+
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
833
|
+
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
834
|
+
PRIMARY KEY (`id`),
|
|
835
|
+
UNIQUE KEY `user_id` (`user_id`),
|
|
836
|
+
CONSTRAINT `fk_user_prefs_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
837
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;</span></code></pre>
|
|
838
|
+
</div>
|
|
839
|
+
</div>
|
|
840
|
+
|
|
841
|
+
<script>
|
|
842
|
+
function switchTableTab(tabId, btn) {
|
|
843
|
+
const container = btn.closest('.table-tabs-container');
|
|
844
|
+
container.querySelectorAll('.table-tab-content').forEach(el => el.style.display = 'none');
|
|
845
|
+
container.querySelectorAll('.table-tab-btn').forEach(el => {
|
|
846
|
+
el.style.background = '#1c2128';
|
|
847
|
+
el.style.color = '#fff';
|
|
848
|
+
el.style.border = '1px solid #30363d';
|
|
849
|
+
el.style.fontWeight = '400';
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
container.querySelector('#' + tabId).style.display = 'block';
|
|
853
|
+
btn.style.background = '#00c88c';
|
|
854
|
+
btn.style.color = '#000';
|
|
855
|
+
btn.style.fontWeight = '600';
|
|
856
|
+
btn.style.border = 'none';
|
|
857
|
+
}
|
|
858
|
+
</script>
|
|
859
|
+
|
|
860
|
+
<h3 style="margin-top: 30px;">Commandes supplémentaires</h3>
|
|
861
|
+
<p><strong>Lister les tables :</strong> Pour voir tous les modèles de tables disponibles et leurs descriptions :</p>
|
|
862
|
+
<pre><code>artiframe> <span class="fn">table</span> <span class="st">list</span></code></pre>
|
|
863
|
+
|
|
864
|
+
<p><strong>Aperçu du contenu de la table :</strong> Pour inspecter le contenu SQL dans le terminal avant de l'ajouter au fichier <code>schema.sql</code>, vous pouvez ajouter le paramètre <code>check</code> :</p>
|
|
865
|
+
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
866
|
+
|
|
867
|
+
</section>
|
|
868
|
+
|
|
869
|
+
<!-- cli v -->
|
|
766
870
|
<section id="cli-cliv">
|
|
767
871
|
<h2><code>cli v</code> (ou <code>cli version</code>) <span class="tag b-cli">CLI Komutu</span></h2>
|
|
768
872
|
<p>ArtiFrame CLI contrôle sa propre version (globale) de l'outil. Affiche non seulement la version actuelle, <strong>Registre NPM</strong> Il vérifie également si la version la plus récente est disponible. S'il existe une nouvelle version, elle peut se mettre à jour globalement en un seul clic (o/n).<code>npm install -g @artilingo/artiframe-cli@latest</code>).</p>
|
|
@@ -3981,7 +4085,15 @@ if ($response['status'] === 'success') {
|
|
|
3981
4085
|
|
|
3982
4086
|
<span><?= <span class="fn">money</span>(<span class="var">$urun</span>[<span class="st">'fiyat'</span>], <span class="st">'usd'</span>) ?></span>
|
|
3983
4087
|
<span class="cm"><!-- Çıktı: $1.250,00 --></span></code></pre>
|
|
3984
|
-
</section>
|
|
4088
|
+
</section>
|
|
4089
|
+
|
|
4090
|
+
<section id="vh-uuid">
|
|
4091
|
+
<h2>View Helpers - <code>uuid()</code> <span class="tag b-view">ViewMethod</span></h2>
|
|
4092
|
+
<p>Convertit un UUID binaire de 16 octets de la base de données en un format de 36 caractères et l'affiche avec une protection XSS.</p>
|
|
4093
|
+
<pre><code><span class="cm"><!-- Sortie: 0190ed84-3f12-7a91-8bc4-91823741abcd --></span>
|
|
4094
|
+
<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>
|
|
4095
|
+
</section>
|
|
4096
|
+
|
|
3985
4097
|
<!-- ====== SYSTEM HELPERS ====== -->
|
|
3986
4098
|
<section id="sh-apiresponse">
|
|
3987
4099
|
<h2>Aides système— <code>apiResponse()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
@@ -4024,7 +4136,29 @@ if ($response['status'] === 'success') {
|
|
|
4024
4136
|
<span class="cm">// Hata yanıtı</span>
|
|
4025
4137
|
<span class="fn">jsonResponse</span>([<span class="st">'status'</span> => <span class="st">'error'</span>, <span class="st">'message'</span> => <span class="st">'Yetkisiz erişim.'</span>], <span class="nu">401</span>);</code></pre>
|
|
4026
4138
|
</section>
|
|
4027
|
-
|
|
4139
|
+
|
|
4140
|
+
<section id="sh-dd">
|
|
4141
|
+
<h2>Aides système— <code>dd()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4142
|
+
<p>Dump & Die. Pendant la phase de développement, les variables étaient affichées à l’écran en mode sombre, lisible et élégant. <code><pre></code> tag et arrête l’exécution du code sur cette ligne (exit). Il peut prendre des paramètres illimités (Variadic).</p>
|
|
4143
|
+
<span class="ret">void dd(mixed ...$vars)</span>
|
|
4144
|
+
<pre><code><span class="fn">dd</span>(<span class="var">$_POST</span>, <span class="var">$kullanici_id</span>);
|
|
4145
|
+
<span class="cm">// Değerleri ekrana basar ve sistemi durdurur.</span></code></pre>
|
|
4146
|
+
</section>
|
|
4147
|
+
<!-- ====== ID GENERATION & UTILITIES ====== -->
|
|
4148
|
+
<section id="id-generation-utilities">
|
|
4149
|
+
</section>
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
|
+
<section id="sh-redirect">
|
|
4153
|
+
<h2>Aides système— <code>redirect()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4154
|
+
<span class="ret">void redirect(string $url)</span>
|
|
4155
|
+
<p>vers la page souhaitée <code>header("Location: ...")</code> Il redirige instantanément et cesse de fonctionner avec (<code>exit</code>).</p>
|
|
4156
|
+
<pre><code><span class="kw">if</span> (!<span class="var">$isLoggedIn</span>) {
|
|
4157
|
+
<span class="fn">redirect</span>(<span class="st">'/login'</span>);
|
|
4158
|
+
}</code></pre>
|
|
4159
|
+
</section>
|
|
4160
|
+
|
|
4161
|
+
<section id="sh-generatecsrf">
|
|
4028
4162
|
<h2>Aides système— <code>generateCsrf()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4029
4163
|
<p>Il génère un tout nouveau jeton CSRF sécurisé basé sur une session, d'une longueur de 32 octets. Pour ajouter comme entrée masquée aux formulaires <code>csrfField()</code> Il est recommandé d'utiliser (View Helper).</p>
|
|
4030
4164
|
<span class="ret">string generateCsrf()</span>
|
|
@@ -4110,14 +4244,7 @@ if ($response['status'] === 'success') {
|
|
|
4110
4244
|
<p>Détecte la véritable adresse IP de l'utilisateur. Flare nuageuse (<code>HTTP_CF_CONNECTING_IP</code>), procuration (<code>HTTP_X_FORWARDED_FOR</code>) et standard (<code>REMOTE_ADDR</code>) résout automatiquement toutes les connexions.</p>
|
|
4111
4245
|
<pre><code><span class="var">$ip</span> = <span class="fn">getClientIp</span>(); <span class="cm">// Örn: 192.168.1.1</span></code></pre>
|
|
4112
4246
|
</section>
|
|
4113
|
-
|
|
4114
|
-
<h2>Aides système— <code>redirect()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4115
|
-
<span class="ret">void redirect(string $url)</span>
|
|
4116
|
-
<p>vers la page souhaitée <code>header("Location: ...")</code> Il redirige instantanément et cesse de fonctionner avec (<code>exit</code>).</p>
|
|
4117
|
-
<pre><code><span class="kw">if</span> (!<span class="var">$isLoggedIn</span>) {
|
|
4118
|
-
<span class="fn">redirect</span>(<span class="st">'/login'</span>);
|
|
4119
|
-
}</code></pre>
|
|
4120
|
-
</section>
|
|
4247
|
+
|
|
4121
4248
|
<section id="sh-verifyemail">
|
|
4122
4249
|
<h2>Aides système— <code>verifyEmail()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4123
4250
|
<p>Il vérifie si l'adresse e-mail donnée est réellement une adresse e-mail valide basée sur le DNS ou le format.</p>
|
|
@@ -4159,16 +4286,10 @@ if ($response['status'] === 'success') {
|
|
|
4159
4286
|
<pre><code><span class="var">$postData</span> = <span class="fn">arrayOnly</span>(<span class="var">$_POST</span>, [<span class="st">'kullanici_adi'</span>, <span class="st">'sifre'</span>, <span class="st">'email'</span>]);
|
|
4160
4287
|
<span class="cm">// ID, rol gibi dışarıdan manipüle edilmiş değerler otomatik yok edilir.</span></code></pre>
|
|
4161
4288
|
</section>
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
<
|
|
4165
|
-
<span class="
|
|
4166
|
-
<pre><code><span class="fn">dd</span>(<span class="var">$_POST</span>, <span class="var">$kullanici_id</span>);
|
|
4167
|
-
<span class="cm">// Değerleri ekrana basar ve sistemi durdurur.</span></code></pre>
|
|
4168
|
-
</section>
|
|
4169
|
-
<!-- ====== ID GENERATION & UTILITIES ====== -->
|
|
4170
|
-
<section id="id-generation-utilities">
|
|
4171
|
-
<h2 id="sh-byteid">Aides système - <code>byteId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4289
|
+
|
|
4290
|
+
|
|
4291
|
+
<section id="sh-byteid">
|
|
4292
|
+
<h2>Aides système - <code>byteId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4172
4293
|
<div class="info-box">
|
|
4173
4294
|
16 octets bruts natifs, hautes performances et ordonnés dans le temps <strong>UUIDv7</strong> produit.
|
|
4174
4295
|
</div>
|
|
@@ -4184,7 +4305,10 @@ if ($response['status'] === 'success') {
|
|
|
4184
4305
|
|
|
4185
4306
|
<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">'Utku'</span>]);</code></pre>
|
|
4186
4307
|
</div>
|
|
4187
|
-
|
|
4308
|
+
</section>
|
|
4309
|
+
|
|
4310
|
+
<section id="sh-makeid">
|
|
4311
|
+
<h2>Aides système - <code>makeId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4188
4312
|
<div class="info-box">
|
|
4189
4313
|
Natif, standard 36 caractères <strong>UUIDv7</strong> produit la chaîne.
|
|
4190
4314
|
</div>
|
|
@@ -4198,7 +4322,10 @@ if ($response['status'] === 'success') {
|
|
|
4198
4322
|
<span class="var">$stringId</span> = SystemMethod::<span class="fn">makeId</span>();
|
|
4199
4323
|
<span class="cm">// Örnek Çıktı: 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4200
4324
|
</div>
|
|
4201
|
-
|
|
4325
|
+
</section>
|
|
4326
|
+
|
|
4327
|
+
<section id="sh-formatid">
|
|
4328
|
+
<h2>Aides système - <code>formatId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4202
4329
|
<div class="info-box">
|
|
4203
4330
|
Convertit les UUID binaires bruts de 16 octets en une chaîne standard de 36 caractères.
|
|
4204
4331
|
</div>
|
|
@@ -4213,7 +4340,10 @@ if ($response['status'] === 'success') {
|
|
|
4213
4340
|
<span class="var">$readableId</span> = SystemMethod::<span class="fn">formatId</span>(<span class="var">$user</span>[<span class="st">'id'</span>]);
|
|
4214
4341
|
<span class="cm">// Örnek Çıktı: 0190ed84-3f12-7a91-8bc4-91823741abcd</span></code></pre>
|
|
4215
4342
|
</div>
|
|
4216
|
-
|
|
4343
|
+
</section>
|
|
4344
|
+
|
|
4345
|
+
<section id="sh-intid">
|
|
4346
|
+
<h2>Aides système - <code>intId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4217
4347
|
<div class="info-box">
|
|
4218
4348
|
Sûr, aléatoire <code>INT</code> ID üretir. (Max 9 Hane)
|
|
4219
4349
|
</div>
|
|
@@ -4225,7 +4355,10 @@ if ($response['status'] === 'success') {
|
|
|
4225
4355
|
<pre><code><span class="var">$id</span> = <span class="fn">intId</span>(8);
|
|
4226
4356
|
<span class="cm">// Örnek Çıktı: 49201834</span></code></pre>
|
|
4227
4357
|
</div>
|
|
4228
|
-
|
|
4358
|
+
</section>
|
|
4359
|
+
|
|
4360
|
+
<section id="sh-bigintid">
|
|
4361
|
+
<h2>System Helpers - <code>bigintId()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4229
4362
|
<div class="info-box">
|
|
4230
4363
|
Sûr, aléatoire <code>BIGINT</code> ID üretir. (Varsayılan 15 hane - JS için güvenli sınır)
|
|
4231
4364
|
</div>
|
|
@@ -4237,7 +4370,10 @@ if ($response['status'] === 'success') {
|
|
|
4237
4370
|
<pre><code><span class="var">$id</span> = <span class="fn">bigintId</span>(); <span class="cm">// 15 haneli INT döner</span>
|
|
4238
4371
|
<span class="var">$massiveId</span> = <span class="fn">bigintId</span>(18, <span class="kw">true</span>); <span class="cm">// 18 haneli STRING döner (JS için güvenli)</span></code></pre>
|
|
4239
4372
|
</div>
|
|
4240
|
-
|
|
4373
|
+
</section>
|
|
4374
|
+
|
|
4375
|
+
<section id="sh-stringer">
|
|
4376
|
+
<h2>Aides système - <code>stringer()</code> <span class="tag b-api">SystemMethod</span></h2>
|
|
4241
4377
|
<div class="info-box">
|
|
4242
4378
|
Encapsule les valeurs dans des chaînes pour se protéger contre l'insensibilité aux nombres énormes (BIGINT) de Javascript.
|
|
4243
4379
|
</div>
|
|
@@ -4249,7 +4385,25 @@ if ($response['status'] === 'success') {
|
|
|
4249
4385
|
<pre><code><span class="cm"><!-- JS'in bozmasını engellemek için stringer ile sarmalıyoruz --></span>
|
|
4250
4386
|
<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>
|
|
4251
4387
|
</div>
|
|
4252
|
-
|
|
4388
|
+
|
|
4389
|
+
|
|
4390
|
+
<section id="sh-otpcoder">
|
|
4391
|
+
<h2>System Helpers - OTP Coder <span class="tag b-api">SystemMethod</span></h2>
|
|
4392
|
+
<div class="info-box">Génère des mots de passe à usage unique (OTP) aléatoires et sécurisés sur le plan cryptographique.</div>
|
|
4393
|
+
<div class="code-block">
|
|
4394
|
+
<pre><code><span class="cm">// Nombre aléatoire à 6 chiffres</span>
|
|
4395
|
+
<span class="var">$code</span> = <span class="fn">otpInt</span>(<span class="nu">6</span>); <span class="cm">// 482910</span>
|
|
4396
|
+
|
|
4397
|
+
<span class="cm">// 8 chiffres de lettres uniquement ('c' : minuscule, 'C' : majuscule, 'cC' : mixte)</span>
|
|
4398
|
+
<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>
|
|
4399
|
+
|
|
4400
|
+
<span class="cm">// 6 chiffres alphanumériques</span>
|
|
4401
|
+
<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>
|
|
4402
|
+
</div>
|
|
4403
|
+
</section>
|
|
4404
|
+
|
|
4405
|
+
|
|
4406
|
+
</section>
|
|
4253
4407
|
<!-- ====== API GÜVENLİĞİ ====== -->
|
|
4254
4408
|
<section id="api-methods">
|
|
4255
4409
|
<h2>API — Contrôle de méthode HTTP <span class="tag b-sec">ApiControl</span></h2>
|