I am trying to follow This tutorial, somewhat unsuccessfully!
I have got to the point where my script should display "Running This Upgrade: Myname_Weblog_Model_Resource_Setup Exit for now". This does not happen.
I believe it is something to do with my config file but looking though it I cannot work out what is wrong.
I have put a die statement into the setup.php file and that killed the script as expected. I then removed the die statement from setup.php and placed it into mysql4-install-0.1.0.php, this had no effect and the script continued on to render data from my controller.
I have added the code which I have been looking at to try and find the solution (as well as the full folder structure, hopefully its clear enough), could someone please advise me where the problem is or where else I should be looking to resolve this issue.
- Myname
- Weblog
- Model
- Resource
- Blogpost
- -Collection.php
- -Blogpost.php
- -Setup.php
- -Blogpost.php
- controllers
- -IndexController.php
- etc
- -config.xml
- sql
- weblog_setup
- -mysql4-install.0.1.0.php
Myname/Weblog/etc/config.xml
<config>
<modules>
<Tonysimpson_Weblog>
<version>0.1.0</version>
</Tonysimpson_Weblog>
</modules>
<global>
<models>
<weblog><!--group name, matches the module name-->
<class>Tonysimpson_Weblog_Model</class><!--Base name allmodels in the weblog group will have-->
<resourceModel>weblog_resource</resourceModel><!--indicagtes which resource model should be used-->
</weblog>
<weblog_resource>
<class>Tonysimpson_Weblog_Model_Resource</class>
<entities>
<blogpost>
<table>blog_posts</table>
</blogpost>
</entities>
</weblog_resource>
</models>
<resources>
<weblog_setup>
<setup>
<module>Tonysimpson_Weblog</module>
<class>Tonysimpson_Weblog_Model_Resource_Setup</class>
</setup>
</weblog_setup>
</resources>
</global>
<frontend>
<routers>
<weblog>
<use>standard</use>
<args>
<module>Tonysimpson_Weblog</module>
<frontName>weblog</frontName>
</args>
</weblog>
</routers>
</frontend>
MyName/Weblog/Model/Resource/Setup.php
class Tonysimpson_Weblog_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
{
}
Myname/Weblog/sql/weblog_setup/mysql4-install-0.1.0.php
echo 'running this upgrde: ' . get_class($this) . "\n <br /> \n";
die("exit for now");
core_resourcecontain an entry forweblog_setup? If so, delete it and try again. - Jürgen Thelen