Changeset 490630
- Timestamp:
- 01/16/2012 04:11:11 PM (14 years ago)
- Location:
- joemobi/trunk
- Files:
-
- 2 edited
-
controllers/core.php (modified) (1 diff)
-
joemobi-api.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
joemobi/trunk/controllers/core.php
r460683 r490630 56 56 return $joemobi_api->controller_info($joemobi_api->query->controller); 57 57 } else { 58 $dir = joemobi_api_dir();59 if (file_exists("$dir/joemobi-api.php")) {60 $php = file_get_contents("$dir/joemobi-api.php");61 } else {62 // Check one directory up, in case joemobi-api.php was moved63 $dir = dirname($dir);64 if (file_exists("$dir/joemobi-api.php")) {65 $php = file_get_contents("$dir/joemobi-api.php");66 }67 }68 if (preg_match('/^\s*Version:\s*(.+)$/m', $php, $matches)) {69 $version = $matches[1];70 } else {71 $version = '(Unknown)';72 }73 58 $active_controllers = explode(',', get_option('joemobi_api_controllers', 'core')); 74 59 $controllers = array_intersect($joemobi_api->get_controllers(), $active_controllers); 75 60 return array( 76 'joemobi_api_version' => $version,61 'joemobi_api_version' => joemobi_get_version(), 77 62 'controllers' => array_values($controllers) 78 63 ); -
joemobi/trunk/joemobi-api.php
r489391 r490630 40 40 @include_once "$dir/models/attachment.php"; 41 41 42 function joemobi_get_version() { 43 $php = file_get_contents(__FILE__); 44 if (preg_match('/^\s*Version:\s*(.+)$/m', $php, $matches)) { 45 $version = $matches[1]; 46 } else { 47 $version = '(Unknown)'; 48 } 49 return $version; 50 } 51 42 52 function joemobi_api_init() { 43 53 global $joemobi_api; … … 52 62 add_filter('rewrite_rules_array', 'joemobi_api_rewrites'); 53 63 $joemobi_api = new JOEMOBI_API(); 64 } 65 66 function joemobi_wp_head() { 67 echo '<!-- JoeMobi (http://joemobi.com) v:' . joemobi_get_version() . ' -->'; 54 68 } 55 69 … … 124 138 add_action( 'publish_post', 'joemobi_post_notification' ); 125 139 add_action( 'comment_duplicate_trigger', 'joemobi_comment_duplicate_trigger' ); 140 add_action('wp_head', 'joemobi_wp_head'); 126 141 127 142
Note: See TracChangeset
for help on using the changeset viewer.