private function publish_cdn() { if (cdn_info('status')) { $hook = hook(); if (cdn_info('filed', 'get_static_style_url')) { $hook->add('get_static_style_url', function () { return cdn_info('filed', 'get_static_style_url') . path_of_style() . "/" . get_style(); }); } if (cdn_info('filed', 'get_bootstrap_url')) { $hook->add('get_bootstrap_url', function () { return cdn_info('filed', 'get_bootstrap_url'); }); } if (cdn_info('filed', 'get_bootstrap_plugin_url')) { $hook->add('get_bootstrap_plugin_url', function () { return cdn_info('filed', 'get_bootstrap_plugin_url') . path_of_bootstrap_plugin(); }); } if (cdn_info('filed', 'get_js_url')) { $hook->add('get_js_url', function () { return cdn_info('filed', 'get_js_url') . path_of_js(); }); } } }
/** * 获取样式分类网址 * @return string */ function get_style_url() { static $url = NULL; if ($url === NULL) { $url = hook()->apply("get_style_url", get_file_url() . path_of_style()); } return clean_url($url . "/" . implode("/", func_get_args()) . add_src_version(func_get_args())); }