0

following is my config file

<config>
    <modules>
        <Opco_Planner>
            <version>1.0.0.0</version>
        </Opco_Planner>
    </modules>
    <global>
        <models>
            <planner>
                <class>Opco_Planner_Model</class>
                <resourceModel>planner_resource</resourceModel>
            </planner>

            <planner_resource>
                <class>Opco_Planner_Model_Resource</class>
                <entities>
                    <theme>
                        <table>planner_theme</table>
                    </theme>
                </entities>
            </planner_resource>
        </models>
        <helpers>
            <planner>
                <class>opco_Planner_Helper</class>
            </planner>
        </helpers>
        <blocks>
            <planner>
                <class>opco_Planner_Block</class>
            </planner>
        </blocks>

        <resources>
            <planner_setup>
                <setup>
                    <module>Opco_Planner</module>
                    <class>Opco_Planner_Model_Resource_Setup</class>
                </setup>
            </planner_setup>
        </resources>

    </global>
    <frontend>
        <routers>
            <planner>
                <use>standard</use>
                <args>
                    <module>Opco_Planner</module>
                    <frontName>planner</frontName>
                </args>
            </planner>
        </routers>
    </frontend>
</config>

I named folder inside sql planner_setup under this folder I create install-1.0.0.0.php. so file path will opco/planner/sql/planner_setup/install-1.0.0.0.php. Installer file look like this

<?php

 echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
 die("Exit for now");

It does not echo any thing. Please help me its my second question. I also create setup file at location opco/planner/model/resource/setup.php but not success.

0

I think your script has already run. I am not sure, but I strongly believe echo wont work while installing script.

When you run the script, it would be wise to log, to check if it has worked. But remember if it runs smoothly, then this script wont run again. Have this on your install-1.0.0.php

<?php
    Mage::log('Installing script.', null, 'my_log.log');

This will create a file called my_log.log in your var/log folder.

What if the script has run already?

Go to your database and check core_resource table and then find planner_setup, now check version and data version part, if data version matches with your version then your script has already run, you need to run update script to run another script.

Just update <version>1.0.0.0</version> in your config.xml to 1.0.0.1 and then create another file in opco/planner/sql/planner_setup/update-1.0.0.0-1.0.0.1.php and have this content again.

<?php
    Mage::log('updating script.', null, 'my_log.log');

Good luck.

| improve this answer | |
  • Thanks yes it was running but I have another module config file look like having same problem I don't know its very strange response of magento. any ways thanks – Haris Khalique May 9 '16 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.