Пример #1
0
<?php

/**
 * 导出代码到后台mysql
 */
use RFramework\RFramework;
require __DIR__ . DIRECTORY_SEPARATOR . 'base.php';
//加载框架
require FRAMEWORK_ROOT . DS . 'RFramework.php';
RFramework::setRootPath(PROJECT_ROOT);
\spl_autoload_register('\\RFramework\\RFramework::autoLoader');
$table_list = ['ORDER' => '\\Entity\\Statistics\\APP_MallOrder'];
//每次插入数据量,排接 insert valuse(),(),()....
$per_limit = 50;
//读取上次/记录本次读取时间
$bg_process_end_file = __DIR__ . DS . 'var' . DS . 'bg_process_last_end';
$start = \is_file($bg_process_end_file) ? file_get_contents($bg_process_end_file) : '1970-01-01 00:00:01';
$end = date('Y-m-d H:i:s');
//file_put_contents($bg_process_end_file, $end = time());
echo 'start_time: ', $start, PHP_EOL;
echo 'end_time: ', date("Y-m-d H:i:s");
//echo 'per limit: ', $pageMax, PHP_EOL;
$config = (require PROJECT_ROOT . 'config' . DS . 'db.php');
$from_config = $config['db'][$config['db']['adapter']];
$to_config = $config['db2'][$config['db2']['adapter']];
//连接mongodb
try {
    $mongoClient = new \MongoClient($from_config['dsn']);
    // $node_collection = $mongoClient->selectCollection($from_config['db'], 'MEMBER_NODE');
} catch (Exception $e) {
    echo $e->getMessage();
Пример #2
0
//echo "hello world";
use RFramework\RFramework;
define('DS', DIRECTORY_SEPARATOR);
define('BASE_ROOT', str_replace('webroot', '', __DIR__));
define('FRAMEWORK_ROOT', str_replace('bnx' . DS . 'webroot', '', __DIR__) . 'RFramework' . DS);
if (isset($_GET['debug']) && $_GET['debug'] == 'd123fdsfda') {
    ini_set('display_errors', 'on');
    error_reporting(E_ALL);
}
$_GET['params'] = str_replace('/config', '', $_GET['params']);
if (!function_exists('apache_request_headers')) {
    function apache_request_headers()
    {
        $headers = [];
        foreach ($_SERVER as $key => $value) {
            if (substr($key, 0, 5) === 'HTTP_') {
                $key = substr($key, 5);
                $key = strtolower($key);
                $key = str_replace('_', ' ', $key);
                $key = ucwords($key);
                $key = str_replace(' ', '-', $key);
                $headers[$key] = $value;
            }
        }
        return $headers;
    }
}
//echo BASE_ROOT, PHP_EOL, FRAMEWORK_ROOT, PHP_EOL;
require FRAMEWORK_ROOT . 'RFramework.php';
RFramework::run(BASE_ROOT);