简体   繁体   English

将Codeigniter 1.7.1升级到3.6

[英]Upgrade Codeigniter 1.7.1 to 3.6

I need upgrade my website codeigniter to V 3.6 from V 1.7.1 , but I don't know where I can find the version 1.7.2 because that isn't in the repository. 我需要将我的网站codeigniter从V 1.7.1升级到V 3.6 ,但我不知道在哪里可以找到version 1.7.2因为它不在存储库中。

I use this user guide ( http://www.codeigniter.com/user_guide/installation/upgrading.html ) for upgrade but this is absolutely necessary to do all the steps 1.7.1 to 1.7.2, 1.7.2 to 2.0,... or can I do directly from version 1.7.1 to the last version 3.6 ? 我使用此用户指南( http://www.codeigniter.com/user_guide/installation/upgrading.html )进行升级,但这对于执行1.7.1 to 1.7.2, 1.7.2 to 2.0,...所有步骤是绝对必要的1.7.1 to 1.7.2, 1.7.2 to 2.0,...或者我可以直接从version 1.7.1last version 3.6吗?

Thanks! 谢谢!

Indeed, as cartalot said, you don't need to upgrade through each version, one by one. 事实上,正如卡塔洛特所说,你不需要逐个升级每个版本。 Just read all the instructions to upgrade between your version and the target one, and build a list of things to do, then you can execute that list on one go. 只需阅读您的版本和目标版本之间的所有升级说明 ,并构建要执行的操作列表,然后您就可以一次执行该列表。 Here are some of the things that I added to my list when upgrading from 1.7.2 to 3.1.3. 以下是我从1.7.2升级到3.1.3时添加到列表中的一些内容。

  • Add return parent::__get($prop); 添加return parent::__get($prop); to your _get magic methods (if you have them). 你的_get魔术方法(如果有的话)。

  • Replace $this->validation->error_string with validation_errors() validation_errors()替换$this->validation->error_string

  • Replace in views $this->validation->field_name with set_value('field_name') and set_select() , etc.. And add the value to be used to pre-populate each field. 使用set_value('field_name')set_select()等替换视图$this->validation->field_name 。并添加用于预填充每个字段的值。 But take in account that set_value() does not work if you don't run form_validation->run() first. 但请注意,如果您不首先运行form_validation->run() ,则set_value()不起作用。

  • When retrieving data: Replace $this->validation->field_name and $this->form_validation->field_name with $this->input->post('field_name') 检索数据时:将$this->validation->field_name$this->form_validation->field_name替换$this->input->post('field_name')

  • When setting data: Replace $this->form_validation->field_name with $this->form_validation->set_data($data); 设置数据时:将$this->form_validation->field_name替换$this->form_validation->field_name $this->form_validation->set_data($data);

  • Take in account that set_data($other_data) overwrites the content of $_POST , so you need to merge $other_data and $_POST . 考虑到set_data($other_data)覆盖$_POST的内容,因此您需要合并$other_data$_POST

Good luck, and just power through it!. 祝你好运,只需通过它!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM