diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | core/config/config.php | 99 | ||||
-rw-r--r-- | core/controllers/welcome.php | 6 | ||||
-rw-r--r-- | index.php | 52 |
4 files changed, 161 insertions, 0 deletions
@@ -0,0 +1,4 @@ +Installation instructions: +* mkdir -p var/logs +* chmod -R 777 var + diff --git a/core/config/config.php b/core/config/config.php new file mode 100644 index 00000000..bd0d781b --- /dev/null +++ b/core/config/config.php @@ -0,0 +1,99 @@ +<?php defined('SYSPATH') or die('No direct script access.'); +/** + * Base path of the web site. If this includes a domain, eg: localhost/kohana/ + * then a full URL will be used, eg: http://localhost/kohana/. If it only includes + * the path, and a site_protocol is specified, the domain will be auto-detected. + */ +$config['site_domain'] = dirname($_SERVER['SCRIPT_NAME']); + +/** + * Force a default protocol to be used by the site. If no site_protocol is + * specified, then the current protocol is used, or when possible, only an + * absolute path (with no protocol/domain) is used. + */ +$config['site_protocol'] = ''; + +/** + * Name of the front controller for this application. Default: index.php + * + * This can be removed by using URL rewriting. + */ +$config['index_page'] = 'index.php?'; + +/** + * Fake file extension that will be added to all generated URLs. Example: .html + */ +$config['url_suffix'] = ''; + +/** + * Length of time of the internal cache in seconds. 0 or FALSE means no caching. + * The internal cache stores file paths and config entries across requests and + * can give significant speed improvements at the expense of delayed updating. + */ +$config['internal_cache'] = FALSE; + +/** + * Enable or disable gzip output compression. This can dramatically decrease + * server bandwidth usage, at the cost of slightly higher CPU usage. Set to + * the compression level (1-9) that you want to use, or FALSE to disable. + * + * Do not enable this option if you are using output compression in php.ini! + */ +$config['output_compression'] = FALSE; + +/** + * Enable or disable global XSS filtering of GET, POST, and SERVER data. This + * option also accepts a string to specify a specific XSS filtering tool. + */ +$config['global_xss_filtering'] = TRUE; + +/** + * Enable or disable hooks. Setting this option to TRUE will enable + * all hooks. By using an array of hook filenames, you can control + * which hooks are enabled. Setting this option to FALSE disables hooks. + */ +$config['enable_hooks'] = TRUE; + +/** + * Log thresholds: + * 0 - Disable logging + * 1 - Errors and exceptions + * 2 - Warnings + * 3 - Notices + * 4 - Debugging + */ +$config['log_threshold'] = 4; + +/** + * Message logging directory. + */ +$config['log_directory'] = VARPATH.'logs'; + +/** + * Enable or disable displaying of Kohana error pages. This will not affect + * logging. Turning this off will disable ALL error pages. + */ +$config['display_errors'] = TRUE; + +/** + * Enable or disable statistics in the final output. Stats are replaced via + * specific strings, such as {execution_time}. + * + * @see http://docs.kohanaphp.com/general/configuration + */ +$config['render_stats'] = TRUE; + +/** + * Filename prefixed used to determine extensions. For example, an + * extension to the Controller class would be named MY_Controller.php. + */ +$config['extension_prefix'] = 'MY_'; + +/** + * Additional resource paths, or "modules". Each path can either be absolute + * or relative to the docroot. Modules can include any resource that can exist + * in your application directory, configuration files, controllers, views, etc. + */ +$config['modules'] = array +( +); diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php new file mode 100644 index 00000000..d33fb295 --- /dev/null +++ b/core/controllers/welcome.php @@ -0,0 +1,6 @@ +<?php +class Welcome_Controller extends Controller { + public function index() { + print "<img src=http://www.gallery2.org/gallery2.png>"; + } +}
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 00000000..839fe876 --- /dev/null +++ b/index.php @@ -0,0 +1,52 @@ +<?php +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2008 Bharat Mediratta + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ + +// Set this to true to disable demo/debugging controllers +define('IN_PRODUCTION', true); + +// Gallery requires PHP 5.2+ +version_compare(PHP_VERSION, '5.2', '<') and exit('Gallery requires PHP 5.2 or newer.'); + +// Set the error reporting level. Use E_ALL unless you have a special need. +error_reporting(E_ALL); + +// Disabling display_errors will effectively disable Kohana error display +// and logging. You can turn off Kohana errors in application/config/config.php +ini_set('display_errors', true); + +define('EXT', '.php'); +define('DOCROOT', getcwd().DIRECTORY_SEPARATOR); +define('GALLERY', basename(__FILE__)); + +// If the front controller is a symlink, change to the real docroot +is_link(GALLERY) and chdir(dirname(realpath(__FILE__))); + +// Define application and system paths +define('APPPATH', realpath('core') . "/"); +define('VARPATH', realpath('var') . "/"); +define('MODPATH', realpath('modules') . "/"); +define('THEMEPATH', realpath('themes') . "/"); +define('SYSPATH', realpath('kohana') . "/"); + +// Override any settings here in index.local.php +file_exists('index.local.php') and include('index.local.php'); + +// Initialize. +require SYSPATH . 'core/Bootstrap' . EXT;
\ No newline at end of file |