| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
|-------------------------------------------------------------------------- |
| 5 |
| Vafpress Framework Constants |
| 6 |
|-------------------------------------------------------------------------- |
| 7 |
*/ |
| 8 |
|
| 9 |
defined('VP_VERSION') or define('VP_VERSION' , '2.0-beta'); |
| 10 |
defined('VP_NAMESPACE') or define('VP_NAMESPACE' , 'VP_'); |
| 11 |
defined('VP_DIR') or define('VP_DIR' , untrailingslashit(dirname(__FILE__))); |
| 12 |
defined('VP_DIR_NAME') or define('VP_DIR_NAME' , basename(VP_DIR)); |
| 13 |
defined('VP_IMAGE_DIR') or define('VP_IMAGE_DIR' , VP_DIR . '/public/img'); |
| 14 |
defined('VP_CONFIG_DIR') or define('VP_CONFIG_DIR' , VP_DIR . '/config'); |
| 15 |
defined('VP_DATA_DIR') or define('VP_DATA_DIR' , VP_DIR . '/data'); |
| 16 |
defined('VP_CLASSES_DIR') or define('VP_CLASSES_DIR', VP_DIR . '/classes'); |
| 17 |
defined('VP_VIEWS_DIR') or define('VP_VIEWS_DIR' , VP_DIR . '/views'); |
| 18 |
defined('VP_INCLUDE_DIR') or define('VP_INCLUDE_DIR', VP_DIR . '/includes'); |
| 19 |
|
| 20 |
// detect url whether it's theme or plugin integrated |
| 21 |
$dirname = str_replace('\\' ,'/', dirname(__FILE__)); |
| 22 |
$dirname = preg_replace('|/+|', '/', $dirname); |
| 23 |
$dir_url = plugin_dir_url(__FILE__); |
| 24 |
|
| 25 |
if( strpos($dir_url, $dirname) === false ) |
| 26 |
$vp_url = $dir_url; |
| 27 |
else |
| 28 |
$vp_url = trailingslashit(get_template_directory_uri()) . VP_DIR_NAME; |
| 29 |
|
| 30 |
defined('VP_URL') or define('VP_URL' , untrailingslashit($vp_url)); |
| 31 |
defined('VP_PUBLIC_URL') or define('VP_PUBLIC_URL' , VP_URL . '/public'); |
| 32 |
defined('VP_IMAGE_URL') or define('VP_IMAGE_URL' , VP_PUBLIC_URL . '/img'); |
| 33 |
defined('VP_INCLUDE_URL') or define('VP_INCLUDE_URL', VP_URL . '/includes'); |
| 34 |
|
| 35 |
// Get the start time and memory usage for profiling |
| 36 |
defined('VP_START_TIME') or define('VP_START_TIME', microtime(true)); |
| 37 |
defined('VP_START_MEM') or define('VP_START_MEM', memory_get_usage()); |
| 38 |
|
| 39 |
/** |
| 40 |
* EOF |
| 41 |
*/ |