| Server IP : 103.161.17.216 / Your IP : 216.73.216.1 Web Server : nginx/1.18.0 System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/app.houseland.info/application/migrations/ |
Upload File : |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Version_122 extends CI_Migration
{
function __construct()
{
parent::__construct();
}
public function up(){
if(file_exists(APPPATH.'controllers/update.php')){
@unlink(APPPATH.'controllers/update.php');
}
if (file_exists(APPPATH . 'views/themes/' . active_clients_theme() . '/views/stripe_payment.php')) {
@unlink(APPPATH . 'views/themes/' . active_clients_theme() . '/views/stripe_payment.php');
}
$this->db->query("CREATE TABLE IF NOT EXISTS `tblsessions` (
`id` varchar(40) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`timestamp` int(10) unsigned NOT NULL DEFAULT '0',
`data` blob NOT NULL,
KEY `ci_sessions_timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
$config_path = APPPATH . 'config/config.php';
$this->load->helper('file');
@chmod($config_path, FILE_WRITE_MODE);
$config_file = read_file($config_path);
$config_file = trim($config_file);
$config_file = str_replace("\$config['sess_driver'] = 'files';", "\$config['sess_driver'] = 'database';", $config_file);
$config_file = str_replace("\$config['sess_save_path'] = sys_get_temp_dir();", "\$config['sess_save_path'] = db_prefix().'sessions';", $config_file);
if (!$fp = fopen($config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) {
return FALSE;
}
flock($fp, LOCK_EX);
fwrite($fp, $config_file, strlen($config_file));
flock($fp, LOCK_UN);
fclose($fp);
@chmod($config_path, FILE_READ_MODE);
$this->db->query("ALTER TABLE `tblmilestones` ADD `description` TEXT NULL AFTER `name`;");
$this->db->query("ALTER TABLE `tblmilestones` ADD `description_visible_to_customer` BOOLEAN NULL DEFAULT FALSE AFTER `description`;");
$this->db->query("ALTER TABLE `tblestimates` ADD `project_id` INT NOT NULL DEFAULT '0' AFTER `clientid`;");
$this->db->query("ALTER TABLE `tblsalesattachments` CHANGE `file_name` `file_name` VARCHAR(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
$this->db->query("ALTER TABLE `tblcustomfields` ADD `allow_client_to_edit` INT NOT NULL DEFAULT '1' AFTER `show_on_client_portal`;");
$this->db->query("ALTER TABLE `tblcustomfields` CHANGE `allow_client_to_edit` `disalow_client_to_edit` INT(11) NOT NULL DEFAULT '0';");
$this->db->query("ALTER TABLE `tblinvoices` ADD `recurring_type` VARCHAR(10) NULL AFTER `recurring`, ADD `custom_recurring` BOOLEAN NOT NULL DEFAULT FALSE AFTER `recurring_type`;");
update_option('update_info_message', '<script>window.location.reload();</script>');
}
}