1
我有一个企业版的Magento模块,我创建时,当我最初设置它是所有工作,没有问题,所以永远没有问题,现在我已经回到它,Magento抛出一个(404没有找到2),在它工作正常之前,没有什么改变,权限没有代码,il在下面放下一些片段,但是存在一些基本的包信息,控制器不能在前端工作,但后端控制器没有错误地启动。Magento模块随机停止工作
包名称/命名空间:Jejamescycles
模块名称:金融
Codepool:社区
活动:真
第一个文件 - 应用程序/代码/社区/ Jejamescycles /金融/控制器/ IndexController.php
<?php
class Jejamescycles_Finance_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_sales`
(
`sales_id` INT(11) NOT NULL AUTO_INCREMENT,
`sales_reference` VARCHAR(50) NOT NULL UNIQUE,
`customer_id` INT(11) NOT NULL ,
`products` TEXT NOT NULL ,
`total_price` VARCHAR(255) NOT NULL ,
`status` VARCHAR(4) NOT NULL ,
PRIMARY KEY(`sales_id`)
)");
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'v12content'
)
->setTemplate('v12_finance/index.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
private function _getCustomerSession() {
Mage::getSingleton('core/session', array('name' => 'frontend'));
return Mage::getSingleton('customer/session');
}
function successAction()
{
$reference = $_GET['REF'];
$sales_reference = $_GET['SR'];
$status = $_GET['Status'];
$auth = $_GET['Auth'];
$conn = Mage::getSingleton('core/resource')->getConnection('core/read');
$confirmed = 0;
if($status == 'A' || $status == 'S')
{
$confirmed = 1;
}
try{
$conn->query("UPDATE `v12_finance_sales` SET `confirmed` = '$confirmed' , `status` = '$status' WHERE `sales_reference` = '$sales_reference'");
$this->loadLayout();
$this->renderLayout();
}catch(Exception $e)
{
$fh = fopen("FINANCE_LOG.log" , "a+");
fwrite($fh , "ERROR[" . date('H:i:s d-m-Y') . ']:EXCEPTION:' . $e->getMessage());
fclose($fh);
$conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_errors`
(
`error_id` int(11) not null AUTO_INCREMENT,
`sales_reference` VARCHAR(200) NOT NULL ,
`status` VARCHAR(4) NOT NULL ,
PRIMARY KEY(`error_id`)
)");
$conn->query("INSERT INTO `v12_finance_errors`
(
`sales_reference` ,
`status`
) VALUES (
'" . $sales_reference . "' ,
'$status'
)");
die("There was an error processing this request, please contact <a href='mailto:[email protected]'>Support</a> with this URL");
}
}
function basic_infoAction()
{
$conn = Mage::getSingleton('core/resource')->getConnection('core/read');
// $conn->query("ALTER TABLE `v12_finance_sales` ADD COLUMN `status` varchar(4) NOT NULL");
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
//not logged in
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/customer/account");
}else{
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'v12content'
)
->setTemplate('v12_finance/finance_setup.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
}
}
?>
和config.xml文件:
<config>
<!-- ... -->
<frontend>
<routers>
<!-- the <helloworld> tagname appears to be arbitrary, but by
convention is should match the frontName tag below-->
<jejamescycles_finance>
<use>standard</use>
<args>
<module>Jejamescycles_Finance</module>
<frontName>jejamescycles_finance</frontName>
</args>
</jejamescycles_finance>
</routers>
</frontend>
<global>
<helpers>
<finance>
<!-- Helper definition needed by Magento -->
<class>Jejamescycles_Finance_Helper</class>
</finance>
</helpers>
<blocks>
<jejamescycles_finance>
<class>Jejamescycles_Finance_Block</class>
</jejamescycles_finance>
</blocks>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<jejamescycles_finance before="Mage_Adminhtml">Jejamescycles_Finance_Adminhtml</jejamescycles_finance>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<!-- ... -->
</config>
没有环境变量发生了变化,该模块本身是独立的和犯规依赖于任何其它软件包,我想不出我的生活为什么它是不加工。我也检查了CMS页面,并没有url键的冲突。