php 如何检查codeigniter框架的版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41296529/
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-26 02:22:21  来源:igfitidea点击:

how to check version of codeigniter framework?

phpcodeigniter

提问by bansal kapil

I recently setup a old Codeigniter framework on my xampp.But i don't know the version of this framework. I use the code

我最近在我的 xampp 上设置了一个旧的 Codeigniter 框架。但我不知道这个框架的版本。我用代码

<?php echo CI_VERSION; ?> 

but its give me error

但它给了我错误

Notice: Use of undefined constant CI_VERSION - assumed 'CI_VERSION' in /opt/lampp/htdocs/projectname/views/v_header.php on line 57
CI_VERSION

Please guide me, I am new in Codeigniter.

请指导我,我是 Codeigniter 的新手。

回答by Hikmat Sijapati

See in system/core/CodeIgniter.phpand there is a constant like this..

看到system/core/CodeIgniter.php里面有一个这样的常数..

define('CI_VERSION', '3.0.6');

回答by RASEL RANA

You can check it two ways. one is to

您可以通过两种方式检查它。一种是

<?php echo CI_VERSION; ?>

Another way is go to your system/core/CodeIgniter.phppath and then check define('CI_VERSION', '2.1.4');

另一种方法是转到您的system/core/CodeIgniter.php路径,然后检查define('CI_VERSION', '2.1.4');

回答by paulc

In the root folder:

在根文件夹中:

cat system/core/CodeIgniter.php | grep CI_VERSION

cat system/core/CodeIgniter.php | grep CI_VERSION

回答by Linu S

check the file system/core/CodeIgniter.php

检查文件系统/core/CodeIgniter.php

回答by Deep Kakkar

Method 1:

方法一:

Please access the file

请访问文件

System >> Core >> Codeigniter.php

系统 >> 核心 >> Codeigniter.php

 /**
  * CodeIgniter Version
  *
  * @var    string
  *
  */
  define('CI_VERSION', '3.0.0');

Method 2:In index.php or any other view file write the following code of php as follows:

方法二:在 index.php 或其他视图文件中写入如下 php 代码:

 <?php
   echo CI_VERSION;
 ?>

CI_VERSION is build in constant in codeigniter, which contains value of version.

CI_VERSION 是内置于 codeigniter 中的常量,其中包含 version 的值。

Thank you!

谢谢!

回答by Rafiqul Islam

Try This:<?php echo CI_VERSION; ?> // echoes something like 3.1.6

尝试这个:<?php echo CI_VERSION; ?> // echoes something like 3.1.6

回答by Naga

Which means you are not properly configure your codeigniter project / system folder. System folder is not necessary to be placed in project root. you can place anywhere and configure the correct system path[something like $system_path = '../system';] in the index.php(project root) properly. It should work...

这意味着您没有正确配置您的 codeigniter 项目/系统文件夹。不需要将系统文件夹放在项目根目录中。您可以放置​​在任何地方并$system_path = '../system';在 index.php(项目根目录)中正确配置正确的系统路径[类似的东西]。它应该工作...