Ejemplo n.º 1
0
    }
    // if
}
// try
// Init application
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Init application');
}
// if
// We need to call application.php after the routing is executed because
// some of the application classes may need CONTROLLER, ACTION or $_GET
// data collected by the matched route
require_once 'application.php';
// Set handle request timer...
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Handle request');
}
// if
// Get controller and action and execute...
try {
    Env::executeAction(request_controller(), request_action());
} catch (Exception $e) {
    if (Env::isDebugging()) {
        Env::dumpError($e);
    } else {
        Logger::log($e, Logger::FATAL);
        redirect_to(get_url('error', 'execute_action'));
    }
    // if
}
// try
Ejemplo n.º 2
0
 function _load_sidebar()
 {
     trace(__FILE__, '_load_sidebar()');
     //Quick error / XSS preventor
     if (request_action() == '_load_sidebar') {
         flash_error('no access permissions');
         $this->redirectTo();
     }
     //Get Sidebar stuff
     $sidebar_page = Wiki::getProjectSidebar(active_project());
     if (instance_of($sidebar_page, 'WikiPage')) {
         $sidebar_revision = $sidebar_page->getLatestRevision();
     } else {
         //Make some default content which should help the user set stuff up
         $sidebar_page = new WikiPage();
         $sidebar_revision = new Revision();
         $sidebar_revision->setName(lang('wiki default sidebar name'));
         $sidebar_revision->setContent(lang('wiki default sidebar content'));
     }
     // if
     $all_pages = Wiki::getAllProjectPages(active_project());
     tpl_assign('sidebar_links', $all_pages);
     tpl_assign('sidebar_page', $sidebar_page);
     tpl_assign('sidebar_revision', $sidebar_revision);
     $this->setSidebar(get_template_path('view_sidebar', 'wiki'));
 }
Ejemplo n.º 3
0
    // 获取对端链接信息, udp链接需要加上$from_id参数
    $fdinfo = $serv->connection_info($fd, $from_id);
    // 对接收到的数据进行类型判断
    if (!isset($msg['y'])) {
        /// 数据格式不合法
        /// 什么都不做
    } else {
        if ($msg['y'] == 'r') {
            // 如果是回复, 且包含nodes信息
            if (array_key_exists('nodes', $msg['r'])) {
                // 对nodes进行操作
                response_action($msg, array($fdinfo['remote_ip'], $fdinfo['remote_port']));
            }
        } elseif ($msg['y'] == 'q') {
            // 如果是请求, 则执行请求判断
            request_action($msg, array($fdinfo['remote_ip'], $fdinfo['remote_port']));
        } else {
            return false;
        }
    }
});
$serv->on('Timer', function ($interval) {
    for ($i = 0; $i < MAX_PROCESS; $i++) {
        $process = new swoole_process(function () {
            auto_find_node();
        });
        $pid = $process->start();
        $threads[$pid] = $process;
        swoole_process::wait();
    }
});
Ejemplo n.º 4
0
 /**
  * @return void
  */
 public function render($fields)
 {
     request_action(array('controller' => 'layout_elements', 'action' => 'display', 'TwitterTweets', $fields));
 }
Ejemplo n.º 5
0
    require_once LIBRARY_PATH . '/utf8/utf8.php';
}
// Set handle request timer...
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Handle request');
}
// if
$url = urldecode($_SERVER['REQUEST_URI']);
if (preg_match('/<script[^>]*>.*(<\\/script>|$)/i', $url)) {
    Logger::log("Javascript injection from " . $_SERVER['REMOTE_ADDR'] . " in URL:" . $url);
    remove_scripts_and_redirect($url);
}
// Get controller and action and execute...
try {
    if (!defined('CONSOLE_MODE')) {
        Env::executeAction(request_controller(), request_action()) or DB::rollback();
    }
} catch (Exception $e) {
    if (Env::isDebugging()) {
        Logger::log($e, Logger::FATAL);
        Env::dumpError($e);
    } else {
        Logger::log($e, Logger::FATAL);
        redirect_to(get_url('error', 'execute_action'));
    }
    // if
}
// try
if (Env::isDebuggingTime()) {
    TimeIt::stop();
    $report = TimeIt::getTimeReportByType();
Ejemplo n.º 6
0
 /**
  * @return void
  */
 public function render($fields)
 {
     request_action(array('controller' => 'layout_elements', 'action' => 'display', 'Tabs', $fields, array('featured' => false)));
 }
<?php

get_header();
?>

<div class="bluebox-builder-row">
<div class="row-fluid bluebox-container">
    
<?php 
if (have_posts()) {
    ?>

    <?php 
    global $wp_query;
    request_action(array('controller' => 'layout_elements', 'action' => 'display', 'Portfolio', array('posts' => $wp_query->posts, 'postsNumber' => $wp_query->query_vars['posts_per_page'], 'excerptLength' => 100, 'layout' => 'grid', 'gridLayoutStyle' => '1', 'lightBoxLinkDisplay' => 'true', 'enablePaginate' => 'true')));
    ?>
	

<?php 
} else {
    ?>
    <div class="msg error">
        <p><?php 
    _e('No posts were found', 'gummfw');
    ?>
</p>
    </div>
<?php 
}
?>