Untuk instalasi:
- Clone project dengan perintah
git clone https://github.com/bagusdevid/form-internal.git - Akan ada folder
form-internal. Silahkan rename folder tsb sesuai yang dikehendaki, misalkanpenawaran - Jalankan perintah
composer installuntuk menginstall dependency - Buat file
.envdengan kode kurang lebih spt ini
CI_ENVIRONMENT = production
# Masukkan URL
app.baseURL = 'http://localhost:8080/'
database.default.hostname = localhost
database.default.database = DB_Name
database.default.username =
database.default.password =
database.default.DBDriver = MySQLi
database.default.DBPrefix =
- Pastikan database dengan nama yang sudah dicantumkan pada
.envsudah tersedia - Pada command jalankan
php spark migrateuntuk men-generate db structure
- Buka console persis di directory project ini dan jalankan
php spark serveuntuk menstartup local web server. Gunakan flag port untuk menstartup diluar port default 8080. Seperti ini:php spark serve --port 5000 - Jika ingin me-running aplikasi dengan subfolder, contohnya
http://localhost/agdcatauhttp://10.14.83.2/agdcsilahkan ubah file.htaccessdipublic/.htaccessmenjadi spt ini:
# public/.htacess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
Kemudian tambahkan pula file .htaccess baru di root aplikasi, dengan kode spt ini:
# .htacess
DirectoryIndex index.php
Options -Indexes
RewriteEngine On
# Unconditionally rewrite everything to the "public" subdirectory
RewriteRule (.*) public/$1 [L]
Untuk melakukan update atau sync aplikasi terbaru (paling mutakhir) jalankan melalui perintah git pull origin main