/** * routing */ public function route() { if (file_exists($file = WWWROOT . "Lib/Action/class.{$this->_controller}Action" . EXT)) { require_once RECHO_PHP . "Lib/Action/class.RcAction.php"; require_once $file; if (class_exists($this->_controller . 'Action')) { $recho = new ReflectionClass($this->_controller . 'Action'); if ($recho->hasMethod($this->_action)) { $rc = $recho->getMethod($this->_action); $fuc = $recho->newInstance(); $rc->invoke($fuc); return true; } } } elseif (file_exists($file = RECHO_PHP . "Lib/Action/class.{$this->_controller}Action" . EXT)) { require_once RECHO_PHP . "Lib/Action/class.RcAction.php"; require_once $file; if (class_exists($this->_controller . 'Action')) { $recho = new ReflectionClass($this->_controller . 'Action'); if ($recho->hasMethod($this->_action)) { $rc = $recho->getMethod($this->_action); $fuc = $recho->newInstance(); $rc->invoke($fuc); return true; } } } rc::debug()->error('404'); }
/** * 获取邮件发送模板内容 * @param $type 模板类型 * @param $info 给模板的变量 */ public function getSendBody($type, $info = false) { rc::smarty()->assign('sendemail', $type); $nowTemplatesPath = rc::smarty()->template_dir; rc::smarty()->assign('info', $info); $body = rc::smarty()->fetch('EmailAction/index-email.html'); rc::smarty()->template_dir = $nowTemplatesPath; return $body; }
<?php // +---------------------------------------------------------------------- // | RechoPHP [ WE CAN DO IT JUST Better ] // +---------------------------------------------------------------------- // | Copyright (c) 2010-2014 http://recho.net All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: recho <*****@*****.**> // +---------------------------------------------------------------------- session_start(); header("X-Powered-By:Recho-2.0"); define('IS_IN', true); define('WWWROOT', dirname(__FILE__) . '/'); define('RECHO_PHP', WWWROOT . '../../RechoPHP/'); require_once RECHO_PHP . 'RechoPHP.php'; //-- 共用smarty数据 -- rc::smarty()->assign(array('redirectURL' => urlencode($_REQUEST['redirectURL']), 'siteInfo' => array('siteName' => C('SITENAME'), 'title' => C('TITLE')), 'siteName' => C('SITENAME'), 'WWWROOT' => C('WWWBASEURL/'), 'WWWROOT1' => C('WWWBASEURL')));
/** * 返回自定义模型 * @param unknown_type $model */ function D($model) { return rc::D($model); }
ob_start(); set_time_limit(10); date_default_timezone_set('Asia/Shanghai'); error_reporting(IS_SERVER ? 0 : E_ALL ^ E_NOTICE); //线下测试 include_once RC_PATH_LIB . 'function.functions.php'; //公用函数 include_once RC_PATH_CFG . 'inc.base.php'; //装载配置文件 include_once RC_PATH_KEL . 'class.Odb.php'; //分布式DB include_once RC_PATH_LIB . 'cache/class.Ocache.php'; //data cache include_once RC_PATH_KEL . 'class.Cache.php'; //data cache include_once RC_PATH_KEL . 'class.rc.php'; //核心入口 include_once RC_PATH_LIB . 'class.Functions.php'; //公用函数 include_once RC_PATH_LIB . 'class.Image.php'; //图像处理类 rc::setConfig($construct); //开始初始化 define('EXT', '.php'); require_once RECHO_PHP . "Lib/Base/front.php"; require_once RECHO_PHP . 'Lib/Base/controller.php'; $front = FrontController::getInstance(); //initialization route if ($_REQUEST['act'] != 'xml') { @ob_start("ob_gzip"); }
static function setConfig($construct) { self::$construct = $construct; }
if (false && $lang == "sk") { $rc = new rc(); $rc->load($dir . "/src/Resources/TortoiseProcENG.rc"); $rc->Translate($native); $rc->report(); echo "<h2>Merge RC Check ({$lang})</h2>"; $rc = new rc(); $rc->load($dir . "/src/Resources/TortoiseMergeENG.rc"); $rc->Translate($native); $rc->report(); echo "<h2>Proc RC Check (EN)</h2>"; $rc = new rc(); $rc->load($dir . "/src/Resources/TortoiseProcENG.rc"); $rc->report(); echo "<h2>Merge RC Check (EN)</h2>"; $rc = new rc(); $rc->load($dir . "/src/Resources/TortoiseMergeENG.rc"); $rc->report(); //* / } else { echo "<p>RC checking is currently off for this language. If you like enable it for your translation drop me an email.</p>\n"; } } else { echo "<h1><font class=\"elerror\">Language not defined or not found !</font></h1>\n"; echo "producing .pot tests"; $pot->buildReport(); $pot->PrintReport(); } //* / echo '</div>'; echo '<div><center><hr/>Icons by: <a href="http://dryicons.com" class="link">DryIcons</a></center></div>';
public function get($name) { return rc::smarty()->getTemplateVars($name); }