@artilingo/artiframe-cli 1.4.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 +4347 -4390
- package/core-stubs/docs/en.html +4347 -4389
- package/core-stubs/docs/es.html +4347 -4390
- package/core-stubs/docs/fr.html +4347 -4389
- package/core-stubs/docs/tr.html +138 -109
- package/package.json +1 -1
- package/src/App.php +8 -0
- package/src/Commands/AddCommand.php +1 -1
- 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/TableCommand.php +2 -1
- package/src/Commands/UpgradeCommand.php +209 -0
- package/src/Commands/VersionCommand.php +2 -1
- package/src/Lang/de.php +7 -1
- package/src/Lang/en.php +6 -0
- package/src/Lang/es.php +7 -1
- package/src/Lang/fr.php +6 -0
- package/src/Lang/tr.php +7 -1
- 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/tr.html
CHANGED
|
@@ -254,11 +254,13 @@
|
|
|
254
254
|
<a href="#kurulum">Kurulum</a>
|
|
255
255
|
<a href="#dizin">Dizin Yapısı</a>
|
|
256
256
|
<div class="sb-cat">Mimari</div>
|
|
257
|
+
<a href="#v2-routing">Zero-Config Routing (v2.0)</a>
|
|
257
258
|
<a href="#bootstrapper">Bootstrapper Mimarisi</a>
|
|
258
259
|
<a href="#kurallar">Kural Seti</a>
|
|
259
260
|
<div class="sb-cat">CLI Aracı</div>
|
|
260
261
|
<a href="#cli-giris">CLI'ye Giriş</a>
|
|
261
262
|
<a href="#cli-new">new</a>
|
|
263
|
+
<a href="#cli-upgrade">upgrade</a>
|
|
262
264
|
<a href="#cli-view">make:view</a>
|
|
263
265
|
<a href="#cli-api">make:api</a>
|
|
264
266
|
<a href="#cli-class">make:class</a>
|
|
@@ -468,6 +470,7 @@ artiframe> </code></pre>
|
|
|
468
470
|
<h3>3. Yeni Proje Başlat</h3>
|
|
469
471
|
<pre><code>artiframe> new benim-projem</code></pre>
|
|
470
472
|
<p>Bu komut <code class="ic">benim-projem/</code> dizinini oluşturur ve tüm iskelet yapıyı içine kopyalar: <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> ve ilk <code class="ic">index.php</code> sayfası.</p>
|
|
473
|
+
|
|
471
474
|
<h3>4. Ortam Ayarları</h3>
|
|
472
475
|
<pre><code>cp .env.example .env</code></pre>
|
|
473
476
|
<p><code class="ic">.env</code> dosyanızı açıp veritabanı ve uygulama bilgilerini doldurun. Bu dosya asla versiyon kontrolüne girmez.</p>
|
|
@@ -485,8 +488,7 @@ artiframe> </code></pre>
|
|
|
485
488
|
│ ├── <span class="file">ViewControl.php</span> <span class="note"># View (HTML sayfa) bootstrapper'ı</span>
|
|
486
489
|
│ ├── <span class="file">ApiControl.php</span> <span class="note"># API endpoint bootstrapper'ı</span>
|
|
487
490
|
│ ├── <span class="file">Database.php</span> <span class="note"># PDO tabanlı veritabanı bağlantısı</span>
|
|
488
|
-
│
|
|
489
|
-
│ └── <span class="file">R2Manager.php</span> <span class="note"># Cloudflare R2 dosya yöneticisi</span>
|
|
491
|
+
│ └── <span class="file">DotEnv.php</span> <span class="note"># .env okuyucu</span>
|
|
490
492
|
│
|
|
491
493
|
├── <span class="dir warn">bin/</span> <span class="note"># ⚠️ Çekirdek sistem — doğrudan düzenlemeyin</span>
|
|
492
494
|
│ ├── <span class="file">SystemMethod.php</span> <span class="note"># API/Backend global yardımcıları</span>
|
|
@@ -506,8 +508,9 @@ artiframe> </code></pre>
|
|
|
506
508
|
│ │ └── <span class="dir">js/</span> <span class="note"># View'a özel JS dosyaları</span>
|
|
507
509
|
│ ├── <span class="dir">includes/</span> <span class="note"># Paylaşılan bileşenler</span>
|
|
508
510
|
│ │ ├── head.php
|
|
509
|
-
│
|
|
510
|
-
│
|
|
511
|
+
│ ├── <span class="file">head.php</span>
|
|
512
|
+
│ ├── <span class="file">header.php</span>
|
|
513
|
+
│ └── <span class="file">footer.php</span>
|
|
511
514
|
│ ├── <span class="dir">api/</span> <span class="note"># API endpoint dosyaları</span>
|
|
512
515
|
│ └── <span class="file">index.php</span> <span class="note"># Ana sayfa</span>
|
|
513
516
|
│
|
|
@@ -520,6 +523,92 @@ artiframe> </code></pre>
|
|
|
520
523
|
<strong>🚫 bin/ dizinine dokunmayın:</strong> <code class="ic">bin/</code> içindeki dosyalar çerçevenin çekirdeğidir. Projeye özel iş mantığı buraya eklenmez. Ekleyeceğiniz sınıflar ve servisler <code class="ic">src/</code> altında, altyapı bileşenleri <code class="ic">app/</code> altında yer alır.
|
|
521
524
|
</div>
|
|
522
525
|
</section>
|
|
526
|
+
|
|
527
|
+
<!-- ====== V2.0 ROUTING & MİMARİ ====== -->
|
|
528
|
+
<section id="v2-routing">
|
|
529
|
+
<h2>Zero-Config Routing & v2.0.0 Yenilikleri <span class="tag b-cli">YENİ</span></h2>
|
|
530
|
+
<p class="lead">ArtiFrame v2.0.0 ile birlikte framework'ün çekirdek yapısı çok daha hafif, hızlı ve geliştirici dostu bir "Zero-Config" (Sıfır Ayar) dosya tabanlı yönlendirme (routing) mimarisine kavuşmuştur.</p>
|
|
531
|
+
|
|
532
|
+
<h3>1. Dosya Tabanlı Otomatik Yönlendirme (routeLink)</h3>
|
|
533
|
+
<p>Geleneksel framework'lerin aksine ArtiFrame, her rota için tek tek yapılandırma (örn: <code>web.php</code> içine route ekleme) yapmanızı istemez. Tüm istekler <code>public/index.php</code> dosyasındaki <strong>tek bir Gateway'e</strong> düşer ve <code>routeLink()</code> metodu aracılığıyla sihirli bir şekilde yönetilir.</p>
|
|
534
|
+
|
|
535
|
+
<div class="card highlight">
|
|
536
|
+
<h4>Nasıl Çalışır?</h4>
|
|
537
|
+
<p>Eğer tarayıcıdan <code>/kategori/elektronik/15</code> adresine girilirse, sistem <code>DOCUMENT_ROOT</code> dizininde aşağıdan yukarıya en uzun eşleşen PHP dosyasını arar:</p>
|
|
538
|
+
<ol>
|
|
539
|
+
<li><code>/kategori/elektronik/15.php</code> (Bulunamadı)</li>
|
|
540
|
+
<li><code>/kategori/elektronik.php</code> (Bulunamadı)</li>
|
|
541
|
+
<li><code>/kategori.php</code> (Bulundu!)</li>
|
|
542
|
+
</ol>
|
|
543
|
+
<p>Eşleşen dosya çalıştırılırken, kalan URL parçaları otomatik olarak <code>$_GET</code> parametrelerine dönüştürülür:</p>
|
|
544
|
+
<pre><code>$_GET['params'] = ['elektronik', '15'];
|
|
545
|
+
$_GET['param1'] = 'elektronik';
|
|
546
|
+
$_GET['param2'] = '15';</code></pre>
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
<div class="alert a-info">
|
|
550
|
+
<strong>💡 Geriye Uyumluluk (ID):</strong> Eski sürümlerdeki alışkanlıkların bozulmaması adına <code>$_GET['param1']</code> her zaman <code>$_GET['id']</code> içine de eşitlenir. Böylece detay sayfalarında direkt <code>$_GET['id']</code> kullanabilirsiniz.
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
<div class="card">
|
|
554
|
+
<h4>Link (a) Etiketleri Nasıl Olmalı?</h4>
|
|
555
|
+
<p>Yeni routing sisteminde eski tarz query string parametreleri (<code>?id=...&token=...</code>) yerine <strong>Temiz URL (Clean URL)</strong> yapısı kullanılır. Bu sayede linkleriniz hem daha okunaklı hem de SEO dostu olur.</p>
|
|
556
|
+
<pre><code><span class="cm"><!-- ❌ ESKİ YAPI (Kullanılmamalı) --></span>
|
|
557
|
+
<a href="user.php?id=123456&token=123j54m23k">Profili Gör</a>
|
|
558
|
+
|
|
559
|
+
<span class="cm"><!-- ✅ YENİ YAPI (ArtiFrame Standardı) --></span>
|
|
560
|
+
<a href="/user/123456/123j54m23k">Profili Gör</a></code></pre>
|
|
561
|
+
<p>Yukarıdaki yeni yapıda ilgili sayfada verilere erişmek oldukça basittir:</p>
|
|
562
|
+
<pre><code><span class="cm">// public/user.php içerisinde:</span>
|
|
563
|
+
$userId = sanitizeInt($_GET['param1']); <span class="cm">// 123456 (veya $_GET['id'])</span>
|
|
564
|
+
$token = sanitizeString($_GET['param2']); <span class="cm">// 123j54m23k</span></code></pre>
|
|
565
|
+
</div>
|
|
566
|
+
|
|
567
|
+
<h3>2. Global Yardımcı Fonksiyonlar (Helpers)</h3>
|
|
568
|
+
<p>Eski sürümlerde <code>\Bin\SystemMethod::generateToken()</code> veya <code>\Bin\ViewMethod::display()</code> gibi uzun namespace çağrıları gerekiyordu. v2.0.0 ile birlikte bu fonksiyonların tamamı global namespace (<code>namespace { }</code>) içine alındı.</p>
|
|
569
|
+
<p>Artık uygulamanızın her yerinden sadece şu şekilde çağırabilirsiniz:</p>
|
|
570
|
+
<pre><code>$token = generateToken();
|
|
571
|
+
echo display($user['name']);
|
|
572
|
+
echo csrfField();</code></pre>
|
|
573
|
+
|
|
574
|
+
<h3>3. Yapısal Değişiklikler (Breaking Changes)</h3>
|
|
575
|
+
|
|
576
|
+
<div class="alert a-success">
|
|
577
|
+
<strong>🕊️ Refactor Korkusuna Son:</strong> Diğer framework'lerin aksine, ArtiFrame çekirdek güncellemeleri yayınlandığında projelerinizde günlerce süren "refactor" (kod yeniden yapılandırma) krizleri yaşamazsınız. <code>artiframe new</code> dediğiniz an, o sürümün tüm çekirdeği (core files) projenize kopyalanır. Çıkan yeni sürümler (örneğin v3, v4) mevcut projelerinizi asla bozmaz; projeye kurulan sürümün gereksinimi ne ise yıllarca o şekilde stabil çalışmaya devam eder.
|
|
578
|
+
</div>
|
|
579
|
+
|
|
580
|
+
<div class="alert a-danger">
|
|
581
|
+
<strong>⚠️ Önemli:</strong> Eski projelerinizde <code>public/index.php</code> bir karşılama sayfası HTML'i içeriyordu. v2.0.0 itibariyle <code>index.php</code> sadece bir Router dosyasıdır. Eski anasayfa tasarımınız artık varsayılan olarak <code>public/landing.php</code> üzerinden sunulmaktadır. (Boş bir URL geldiğinde sistem varsayılan olarak <code>landing.php</code> dosyasına yönlendirir).
|
|
582
|
+
</div>
|
|
583
|
+
<p>Ayrıca yeni projelerde <code>artiframe new</code> çalıştırdığınızda otomatik olarak sistemin fallback yapabilmesi için <code>public/404.php</code> ve <code>public/503.php</code> hata sayfaları üretilir.</p>
|
|
584
|
+
|
|
585
|
+
<div class="card">
|
|
586
|
+
<h4>Akıllı API Hata Yönetimi</h4>
|
|
587
|
+
<p>Eğer 404 (Sayfa Bulunamadı) veya 503 (Bakım Modu) hataları bir <strong>API uç noktasına</strong> (örneğin <code>/api/user/get</code>) gelirse; sistem, HTTP istemcisine (mobil uygulama, frontend) HTML sayfa göstermek yerine, durum kodunu ayarlayıp otomatik olarak standart bir <strong>JSON hatası</strong> döndürür. Bu, API'nizin kırılmadan (crash olmadan) her zaman JSON yanıt verebilmesini garanti eder.</p>
|
|
588
|
+
<pre><code>{
|
|
589
|
+
"status": "error",
|
|
590
|
+
"message": "API Endpoint Not Found",
|
|
591
|
+
"data": []
|
|
592
|
+
}</code></pre>
|
|
593
|
+
|
|
594
|
+
<div class="alert a-warning" style="margin-top: 15px;">
|
|
595
|
+
<strong>💡 Not: İstemci Tarafında (Frontend) Hata Yakalama</strong><br>
|
|
596
|
+
Hata kodu (404, 503 vb.) JSON verisinin içinde değil, doğrudan standart <strong>HTTP Ağ Yanıtında (Status Code)</strong> döner. Bu sayede JSON içeriğini parse etmeye gerek kalmadan hataları ağ katmanında yakalayabilirsiniz:
|
|
597
|
+
</div>
|
|
598
|
+
<pre><code><span class="cm">// Fetch API Örneği:</span>
|
|
599
|
+
fetch('/api/user/get').then(response => {
|
|
600
|
+
if (!response.ok) {
|
|
601
|
+
console.error("HTTP Hatası:", response.status); <span class="cm">// 404 veya 503</span>
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
<span class="cm">// Axios Örneği:</span>
|
|
606
|
+
axios.get('/api/user/get').catch(error => {
|
|
607
|
+
console.error("HTTP Hatası:", error.response.status); <span class="cm">// 404 veya 503</span>
|
|
608
|
+
});</code></pre>
|
|
609
|
+
</div>
|
|
610
|
+
</section>
|
|
611
|
+
|
|
523
612
|
<!-- ====== BOOTSTRAPPER ====== -->
|
|
524
613
|
<section id="bootstrapper">
|
|
525
614
|
<h2>Bootstrapper Mimarisi <span class="tag b-core">Kritik</span></h2>
|
|
@@ -673,6 +762,20 @@ proje-adi/
|
|
|
673
762
|
└── kilavuz.html
|
|
674
763
|
</div>
|
|
675
764
|
</section>
|
|
765
|
+
<!-- upgrade -->
|
|
766
|
+
<section id="cli-upgrade">
|
|
767
|
+
<h2><code>upgrade</code> <span class="tag b-cli">CLI Komutu</span></h2>
|
|
768
|
+
<p>Küresel olarak NPM üzerinden güncellediğiniz ArtiFrame CLI aracındaki yeni özellikleri mevcut projenize güvenle entegre etmenizi sağlar.</p>
|
|
769
|
+
<pre><code>artiframe> <span class="fn">upgrade</span></code></pre>
|
|
770
|
+
<ul style="margin-left: 20px; margin-bottom: 15px; line-height: 1.6;">
|
|
771
|
+
<li>Sadece <code>app/</code> ve <code>bin/</code> çekirdek klasörlerini ile <code>src/Service/</code> altındaki sabit servis sınıflarını (varsa) günceller.</li>
|
|
772
|
+
<li>İş mantığınızın bulunduğu <code>src/</code>, <code>public/</code> ve <code>config/</code> dizinlerine kesinlikle <strong>dokunulmaz</strong> (böylece projeniz zarar görmez).</li>
|
|
773
|
+
<li><strong>Güvenlik Duvarı:</strong> Eğer projeniz v1.x ise ve <code>public/index.php</code> dosyanız yeni router yapısına uymuyorsa, hata verir ve sizden mevcut index.php'nizin adını <code>landing.php</code> olarak değiştirmenizi ister.</li>
|
|
774
|
+
<li><strong>Modifikasyon Uyarısı:</strong> Eğer daha önce <code>bin/</code> altındaki çekirdek fonksiyonları elle değiştirdiyseniz, veri kaybı yaşamamanız için işleme başlamadan önce sizden <strong>Enter</strong> tuşuyla manuel onay (yedekleme uyarısı) ister.</li>
|
|
775
|
+
<li><strong>Akıllı Değişiklik Raporu (Diff):</strong> Güncelleme bittiğinde terminale, projenize yeni eklenen veya üzerinde değişiklik yapılan (güncellenen) dosyaların detaylı bir raporunu basar.</li>
|
|
776
|
+
<li><strong>Fonksiyon Düzeyinde Analiz:</strong> Eğer güncellenen dosya bir <code>.php</code> dosyası ise, eski ve yeni dosya içindeki metodları karşılaştırır. Yeni bir fonksiyon eklendiyse, raporda <code>[YENİ FONKSİYON] ad()</code> şeklinde özel olarak uyararak dokümantasyonu okumaya yönlendirir.</li>
|
|
777
|
+
</ul>
|
|
778
|
+
</section>
|
|
676
779
|
<!-- make:view -->
|
|
677
780
|
<section id="cli-view">
|
|
678
781
|
<h2><code>make:view</code> <span class="tag b-cli">CLI Komutu</span></h2>
|
|
@@ -816,6 +919,7 @@ Example: /src/Service/PaymentService</code></pre>
|
|
|
816
919
|
<p><strong>Tablo İçeriğini Önizlemek:</strong> Bir tabloyu <code>schema.sql</code> dosyasına eklemeden önce SQL içeriğini terminalde incelemek için komutun sonuna <code>check</code> parametresini ekleyebilirsiniz:</p>
|
|
817
920
|
<pre><code>artiframe> <span class="fn">table:</span><span class="st">users</span> <span class="st">check</span></code></pre>
|
|
818
921
|
</section>
|
|
922
|
+
<!-- upgrade -->
|
|
819
923
|
<!-- cli v -->
|
|
820
924
|
<section id="cli-cliv">
|
|
821
925
|
<h2><code>cli v</code> (veya <code>cli version</code>) <span class="tag b-cli">CLI Komutu</span></h2>
|
|
@@ -906,10 +1010,13 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
906
1010
|
<!-- serve -->
|
|
907
1011
|
<section id="cli-serve">
|
|
908
1012
|
<h2><code>serve</code> <span class="tag b-cli">CLI Komutu</span></h2>
|
|
909
|
-
<p>Projeyi test etmek için yerel bir geliştirme sunucusu (
|
|
1013
|
+
<p>Projeyi test etmek için yerel bir geliştirme sunucusu başlatır ve 0.0.0.0 (tüm ağ arayüzleri) üzerinden yerel ağa (Local Network) açar. Ek bir web sunucusu kurmanıza (XAMPP, Nginx vs.) gerek kalmadan projenizi saniyeler içinde ayağa kaldırır, kendi bilgisayarınızda localhost sekmesini otomatik açar ve ağdaki diğer cihazlar (telefon/tablet) için bağlantı IP'sini ekrana basar.</p>
|
|
910
1014
|
<pre><code>artiframe> <span class="fn">serve</span>
|
|
911
|
-
🚀 Geliştirme sunucusu
|
|
912
|
-
Durdurmak için CTRL+C tuşlarına basın
|
|
1015
|
+
🚀 Geliştirme sunucusu başlatıldı: 0.0.0.0:8000
|
|
1016
|
+
Durdurmak için CTRL+C tuşlarına basın.
|
|
1017
|
+
|
|
1018
|
+
Local: http://localhost:8000
|
|
1019
|
+
Network: http://192.168.1.34:8000</code></pre>
|
|
913
1020
|
<p>İsterseniz farklı bir port numarası belirtebilirsiniz:</p>
|
|
914
1021
|
<pre><code>artiframe> <span class="fn">serve</span> <span class="st">8080</span></code></pre>
|
|
915
1022
|
</section>
|
|
@@ -927,7 +1034,14 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
927
1034
|
<pre><code>artiframe> <span class="fn">suggest</span></code></pre>
|
|
928
1035
|
<p>Komut, interaktif olarak kategori seçmenizi, başlık yazmanızı ve detaylı bir açıklama girmenizi ister. İşlem tamamlandığında resmi ArtiFrame deposunda bir Issue olarak yayınlanır.</p>
|
|
929
1036
|
</section>
|
|
930
|
-
<!--
|
|
1037
|
+
<!-- issues -->
|
|
1038
|
+
<section id="cli-issues">
|
|
1039
|
+
<h2><code>issues</code> <span class="tag b-cli">CLI Komutu</span></h2>
|
|
1040
|
+
<p>Gönderdiğiniz issue'ları listeleyin ve yorumlarını doğrudan terminalinizden okuyun. <code>auth</code> komutu ile giriş yapmayı gerektirir.</p>
|
|
1041
|
+
<pre><code>artiframe> <span class="fn">issues</span> [id]</code></pre>
|
|
1042
|
+
<p>Issue'larınızın listesini görmek için <code>issues</code> çalıştırın. 4 numaralı issue'nun detaylarını ve yorumlarını görmek için <code>issues 4</code> çalıştırın.</p>
|
|
1043
|
+
</section>
|
|
1044
|
+
<!-- add -->
|
|
931
1045
|
<section id="cli-add">
|
|
932
1046
|
<h2><code>add</code> <span class="tag b-cli">CLI Komutu</span></h2>
|
|
933
1047
|
<p>Projenize harici modüller veya hazır entegrasyonlar dahil etmenizi sağlayan en güçlü komuttur. Klasik <code>composer require</code> işleminin ötesine geçerek, bazı modüller için otomatik servis sınıfları (stubs) oluşturur ve <code>.env</code> dosyalarınıza gerekli tanımlamaları kendiliğinden yapar.</p>
|
|
@@ -947,7 +1061,7 @@ artiframe> <span class="fn">go</span> <span class="st">back</span>
|
|
|
947
1061
|
<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>
|
|
948
1062
|
<tr><td><code>add image</code></td><td>intervention/image</td><td><span class="tag b-core">src/Service/ImageProcessor.php</span></td></tr>
|
|
949
1063
|
<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>
|
|
950
|
-
<tr><td><code>add sentry</code></td><td>sentry/sentry</td><td><span class="tag b-core">
|
|
1064
|
+
<tr><td><code>add sentry</code></td><td>sentry/sentry</td><td><span class="tag b-core">src/Service/Sentry.php</span></td></tr>
|
|
951
1065
|
<tr><td><code>add redis</code></td><td>predis/predis</td><td><span class="tag b-core">src/Service/RedisCache.php</span></td></tr>
|
|
952
1066
|
<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>
|
|
953
1067
|
<tr><td><code>add twilio</code></td><td>twilio/sdk</td><td><span class="tag b-core">src/Service/Twilio.php</span></td></tr>
|
|
@@ -3567,78 +3681,23 @@ if ($response['status'] === 'success') {
|
|
|
3567
3681
|
<h2>Sentry <span class="tag b-core" style="padding: 1px 5px; margin-left: 2px; font-weight: bold;" title="Ücretli/Lisanslı Servis">$</span></h2>
|
|
3568
3682
|
<div class="alert a-info" style="margin-top: 10px; padding: 10px 15px; font-size: 0.85em;"><strong>📌 Üyelik & API Anahtarları:</strong> Hata ve performans takibini devreye almak için <a href="https://sentry.io" target="_blank" style="color: var(--green); font-weight: bold;">sentry.io</a> üzerinden ücretsiz hesabınızı oluşturup, PHP projesi ekleyerek size verilen DSN (Client Key) adresini kopyalamalısınız.</div>
|
|
3569
3683
|
<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;">
|
|
3570
|
-
<strong>Sınıf Konumu:</strong> <code style="color: #4ade80;">
|
|
3684
|
+
<strong>Sınıf Konumu:</strong> <code style="color: #4ade80;">src/Service/Sentry.php</code>
|
|
3571
3685
|
</div>
|
|
3572
|
-
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;"
|
|
3686
|
+
<p style="margin-bottom: 15px; font-size: 0.95em; color: #a1a1aa;">Projenizdeki hataları ve uyarıları merkezi bir log sisteminde toplamanızı sağlar. Uygulamanızın başlangıcında (örneğin <code>ApiControl.php</code> veya <code>ViewControl.php</code> içinde) başlatılması tavsiye edilir.</p>
|
|
3573
3687
|
<div class="alert a-info" style="margin-bottom: 20px;">
|
|
3574
|
-
<strong>ℹ️
|
|
3688
|
+
<strong>ℹ️ Statik Sınıf:</strong> Bu servis sınıfı doğrudan statik metotlarla kullanılır, yeni bir nesne (instance) oluşturmanıza gerek yoktur.
|
|
3575
3689
|
</div>
|
|
3576
3690
|
<h3>Metotlar ve Kullanım Örnekleri</h3>
|
|
3577
3691
|
<div class="accordion-group">
|
|
3578
3692
|
<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%;">
|
|
3579
|
-
<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;">
|
|
3580
|
-
<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;">
|
|
3581
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Sentry Error Tracking Configuration Initializes the Sentry SDK for error reporting and provides helper functions for capturing exceptions and messages. Required ENV variables: SENTRY_DSN — Sentry Data Source Name (project DSN from sentry.io) Optional ENV variables: APP_ENV — "0" for production, "1" for development (default: 0) APP_VERSION — Application version string, used as Sentry release tag Usage: require_once __DIR__ . '/sentry.php'; // Capture an exception try { ... } catch (\Throwable $e) { $eventId = captureError($e);</p>
|
|
3582
|
-
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3583
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3584
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Parametre Yapısı:</h4>
|
|
3585
|
-
<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>}
|
|
3586
|
-
// Capture an informational message
|
|
3587
|
-
captureMessage('Deployment completed', 'info');
|
|
3588
|
-
/
|
|
3589
|
-
// ---------------------------------------------------------------
|
|
3590
|
-
// Guard — only initialize when a DSN is available
|
|
3591
|
-
// ---------------------------------------------------------------
|
|
3592
|
-
if (empty($_ENV['SENTRY_DSN'])) {
|
|
3593
|
-
/**
|
|
3594
|
-
No-op fallback when Sentry is not configured.
|
|
3595
|
-
@param \Throwable $e The exception (ignored).</code></pre>
|
|
3596
|
-
</div>
|
|
3597
|
-
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3598
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3599
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Örnek Kullanım:</h4>
|
|
3600
|
-
<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();
|
|
3601
|
-
$response = $sentry->captureError($e);
|
|
3602
|
-
if ($response['status'] === 'success') {
|
|
3603
|
-
// Başarılı
|
|
3604
|
-
}</code></pre>
|
|
3605
|
-
</div>
|
|
3606
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3607
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Beklenen Dönüş ($response['data']):</h4>
|
|
3608
|
-
<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>[
|
|
3609
|
-
'id' => '...',
|
|
3610
|
-
'success' => true
|
|
3611
|
-
]</code></pre>
|
|
3612
|
-
</div>
|
|
3613
|
-
</div>
|
|
3614
|
-
</div>
|
|
3615
|
-
</div>
|
|
3616
|
-
</details>
|
|
3617
|
-
<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%;">
|
|
3618
|
-
<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>
|
|
3693
|
+
<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>
|
|
3619
3694
|
<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;">
|
|
3620
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">
|
|
3695
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Sentry SDK'sını ortam değişkenlerine göre başlatır. Uygulamanın en başında bir kez çağrılmalıdır.</p>
|
|
3621
3696
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3622
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3623
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Parametre Yapısı:</h4>
|
|
3624
|
-
<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).
|
|
3625
|
-
@param string $level Severity level (ignored).</code></pre>
|
|
3626
|
-
</div>
|
|
3627
3697
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3628
3698
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3629
3699
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Örnek Kullanım:</h4>
|
|
3630
|
-
<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
|
|
3631
|
-
$response = $sentry->captureMessage($message);
|
|
3632
|
-
if ($response['status'] === 'success') {
|
|
3633
|
-
// Başarılı
|
|
3634
|
-
}</code></pre>
|
|
3635
|
-
</div>
|
|
3636
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3637
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Beklenen Dönüş ($response['data']):</h4>
|
|
3638
|
-
<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>[
|
|
3639
|
-
'id' => '...',
|
|
3640
|
-
'success' => true
|
|
3641
|
-
]</code></pre>
|
|
3700
|
+
<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>
|
|
3642
3701
|
</div>
|
|
3643
3702
|
</div>
|
|
3644
3703
|
</div>
|
|
@@ -3647,34 +3706,20 @@ if ($response['status'] === 'success') {
|
|
|
3647
3706
|
<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%;">
|
|
3648
3707
|
<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>
|
|
3649
3708
|
<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;">
|
|
3650
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;"
|
|
3709
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Yakalanan bir Exception veya Throwable nesnesini Sentry'e gönderir.</p>
|
|
3651
3710
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3652
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3653
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Parametre Yapısı:</h4>
|
|
3654
|
-
<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>}
|
|
3655
|
-
\Sentry\init($options);
|
|
3656
|
-
// ---------------------------------------------------------------
|
|
3657
|
-
// Helper functions
|
|
3658
|
-
// ---------------------------------------------------------------
|
|
3659
|
-
/**
|
|
3660
|
-
Capture a Throwable and send it to Sentry.
|
|
3661
|
-
@param \Throwable $e The exception or error to report.</code></pre>
|
|
3662
|
-
</div>
|
|
3663
3711
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3664
3712
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3665
3713
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Örnek Kullanım:</h4>
|
|
3666
|
-
<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
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3714
|
+
<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 {
|
|
3715
|
+
// Hata yapabilecek işlemler...
|
|
3716
|
+
} catch (\Throwable $e) {
|
|
3717
|
+
$eventId = \Src\Service\Sentry::captureError($e);
|
|
3670
3718
|
}</code></pre>
|
|
3671
3719
|
</div>
|
|
3672
3720
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3673
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Beklenen Dönüş (
|
|
3674
|
-
<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>
|
|
3675
|
-
'id' => '...',
|
|
3676
|
-
'success' => true
|
|
3677
|
-
]</code></pre>
|
|
3721
|
+
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Beklenen Dönüş (string|null):</h4>
|
|
3722
|
+
<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>
|
|
3678
3723
|
</div>
|
|
3679
3724
|
</div>
|
|
3680
3725
|
</div>
|
|
@@ -3683,28 +3728,12 @@ if ($response['status'] === 'success') {
|
|
|
3683
3728
|
<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%;">
|
|
3684
3729
|
<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>
|
|
3685
3730
|
<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;">
|
|
3686
|
-
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">
|
|
3731
|
+
<p style="color: #d1d5db; margin-bottom: 15px; word-wrap: break-word;">Belirtilen bir metni bilgi/uyarı mesajı olarak Sentry'e gönderir. Geçerli seviyeler: <code>fatal</code>, <code>error</code>, <code>warning</code>, <code>info</code>, <code>debug</code>.</p>
|
|
3687
3732
|
<div style="display: flex; flex-direction: column; gap: 15px; box-sizing: border-box; width: 100%; max-width: 100%;">
|
|
3688
|
-
<div style="flex: 1; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3689
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Parametre Yapısı:</h4>
|
|
3690
|
-
<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.
|
|
3691
|
-
@param string $level Sentry severity level (default: info).</code></pre>
|
|
3692
|
-
</div>
|
|
3693
3733
|
<div style="display: flex; flex-wrap: wrap; gap: 15px; box-sizing: border-box; width: 100%;">
|
|
3694
3734
|
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3695
3735
|
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Örnek Kullanım:</h4>
|
|
3696
|
-
<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>$
|
|
3697
|
-
$response = $sentry->captureMessage($message);
|
|
3698
|
-
if ($response['status'] === 'success') {
|
|
3699
|
-
// Başarılı
|
|
3700
|
-
}</code></pre>
|
|
3701
|
-
</div>
|
|
3702
|
-
<div style="flex: 1; min-width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden;">
|
|
3703
|
-
<h4 style="margin-bottom: 8px; font-size: 0.9em; color: #9ca3af;">Beklenen Dönüş ($response['data']):</h4>
|
|
3704
|
-
<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>[
|
|
3705
|
-
'id' => '...',
|
|
3706
|
-
'success' => true
|
|
3707
|
-
]</code></pre>
|
|
3736
|
+
<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>
|
|
3708
3737
|
</div>
|
|
3709
3738
|
</div>
|
|
3710
3739
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artilingo/artiframe-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "ArtiFrame — Zero-dependency native PHP framework with a powerful multilingual CLI. Scaffold projects, generate views, APIs and classes instantly.",
|
|
5
5
|
"main": "bin/artiframe.js",
|
|
6
6
|
"bin": {
|
package/src/App.php
CHANGED
|
@@ -199,6 +199,10 @@ class App
|
|
|
199
199
|
case 'new':
|
|
200
200
|
(new \ArtiFrame\Cli\Commands\NewProjectCommand($this->translator))->execute($commandArgs);
|
|
201
201
|
break;
|
|
202
|
+
|
|
203
|
+
case 'upgrade':
|
|
204
|
+
(new \ArtiFrame\Cli\Commands\UpgradeCommand($this->translator))->execute($commandArgs);
|
|
205
|
+
break;
|
|
202
206
|
|
|
203
207
|
case 'make:view':
|
|
204
208
|
(new \ArtiFrame\Cli\Commands\MakeViewCommand($this->translator))->execute($commandArgs);
|
|
@@ -302,6 +306,10 @@ class App
|
|
|
302
306
|
echo " " . $g . "new" . $r . " " . $y . "<project-path>" . $r . PHP_EOL;
|
|
303
307
|
echo " " . $d . "│" . $r . " " . $t->get('HELP_NEW_DESC') . PHP_EOL;
|
|
304
308
|
echo " " . $d . "└── " . $r . "Example: " . $lg . "new my-app" . $r . PHP_EOL;
|
|
309
|
+
// upgrade
|
|
310
|
+
echo " " . $g . "upgrade" . $r . PHP_EOL;
|
|
311
|
+
echo " " . $d . "│" . $r . " " . $t->get('HELP_UPGRADE_DESC') . PHP_EOL;
|
|
312
|
+
echo " " . $d . "└── " . $r . "Example: " . $lg . "upgrade" . $r . PHP_EOL;
|
|
305
313
|
echo PHP_EOL;
|
|
306
314
|
|
|
307
315
|
// make:view
|
|
@@ -425,7 +425,11 @@ class NewProjectCommand
|
|
|
425
425
|
"Bin\\\\": "bin/",
|
|
426
426
|
"App\\\\": "app/",
|
|
427
427
|
"Src\\\\": "src/"
|
|
428
|
-
}
|
|
428
|
+
},
|
|
429
|
+
"files": [
|
|
430
|
+
"bin/ViewMethod.php",
|
|
431
|
+
"bin/SystemMethod.php"
|
|
432
|
+
]
|
|
429
433
|
},
|
|
430
434
|
"authors": [
|
|
431
435
|
{
|
|
@@ -469,6 +473,7 @@ JSON;
|
|
|
469
473
|
"# Uygulama",
|
|
470
474
|
"APP_NAME=ArtiFrame",
|
|
471
475
|
"APP_URL=http://localhost",
|
|
476
|
+
"APP_MAINTENANCE=false",
|
|
472
477
|
"",
|
|
473
478
|
"# Veritabanı (MySQL / MariaDB)",
|
|
474
479
|
"DB_HOST=localhost",
|
|
@@ -476,22 +481,7 @@ JSON;
|
|
|
476
481
|
"DB_PASS=",
|
|
477
482
|
"DB_NAME=artiframe",
|
|
478
483
|
"",
|
|
479
|
-
|
|
480
|
-
"MAIL_HOST=smtp.example.com",
|
|
481
|
-
"MAIL_PORT=587",
|
|
482
|
-
"MAIL_USERNAME=",
|
|
483
|
-
"MAIL_PASSWORD=",
|
|
484
|
-
"MAIL_FROM_ADDRESS=noreply@example.com",
|
|
485
|
-
"MAIL_FROM_NAME=ArtiFrame",
|
|
486
|
-
"MAIL_ENCRYPTION=tls",
|
|
487
|
-
"",
|
|
488
|
-
"# Cloudflare R2 (AWS S3 Uyumlu Depolama)",
|
|
489
|
-
"R2_ACCOUNT_ID=",
|
|
490
|
-
"R2_ACCESS_KEY=",
|
|
491
|
-
"R2_SECRET_KEY=",
|
|
492
|
-
"R2_BUCKET_NAME=",
|
|
493
|
-
"R2_PUBLIC_URL=",
|
|
494
|
-
"",
|
|
484
|
+
|
|
495
485
|
"# Redis",
|
|
496
486
|
"REDIS_HOST=127.0.0.1",
|
|
497
487
|
"REDIS_PORT=6379",
|
|
@@ -645,14 +635,14 @@ REDISPHP;
|
|
|
645
635
|
// public/index.php — localized welcome page
|
|
646
636
|
$lang = $this->translator->getLang();
|
|
647
637
|
$docFile = [
|
|
648
|
-
'tr' => ['file' => 'kilavuz.html', 'installed' => 'Projeniz Başarıyla Oluşturuldu!', 'guide' => 'İlk adımlar için kılavuzu inceleyebilirsiniz:'],
|
|
649
|
-
'en' => ['file' => 'guide.html', 'installed' => 'Project Created Successfully!', 'guide' => 'Check out the guide for the first steps:'],
|
|
650
|
-
'de' => ['file' => 'handbuch.html', 'installed' => 'Projekt Erfolgreich Erstellt!', 'guide' => 'Für die ersten Schritte sehen Sie im Handbuch nach:'],
|
|
651
|
-
'fr' => ['file' => 'guide_fr.html', 'installed' => 'Projet Créé avec Succès !', 'guide' => 'Consultez le guide pour les premières étapes :'],
|
|
652
|
-
'es' => ['file' => 'guia.html', 'installed' => '¡Proyecto Creado Exitosamente!', 'guide' => 'Consulta la guía para los primeros pasos:'],
|
|
653
|
-
][$lang] ?? ['file' => 'guide.html', 'installed' => 'ArtiFrame Installed Successfully!', 'guide' => 'To get started, see'];
|
|
654
|
-
|
|
655
|
-
$
|
|
638
|
+
'tr' => ['file' => 'kilavuz.html', 'installed' => 'Projeniz Başarıyla Oluşturuldu!', 'guide' => 'İlk adımlar için kılavuzu inceleyebilirsiniz:', 'note' => '💡 <b>Not:</b> Eğer anasayfa (landing.php) ismini değiştirmek isterseniz, <code>bin/ViewMethod.php</code> içindeki <code>routeLink()</code> metodunda bulunan varsayılan sayfa adını da güncellemelisiniz.'],
|
|
639
|
+
'en' => ['file' => 'guide.html', 'installed' => 'Project Created Successfully!', 'guide' => 'Check out the guide for the first steps:', 'note' => '💡 <b>Note:</b> If you want to change the homepage (landing.php) filename, you must also update the default page name in the <code>routeLink()</code> method inside <code>bin/ViewMethod.php</code>.'],
|
|
640
|
+
'de' => ['file' => 'handbuch.html', 'installed' => 'Projekt Erfolgreich Erstellt!', 'guide' => 'Für die ersten Schritte sehen Sie im Handbuch nach:', 'note' => '💡 <b>Hinweis:</b> Wenn Sie den Dateinamen der Startseite (landing.php) ändern möchten, müssen Sie auch den Standardseitennamen in der Methode <code>routeLink()</code> in <code>bin/ViewMethod.php</code> aktualisieren.'],
|
|
641
|
+
'fr' => ['file' => 'guide_fr.html', 'installed' => 'Projet Créé avec Succès !', 'guide' => 'Consultez le guide pour les premières étapes :', 'note' => '💡 <b>Remarque :</b> Si vous souhaitez modifier le nom de fichier de la page d\'accueil (landing.php), vous devez également mettre à jour le nom de page par défaut dans la méthode <code>routeLink()</code> dans <code>bin/ViewMethod.php</code>.'],
|
|
642
|
+
'es' => ['file' => 'guia.html', 'installed' => '¡Proyecto Creado Exitosamente!', 'guide' => 'Consulta la guía para los primeros pasos:', 'note' => '💡 <b>Nota:</b> Si desea cambiar el nombre del archivo de la página de inicio (landing.php), también debe actualizar el nombre de la página predeterminada en el método <code>routeLink()</code> dentro de <code>bin/ViewMethod.php</code>.'],
|
|
643
|
+
][$lang] ?? ['file' => 'guide.html', 'installed' => 'ArtiFrame Installed Successfully!', 'guide' => 'To get started, see', 'note' => '💡 <b>Note:</b> If you want to change the homepage (landing.php) filename, you must also update the default page name in the <code>routeLink()</code> method inside <code>bin/ViewMethod.php</code>.'];
|
|
644
|
+
|
|
645
|
+
$landingContent = "<?php\n"
|
|
656
646
|
. "if (isset(\$_GET['guide'])) {\n"
|
|
657
647
|
. " header('Content-Type: text/html; charset=utf-8');\n"
|
|
658
648
|
. " readfile(__DIR__ . '/../{$docFile['file']}');\n"
|
|
@@ -696,6 +686,12 @@ REDISPHP;
|
|
|
696
686
|
. " transition: all 0.3s ease; box-shadow: 0 4px 14px 0 rgba(9, 151, 114, 0.39);\n"
|
|
697
687
|
. " }\n"
|
|
698
688
|
. " .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(9, 151, 114, 0.45); }\n"
|
|
689
|
+
. " .note {\n"
|
|
690
|
+
. " font-size: 0.85rem; color: #6b7280; margin-top: 2rem;\n"
|
|
691
|
+
. " background: rgba(255,255,255,0.5); padding: 1rem; border-radius: 0.75rem;\n"
|
|
692
|
+
. " border: 1px solid rgba(0,0,0,0.05); text-align: left; line-height: 1.5;\n"
|
|
693
|
+
. " }\n"
|
|
694
|
+
. " .note code { background: rgba(0,0,0,0.05); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: monospace; }\n"
|
|
699
695
|
. " .footer {\n"
|
|
700
696
|
. " display: flex; align-items: center; gap: 0.5rem;\n"
|
|
701
697
|
. " color: #6b7280; font-size: 0.875rem; font-weight: 500;\n"
|
|
@@ -714,6 +710,7 @@ REDISPHP;
|
|
|
714
710
|
. " <h1>{$docFile['installed']}</h1>\n"
|
|
715
711
|
. " <p>{$docFile['guide']}</p>\n"
|
|
716
712
|
. " <a href=\"?guide\" class=\"btn\">{$docFile['file']}</a>\n"
|
|
713
|
+
. " <div class=\"note\">{$docFile['note']}</div>\n"
|
|
717
714
|
. " </div>\n"
|
|
718
715
|
. " <div class=\"footer\">\n"
|
|
719
716
|
. " <span>Powered by</span>\n"
|
|
@@ -723,9 +720,24 @@ REDISPHP;
|
|
|
723
720
|
. " </div>\n"
|
|
724
721
|
. "</body>\n"
|
|
725
722
|
. "</html>\n";
|
|
723
|
+
file_put_contents($targetDir . '/public/landing.php', $landingContent);
|
|
724
|
+
$this->tick('public/landing.php');
|
|
725
|
+
|
|
726
|
+
// public/index.php - router
|
|
727
|
+
$indexContent = "<?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nrouteLink();\n";
|
|
726
728
|
file_put_contents($targetDir . '/public/index.php', $indexContent);
|
|
727
729
|
$this->tick('public/index.php');
|
|
728
730
|
|
|
731
|
+
// public/404.php
|
|
732
|
+
$error404Content = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>404 Not Found</title>\n <style>body{font-family:sans-serif;display:flex;justify-content:center;align-items:center;height:100vh;background:#f3f4f6;color:#374151;text-align:center;} h1{font-size:3rem;margin-bottom:0;} p{font-size:1.2rem;color:#6b7280;}</style>\n</head>\n<body>\n <div>\n <h1>404</h1>\n <p>Page Not Found</p>\n </div>\n</body>\n</html>\n";
|
|
733
|
+
file_put_contents($targetDir . '/public/404.php', $error404Content);
|
|
734
|
+
$this->tick('public/404.php');
|
|
735
|
+
|
|
736
|
+
// public/503.php
|
|
737
|
+
$error503Content = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>503 Service Unavailable</title>\n <style>body{font-family:sans-serif;display:flex;justify-content:center;align-items:center;height:100vh;background:#f3f4f6;color:#374151;text-align:center;} h1{font-size:3rem;margin-bottom:0;} p{font-size:1.2rem;color:#6b7280;}</style>\n</head>\n<body>\n <div>\n <h1>503</h1>\n <p>Service Unavailable / Maintenance Mode</p>\n </div>\n</body>\n</html>\n";
|
|
738
|
+
file_put_contents($targetDir . '/public/503.php', $error503Content);
|
|
739
|
+
$this->tick('public/503.php');
|
|
740
|
+
|
|
729
741
|
// public/.htaccess
|
|
730
742
|
$htaccessContent = <<<HTACCESS
|
|
731
743
|
RewriteEngine On
|