Authored by hf

code review by fei.hong: do add couponxinshili huodong

Showing 30 changed files with 1438 additions and 0 deletions
<?php
/**
* 所有Controller控制器的基类
*
* @name HuodongAction
* @package library
* @copyright yoho.inc
* @version 1.0 (2015-11-27 14:40:21)
* @author fei.hong <fei.hong@yoho.cn>
*/
namespace Action;
use Yaf\Controller_Abstract;
use Yaf\Dispatcher;
use Yaf\Application;
use Plugin\Cache;
use Hood\Session;
use WebPlugin\Mobile;
class HuodongWebAction extends Controller_Abstract
{
/**
* HTTP请求对象
*
* @var object
*/
protected $_request;
/**
* 用户相关信息
*/
protected $_uid = 0;
protected $_uname = '';
/**
* 存放模板数据
*
* @var array
*/
protected $_data;
/**
* 是否是APP访问
*
* @var bool
*/
protected $_isApp;
/**
* 初始化
*/
public function init()
{
if (!$this->isAjax() && Mobile::isMobile()) {
echo 'ddd'; exit;
header("HTTP/1.1 301 Moved Permanently");
header('Location:http://huodong.m.yohobuy.com'.$_SERVER['REQUEST_URI']);
exit();
}
$this->_request = $this->getRequest();
$config = Application::app()->getConfig()->get('application');
if (isset($config->js->url)) {
$this->_view->assign('jsUrl', $config->js->url);
}
if (isset($config->css->url)) {
$this->_view->assign('cssUrl', $config->css->url);
}
if (isset($config->css->url)) {
$this->_view->assign('imgUrl', $config->img->url);
}
$this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid'));
}
/**
* 封装一下获取get参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function get($key = null, $default = null)
{
if (null === $key) {
return $_GET;
}
return $this->_request->getQuery($key, $default);
}
/**
* 封装一下获取post参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function post($key = null, $default = null)
{
if (null === $key) {
return $_POST;
}
return $this->_request->getPost($key, $default);
}
/**
* 封装一下获取YAF内部的参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function param($key, $default = null)
{
return $this->_request->getParam($key, $default);
}
/**
* 封装一下获取服务器的参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function server($key, $default = null)
{
return $this->_request->getServer($key, $default);
}
/**
* 关闭模板自动渲染
*
* @return void
*/
protected function disableView()
{
Dispatcher::getInstance()->autoRender(false);
}
/**
* 输出JSON数据到浏览器
*
* @return void
*/
protected function echoJson($json)
{
headers_sent() || header('Content-Type: application/json; charset=utf-8;');
if (is_array($json)) {
$json = json_encode($json);
}
echo $json;
}
/**
* 返回JSON数据
*
* @param int $code 状态编码
* @param string $message 提示信息
* @param mixed $data 数据内容
* @return json
*/
protected function returnJson($code, $message, $data)
{
return json_encode(array(
'code' => $code,
'message' => $message,
'data' => $data,
));
}
/**
* 判断是不是AJAX请求
*
* @return bool
*/
protected function isAjax()
{
return $this->_request->isXmlHttpRequest();
}
/**
* 跳转到错误页面
*/
protected function error()
{
headers_sent() || header('Location: /error.html');
exit();
}
/**
* 跳转到指定的URL
*
* @param string $url 链接地址
* @return void
*/
protected function go($url)
{
headers_sent() || header('Location: ' . $url);
exit();
}
/**
* 设置Cookie
*
* @param string $name cookie的名字
* @param string $value cookie的值
* @param integer $expire cookie过期时间
* @param integer $path cookie可用的路径
* @param string $domain cookie可用域名
*/
protected function setCookie($name, $value, $expire = 0, $path = '/', $domain = '.yohobuy.com')
{
setcookie($name, $value, $expire, $path, $domain);
}
/**
* 返回Cookie变量
*
* @param string $name cookie名称
* @param string $default 未获取到返回的默认值
* @return string 获取到的cookie值
*/
protected function getCookie($name, $default = '')
{
return $this->_request->getCookie($name, $default);
}
/**
* 设置缓存
*
* @param string $key 键名
* @param mixed $value 需要缓存的数据
* @param int $expire 缓存有效期(单位秒, 0表示永久)
* @return void
*/
protected function setCache($key, $value, $expire)
{
Cache::set($key, $value, $expire);
}
/**
* 获取缓存
*
* @param string $key 键名
* @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存
* @return mixed
*/
protected function getCache($key, $isMaster = true)
{
if ($isMaster) {
return Cache::get($key, 'master');
} else {
return Cache::get($key, 'slave');
}
}
/**
* 设置Session
*
* @param string $name 名称
* @param mixed $value 值
* @return void
*/
public function setSession($name, $value)
{
Session::start('yohobuy_session', null, 'yohobuy.com')->__set($name, $value);
}
/**
* 获取Session
*
* @param string $name 名称
*/
public function getSession($name)
{
return Session::start('yohobuy_session', null, 'yohobuy.com')->__get($name);
}
/**
* 获取当前登录的用户ID
*
* @return int
* @todo
*/
protected function getUid()
{
if (!$this->_uid) {
$cookie = $this->getCookie('_UID');
if (!empty($cookie)) {
$cookieList = explode('::', $cookie);
if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
$this->_uid = $cookieList[1];
$this->_uname = $cookieList[0];
}
}
}
return $this->_uid;
}
/**
* 获取客户端唯一标识
*
* @return string
*/
protected function getUdid()
{
$udid = '';
$realIP = $this->_request->getServer('HTTP_X_REAL_IP');
if ($realIP) {
$udid = md5($realIP);
} else {
$realIP = $this->_request->getServer('REMOTE_ADDR', '');
$udid = md5($realIP);
}
return $udid;
}
/*
* 设置网站SEO的标题
*
* @param string $title 标题
* @param string $sign 连接的字符串
* @param bool $showMore 是否显示更多内容
* @return void
*/
protected function setTitle($title, $showMore = true, $sign = ' | ')
{
$this->_view->assign('title_more', $showMore);
$this->_view->assign('title', $title . $sign);
}
/**
* 设置网站SEO的关键词
*
* @param string $keywords 关键词,多个之间用","逗号分隔
* @return void
*/
protected function setKeywords($keywords)
{
$this->_view->assign('keywords', rtrim($keywords, ',') . ',');
}
/**
* 设置网站SEO的描述内容
*
* @param string $description 描述内容
* @param string $sign 连接的字符串
* @param bool $showMore 是否显示更多内容
* @return void
*/
protected function setDescription($description, $showMore = true, $sign = ' ')
{
$this->_view->assign('description_more', $showMore);
$this->_view->assign('description', $description . $sign);
}
/**
* 设置最后修改时间
*
* @param string $modifiedTime 修改时间戳
* @param type $notModifiedExit 是否在没有修改时返回304状态
* @return void
*/
public static function setLastModified($modifiedTime, $notModifiedExit = true)
{
$modifiedTime = date('D, d M Y H:i:s ', $modifiedTime) . 'GMT';
if ($notModifiedExit && isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $modifiedTime == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
header('HTTP/1.1 304 Not Modified');
exit();
}
header('Last-Modified: ' . $modifiedTime);
}
/**
* 设置浏览器的缓存
*
* @param int $seconds 单位是秒
* @return void
*/
public static function setExpires($seconds = 180)
{
$time = date('D, d M Y H:i:s ', time() + $seconds) . 'GMT';
header('Expires: ' . $time);
}
}
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>{{staticTitle}}</title>
<link rel="stylesheet" href="{{staticFile}}/css/style.css">
</head>
<body>
<div class="main-wrap home">
<div class="header"></div>
<div class="coupon">
</div>
<a class="go" href="{{couponUrl}}">
去看看 <span class="arrow"></span>
</a>
<div class="share">
</div>
<a class="banner" href="{{banner.url}}">
<img src="{{banner.img}}">
</a>
<div class="footer">
</div>
</div>
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<div class="desc">
如多次领取失败,请联系客服人员<br>
带来不便敬请谅解
</div>
<a class="button" href="">
刷新
</a>
</div>
<div class="tip hide geted">
<div class="title">
你已领取过优惠券
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<script type="text/javascript" src="{{staticFile}}/js/libs.js"></script>
{{# staticJS}}
<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
{{/ staticJS}}
</body>
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>{{staticTitle}}</title>
<link rel="stylesheet" href="{{staticFile}}/css/style.css">
</head>
<body>
<div class="main-wrap home">
<div class="header"></div>
<div class="coupon">
</div>
<a class="go" href="{{couponUrl}}">
去看看 <span class="arrow"></span>
</a>
<div class="share">
</div>
<a class="banner" href="{{banner.url}}">
<img src="{{banner.img}}">
</a>
<div class="footer">
</div>
</div>
<div class="tip hide fail">
<div class="title">
领取失败<br>
请刷新重新领取
</div>
<div class="desc">
如多次领取失败,请联系客服人员<br>
带来不便敬请谅解
</div>
<a class="button" href="">
刷新
</a>
</div>
<div class="tip hide geted">
<div class="title">
你已领取过优惠券
</div>
<div class="sub-title">
快去分享给更多<br>
喜爱<span class="title">潮流</span>的小伙伴吧!
</div>
<a class="button close" href="">
返回
</a>
</div>
<script type="text/javascript" src="{{staticFile}}/js/libs.js"></script>
{{# staticJS}}
<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
{{/ staticJS}}
</body>
... ...
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
var _hmt = _hmt || [];
function async_load(){
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
}
window.addEventListener('load', async_load, false);
</script>
... ...
<?php
/**
* 启动运行
*
* @name Bootstrap
* @author fei.hong
* @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用,
* @see http://www.php.net/manual/en/class.yaf-bootstrap-abstract.php
* 这些方法, 都接受一个参数:Yaf_Dispatcher $dispatcher
* 调用的次序, 和申明的次序相同
*/
use Yaf\Bootstrap_Abstract;
use Yaf\Dispatcher;
use Yaf\Application;
use Yaf\Registry;
use Yaf\Loader;
use Yaf\Config;
use WebPlugin\TemplateLayout;
class Bootstrap extends Bootstrap_Abstract
{
private $_config;
/**
* 初始化配置
* @param Yaf_Dispatcher $dispatcher
*/
public function _initConfig(Dispatcher $dispatcher)
{
define('REQUEST_METHOD', strtoupper($dispatcher->getRequest()->getMethod()));
$this->_config = Application::app()->getConfig();
Registry::set('appConfig', $this->_config);
}
/**
* 初始化应用
* @param Yaf_Dispatcher $dispatcher
*/
public function _initApplication(Dispatcher $dispatcher)
{
defined('APPLICATION_SYSTEM_CONFIG') || define('APPLICATION_SYSTEM_CONFIG', $this->_config->application->servers->config);
if (APPLICATION_ENV !== 'production') {
error_reporting(E_ALL);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
}
Loader::getInstance()->registerLocalNameSpace(explode(',', $this->_config->application->namespaces));
}
// /**
// * 初始化插件
// * @param Yaf_Dispatcher $dispatcher
// */
// public function _initPlugin(Dispatcher $dispatcher)
// {
//
// }
/**
* 初始化路由
* @param Yaf_Dispatcher $dispatcher
*/
public function _initRoute(Dispatcher $dispatcher)
{
/* 根据对应模块的配置,添加相应的路由规则 */
$iniFile = APPLICATION_PATH . '/configs/routes.index.ini';
if (file_exists($iniFile)) {
$config = new Config\Ini($iniFile);
if (isset($config->routes)) {
$dispatcher->getRouter()->addConfig($config->routes);
}
}
}
/**
* 初始化Layout
* @param Yaf_Dispatcher $dispatcher
*/
public function _initLayout(Dispatcher $dispatcher)
{
// 关闭自动渲染模板
$dispatcher->autoRender(false);
// 判断到不是AJAX请求时, 使用自定义的模板渲染 (Mustache or Handlebars)
//if (!$dispatcher->getRequest()->isXmlHttpRequest()) {
$layout = new TemplateLayout();
$layout->setScriptPath($this->_config->application->template->path);
$dispatcher->setView($layout);
//}
}
// /**
// * 初始化第三方包
// * @param Dispatcher $dispatcher
// */
// public function _initPackage(Dispatcher $dispatcher)
// {
// if ($this->_config->composer->autoload == 1) {
// require $this->_config->composer->path . '/vendor/autoload.php';
// }
// }
}
... ...
<?php
/**
* 错误错误控制器
*
* @name ErrorController
* @desc 错误控制器, 在发生未捕获的异常时刻被调用
* @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
*/
use Action\AbstractAction;
class ErrorController extends AbstractAction
{
public function indexAction()
{
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
exit();
}
public function errorAction($exception)
{
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
exit();
}
}
... ...
<?php
use Action\AbstractAction;
/**
* 跳转
*/
class GoController extends AbstractAction
{
/**
* 跳转PC或WAP
*/
public function indexAction()
{
$pc = $this->get('pc', 'http://www.yohobuy.com');
$wap = $this->get('wap', 'http://m.yohobuy.com');
$pc = rawurldecode($pc);
$wap = rawurldecode($wap);
// 苹果设备
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
$this->go($wap);
}
// 苹果IPAD
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
$this->go($pc);
}
// 安卓设备
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'Android')) {
$this->go($wap);
}
// 其它
else {
$this->go($pc);
}
}
}
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 默认
*/
class IndexController extends AbstractAction
{
/**
* 首页
*/
public function indexAction()
{
exit();
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/3/2
* Time: 10:53
*/
namespace Cuxiao;
use LibModels\Wap\Cuxiao\ActivityData;
class GirldayModel
{
/**
* 获取领券活动结果
*
* @param int $uid 用户id
* @param int $actId 活动id
* @return array
*/
public static function getGirldayCoupon($uid, $actId)
{
$result = array('code' => 201);
do {
if (empty($uid) || empty($actId)) {
break;
}
$result = ActivityData::getCouponAll($uid, $actId);
if (!$result) {
$result = array('code' => 201);
break;
}
if (intval($result['code']) === 200) {
self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
}
} while (false);
return $result;
}
/**
* 发送站内信
*
* @param int $uid 用户ID
* @param string $title 站内信标题
* @param string $content 站内信内容
*/
private static function sendMessage($uid, $title, $content)
{
try {
ActivityData::message($uid, $title, $content);
} catch (Exception $e) {
// do nothing
}
}
}
\ No newline at end of file
... ...
<?php
namespace Cuxiao;
use LibModels\Wap\Cuxiao\ActivityData;
/**
* Created by PhpStorm.
* User: DELL
* Date: 2016/2/25
* Time: 15:29
*
* @name XinshiliModel
* @package models/Cuxiao
* @author Gtskk(tttt6399998@126.com)
*/
class XinshiliModel
{
/**
* 获取领券活动结果
*
* @param int $uid 用户id
* @param int $actId 活动id
* @return array
*/
public static function getXinshiliCoupon($uid, $actId)
{
$result = array('code' => 201);
do {
if (empty($uid) || empty($actId)) {
break;
}
$result = ActivityData::getCouponAll($uid, $actId);
if (!$result) {
$result = array('code' => 201);
break;
}
if (intval($result['code']) === 200) {
self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
}
} while (false);
return $result;
}
/**
* 发送站内信
*
* @param int $uid 用户ID
* @param string $title 站内信标题
* @param string $content 站内信内容
*/
private static function sendMessage($uid, $title, $content)
{
try {
ActivityData::message($uid, $title, $content);
} catch (Exception $e) {
// do nothing
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/3/2
* Time: 10:48
*/
use Action\HuodongAction;
use Cuxiao\GirldayModel;
use WebPlugin\Helpers;
/**
* 女生节活动领券-第二波
* @author Administrator
*/
class GirldayController extends HuodongAction
{
// const STATIC_FILE = 'http://localhost:2222/1.0.0';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili-2-web/1.0.0';
/**
* 检测登录状态
*
* @return int
*/
private function getLoggedUid()
{
if ($this->_isApp) {
$uid = $this->get('uid');
} else {
$uid = $this->getUid();
}
return $uid;
}
/**
* 判断是否登录
*/
private function checkLogin()
{
$url = Helpers::url('/cuxiao/girlday/index');
$uid = $this->getLoggedUid();
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $url), 'default'));
}
}
/**
* 根据环境来获取活动ID
*
* @return int
*/
private function getActivityId()
{
// 设置环境变量
switch (APPLICATION_ENV) {
case 'production': // 生产
return 528;
case 'preview': // 预览
case 'testing': // 测试
case 'develop': // 开发
default:
return 90;
}
}
/**
* 领券接口
*/
public function sendCouponAction()
{
$result = array('code' => 201);
do {
if (!$this->isAjax()) {
break;
}
$activityId = $this->getActivityId();
$uid = $this->getLoggedUid();
$result = GirldayModel::getGirldayCoupon($uid, $activityId);
} while (false);
$this->echoJson($result);
}
public function indexAction()
{
$this->checkLogin();
//获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
$myCouponUrl = Helpers::url('/home/coupons', null, 'default');
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】', // 标题
'staticFile' => self::STATIC_FILE,
'staticJS' => array(
'home.js'
),
'couponUrl' => $myCouponUrl, // 个人中心优惠券地址
'banner' => array(
'img' => '',
'url' => 'http://www.yohobuy.com/special_14548_0310PCHOME.html',
),
'selectUrl' => 'http://www.yohobuy.com/home/coupons',
));
}
}
... ...
<?php
use Action\HuodongWebAction;
use Cuxiao\XinshiliModel;
use WebPlugin\Helpers;
/**
* 新势力领券活动
*/
class XinshiliController extends HuodongWebAction
{
// const STATIC_FILE = 'http://localhost:2222/1.0.6';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili-web/1.0.6';
/**
* 检测登录状态
*
* @return int
*/
private function getLoggedUid()
{
if ($this->_isApp) {
$uid = $this->get('uid');
} else {
$uid = $this->getUid();
}
return $uid;
}
/**
* 判断是否登录
*/
private function checkLogin()
{
$playUrl = Helpers::url('/cuxiao/xinshili/index');
$uid = $this->getLoggedUid();
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
}
}
/**
* 领券活动页面控制器
*/
public function indexAction()
{
$this->checkLogin();
//获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
$myCouponUrl = Helpers::url('/home/coupons', null, 'default');
$this->_view->display('index', array(
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticFile' => self::STATIC_FILE,
'staticJS' => array(
'home.js'
),
'couponUrl' => $myCouponUrl, // 个人中心优惠券地址
'banner' => array(
'img' => 'http://img02.yohoboys.com/staticimg/2016/03/04/09/021a94b08418c4416785d37a47088aac58.jpg',
'url' => 'http://www.yohobuy.com/special_14444_0302PCHOME.html'
)
));
}
/**
* 领券接口
*/
public function sendCouponAction()
{
$result = array('code' => 201);
do {
if (!$this->isAjax()) {
break;
}
$activityId = $this->getActivityId();
$uid = $this->getLoggedUid();
$result = XinshiliModel::getXinshiliCoupon($uid, $activityId);
} while (false);
$this->echoJson($result);
}
/**
* 根据环境来获取活动ID
*
* @return int
*/
private function getActivityId()
{
// 设置环境变量
switch (APPLICATION_ENV) {
case 'production': // 生产
return 506;
case 'preview': // 预览
case 'testing': // 测试
case 'develop': // 开发
default:
return 506;
}
}
}
... ...
[common]
;;默认项目
application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;模块配置
application.modules = "Index,Cuxiao"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
application.view.ext = "phtml"
;;默认layouts
application.layout.path = APPLICATION_PATH "/application/layouts"
;;layouts 默认文件
application.layout.default = "default"
;;默认Controller
application.dispatcher.defaultController = "index"
;;默认Action
application.dispatcher.defaultAction = "index"
;;初始化命名空间
application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
;;使用composer
composer.autoload = 0
composer.path = APPLICATION_PATH "/library/Package"
yaf.use_namespace = 1
;;调试模式
[developer : common]
application.debug = True
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = True
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象 False
application.dispatcher.catchException = True
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
application.template.ext = ".phtml"
;静态HTML页面的存放目录, 该目录需要有读写权限
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.1"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
; 网站静态资源
application.js.url = "http://static.dev.yohobuy.com/huodong"
application.css.url = "http://static.dev.yohobuy.com/huodong"
application.img.url = "http://static.dev.yohobuy.com/huodong"
... ...
[common]
;;默认项目
application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index,Cuxiao"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
application.view.ext = "phtml"
;;默认layouts
application.layout.path = APPLICATION_PATH "/application/layouts"
;;layouts 默认文件
application.layout.default = "default"
;;默认Controller
application.dispatcher.defaultController = "index"
;;默认Action
application.dispatcher.defaultAction = "index"
;;初始化命名空间
application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
;;使用composer
composer.autoload = 0
composer.path = APPLICATION_PATH "/library/Package"
yaf.use_namespace = 1
;;调试模式
[preview : common]
application.debug = False
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = False
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象
application.dispatcher.catchException = False
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
application.template.ext = ".phtml"
;静态HTML页面的存放目录, 该目录需要有读写权限
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.1"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
; 网站静态资源
application.js.url = "http://buy.static.test.yoho.cn/huodong"
application.css.url = "http://buy.static.test.yoho.cn/huodong"
application.img.url = "http://buy.static.test.yoho.cn/huodong"
\ No newline at end of file
... ...
[common]
;;默认项目
application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index,Cuxiao"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
application.view.ext = "phtml"
;;默认layouts
application.layout.path = APPLICATION_PATH "/application/layouts"
;;layouts 默认文件
application.layout.default = "default"
;;默认Controller
application.dispatcher.defaultController = "index"
;;默认Action
application.dispatcher.defaultAction = "index"
;;初始化命名空间
application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
;;使用composer
composer.autoload = 0
composer.path = APPLICATION_PATH "/library/Package"
yaf.use_namespace = 1
;;调试模式
[production : common]
application.debug = False
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = False
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象
application.dispatcher.catchException = False
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
application.template.ext = ".phtml"
;静态HTML页面的存放目录, 该目录需要有读写权限
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.1"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
; 网站静态资源
application.js.url = "http://cdn.yoho.cn/huodong"
application.css.url = "http://cdn.yoho.cn/huodong"
application.img.url = "http://cdn.yoho.cn/huodong"
\ No newline at end of file
... ...
[common]
;;默认项目
application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index,Cuxiao"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
application.view.ext = "phtml"
;;默认layouts
application.layout.path = APPLICATION_PATH "/application/layouts"
;;layouts 默认文件
application.layout.default = "default"
;;默认Controller
application.dispatcher.defaultController = "index"
;;默认Action
application.dispatcher.defaultAction = "index"
;;初始化命名空间
application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
;;使用composer
composer.autoload = 0
composer.path = APPLICATION_PATH "/library/Package"
yaf.use_namespace = 1
;;调试模式
[testing : common]
application.debug = True
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = True
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象 False
application.dispatcher.catchException = True
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
application.template.ext = ".phtml"
;静态HTML页面的存放目录, 该目录需要有读写权限
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "0.0.1"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
; 网站静态资源
application.js.url = "http://static.buy.test.yoho.cn/huodong"
application.css.url = "http://static.buy.test.yoho.cn/huodong"
application.img.url = "http://static.buy.test.yoho.cn/huodong"
\ No newline at end of file
... ...
[memcached]
master.hosts = 127.0.0.1:11212,127.0.0.1:11213
slave.hosts = 127.0.0.1:11212,127.0.0.1:11213
session.hosts = 127.0.0.1:11212,127.0.0.1:11213
[redis]
servers.hosts = 192.168.1.168:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=127.0.0.1:11212,127.0.0.1:11213
slave.hosts=127.0.0.1:11212,127.0.0.1:11213
session.hosts=127.0.0.1:11212,127.0.0.1:11213
[redis]
servers.hosts = 127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=127.0.0.1:11212,127.0.0.1:11213
slave.hosts=127.0.0.1:11212,127.0.0.1:11213
session.hosts=127.0.0.1:11212,127.0.0.1:11213
[redis]
servers.hosts = 127.0.0.1:6379
\ No newline at end of file
... ...
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*.yohobuy.com" />
</cross-domain-policy>
\ No newline at end of file
... ...
No preview for this file type
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://huodong.pc.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.pc.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.pc.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
$application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
$application->bootstrap()->run();
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview');
$application = new Application(APPLICATION_PATH . '/configs/application.preview.ini');
$application->bootstrap()->run();
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing');
$application = new Application(APPLICATION_PATH . '/configs/application.testing.ini');
$application->bootstrap()->run();
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
$application = new Application(APPLICATION_PATH . '/configs/application.production.ini');
$application->bootstrap()->run();
... ...
User-agent: *
Disallow:
\ No newline at end of file
... ...