Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.10 KB | None | 0 0
  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. // get and normalize framework dirname
  21. $dirname        = str_replace('\\' ,'/', dirname(__FILE__)); // standardize slash
  22. $dirname        = preg_replace('|/+|', '/', $dirname);       // normalize duplicate slash
  23.  
  24. // get and normalize WP content directory
  25. $wp_content_dir = str_replace( '\\', '/', WP_CONTENT_DIR );  // standardize slash
  26. if( trim( $wp_content_dir, '/' ) != $wp_content_dir ) {
  27.     $wp_content_dir = '/' . trim( $wp_content_dir, '/' );
  28. }
  29.  
  30. // build relative url
  31. $relative_url   = str_replace($wp_content_dir, "", $dirname);
  32.  
  33. // finally framework base url
  34. $vp_url         = content_url() . $relative_url;
  35.  
  36. defined('VP_URL')         or define('VP_URL'        , untrailingslashit($vp_url));
  37. defined('VP_PUBLIC_URL')  or define('VP_PUBLIC_URL' , VP_URL        . '/public');
  38. defined('VP_IMAGE_URL')   or define('VP_IMAGE_URL'  , VP_PUBLIC_URL . '/img');
  39. defined('VP_INCLUDE_URL') or define('VP_INCLUDE_URL', VP_URL        . '/includes');
  40.  
  41. // Get the start time and memory usage for profiling
  42. defined('VP_START_TIME')  or define('VP_START_TIME', microtime(true));
  43. defined('VP_START_MEM')   or define('VP_START_MEM',  memory_get_usage());
  44.  
  45. /**
  46.  * EOF
  47.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement