webapp-sample
package into your local disk driveD:/webapp-sample
C:/xampp
We need to configure XAMPP, PHP, MySQL and phpMyAdmin.
XAMPP
server. Remember to Run as administrator
.C:/xampp/apache/conf/extra/httpd-vhosts.conf
with Notepad++ or VSCode#
DocumentRoot "d:webapp-sample"
ServerName wapapp
Order allow,deny
AllowOverride All
Allow from all
Require all granted
file_uploads=On
in php.ini
MySQL
local serverAdmin
button to open phpMyAdmin
docs/sql/webapptemplate.sql
GO
I believe there will be some errors and you will feel very upset.
Be calm, please!
I understand it and here below what you should do next.
configs/__config.php
define("APP_HOST","webapptemplate.hssoftvn.com");
define("APP_PROTOCOL","https://");
define("APP_URL", APP_PROTOCOL . APP_HOST);
define("LOCALHOST","http://localhost");
define("COMPANY_NAME","YOUR_COMPANY");
define("CDN_DIR", __DIR__ . "/../cdn");
define("CDN_DIR_BK", CDN_DIR . "_bk");
define("MAX_UPLOAD_SIZE", 5_000_000);
$server_name = $_SERVER['SERVER_NAME'];
$url_origin = APP_URL;
if($server_name != APP_HOST){
$url_origin = LOCALHOST;
}
$current_url = $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$is_local = ($url_origin == LOCALHOST);
function isLocal(){
global $is_local;
return $is_local;
}
define("CDN_URL", (isLocal()? LOCALHOST:APP_URL) . "/cdn");
$APP_DOWNLOAD_LINK = "https://play.google.com/store/apps/details?id=com.hssoftvn.gicungduoc";
?>
.htaccess
SetEnv MY_DB_SERVERNAME your.remote.sqlsever.hosting
controllers/core/database/core.db.php
define("MY_DB_SERVERNAME", getenv("MY_DB_SERVERNAME"));
define("MY_DB_USERNAME", "root");
define("MY_DB_PASSWORD", "");
define("MY_DB_DATABASENAME", "webapptemplate");
controllerscore/upload/module.photo.php
if(isLocal()){
$CDN_DIR = isLocal()? "./cdn":$CDN_DIR;
$CDN_BK_DIR = isLocal()? "./cdn_bk":$CDN_BK_DIR;
$CDN_URL = "cdn/";
}
$CDN_DIR = CDN_DIR;
$CDN_BK_DIR = CDN_DIR_BK;
$MAX_UPLOAD_SIZE = MAX_UPLOAD_SIZE;
$CDN_URL = CDN_URL;
controllers/core/jwt/jwt.php
// Hours * Minutes * Seconds
$token_expiration = 6 * 60 * 60;
//For Mobile, reduce the token expiration
if($iss=='am'){
$token_expiration = 2 * 60 * 60;
}
// Get our server-side secret key from a secure location.
define ("SERVER_KEY", 'IyQlXiZAKjMlKiZeLTgyJioqPQ'); //base64 encode
define ("ALGORITHM", 'HS256'); //in seconds
define ("EXPIRATION_TIMES", $token_expiration); //in seconds
I believe the sample should work well now.
Changing icons and logos are very easy.
See your new icons and logos?
If you are looking for a tool to convert PNG to ICO files, here you go