<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Upgrade ciext module to version 3.0.11
 *
 * @author Igor Ratsun
 */
class Ciext_upgrade_3_0_1 extends Abstract_upgrade
{

    public function up()
    {
        $file = APPPATH . 'config' . DIRECTORY_SEPARATOR . 'js_css.php';
        if (!file_exists($file)) {
            file_put_contents($file, $this->get_file_data());
        }

        return file_exists($file) ? '3.0.11' : '3.0.1';
    }

    public function down()
    {
        return '3.0.1';
    }

    protected function get_file_data()
    {
        return '<?php
defined(\'BASEPATH\') OR exit(\'No direct script access allowed\');

/**
 * Asynchronous scripts and styles loading
 */
$config[\'async_loading\'] = false;
/**
 * If set to true than all styles will be appended in the body
 */
$config[\'styles_to_body\'] = true;
/**
 * If set to true than all java scripts will be appended in the body
 */
$config[\'javascripts_to_body\'] = true;';
    }

}
