是否可以知道用于生成仅具有应用程序代码的项目的CakePHP版本?
我的问题:
我下载了一个用CakePHP制作的项目,我真的说不出要使用的Cake版本.文件说,例如@version $Revision: 8004 $,但在某些文件中这是不同的.我应该假设最高版本(8004)是正确使用的吗?
它似乎是从2008年左右开始的,所以我猜它是一个1.x版本.
PD:这是项目的代码.
小智 75
我发现从CakePHP 2.3.0开始,该版本保存在根Cake lib下的静态文件中.
bash #: cat $CAKE_ROOT/lib/Cake/VERSION.txt
////////////////////////////////////////////////////////////////////////////////////////////////////
// +--------------------------------------------------------------------------------------------+ //
// CakePHP Version
//
// Holds a static string representing the current version of CakePHP
//
// CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
// Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
//
// Licensed under The MIT License
// Redistributions of files must retain the above copyright notice.
//
// @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
// @link http://cakephp.org
// @package cake.libs
// @since CakePHP(tm) v 0.2.9
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
2.3.0
Run Code Online (Sandbox Code Playgroud)
Cos*_*sta 24
编辑core.php,添加到顶部:
echo Configure::version();
Run Code Online (Sandbox Code Playgroud)
tar*_*l05 15
对于cakephp 3.x,找到\ vendor\cakephp\cakephp\VERSION.txt

////////////////////////////////////////////////////////////////////////////////////////////////////
// +--------------------------------------------------------------------------------------------+ //
// CakePHP Version
//
// Holds a static string representing the current version of CakePHP
//
// CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
// Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
//
// Licensed under The MIT License
// Redistributions of files must retain the above copyright notice.
//
// @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
// @link http://cakephp.org
// @since CakePHP(tm) v 0.2.9
// @license http://www.opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
3.3.2
Run Code Online (Sandbox Code Playgroud)
简单方法:只搜索VERSION.txt文件.打开它来检查版本.
version.txt的路径
对于cakephp 1.*:cake/VERSION.txt
对于cakephp 2.*:lib/Cake/VERSION.txt
对于cakephp 3.* :vendor/cakephp/cakephp/VERSION.txt