Example #1
0
 /**
  * Constructor
  */
 function init_locale()
 {
     $this->_load_lang($this->CUR_LOCALE);
     // Get charset from the current language
     $charset = conf('languages::' . $this->CUR_LOCALE . '::charset');
     // Force UTF-8 for the admin section
     if (MAIN_TYPE_ADMIN && $this->CUR_LOCALE == 'en') {
         $charset = 'utf-8';
     }
     conf('charset', !empty($charset) ? $charset : $this->CUR_CHARSET);
     conf('language', $this->CUR_LOCALE);
     $this->CUR_CHARSET = conf('charset');
     // TODO: country detection connect
     $this->CUR_COUNTRY = conf('country') ?: (in_array(strtolower($this->CUR_LOCALE), ['ru', 'uk']) ? 'UA' : '');
     $lc_all = array_unique(array_filter([strtolower($this->CUR_LOCALE) . '_' . strtoupper($this->CUR_LOCALE) . '.' . $this->CUR_CHARSET, strtolower($this->CUR_LOCALE) . '_' . strtoupper($this->CUR_LOCALE), $this->CUR_COUNTRY ? strtolower($this->CUR_LOCALE) . '_' . strtoupper($this->CUR_COUNTRY) . '.' . $this->CUR_CHARSET : '', $this->CUR_COUNTRY ? strtolower($this->CUR_LOCALE) . '_' . strtoupper($this->CUR_COUNTRY) : '', strtolower($this->CUR_LOCALE), strtolower(conf('languages::' . $this->CUR_LOCALE . '::name')), 'en_US.utf-8', 'en_US', 'en']));
     if (DEBUG_MODE) {
         debug('locale::default', ['LC_ALL' => setlocale(LC_ALL, 0), 'LC_COLLATE' => setlocale(LC_COLLATE, 0), 'LC_CTYPE' => setlocale(LC_CTYPE, 0), 'LC_MONETARY' => setlocale(LC_MONETARY, 0), 'LC_NUMERIC' => setlocale(LC_NUMERIC, 0), 'LC_TIME' => setlocale(LC_TIME, 0), 'LC_MESSAGES' => setlocale(LC_MESSAGES, 0)]);
         debug('locale::variants', ['LC_ALL' => $lc_all]);
     }
     // Try to set PHP's locale (provide several possible values)
     $success = setlocale(LC_ALL, $lc_all);
     // TODO: check $success
     if (DEBUG_MODE && !is_hhvm()) {
         debug('locale::current', ['LC_ALL' => setlocale(LC_ALL, 0), 'LC_COLLATE' => setlocale(LC_COLLATE, 0), 'LC_CTYPE' => setlocale(LC_CTYPE, 0), 'LC_MONETARY' => setlocale(LC_MONETARY, 0), 'LC_NUMERIC' => setlocale(LC_NUMERIC, 0), 'LC_TIME' => setlocale(LC_TIME, 0), 'LC_MESSAGES' => setlocale(LC_MESSAGES, 0)]);
         $sys_locale = '';
         exec('locale -a', $sys_locale);
         debug('locale::system', $sys_locale);
     }
     $this->_init_inline_editor();
 }
Example #2
0
 /**
  * Show Stream Extension Warning (stream_socket_enable_crypto is not supported in HHVM).
  *
  * @return true
  */
 private function showStreamExtensionWarning()
 {
     if (!is_testing()) {
         error_log('Warning: ' . (is_hhvm() ? 'The HHVM (HipHop VM)' : 'This version of PHP') . ' does not support checking SSL certificates Stripe cannot guarantee that the server has a ' . 'certificate which is not blacklisted.');
     }
     return true;
 }
Example #3
0
 /**
  */
 function _render_debug_info(&$params, $ts = 0, $trace = '')
 {
     if (!DEBUG_MODE) {
         return false;
     }
     $_fields = [];
     foreach ((array) $this->_fields as $k => $v) {
         $_fields[$k] = ['func' => '%lambda%', 'data' => '%data%'] + $v;
     }
     $_header_links = [];
     foreach ((array) $this->_header_links as $k => $v) {
         $_header_links[$k] = ['func' => '%lambda%', 'data' => '%data%'] + $v;
     }
     $_footer_links = [];
     foreach ((array) $this->_footer_links as $k => $v) {
         $_footer_links[$k] = ['func' => '%lambda%', 'data' => '%data%'] + $v;
     }
     $_buttons = [];
     foreach ((array) $this->_buttons as $k => $v) {
         $_buttons[$k] = ['func' => '%lambda%', 'data' => '%data%'] + $v;
     }
     !is_hhvm() && debug('table2[]', ['params' => $params, 'fields' => $_fields, 'buttons' => $_buttons, 'header_links' => $_header_links, 'footer_links' => $_footer_links, 'time' => round(microtime(true) - $ts, 5), 'trace' => $trace ?: main()->trace_string()]);
 }