Skip to content

Commit

Permalink
Project structure setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ianarundale committed Mar 21, 2013
1 parent 3e4b1e8 commit 0637949
Show file tree
Hide file tree
Showing 1,283 changed files with 145,114 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Kohana License Agreement

This license is a legal agreement between you and the Kohana Team for the use of Kohana Framework (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license.

Copyright (c) 2007-2011 Kohana Team
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the Kohana nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 changes: 19 additions & 0 deletions README 2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Kohana PHP Framework

[Kohana](http://kohanaframework.org/) is an elegant, open source, and object oriented HMVC framework built using PHP5, by a team of volunteers. It aims to be swift, secure, and small.

Released under a [BSD license](http://kohanaframework.org/license), Kohana can be used legally for any open source, commercial, or personal project.

## Documentation
Kohana's documentation can be found at <http://kohanaframework.org/documentation> which also contains an API browser.

The `userguide` module included in all Kohana releases also allows you to view the documentation locally. Once the `userguide` module is enabled in the bootstrap, it is accessible from your site via `/index.php/guide` (or just `/guide` if you are rewriting your URLs).

## Reporting bugs
If you've stumbled across a bug, please help us out by [reporting the bug](http://dev.kohanaframework.org/projects/kohana3/) you have found. Simply log in or register and submit a new issue, leaving as much information about the bug as possible, e.g.

* Steps to reproduce
* Expected result
* Actual result

This will help us to fix the bug as quickly as possible, and if you'd like to fix it yourself feel free to [fork us on GitHub](https://github.com/kohana) and submit a pull request!
129 changes: 129 additions & 0 deletions application/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php defined('SYSPATH') or die('No direct script access.');

// -- Environment setup --------------------------------------------------------

// Load the core Kohana class
require SYSPATH.'classes/Kohana/Core'.EXT;

if (is_file(APPPATH.'classes/Kohana'.EXT))
{
// Application extends the core
require APPPATH.'classes/Kohana'.EXT;
}
else
{
// Load empty core extension
require SYSPATH.'classes/Kohana'.EXT;
}

/**
* Set the default time zone.
*
* @link http://kohanaframework.org/guide/using.configuration
* @link http://www.php.net/manual/timezones
*/
date_default_timezone_set('America/Chicago');

/**
* Set the default locale.
*
* @link http://kohanaframework.org/guide/using.configuration
* @link http://www.php.net/manual/function.setlocale
*/
setlocale(LC_ALL, 'en_US.utf-8');

/**
* Enable the Kohana auto-loader.
*
* @link http://kohanaframework.org/guide/using.autoloading
* @link http://www.php.net/manual/function.spl-autoload-register
*/
spl_autoload_register(array('Kohana', 'auto_load'));

/**
* Optionally, you can enable a compatibility auto-loader for use with
* older modules that have not been updated for PSR-0.
*
* It is recommended to not enable this unless absolutely necessary.
*/
//spl_autoload_register(array('Kohana', 'auto_load_lowercase'));

/**
* Enable the Kohana auto-loader for unserialization.
*
* @link http://www.php.net/manual/function.spl-autoload-call
* @link http://www.php.net/manual/var.configuration#unserialize-callback-func
*/
ini_set('unserialize_callback_func', 'spl_autoload_call');

// -- Configuration and initialization -----------------------------------------

/**
* Set the default language
*/
I18n::lang('en-us');

/**
* Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied.
*
* Note: If you supply an invalid environment name, a PHP warning will be thrown
* saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>"
*/
if (isset($_SERVER['KOHANA_ENV']))
{
Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
}

/**
* Initialize Kohana, setting the default options.
*
* The following options are available:
*
* - string base_url path, and optionally domain, of your application NULL
* - string index_file name of your index file, usually "index.php" index.php
* - string charset internal character set used for input and output utf-8
* - string cache_dir set the internal cache directory APPPATH/cache
* - integer cache_life lifetime, in seconds, of items cached 60
* - boolean errors enable or disable error handling TRUE
* - boolean profile enable or disable internal profiling TRUE
* - boolean caching enable or disable internal caching FALSE
* - boolean expose set the X-Powered-By header FALSE
*/
Kohana::init(array(
'base_url' => '/kohana/',
));

/**
* Attach the file write to logging. Multiple writers are supported.
*/
Kohana::$log->attach(new Log_File(APPPATH.'logs'));

/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Config_File);

/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array(
// 'auth' => MODPATH.'auth', // Basic authentication
// 'cache' => MODPATH.'cache', // Caching with multiple backends
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
// 'database' => MODPATH.'database', // Database access
// 'image' => MODPATH.'image', // Image manipulation
// 'minion' => MODPATH.'minion', // CLI Tasks
// 'orm' => MODPATH.'orm', // Object Relationship Mapping
// 'unittest' => MODPATH.'unittest', // Unit testing
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
));

/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
10 changes: 10 additions & 0 deletions application/classes/Controller/Welcome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

public function action_index()
{
$this->response->body('hello, world!');
}

} // End Welcome
26 changes: 26 additions & 0 deletions application/logs/2012/03/26.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php defined('SYSPATH') or die('No direct script access.'); ?>

2012-03-26 09:13:53 --- ERROR: Kohana_Exception [ 0 ]: Attempted to load an invalid or missing module 'minion' at 'MODPATH/minion' ~ SYSPATH/classes/kohana/core.php [ 542 ]
2012-03-26 09:13:53 --- STRACE: Kohana_Exception [ 0 ]: Attempted to load an invalid or missing module 'minion' at 'MODPATH/minion' ~ SYSPATH/classes/kohana/core.php [ 542 ]
--
#0 /Volumes/Code/kohana/kohana-3.3/application/bootstrap.php(109): Kohana_Core::modules(Array)
#1 /Volumes/Code/kohana/kohana-3.3/index.php(102): require('/Volumes/Code/k...')
#2 {main}
2012-03-26 09:14:48 --- EMERGENCY: ErrorException [ 1 ]: Class 'CLI' not found ~ DOCROOT/index.php [ 109 ] in :
2012-03-26 09:14:48 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
2012-03-26 09:14:52 --- EMERGENCY: ErrorException [ 1 ]: Class 'CLI' not found ~ DOCROOT/index.php [ 109 ] in :
2012-03-26 09:14:52 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
2012-03-26 09:15:13 --- EMERGENCY: ErrorException [ 1 ]: Class 'CLI' not found ~ DOCROOT/index.php [ 109 ] in :
2012-03-26 09:15:13 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
2012-03-26 09:16:42 --- EMERGENCY: ErrorException [ 1 ]: Class 'Minion_Util' not found ~ MODPATH/minion/classes/Task/Help.php [ 20 ] in :
2012-03-26 09:16:42 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
2012-03-26 09:18:10 --- EMERGENCY: ErrorException [ 1 ]: Call to undefined method Minion_Task::compile_task_list() ~ MODPATH/minion/classes/Task/Help.php [ 20 ] in :
2012-03-26 09:18:10 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
2012-03-26 09:18:12 --- EMERGENCY: ErrorException [ 1 ]: Call to undefined method Minion_Task::compile_task_list() ~ MODPATH/minion/classes/Task/Help.php [ 20 ] in :
2012-03-26 09:18:12 --- ALERT: #0 [internal function]: Kohana_Core::shutdown_handler()
#1 {main} in :
19 changes: 19 additions & 0 deletions application/logs/2012/06/25.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php defined('SYSPATH') OR die('No direct script access.'); ?>

2012-06-25 14:45:57 --- EMERGENCY: Kohana_Exception [ 0 ]: Cannot create instances of abstract Controller_Template ~ SYSPATH/classes/Kohana/Request/Client/Internal.php [ 87 ] in /home/vagrant/web-app/kohana-3.3/system/classes/Kohana/Request/Client.php:114
2012-06-25 14:45:57 --- DEBUG: #0 /home/vagrant/web-app/kohana-3.3/system/classes/Kohana/Request/Client.php(114): Kohana_Request_Client_Internal->execute_request(Object(Mock_Request_92742025), Object(Response))
#1 /home/vagrant/web-app/kohana-3.3/system/tests/kohana/request/client/InternalTest.php(64): Kohana_Request_Client->execute(Object(Mock_Request_92742025))
#2 [internal function]: Kohana_Request_Client_InternalTest->test_response_failure_status('', 'Template', 'missing_action', 'kohana3/Templat...', 500)
#3 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestCase.php(738): ReflectionMethod->invokeArgs(Object(Kohana_Request_Client_InternalTest), Array)
#4 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestCase.php(628): PHPUnit_Framework_TestCase->runTest()
#5 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestResult.php(666): PHPUnit_Framework_TestCase->runBare()
#6 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestCase.php(576): PHPUnit_Framework_TestResult->run(Object(Kohana_Request_Client_InternalTest))
#7 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestSuite.php(757): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#8 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestSuite.php(733): PHPUnit_Framework_TestSuite->runTest(Object(Kohana_Request_Client_InternalTest), Object(PHPUnit_Framework_TestResult))
#9 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestSuite.php(693): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#10 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/Framework/TestSuite.php(693): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#11 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/TextUI/TestRunner.php(305): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#12 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/TextUI/Command.php(188): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#13 /home/vagrant/web-app/kohana-3.3/modules/unittest/vendor/phpunit/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#14 /home/vagrant/web-app/kohana-3.3/modules/unittest/phpunit(68): PHPUnit_TextUI_Command::main()
#15 {main} in /home/vagrant/web-app/kohana-3.3/system/classes/Kohana/Request/Client.php:114
Loading

0 comments on commit 0637949

Please sign in to comment.