I am writing a Magento extension and I just cannot get it to show up in the core resources table. I believe I am declaring the resources part of my config correctly. Can someone help me wrap my head around this? Thanks in advance!
<?xml version="1.0"?>
<config>
<modules>
<CTRL_Analytics>
<version>0.2.0</version>
</CTRL_Analytics>
</modules>
<global>
<blocks>
<analytics>
<class>CTRL_Analytics_Block</class>
</analytics>
</blocks>
<helpers>
<analytics>
<class>CTRL_Analytics_Helper</class>
</analytics>
</helpers>
<resources>
<analytics_setup>
<setup>
<module>CTRL_Analytics</module>
</setup>
<connection>
<use>co开发者_开发知识库re_setup</use>
</connection>
</analytics_setup>
<analytics_write>
<connection>
<use>core_write</use>
</connection>
</analytics_write>
<analytics_read>
<connection>
<use>core_read</use>
</connection>
</analytics_read>
</resources>
</global>
<adminhtml>
<menu>
<analytics translate="title" module="analytics">
<title>Marketing and Analytics</title>
<sort_order>100</sort_order>
<action>analytics/admin</action>
</analytics>
</menu>
</adminhtml>
<frontend>
<routers>
<CTRL_Analytics>
<use>standard</use>
<args>
<module>CTRL_Analytics</module>
<frontName>analytics</frontName>
</args>
</CTRL_Analytics>
</routers>
</frontend>
</config>
Looking at your XML, you're naming your installer file
"mysql4-install-0.1.0.php",
but your starting module version is
"<version>0.2.0</version>"
Try changing your starting version to
"<version>0.1.0</version>"
or changing your installer file to
"mysql4-install-0.2.0.php".
Those file version numbers come from your module version number.
I always drop an exit or exception into any new installer file to make sure PHP is trying to load the file. Information is written out to the core_resource table only after a successful execution of this file, an exit or exception will prevent that writing. This allows you to reload the page and have an installer run again and again until you get it right.
I had the same problem and took me a week (or made me lost a week!!!) to figure out why and it was dead simple.
Check the file and folder permissions. They're probably limited, change to read&write for both files and directories of your new extension, it'll work immediately. Does not have anything to do with the cache after all!!!
Firstly (and I'm sure you've done this), clear and disable all cache.
Secondly, check that you able to access the Blocks and Helpers. If not, it might be a problem with your app\etc\modules\CTRL_Analytics.xml
. Does the module show up in the Admin under System>Config>Advanced?
Thirdly, do you have your sql\analytics_setup\mysql4-install-0.1.0.php
and sql\analytics_setup\mysql4-upgrade-0.1.0-0.2.0.php
correctly named and coded. I've found the mysql upgrade naming convention has tripped up a lot of people in the past.
Finally, try putting your server into debug and setting a breakpoint inside the mysql4-install-0.1.0.php
to check whether the file is actually getting executed. It might be attempting to run but silently failing on an SQL error (hate that!).
Hope one of these helps! JD
精彩评论