storeid=''; if(!$_SERVER=='/api/v2_soap/?wsdl') { $lang = substr($_SERVER, 0, 2); switch ($lang) { case "fr": $storeid = 2; break; case "en": //echo "PAGE EN"; $storeid = 1; break; default: $storeid = 1; break; } } $mageRunCode = isset($_SERVER) ? $_SERVER : $storeid;...
Year: 2015
WordPress工作原理之程序文件执行顺序
WordPress工作原理之程序文件执行顺序(传说中的架构源码分析) 2014年10月13日 ⁄ WordPress教程 ⁄ 共 5236字 ⁄ 评论数 1 ⁄ 阅读 1,494 次 文章目录 第一步:加载index.php文件 第二步:加载wp-blog-header.php文件 第三步:加载wp-load.php文件(初始化) 第四步: 执行wp()函数(内容处理) 第五步:加载template-loader.php文件(主题应用) 在了解WordPress挂载机制时,一直有一个疑惑,到底是WordPress的内核源文件先执行还是主题文件里functions.php文件先执行。为了解决这个问题,想了解WordPress的工作原理,它是如何生成网页的,各程序文件的执行顺序是什么,于是有了这篇文章。 WordPress所有的前端页面生成都要经过根目录下的index.php文件(不是主题根目录),这是通过Web服务器的rewrite规则实现的。然后通过index.php文件一步步引导WordPress环境启动,再分析请求URL返回相应数据所组成的前台页面。以下将一步步分析源码文件,以此来了解WordPress整体框架及工作原理。 第一步:加载index.php文件 该文件有效源码如下: define('WP_USE_THEMES', true); # 定义是否加载主题文件,true为加载; require('./wp-blog-header.php'); # 加载wp-blog-header.php文件,该文件用于启动WordPress环境及模板; 第二步:加载wp-blog-header.php文件 该文件有效源码如下: 1 2 3 4 5 6...
delete order test
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_flat_creditmemo`; TRUNCATE `sales_flat_creditmemo_comment`; TRUNCATE `sales_flat_creditmemo_grid`; TRUNCATE `sales_flat_creditmemo_item`; TRUNCATE `sales_flat_invoice`; TRUNCATE `sales_flat_invoice_comment`; TRUNCATE `sales_flat_invoice_grid`; TRUNCATE `sales_flat_invoice_item`; TRUNCATE `sales_flat_order`; TRUNCATE `sales_flat_order_address`; TRUNCATE `sales_flat_order_grid`; TRUNCATE `sales_flat_order_item`; TRUNCATE `sales_flat_order_payment`; TRUNCATE `sales_flat_order_status_history`; TRUNCATE `sales_flat_quote`; TRUNCATE `sales_flat_quote_address`; TRUNCATE `sales_flat_quote_address_item`; TRUNCATE `sales_flat_quote_item`; TRUNCATE `sales_flat_quote_item_option`;...
Get rewritten product url in a different store
It was pointed out to me in one of the preceding articles that getting a product’s URL in a different store can get pretty complicated if the URL you want to get is rewritten. I decided to come up with...
4 Simple but Effective Ways to Improve Magento’s Performance
4 Simple but Effective Ways to Improve Magento’s Performance When Magento is not set up correctly, it will run slowly since it is a ‘heavy’ eCommerce CMS system. Even the most experienced web developers might miss the not so obvious...
add ssh in mac
user@localhost: ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/Users/user/.ssh/id_dsa): id_dsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_dsa. Your public key has...
magento check stock qty est out stock
$_product=Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple')); foreach($_product as $p) { $stock=Mage::getModel('cataloginventory/stock_item')->loadByProduct($p); if($stock->getIsInStock()==="0"&&$stock->getQty()>=1) { echo $p->getSku(); echo '<br/>'; echo $p->getId(); echo '<br/>'; } }
Zend Framework Database Query
Zend Framework Database Query Database Manipulation Create a controller Call / Create(Write) Database configuration setting Request data object creation Assign message (Success / Failure / Already exists) Create a view page to see the message or to redirect to the...
use zend adapter conncet exterme DB
$db = new Zend_Db_Adapter_Pdo_Mysql(array( 'host' => '174.142.90.89', 'username' => 'devleero_app', 'password' => 'app123', 'dbname' => 'devleero_vu_centerdata', 'profiler' => true, )); $profiler = $db->getProfiler(); $sql='select * from product_simple'; $data=$result = $db->fetchAssoc($sql);; $i=0; foreach($data as $d) { var_dump($d); $i++; } echo 'total:'.$i;
generate Data Center product to cvs (module verification)
SELECT di.sku,di.nom,di.couleur ,s.name as size, m.name_model as modele_nom , m.id_model as modele_id , ma.name as marque_nom ,ma.id_mark as marque_id,di.qty,di.sexe,prix,di.etiquette,di.combined_width, di.warranty,di.prescription FROM product_simple as di inner join models as m on m.name_model=di.modele_nom inner join mark as ma on ma.name = di.marque_nom...