如何判断项目是用哪个 CakePHP 版本制作的?

问题描述 投票:0回答:3

是否可以仅通过应用程序代码知道用于生成项目的CakePHP版本?


我的问题:

下载了一个用CakePHP做的工程,实在分不清用哪个Cake版本。文件说,例如

@version       $Revision: 8004 $
,但这在某些文件中是不同的。我是否应该假设最高版本 (8004) 是正确的版本?

好像是2008年左右的,估计是1.x版本吧

PD:这里是项目的代码。

php cakephp
3个回答
88
投票

我发现 CakePHP 2.3.0 的版本保存在根 Cake 库下的静态文件中。

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

27
投票

编辑core.php,添加到顶部:

echo Configure::version();

19
投票

对于 cakephp 3.x 查找 远藤

© www.soinside.com 2019 - 2024. All rights reserved.