自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 收藏
  • 关注

转载 Magento 缓存机制简析

在知道缓存机制前,首先需要知道,Magento的路由机制,这边就不做赘述了,百度一大堆。下面一个简单的缓存生效流程:A:首先在页面开始时,Magento在app\code\core\Mage\Core\Model\App.php的run函数里//可以看到一个判断条件,根据请求地址,判断是否有缓存命中,若中,则直接返回缓存if ($this->_c...

2017-01-23 16:25:00 153

转载 magento优化之模板静态化

最近首页很慢,运行magento profile检查的时候,发现首页某个templat运行时间占了一半,大概6s。用magento自带的缓存,尝试把代码中的collection缓存起来,但不知道为啥一直失败,最后决定把整个template转成静态的页面,每两小时重新生成。代码如下:<?php$dir = Mage::getBaseDir().DS.'var'.D...

2016-12-22 08:32:00 166

转载 zabbix 安装小结

其实很简单的东西,结果折腾了好久。首先去官网 下个source,然后按照文档来 https://www.zabbix.com/documentation/3.2/manual/installation/install。下面说下遇到的问题:1.configure: error: Invalid Net-SNMP directory - unable to find net-snmp...

2016-11-30 15:37:00 131

转载 mysql ibd 文件过大问题

公司的数据库挂了查了下 ,每个表都有自己独立的表空间,有一张表的ibd 文件有好几G了。然后想要释放它。解决方案:第一种,删除表,然后重新建。drop table 操作自动回收表空间第二种,alter table tablename engin=innodb 。搞定转载于:https://www.cnblogs.com/cangzhou/p/5981454.h...

2016-10-20 16:43:00 3637

转载 magento性能分析插件

两个好用的插件:http://connect20.magentocommerce.com/community/MagnetoDebughttp://connect20.magentocommerce.com/community/dckap_speedanalyser当然也可以将 index.php的Varien_Profiler::enable();注释去掉转载于...

2016-08-01 15:58:00 113

转载 magento 自定义url路径 和 filter data 小结

背景是往一个第三方的搜索插件里面加入filter功能。首先是路径,插件自己定义了一个router,类似于cms。那首先说说router好了,从入口一路追查的话,会发现最后进入的是Mage_Core_Controller_Varien_Front类下面的dispatch()函数。 1 public function dispatch() 2 { 3 ...

2016-07-26 10:07:00 120

转载 magento layout xml 小结

基础概念: http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/调试方案函数:$this->getLayout()->getNode()->asXML();Mage::app()->getLayout()->getUpdate()->...

2016-07-15 16:16:00 95

转载 magento 开启 3D secure credit card validation

因为国外盗刷严重,于是得开启验证。首先可以去 https://developer.cardinalcommerce.com/try-it-now.shtml。这上面有测试账号,截图如下:这上面的信息填到 system/configuration/paymentServices/ 里面接着去paymentMethod 下配置paypal的credit card:...

2016-07-13 08:54:00 261

转载 magento package

Magento Local module file is relative to app/code/local/Magento Community module file is relative to app/code/community/Magento Core team module file is relative to app/code/core/Magento Us...

2016-06-20 16:47:00 55

转载 yii2 checkbox 的使用实例

使用的是Yii自带的Grid,在使用checkbox希望可以把选中行的id值传到我想要的页面。首先需要改变key值$dataProvider->key = 'ID';button: Html::button('<i class="glyphicon glyphicon-wrench"></i>', [ ...

2016-05-18 14:38:00 438

转载 yii2 设置多个入口文件

在web下希望加个core.php的后台入口,但因为权限问题,总是会跳转到index.php解决方案:在core.php 引用的配置文件main-core.php加入如下代码: 'components' => [ 'urlManager'=>[ 'showScriptName' => true, ...

2015-05-26 17:03:00 264

转载 composer 加快更新速度

一.使用代理set http_proxy=http://127.0.0.1:8087 //Windowsexport http_proxy=http://127.0.0.1:8087 //linux or Mac OS二. 使用中国镜像。http://pkg.phpcomposer.com/转载于:https://www.cnblogs.com/cang...

2015-05-19 15:28:00 90

转载 magento getMessage 不显示或者显示html标签解决方案

在模板页面不显示getMessage的解决方案是,在对应的控制器里加上如下代码:$this->_initLayoutMessages('customer/session'); 如果加入后出现如下图的bug则再加入如下代码$this->_initLayoutMessages('catalog/session');转载于:http...

2014-08-12 13:25:00 97

转载 magento 自建插件通道服务

首先建立如下的目录结构在channel.xml中如此写上<channel> <name>local</name> <uri>http://localhost/channel/</uri> <summary>local</summary></chann...

2014-08-05 16:46:00 96

转载 magento 获得当前产品页面的产品id

$product_id = Mage::registry('current_product')->getId();转载于:https://www.cnblogs.com/cangzhou/p/3874909.html

2014-07-29 10:28:00 119

转载 magento CURD操作

查询:$model = Mage::getModel('mynews/mynews'); $collection = $model->getCollection(); $collection->addAttributeToSelect(array('name', 'image', 'url_key')) //选择要select的属性  ->setPa...

2014-07-25 15:58:00 121

转载 magento 添加事件

首先是配置文件config.xml里的配置<checkout_cart_save_after> /*事件名字*/ <observers> <deal> /*模块名字*/ <class>deal/observe...

2014-07-07 17:10:00 93

转载 magento controller直接渲染Block 以及传参

class Jago_Deal_IndexController extends Mage_Core_Controller_Front_Action{ public function ajaxAction() { $block = $this->getLayout()->createBlock('deal/list')->...

2014-05-29 10:34:00 211

转载 magento 用程序生成优惠劵码

参考自http://fragmentedthought.com/fragments/programatically-creating-sales-rule-coupon-code上面的代码只能生成Coupon Code,却不能使用,需加入$coupon->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC...

2014-05-28 14:09:00 139

转载 magento getUrl函数跳转admin模块问题

在用以下代码时,跳转后的url里面会是空的,即没有admin这个值$this->getUrl('admin/catalog_product/edit', array('id' => $customerId));解决方案,将admin改成adminhtmlreturn $this->getUrl('adminhtml/catalog_product...

2014-05-28 10:24:00 93

转载 magento Grid 显示下拉菜单属性

在使用grid时自己新建了几个属性,然后其中有一个是下拉单,即deal_status protected function _prepareCollection() { $collection = Mage::getModel('catalog/product')->getCollection() ->addAtt...

2014-05-28 10:20:00 93

转载 magento 翻译使用实例

在自定义的模块中若想要使用翻译,需在config.xml中加入如下配置<config> <adminhtml> //后台 <translate> <modules> <Jago_translate> ...

2014-05-27 09:56:00 104

转载 magento后台开发学习笔记(入门实例向)

目的是做一个grid,参考博客http://www.sunzhenghua.com/magento-admin-module-development-part1-grid-forms-tabs-controllers,由于少了很多基础的配置,我便补充了一下一。开发的目录结构如下:Jago->Employee:第一步是建立module,在config....

2014-05-22 17:12:00 144

转载 magento “Model collection resource name is not defined” 错误

问题出现于使用Grid时,解决方案。在使用的Model处添加public function _construct() { parent::_construct(); $this->_init('employee/employee'); }其中init内的数值由下面的函数决定protected function _...

2014-05-22 13:41:00 178

转载 yii int

@echo offrem -------------------------------------------------------------rem Yii command line init script for Windows.remrem @author Qiang Xue <qiang.xue@gmail.com>rem @li...

2014-04-25 09:51:00 79

转载 yii框架下jquery在ajax更新后失效问题

解决方案,以live的形式重新绑定一次,/***回复隐藏收起效果***/ $(".btn-reply").live('click',function(event){ var data_id=$(event.target).attr('data-id'); $("[reply-id="+data_id+"]").toggle()...

2013-12-16 15:55:00 61

转载 mysql_workbeach 教程

http://blog.sina.com.cn/s/blog_5eacdffa0100ipvr.html转载于:https://www.cnblogs.com/cangzhou/p/3464738.html

2013-12-09 09:55:00 129

转载 腾讯微博模拟登录

最近比较懒,都不想写东西,嘛,良心发现还是写点什么好了。总之工作原因,需要弄这个,只能说企鹅娘的程序员都是折翼的天使啊,把我这种渣渣折腾死了。首先在输入账户的输入框中输完帐号后,页面的js就会向"http://check.ptlogin2.qq.com/check?regmaster=&uin=".$user."&appid=46000101&js_v...

2013-06-25 15:15:00 191

转载 firebug不能断点调试压缩后的js文件问题

想用firebug调试js,结果出来后是一行的,那个伤心遗憾啊,各种方法各种找,然后,找到了另一个插件Javascript Deminifier。搞定,只要把右下角JSD OFF 改成JSD ON firebug重新激活一下就可以了转载于:https://www.cnblogs.com/cangzhou/archive/2013/06/03/3115685.html...

2013-06-03 16:34:00 332

转载 php curl 实例

1转自phpchina 一个人的回答,又搜不到了。。。。 做模拟登录时火狐浏览器的Httpfox和Firebug两个插件真心好使啊,嗯,神器 2 3 4 /*------------------------简单的测试------------------------------------------------start*/ 5 /* 6 ...

2013-06-02 14:54:00 208

转载 php正则匹配 <div></div>

问题是正则直接读到末尾了,而我需要的只是到第一个</div>为止。<div class="proxylistitem"> <div style="float:left; display:block; width:630px;">       <span>...</span>      ...

2013-05-27 22:17:00 291

转载 将新浪接口created_at返回的字段化为date

纠结的很蛋疼 结果一步就出来了1 $date=date("Y 年 m 月 d 日 H 点 i 分 s 秒",strtotime("Sat Feb 04 09:36:27 +0800 2012"));呜呼 转载于:https://www.cnblogs.com/cangzhou/archive/2013/05/26/3099681.html...

2013-05-26 09:48:00 162

转载 apache2 子目录forbidden问题

  安装环境的时候是用apt-get的方式直接安装的。配置文件的地址是/etc/apache2/sites-enabled/000-default。  因而更改根目录的目录时候,便直接在<Directory >里修改了,就在根目录www里面创建了个文件夹first,在first里面的index是可以访问的,但是创建的image却一直无法访问。起初以为是apache2设置的...

2013-04-19 21:25:00 486

转载 U盘制作linux启动盘及系统安装

  装linux,可惜,过程相当不顺利,不过还是解决了,nice,做个记录。  首先是做启动盘的工具,网上搜了不少,最后是用UltraLSO,不过不知道为什么原来那个版本不能用,制作完之后,系统进不去,需要最新版的才可以,之后就是将ubuntu的镜像写入U盘就是了,版本是12.04的。(这一段耗时最长,好多工具用了,最后都进不去系统,难以理解啊)  之后是需要给linux腾出空间...

2013-04-15 21:58:00 95

转载 thinkphp中的时间自动填充问题

在玩thinkphp,结果就时间的自动填充问题纠结了好久。protected $_auto = array ( array ('date','time',1,'function'),);照着手册弄的,可是数据库显示的结果一直是0,折腾了好一会。改成下面那个也木有用。protected $_auto = array ( array...

2012-12-12 14:45:00 103

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除