Answers:
为此,我建议使用data您的一个自定义模块的文件夹。
假设该模块当前为version 1.0.4。      
创建data/[module]_setup/data-upgrade-1.0.4-1.0.5.php具有以下内容的文件:
编辑:更改文件名
$content = 'BLOCK CONTENT HERE';
//if you want one block for each store view, get the store collection
$stores = Mage::getModel('core/store')->getCollection()->addFieldToFilter('store_id', array('gt'=>0))->getAllIds();
//if you want one general block for all the store viwes, uncomment the line below
//$stores = array(0);
foreach ($stores as $store){
    $block = Mage::getModel('cms/block');
    $block->setTitle('Block title here');
    $block->setIdentifier('block_identifier_here');
    $block->setStores(array($store));
    $block->setIsActive(1);
    $block->setContent($content);
    $block->save();
}之后,只需更改版本config.xml即可1.0.5清除缓存并刷新任何页面。
Mage::app()->getStores()做同样的事情吗?
                    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$staticBlock = array(
                'title' => 'Test Block',
                'identifier' => 'test-block',                   
                'content' => 'Sample Test Block',
                'is_active' => 1,                   
                'stores' => array(0)
                );
Mage::getModel('cms/block')->setData($staticBlock)->save();来自:http : //blog.chapagain.com.np/magento-create-cms-page-static-block-programmatically/#sthash.1FYKYYhI.dpuf
代替使用sql文件夹,您应该在文件夹中放置任何修改CMS数据的安装脚本data。请参阅参考资料app/code/core/Mage/Cms/data/cms_setup。这些安装脚本会添加静态块和CMS页面。
要更改配置值,请使用以下代码:
$installer->setConfigData(
    Mage_Page_Model_Config::XML_PATH_CMS_LAYOUTS,
    'your_value_here'
);另外,这是一篇有用的文章
您还可以在升级脚本中使用以下代码:
$installer = $this;
/* @var $installer Mage_Core_Model_Resource_Setup */
$connection = $installer->getConnection();
/* @var $connection Varien_Db_Adapter_Pdo_Mysql */
$installer->startSetup();
$connection->insert($installer->getTable('cms/block'), array(
    'title'             => 'Footer Links',  
    'identifier'        => 'footer-links',
    'content'           => '<ul>\r\n<li><a href=\"{{store direct_url=\"about-magento-demo-store\"}}\">About Us</a></li>\r\n<li class=\"last\"><a href=\"{{store direct_url=\"customer-service\"}}\">Customer Service</a></li>\r\n</ul>',
    'creation_time'     => now(),
    'update_time'       => now(),
));
$connection->insert($installer->getTable('cms/block_store'), array(
    'block_id'   => $connection->lastInsertId(),
    'store_id'  => 0
));
$installer->endSetup();以下代码使用magento脚本创建和更新静态块
http://www.pearlbells.co.uk/how-to-create-and-update-the-static-blocks-using-magento-script/
function createBlock($blockData) {
$block = Mage::getModel('cms/block')->load($blockData['identifier']);
$block->setTitle($blockData['title']);
$block->setIdentifier($blockData['identifier']);
$block->setStores(array($blockData['storeId']));
$block->setIsActive($blockData['active']);
$block->setContent($blockData['content']);
$block->save();}