mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
89fbf1c8bf
Changing version number to 1.x.x.x, 0.10.x.x code base had been changed to the version number 1.x.x.x, and what was planned for 1.x.x.x code has now been moved to 2.x.x.x, and 2.x.x.x moved to 3.x.x.x. This will give us easier to track version numbers from now on. Revision: [2248] Merging changes from model_php5.php Revision: [2247] "Removing test code from view class" Revision: [2246] Removed cache time define from core.php. Modified the __() function in basics.php to echo string like it will in later versions of cake with translations. Refactored the cache checking in bootstrap.php to read the files embedded time stamp and delete or output the cached version. Added View::cacheView() for caching pages. Revision: [2245] Moving column formatting from DBO to Sanitize Revision: [2244] Adding beforeValidate() Model callback, and allowing query data to be modified in beforeFind() Revision: [2243] "Adding caching changes to Controller class " Revision: [2242] "Added check to delete cached version if it has expired" Revision: [2241] Adding app/cache/views directory Revision: [2240] "Fixed missing variable" Revision: [2239] "Adding full page caching to view class." Revision: [2238] "Adding defines for caching" Revision: [2237] "Adding caching check too bootstrap.php" Revision: [2236] Adding ClassRegistry::removeObject from Ticket #477 Revision: [2235] "Correcting setting in DATABASE_CONFIG class" Revision: [2231] Adding convenience function am(), which allows merging an infinite number of arrays merged into one Revision: [2207] Change Model::save() to call beforeSave() before validations Revision: [2199] Removing conditions method call in Model::field() Revision: [2196] Setting proper mime type again git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2250 3807eeeb-6ff5-0310-8944-8be069107fe0
153 lines
No EOL
3.1 KiB
PHP
153 lines
No EOL
3.1 KiB
PHP
<?php
|
|
/* SVN FILE: $Id$ */
|
|
|
|
/**
|
|
* Basic Cake functionality.
|
|
*
|
|
* Core functions for including other source files, loading models and so forth.
|
|
*
|
|
* PHP versions 4 and 5
|
|
*
|
|
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
|
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
* Las Vegas, Nevada 89104
|
|
*
|
|
* Licensed under The MIT License
|
|
* Redistributions of files must retain the above copyright notice.
|
|
*
|
|
* @filesource
|
|
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
|
* @package cake
|
|
* @subpackage cake.cake
|
|
* @since CakePHP v 0.2.9
|
|
* @version $Revision$
|
|
* @modifiedby $LastChangedBy$
|
|
* @lastmodified $Date$
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* Configuration, directory layout and standard libraries
|
|
*/
|
|
if(!isset($bootstrap))
|
|
{
|
|
require CORE_PATH.'cake'.DS.'basics.php';
|
|
require APP_PATH.'config'.DS.'core.php';
|
|
require CORE_PATH.'cake'.DS.'config'.DS.'paths.php';
|
|
}
|
|
require LIBS.'object.php';
|
|
require LIBS.'session.php';
|
|
require LIBS.'security.php';
|
|
require LIBS.'neat_array.php';
|
|
require LIBS.'inflector.php';
|
|
|
|
/**
|
|
* Enter description here...
|
|
*/
|
|
if (empty($uri) && defined('BASE_URL'))
|
|
{
|
|
$uri = setUri();
|
|
if ($uri === '/' || $uri === '/index.php' || $uri === '/app/')
|
|
{
|
|
$_GET['url'] = '/';
|
|
$url = '/';
|
|
}
|
|
else
|
|
{
|
|
$elements = explode('/index.php', $uri);
|
|
if(!empty($elements[1]))
|
|
{
|
|
$_GET['url'] = $elements[1];
|
|
$url = $elements[1];
|
|
}
|
|
else
|
|
{
|
|
$_GET['url'] = '/';
|
|
$url = '/';
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(empty($_GET['url']))
|
|
{
|
|
$url = null;
|
|
}
|
|
else
|
|
{
|
|
$url = $_GET['url'];
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if (strpos($url, 'ccss/') === 0)
|
|
{
|
|
include WWW_ROOT.DS.'css.php';
|
|
die();
|
|
}
|
|
|
|
|
|
if (DEBUG)
|
|
{
|
|
error_reporting(E_ALL);
|
|
|
|
if(function_exists('ini_set'))
|
|
{
|
|
ini_set('display_errors', 1);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
error_reporting(0);
|
|
}
|
|
|
|
$TIME_START = getMicrotime();
|
|
if(defined('CACHE_CHECK'))
|
|
{
|
|
if (empty($uri))
|
|
{
|
|
$uri = setUri();
|
|
}
|
|
|
|
$filename = CACHE.'views'.DS.str_replace('/', '_', $uri.'.php');
|
|
|
|
if (file_exists($filename))
|
|
{
|
|
ob_start();
|
|
include($filename);
|
|
if (DEBUG)
|
|
{
|
|
echo "<!-- Cached Render Time: ". round(getMicrotime() - $TIME_START, 4) ."s -->";
|
|
}
|
|
$out = ob_get_clean();
|
|
if (preg_match('/^<!--cachetime:(\\d+)-->/', $out, $match))
|
|
{
|
|
if(time() >= $match['1'])
|
|
{
|
|
@unlink($filename);
|
|
unset($out);
|
|
}
|
|
else
|
|
{
|
|
die(e($out));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
require CAKE.'dispatcher.php';
|
|
require LIBS.'model'.DS.'connection_manager.php';
|
|
|
|
config('database');
|
|
|
|
if (!class_exists('AppModel'))
|
|
{
|
|
require LIBS.'model'.DS.'model.php';
|
|
loadModels();
|
|
}
|
|
?>
|