コード例 #1
0
ファイル: base.php プロジェクト: uzura8/flockbird
 public function before()
 {
     parent::before();
     if (!defined('IS_SSL')) {
         define('IS_SSL', Input::protocol() == 'https');
     }
     if (!defined('IS_ADMIN')) {
         define('IS_ADMIN', $this->check_is_admin_request());
     }
     if (!defined('IS_SP')) {
         define('IS_SP', \MyAgent\Agent::is_mobile_device());
     }
     if (!defined('IS_API')) {
         define('IS_API', Site_Util::check_is_api());
     }
     $this->set_default_data();
     $this->check_ssl_required_request_and_redirect();
     $this->check_remote_ip();
     $this->auth_instance = Auth::forge($this->auth_driver);
     if (!defined('IS_AUTH')) {
         define('IS_AUTH', $this->check_auth(false));
     }
     $this->check_auth_and_redirect();
     $this->set_current_user();
     $this->check_required_setting_and_redirect();
     self::setup_assets();
 }
コード例 #2
0
ファイル: opengraph.php プロジェクト: uzura8/flockbird
 public static function get_analized_data($url, $is_cached = false, $cache_key_prefix = '', $cache_expire = null)
 {
     if (is_null($cache_expire)) {
         $cache_expire = 60 * 60 * 24;
     }
     if (!$is_cached) {
         return static::analyze_url($url);
     }
     $device_type = \MyAgent\Agent::is_mobile_device() ? 'sp' : 'pc';
     $cache_key = static::get_cache_key($url, $device_type, $cache_key_prefix);
     try {
         $analized_data = \Cache::get($cache_key, $cache_expire);
     } catch (\CacheNotFoundException $e) {
         $analized_data = static::analyze_url($url);
         \Cache::set($cache_key, $analized_data, $cache_expire);
     }
     return $analized_data;
 }
コード例 #3
0
ファイル: load_common_js.php プロジェクト: uzura8/flockbird
<?php

echo Asset::js('handlebars-v1.3.0.js');
$jquery_version = conf('library.jqueryVersion.latest');
if (conf('legacyBrowserSupport.isEnabled') && \MyAgent\Agent::check_legacy_ie(conf('legacyBrowserSupport.legacyIECriteriaVersion'))) {
    $jquery_version = conf('library.jqueryVersion.legacy');
}
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/<?php 
echo $jquery_version;
?>
/jquery.min.js"></script>
<script>
if (typeof jQuery == 'undefined') document.write('<script src="<?php 
echo Uri::base_path('assets/js/jquery-' . $jquery_version . '.min.js');
?>
"><\/script>')
</script>

<?php 
if (conf('library.angularJs.isEnabled') && $use_angularjs) {
    $angularjs_version = conf('library.angularJs.versions.latest');
    //if (conf('legacyBrowserSupport.isEnabled') && \MyAgent\Agent::check_legacy_ie(conf('legacyBrowserSupport.legacyIECriteriaVersion')))
    //{
    //	$jquery_version = conf('library.angularJs.versions.legacy');
    //}
    ?>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/<?php 
    echo $angularjs_version;
    ?>
/angular.min.js"></script>