Skip to content

Instantly share code, notes, and snippets.

@maulayyacyber
Last active September 7, 2020 19:52
Show Gist options
  • Save maulayyacyber/2fffd688363c51fc1025a895b46b3edf to your computer and use it in GitHub Desktop.
Save maulayyacyber/2fffd688363c51fc1025a895b46b3edf to your computer and use it in GitHub Desktop.
How To Create CDN on CodeIgniter
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* @package Content Delivery Network - BelanCon.com | Belanja Icon
* @version 1.0
* @author Belancon Dev Team
* @copyright Copyright © 2016 Belancon - Belanja Icon.
* @link https://belancon.com
*/
//function CDN - Content Delivery Network
if(!function_exists('cdn'))
{
function cdn($str = NULL)
{
return get_instance()->config->item('cdn') . $str;
}
}
//function CLOUD - Server Management storage
if(!function_exists('cloud'))
{
function cloud($str = NULL)
{
return get_instance()->config->item('cloud') . $str;
}
}
//function CLOUD - Server Management storage
if(!function_exists('cloud_path'))
{
function cloud_path($str = NULL)
{
return get_instance()->config->item('cloud_path') . $str;
}
}
/*
|--------------------------------------------------------------------------
| Other virtual host
|--------------------------------------------------------------------------
*/
$config['cdn'] = ((ENVIRONMENT != 'production')?'//cdn.localhost/belancon/':'//cdn.belancon.com/belancon/');
// $config['cloud'] = ((ENVIRONMENT != 'production')?'//cloud.localhost/belancon/':'//cloud.belancon.com/belancon/');
$config['cloud'] = ((ENVIRONMENT != 'production') ? 'http://localhost/cloud-belancon/': '//cloud.belancon.com/belancon/');
$config['cloud_path'] = ((ENVIRONMENT != 'production') ? 'http://localhost/cloud-belancon/': 'http://cloud.belancon.com/');
/*
|--------------------------------------------------------------------------
| Path upload cloud
|--------------------------------------------------------------------------
*/
$config['path'] = '../cloud/';
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment