Пример #1
0
 /**
  */
 function _on_before_connect_default()
 {
     if (is_console()) {
         $this->params['persist'] = true;
         $this->SQL_AFTER_CONNECT = $this->SQL_AFTER_CONNECT_CONSOLE;
     }
 }
Пример #2
0
 function __call($name, $arguments)
 {
     if (!$this->_silent) {
         trigger_error($this->_o_name . '(): missing object method: ' . $name . ($this->_c_name ? ' for class: ' . $this->_c_name : ''), E_USER_WARNING);
         if (function_exists('trace') && function_exists('is_console') && is_console()) {
             echo trace() . PHP_EOL . PHP_EOL;
         }
         return false;
     }
 }
Пример #3
0
<?php

return function ($assets) {
    $main_type = $assets->_override['main_type'] ?: MAIN_TYPE;
    if (!(is_console() || $assets->_override['main_type'] || $main_type == 'user')) {
        $bs_theme = common()->bs_current_theme($main_type, $force_default = false);
    } else {
        $bs_theme = common()->bs_current_theme($main_type, $force_default = true);
    }
    $html5fw = conf('css_framework');
    $bs_major_version = $html5fw === 'bs3' ? '3' : '2';
    $require_name = 'bootstrap' . $bs_major_version;
    $fixes_name = 'yf_bootstrap_fixes_' . $main_type;
    if ($bs_theme === 'bootstrap') {
        conf('bs3_no_default_theme', true);
        return ['require' => ['asset' => $require_name], 'add' => ['asset' => ['font-awesome4', $fixes_name]]];
    } elseif ($bs_theme === 'bootstrap_theme') {
        return ['require' => ['asset' => $require_name], 'add' => ['asset' => ['font-awesome4', $fixes_name]]];
    } elseif ($bs_theme === 'material_design') {
        conf('bs3_no_default_theme', true);
        return ['versions' => ['master' => ['css' => ['//cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.1/bootstrap-material-design.min.css'], 'js' => ['//cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.1/bootstrap-material-design.iife.min.js', '$(function(){ $.material.init(); })']]], 'require' => ['asset' => 'bootstrap3'], 'add' => ['asset' => $fixes_name]];
    } elseif ($bs_theme === 'todc_bootstrap') {
        conf('bs3_no_default_theme', true);
        return ['versions' => ['master' => ['css' => ['//rawgit.yfix.net/yfix/todc-bootstrap/master/dist/css/bootstrap.min.css', '//rawgit.yfix.net/yfix/todc-bootstrap/master/dist/css/todc-bootstrap.min.css'], 'js' => ['//rawgit.yfix.net/yfix/todc-bootstrap/master/dist/js/bootstrap.min.js']]], 'require' => ['asset' => 'bootstrap3'], 'add' => ['asset' => $fixes_name]];
    } elseif ($bs_major_version == 2) {
        return ['versions' => ['2.3.2' => ['css' => '//netdna.bootstrapcdn.com/bootswatch/2.3.2/' . $bs_theme . '/bootstrap.min.css']], 'require' => ['asset' => 'bootstrap2'], 'add' => ['asset' => ['font-awesome3', $fixes_name]]];
    } elseif ($bs_major_version == 3) {
        conf('bs3_no_default_theme', true);
        return ['versions' => ['3.3.7' => ['css' => '//rawgit.yfix.net/thomaspark/bootswatch/v3.3.7/' . $bs_theme . '/bootstrap.min.css']], 'require' => ['asset' => 'bootstrap3'], 'add' => ['asset' => ['font-awesome4', $fixes_name]]];
    }
};
Пример #4
0
 /**
  */
 function cache_purge()
 {
     $assets = clone _class('assets');
     $assets->USE_CACHE = false;
     $cache_dir_tpl = preg_replace('~/+~', '/', str_replace('{project_path}', PROJECT_PATH, $assets->CACHE_DIR_TPL));
     $cache_dir = substr($cache_dir_tpl, 0, strpos($cache_dir_tpl, '{')) ?: $cache_dir_tpl;
     if (substr($cache_dir, 0, strlen(PROJECT_PATH)) === PROJECT_PATH && strlen($cache_dir) > strlen(PROJECT_PATH)) {
         if (is_console()) {
             echo 'Cleaning ' . $cache_dir . PHP_EOL;
         }
         _class('dir')->delete($cache_dir, $and_start_dir = true);
     }
     return 'Done';
 }
Пример #5
0
 /**
  */
 function test_send_from_console()
 {
     if (!is_console()) {
         return _404('Only for console testing');
     }
     _class('email')->_send_admin_email('moved_to_arbitration', 1);
 }