php 我目前使用的是哪个版本的 CodeIgniter?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2196799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 05:28:00  来源:igfitidea点击:

Which version of CodeIgniter am I currently using?

phpcodeigniter

提问by Dirk

Quick question.

快速提问。

Is there something similar to a phpinfo()- that would display the version for CodeIgniter?

是否有类似于 a phpinfo()- 的东西会显示 的版本CodeIgniter

Thanks.

谢谢。

回答by Colin Brock

Yes, the constantCI_VERSIONwill give you the current CodeIgniter version number. It's defined in: /system/codeigniter/CodeIgniter.phpAs of CodeIgniter 2, it's defined in /system/core/CodeIgniter.php

是的,该常量CI_VERSION将为您提供当前的 CodeIgniter 版本号。它定义在:/system/codeigniter/CodeIgniter.php从 CodeIgniter 2 开始,它定义在 /system/core/CodeIgniter.php

For example,

例如,

echo CI_VERSION; // echoes something like 1.7.1

回答by Timo

Look for definein system/core/CodeIgniter.php:

寻找definesystem/core/CodeIgniter.php

define('CI_VERSION', '3.1.8');

回答by Anish Rai

You should try :

你应该试试 :

<?php
echo CI_VERSION;
?>

Or check the file system/core/CodeIgniter.php

或者检查文件 system/core/CodeIgniter.php

回答by KISHOR PANT

you can easily find the current CodeIgniter version by

您可以通过以下方式轻松找到当前的 CodeIgniter 版本

echo CI_VERSION 


or you can navigate to System->core->codeigniter.php file and you can see the constant

/**
 * CodeIgniter Version
 *
 * @var string
 *
 */
    const CI_VERSION = '3.1.6';


回答by Creeperstanson

From a controller or view - use the following to display the version:

从控制器或视图 - 使用以下内容显示版本:

<?php
   echo CI_VERSION;
?>

回答by Nooha Haris

Please check the file "system/core/CodeIgniter.php". It is defined in const CI_VERSION = '3.1.10';

请检查文件“system/core/CodeIgniter.php”。它定义在const CI_VERSION = '3.1.10';

回答by Gilles Bossuyt

For CodeIgniter 4, use the following:

对于 CodeIgniter 4,使用以下内容:

<?php    
    echo \CodeIgniter\CodeIgniter::CI_VERSION;
?>