Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updating UG prototype

  • Loading branch information...
commit 075ff8f6fb87751916cf6a1bef840a71b48d7c1c 1 parent baed107
Todd authored
Showing with 6 additions and 26,258 deletions.
  1. +6 −0 .htaccess
  2. +0 −82 application/config/autoload.php
  3. +0 −332 application/config/config.php
  4. +0 −62 application/config/database.php
  5. +0 −14 application/config/hooks.php
  6. +0 −15 application/config/index.html
  7. +0 −104 application/config/mimes.php
  8. +0 −46 application/config/routes.php
  9. +0 −63 application/config/smileys.php
  10. +0 −107 application/config/user_agents.php
  11. +0 −15 application/controllers/index.html
  12. +0 −15 application/controllers/welcome.php
  13. +0 −35 application/errors/error_404.php
  14. +0 −34 application/errors/error_db.php
  15. +0 −34 application/errors/error_general.php
  16. +0 −10 application/errors/error_php.php
  17. +0 −15 application/errors/index.html
  18. +0 −15 application/helpers/index.html
  19. +0 −15 application/hooks/index.html
  20. +0 −15 application/index.html
  21. +0 −15 application/libraries/index.html
  22. +0 −15 application/logs/index.html
  23. +0 −15 application/models/index.html
  24. +0 −15 application/plugins/index.html
  25. +0 −15 application/views/index.html
  26. +0 −62 application/views/welcome_message.php
  27. +0 −15 system/cache/index.html
  28. +0 −152 system/database/DB.php
  29. +0 −940 system/database/DB_active_rec.php
  30. +0 −201 system/database/DB_cache.php
  31. +0 −1,058 system/database/DB_driver.php
  32. +0 −297 system/database/DB_result.php
  33. +0 −459 system/database/DB_utility.php
  34. +0 −15 system/database/index.html
  35. +0 −15 system/fonts/index.html
  36. BIN  system/fonts/texb.ttf
  37. +0 −78 system/helpers/array_helper.php
  38. +0 −133 system/helpers/cookie_helper.php
  39. +0 −522 system/helpers/date_helper.php
  40. +0 −74 system/helpers/directory_helper.php
  41. +0 −103 system/helpers/download_helper.php
  42. +0 −186 system/helpers/file_helper.php
  43. +0 −418 system/helpers/form_helper.php
  44. +0 −211 system/helpers/html_helper.php
  45. +0 −15 system/helpers/index.html
  46. +0 −160 system/helpers/inflector_helper.php
  47. +0 −119 system/helpers/security_helper.php
  48. +0 −172 system/helpers/smiley_helper.php
  49. +0 −165 system/helpers/string_helper.php
  50. +0 −404 system/helpers/text_helper.php
  51. +0 −528 system/helpers/typography_helper.php
  52. +0 −499 system/helpers/url_helper.php
  53. +0 −60 system/helpers/xml_helper.php
  54. +0 −15 system/index.html
  55. +0 −73 system/kohana/Base4.php
  56. +0 −59 system/kohana/Base5.php
  57. +0 −266 system/kohana/Common.php
  58. +0 −277 system/kohana/Kohana.php
  59. +0 −15 system/kohana/index.html
  60. +0 −15 system/language/index.html
  61. +0 −118 system/libraries/Benchmark.php
  62. +0 −482 system/libraries/Calendar.php
  63. +0 −244 system/libraries/Config.php
  64. +0 −122 system/libraries/Controller.php
  65. +0 −1,659 system/libraries/Email.php
  66. +0 −404 system/libraries/Encrypt.php
  67. +0 −177 system/libraries/Exceptions.php
  68. +0 −623 system/libraries/Ftp.php
  69. +0 −230 system/libraries/Hooks.php
  70. +0 −1,534 system/libraries/Image_lib.php
  71. +0 −730 system/libraries/Input.php
  72. +0 −128 system/libraries/Language.php
  73. +0 −1,002 system/libraries/Loader.php
  74. +0 −125 system/libraries/Log.php
  75. +0 −89 system/libraries/Model.php
  76. +0 −369 system/libraries/Output.php
  77. +0 −218 system/libraries/Pagination.php
  78. +0 −178 system/libraries/Parser.php
  79. +0 −221 system/libraries/Profiler.php
  80. +0 −558 system/libraries/Router.php
  81. +0 −522 system/libraries/Session.php
  82. +0 −256 system/libraries/Sha1.php
  83. +0 −446 system/libraries/Table.php
  84. +0 −535 system/libraries/Trackback.php
  85. +0 −355 system/libraries/URI.php
  86. +0 −338 system/libraries/Unit_test.php
  87. +0 −815 system/libraries/Upload.php
  88. +0 −507 system/libraries/User_agent.php
  89. +0 −788 system/libraries/Validation.php
  90. +0 −1,419 system/libraries/Xmlrpc.php
  91. +0 −509 system/libraries/Xmlrpcs.php
  92. +0 −380 system/libraries/Zip.php
  93. +0 −15 system/libraries/index.html
  94. +0 −351 system/plugins/captcha_pi.php
  95. +0 −15 system/plugins/index.html
  96. +0 −610 system/plugins/js_calendar_pi.php
  97. +0 −287 system/scaffolding/Scaffolding.php
  98. +0 −15 system/scaffolding/index.html
6 .htaccess
View
@@ -0,0 +1,6 @@
+RewriteEngine On
+
+RewriteBase /user_guide
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php/$1 [L]
82 application/config/autoload.php
View
@@ -1,82 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------
-| AUTO-LOADER
-| -------------------------------------------------------------------
-| This file specifies which systems should be loaded by default.
-|
-| In order to keep the framework as light-weight as possible only the
-| absolute minimal resources are loaded by default. For example,
-| the database is not connected to automatically since no assumption
-| is made regarding whether you intend to use it. This file lets
-| you globally define which systems you would like loaded with every
-| request.
-|
-| -------------------------------------------------------------------
-| Instructions
-| -------------------------------------------------------------------
-|
-| These are the things you can load automatically:
-|
-| 1. Libraries
-| 2. Helper files
-| 3. Plugins
-| 4. Custom config files
-|
-*/
-
-/*
-| -------------------------------------------------------------------
-| Auto-load Libraries
-| -------------------------------------------------------------------
-| These are the classes located in the system/libraries folder
-| or in your application/libraries folder.
-|
-| Prototype:
-|
-| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
-*/
-
-$autoload['libraries'] = array();
-
-
-/*
-| -------------------------------------------------------------------
-| Auto-load Helper Files
-| -------------------------------------------------------------------
-| Prototype:
-|
-| $autoload['helper'] = array('url', 'file');
-*/
-
-$autoload['helper'] = array();
-
-
-/*
-| -------------------------------------------------------------------
-| Auto-load Plugins
-| -------------------------------------------------------------------
-| Prototype:
-|
-| $autoload['plugin'] = array('captcha', 'js_calendar');
-*/
-
-$autoload['plugin'] = array();
-
-
-/*
-| -------------------------------------------------------------------
-| Auto-load Config files
-| -------------------------------------------------------------------
-| Prototype:
-|
-| $autoload['config'] = array('config1', 'config2');
-|
-| NOTE: This item is intended for use ONLY if you have created custom
-| config files. Otherwise, leave it blank.
-|
-*/
-
-$autoload['config'] = array();
-
-?>
332 application/config/config.php
View
@@ -1,332 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-
-/*
-|--------------------------------------------------------------------------
-| Base Site URL
-|--------------------------------------------------------------------------
-|
-| URL to your Kohana root. Typically this will be your base URL,
-| WITH a trailing slash:
-|
-| http://www.your-site.com/
-|
-*/
-$config['base_url'] = 'http://127.0.0.1/Kohana/';
-
-/*
-|--------------------------------------------------------------------------
-| Index File
-|--------------------------------------------------------------------------
-|
-| Typically this will be your index.php file, unless you've renamed it to
-| something else. If you are using mod_rewrite to remove the page set this
-| variable so that it is blank.
-|
-*/
-$config['index_page'] = 'index.php';
-
-/*
-|--------------------------------------------------------------------------
-| URI PROTOCOL
-|--------------------------------------------------------------------------
-|
-| This item determines which server global should be used to retrieve the
-| URI string. The default setting of "AUTO" works for most servers.
-| If your links do not seem to work, try one of the other delicious flavors:
-|
-| 'AUTO' Default - auto detects
-| 'PATH_INFO' Uses the PATH_INFO
-| 'QUERY_STRING' Uses the QUERY_STRING
-| 'REQUEST_URI' Uses the REQUEST_URI
-| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
-|
-*/
-$config['uri_protocol'] = 'AUTO';
-
-/*
-|--------------------------------------------------------------------------
-| URL suffix
-|--------------------------------------------------------------------------
-|
-| This option allows you to add a suffix to all URLs generated by Kohana.
-| For more information please see the user guide:
-|
-| http://www.codeigniter.com/user_guide/general/urls.html
-*/
-
-$config['url_suffix'] = '';
-
-/*
-|--------------------------------------------------------------------------
-| Active Record
-|--------------------------------------------------------------------------
-|
-| This option disables active record capability in the database when set to TRUE
-| If you have no need for active record interaction, you can save some CPU cycles
-| by disabling it.
-|
-| http://codeigniter.com/user_guide/database/active_record.html
-*/
-$config['disable_ar'] = FALSE;
-
-/*
-|--------------------------------------------------------------------------
-| Default Language
-|--------------------------------------------------------------------------
-|
-| This determines which set of language files should be used. Make sure
-| there is an available translation if you intend to use something other
-| than english.
-|
-*/
-$config['language'] = 'english';
-
-
-/*
-|--------------------------------------------------------------------------
-| Enable/Disable System Hooks
-|--------------------------------------------------------------------------
-|
-| If you would like to use the "hooks" feature you must enable it by
-| setting this variable to TRUE (boolean). See the user guide for details.
-|
-*/
-$config['enable_hooks'] = FALSE;
-
-
-/*
-|--------------------------------------------------------------------------
-| Class Extension Prefix
-|--------------------------------------------------------------------------
-|
-| This item allows you to set the filename/classname prefix when extending
-| native libraries. For more information please see the user guide:
-|
-| http://www.codeigniter.com/user_guide/general/core_classes.html
-| http://www.codeigniter.com/user_guide/general/creating_libraries.html
-|
-*/
-$config['subclass_prefix'] = 'MY_';
-
-
-/*
-|--------------------------------------------------------------------------
-| Allowed URL Characters
-|--------------------------------------------------------------------------
-|
-| This lets you specify which characters are permitted within your URLs.
-| When someone tries to submit a URL with disallowed characters they will
-| get a warning message.
-|
-| As a security measure you are STRONGLY encouraged to restrict URLs to
-| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
-|
-| Leave blank to allow all characters -- but only if you are insane.
-|
-| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
-|
-*/
-$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
-
-
-/*
-|--------------------------------------------------------------------------
-| ENABLE GET
-|--------------------------------------------------------------------------
-|
-| This option will enable $this->input->get('key') and $_GET['key'], but
-| will allow you to continue using segment based URLs, unlike the
-| 'enable_query_strings' option, which will disable segment based URLs.
-|
-| Options are: TRUE or FALSE (default)
-|
-| NOTE: When enabling GET, you should set your the uri_protocol option
-| to PATH_INFO, ORIG_PATH_INFO, or REQUEST_URI.
-|
-*/
-$config['enable_get_requests'] = FALSE;
-
-
-/*
-|--------------------------------------------------------------------------
-| Enable Query Strings
-|--------------------------------------------------------------------------
-|
-| By default Kohana uses search-engine friendly segment based URLs:
-| www.your-site.com/who/what/where/
-|
-| You can optionally enable standard query string based URLs:
-| www.your-site.com?who=me&what=something&where=here
-|
-| Options are: TRUE or FALSE (boolean)
-|
-| The two other items let you set the query string "words" that will
-| invoke your controllers and its functions:
-| www.your-site.com/index.php?c=controller&m=function
-|
-| Please note that some of the helpers won't work as expected when
-| this feature is enabled, since Kohana is designed primarily to
-| use segment based URLs.
-|
-*/
-$config['enable_query_strings'] = FALSE;
-$config['controller_trigger'] = 'c';
-$config['function_trigger'] = 'm';
-
-/*
-|--------------------------------------------------------------------------
-| Error Logging Threshold
-|--------------------------------------------------------------------------
-|
-| If you have enabled error logging, you can set an error threshold to
-| determine what gets logged. Threshold options are:
-| You can enable error logging by setting a threshold over zero. The
-| threshold determines what gets logged. Threshold options are:
-|
-| 0 = Disables logging, Error logging TURNED OFF
-| 1 = Error Messages (including PHP errors)
-| 2 = Debug Messages
-| 3 = Informational Messages
-| 4 = All Messages
-|
-| For a live site you'll usually only enable Errors (1) to be logged otherwise
-| your log files will fill up very fast.
-|
-*/
-$config['log_threshold'] = 0;
-
-/*
-|--------------------------------------------------------------------------
-| Error Logging Directory Path
-|--------------------------------------------------------------------------
-|
-| Leave this BLANK unless you would like to set something other than the default
-| application/logs/ folder. Use a full server path with trailing slash.
-|
-*/
-$config['log_path'] = '';
-
-/*
-|--------------------------------------------------------------------------
-| Date Format for Logs
-|--------------------------------------------------------------------------
-|
-| Each item that is logged has an associated date. You can use PHP date
-| codes to set your own date formatting
-|
-*/
-$config['log_date_format'] = 'Y-m-d H:i:s';
-
-/*
-|--------------------------------------------------------------------------
-| Cache Directory Path
-|--------------------------------------------------------------------------
-|
-| Leave this BLANK unless you would like to set something other than the default
-| system/cache/ folder. Use a full server path with trailing slash.
-|
-*/
-$config['cache_path'] = '';
-
-/*
-|--------------------------------------------------------------------------
-| Encryption Key
-|--------------------------------------------------------------------------
-|
-| If you use the Encryption class or the Sessions class with encryption
-| enabled you MUST set an encryption key. See the user guide for info.
-|
-*/
-$config['encryption_key'] = '';
-
-/*
-|--------------------------------------------------------------------------
-| Session Variables
-|--------------------------------------------------------------------------
-|
-| 'session_cookie_name' = the name you want for the cookie
-| 'encrypt_sess_cookie' = TRUE/FALSE (boolean). Whether to encrypt the cookie
-| 'session_expiration' = the number of SECONDS you want the session to last.
-| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
-|
-*/
-$config['sess_cookie_name'] = 'kohana_session';
-$config['sess_expiration'] = 7200;
-$config['sess_encrypt_cookie'] = FALSE;
-$config['sess_use_database'] = FALSE;
-$config['sess_table_name'] = 'kohana_sessions';
-$config['sess_match_ip'] = FALSE;
-$config['sess_match_useragent'] = TRUE;
-
-/*
-|--------------------------------------------------------------------------
-| Cookie Related Variables
-|--------------------------------------------------------------------------
-|
-| 'cookie_prefix' = Set a prefix if you need to avoid collisions
-| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
-| 'cookie_path' = Typically will be a forward slash
-|
-*/
-$config['cookie_prefix'] = '';
-$config['cookie_domain'] = '';
-$config['cookie_path'] = '/';
-
-/*
-|--------------------------------------------------------------------------
-| Global XSS Filtering
-|--------------------------------------------------------------------------
-|
-| Determines whether the XSS filter is always active when GET, POST or
-| COOKIE data is encountered
-|
-*/
-$config['global_xss_filtering'] = FALSE;
-
-/*
-|--------------------------------------------------------------------------
-| Output Compression
-|--------------------------------------------------------------------------
-|
-| Enables Gzip output compression for faster page loads. When enabled,
-| the output class will test whether your server supports Gzip.
-| Even if it does, however, not all browsers support compression
-| so enable only if you are reasonably sure your visitors can handle it.
-|
-| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
-| means you are prematurely outputting something to your browser. It could
-| even be a line of whitespace at the end of one of your scripts. For
-| compression to work, nothing can be sent before the output buffer is called
-| by the output class. Do not "echo" any values with compression enabled.
-|
-*/
-$config['compress_output'] = FALSE;
-
-/*
-|--------------------------------------------------------------------------
-| Master Time Reference
-|--------------------------------------------------------------------------
-|
-| Options are "local" or "gmt". This pref tells the system whether to use
-| your server's local time as the master "now" reference, or convert it to
-| GMT. See the "date helper" page of the user guide for information
-| regarding date handling.
-|
-*/
-$config['time_reference'] = 'local';
-
-
-/*
-|--------------------------------------------------------------------------
-| Rewrite PHP Short Tags
-|--------------------------------------------------------------------------
-|
-| If your PHP installation does not have short tag support enabled CI
-| can rewrite the tags on-the-fly, enabling you to utilize that syntax
-| in your view files. Options are TRUE or FALSE (boolean)
-|
-*/
-$config['rewrite_short_tags'] = FALSE;
-
-
-?>
62 application/config/database.php
View
@@ -1,62 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------
-| DATABASE CONNECTIVITY SETTINGS
-| -------------------------------------------------------------------
-| This file will contain the settings needed to access your database.
-|
-| For complete instructions please consult the 'Database Connection'
-| page of the User Guide.
-|
-| -------------------------------------------------------------------
-| AUTHENTICATION
-| -------------------------------------------------------------------
-|
-| There are two methods to provide database authentication/selection,
-| the array method, and the DSN (Data Source Name) method.
-|
-| Array Method:
-| -------------------------------------------------------------------
-| ['hostname'] The hostname of your database server.
-| ['username'] The username used to connect to the database
-| ['password'] The password used to connect to the database
-| ['database'] The name of the database you want to connect to
-| ['dbdriver'] The database type. ie: mysql. Currently supported:
-| mysql, mysqli, postgre, odbc, mssql, oci8
-|
-| DSN Method:
-| -------------------------------------------------------------------
-| ['database'] DSN formatted connection string
-| example: dbdriver://username:password@hostname/database
-| example: postgre://root:root@localhost/test
-|
-| -------------------------------------------------------------------
-| EXPLANATION OF VARIABLES
-| -------------------------------------------------------------------
-| ['dbprefix'] You can add an optional prefix, which will be added
-| to the table name when using the Active Record class
-| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
-| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
-| ['cache_on'] TRUE/FALSE - Enables/disables query caching
-| ['cachedir'] The path to the folder where cache files should be stored
-|
-| The $active_group variable lets you choose which connection group to
-| make active. By default there is only one group (the 'default' group).
-|
-*/
-
-$active_group = 'default';
-
-$db['default']['hostname'] = 'localhost';
-$db['default']['username'] = 'root';
-$db['default']['password'] = 'pass';
-$db['default']['database'] = 'test';
-$db['default']['dbdriver'] = 'mysql';
-$db['default']['dbprefix'] = '';
-$db['default']['pconnect'] = TRUE;
-$db['default']['db_debug'] = TRUE;
-$db['default']['cache_on'] = FALSE;
-$db['default']['cachedir'] = '';
-$db['default']['charset'] = '';
-
-?>
14 application/config/hooks.php
View
@@ -1,14 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------------
-| Hooks
-| -------------------------------------------------------------------------
-| This file lets you define "hooks" to extend Kohana without hacking the core
-| files. Please see the user guide for info:
-|
-| http://kohanaphp.com/user_guide/general/hooks.html
-|
-*/
-
-
-?>
15 application/config/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
104 application/config/mimes.php
View
@@ -1,104 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------
-| MIME TYPES
-| -------------------------------------------------------------------
-| This file contains an array of mime types. It is used by the
-| Upload class to help identify allowed file types.
-|
-*/
-
-$mimes = array
-(
- 'hqx' => 'application/mac-binhex40',
- 'cpt' => 'application/mac-compactpro',
- 'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel'),
- 'bin' => 'application/macbinary',
- 'dms' => 'application/octet-stream',
- 'lha' => 'application/octet-stream',
- 'lzh' => 'application/octet-stream',
- 'exe' => 'application/octet-stream',
- 'class' => 'application/octet-stream',
- 'psd' => 'application/x-photoshop',
- 'so' => 'application/octet-stream',
- 'sea' => 'application/octet-stream',
- 'dll' => 'application/octet-stream',
- 'oda' => 'application/oda',
- 'pdf' => array('application/pdf', 'application/x-download'),
- 'ai' => 'application/postscript',
- 'eps' => 'application/postscript',
- 'ps' => 'application/postscript',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'mif' => 'application/vnd.mif',
- 'xls' => array('application/excel', 'application/vnd.ms-excel'),
- 'ppt' => 'application/powerpoint',
- 'wbxml' => 'application/wbxml',
- 'wmlc' => 'application/wmlc',
- 'dcr' => 'application/x-director',
- 'dir' => 'application/x-director',
- 'dxr' => 'application/x-director',
- 'dvi' => 'application/x-dvi',
- 'gtar' => 'application/x-gtar',
- 'gz' => 'application/x-gzip',
- 'php' => 'application/x-httpd-php',
- 'php4' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'phtml' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'js' => 'application/x-javascript',
- 'swf' => 'application/x-shockwave-flash',
- 'sit' => 'application/x-stuffit',
- 'tar' => 'application/x-tar',
- 'tgz' => 'application/x-tar',
- 'xhtml' => 'application/xhtml+xml',
- 'xht' => 'application/xhtml+xml',
- 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mpga' => 'audio/mpeg',
- 'mp2' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'aif' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'ram' => 'audio/x-pn-realaudio',
- 'rm' => 'audio/x-pn-realaudio',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'ra' => 'audio/x-realaudio',
- 'rv' => 'video/vnd.rn-realvideo',
- 'wav' => 'audio/x-wav',
- 'bmp' => 'image/bmp',
- 'gif' => 'image/gif',
- 'jpeg' => array('image/jpeg', 'image/pjpeg'),
- 'jpg' => array('image/jpeg', 'image/pjpeg'),
- 'jpe' => array('image/jpeg', 'image/pjpeg'),
- 'png' => array('image/png', 'image/x-png'),
- 'tiff' => 'image/tiff',
- 'tif' => 'image/tiff',
- 'css' => 'text/css',
- 'html' => 'text/html',
- 'htm' => 'text/html',
- 'shtml' => 'text/html',
- 'txt' => 'text/plain',
- 'text' => 'text/plain',
- 'log' => array('text/plain', 'text/x-log'),
- 'rtx' => 'text/richtext',
- 'rtf' => 'text/rtf',
- 'xml' => 'text/xml',
- 'xsl' => 'text/xml',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpe' => 'video/mpeg',
- 'qt' => 'video/quicktime',
- 'mov' => 'video/quicktime',
- 'avi' => 'video/x-msvideo',
- 'movie' => 'video/x-sgi-movie',
- 'doc' => 'application/msword',
- 'word' => array('application/msword', 'application/octet-stream'),
- 'xl' => 'application/excel',
- 'eml' => 'message/rfc822'
-);
-
-
-?>
46 application/config/routes.php
View
@@ -1,46 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------------
-| URI ROUTING
-| -------------------------------------------------------------------------
-| This file lets you re-map URI requests to specific controller functions.
-|
-| Typically there is a one-to-one relationship between a URL string
-| and its corresponding controller class/method. The segments in a
-| URL normally follow this pattern:
-|
-| www.your-site.com/class/method/id/
-|
-| In some instances, however, you may want to remap this relationship
-| so that a different class/function is called than the one
-| corresponding to the URL.
-|
-| Please see the user guide for complete details:
-|
-| http://kohanaphp.com/user_guide/general/routing.html
-|
-| -------------------------------------------------------------------------
-| RESERVED ROUTES
-| -------------------------------------------------------------------------
-|
-| There are two reserved routes:
-|
-| $route['default_controller'] = 'welcome';
-|
-| This route indicates which controller class should be loaded if the
-| URI contains no data. In the above example, the "welcome" class
-| would be loaded.
-|
-| $route['scaffolding_trigger'] = 'scaffolding';
-|
-| This route lets you set a "secret" word that will trigger the
-| scaffolding feature for added security. Note: Scaffolding must be
-| enabled in the controller in which you intend to use it. The reserved
-| routes must come before any wildcard or regular expression routes.
-|
-*/
-
-$route['default_controller'] = 'welcome';
-$route['scaffolding_trigger'] = '';
-
-?>
63 application/config/smileys.php
View
@@ -1,63 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/*
-| -------------------------------------------------------------------
-| SMILEYS
-| -------------------------------------------------------------------
-| This file contains an array of smileys for use with the emoticon helper.
-| Individual images can be used to replace multiple simileys. For example:
-| :-) and :) use the same image replacement.
-|
-| Please see user guide for more info:
-| http://kohanaphp.com/user_guide/helpers/smiley_helper.html
-|
-*/
-
-$smileys = array(
-
-// smiley image name width height alt
- ':-)' => array('grin.gif', '19', '19', 'grin'),
- ':lol:' => array('lol.gif', '19', '19', 'LOL'),
- ':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
- ':)' => array('smile.gif', '19', '19', 'smile'),
- ';-)' => array('wink.gif', '19', '19', 'wink'),
- ';)' => array('wink.gif', '19', '19', 'wink'),
- ':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
- ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
- ':-S' => array('confused.gif', '19', '19', 'confused'),
- ':wow:' => array('surprise.gif', '19', '19', 'surprised'),
- ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
- ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
- '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
- ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
- ':P' => array('rasberry.gif', '19', '19', 'rasberry'),
- ':blank:' => array('blank.gif', '19', '19', 'blank stare'),
- ':long:' => array('longface.gif', '19', '19', 'long face'),
- ':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
- ':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
- ':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
- '8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
- ':down:' => array('downer.gif', '19', '19', 'downer'),
- ':red:' => array('embarrassed.gif', '19', '19', 'red face'),
- ':sick:' => array('sick.gif', '19', '19', 'sick'),
- ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
- ':-/' => array('hmm.gif', '19', '19', 'hmmm'),
- '>:(' => array('mad.gif', '19', '19', 'mad'),
- ':mad:' => array('mad.gif', '19', '19', 'mad'),
- '>:-(' => array('angry.gif', '19', '19', 'angry'),
- ':angry:' => array('angry.gif', '19', '19', 'angry'),
- ':zip:' => array('zip.gif', '19', '19', 'zipper'),
- ':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
- ':ahhh:' => array('shock.gif', '19', '19', 'shock'),
- ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
- ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
- ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
- ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
- ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
- ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
- ':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
- ':snake:' => array('snake.gif', '19', '19', 'snake'),
- ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'),
- ':question:' => array('question.gif', '19', '19', 'question')
-);
-
-?>
107 application/config/user_agents.php
View
@@ -1,107 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-
-/*
-| -------------------------------------------------------------------
-| USER AGENT TYPES
-| -------------------------------------------------------------------
-| This file contains four arrays of user agent data. It is used by the
-| User Agent Class to help identify browser, platform, robot, and
-| mobile device data. The array keys are used to identify the device
-| and the array values are used to set the actual name of the item.
-|
-*/
-
-$platforms = array
-(
- 'windows nt 6.0' => 'Windows Longhorn',
- 'windows nt 5.2' => 'Windows 2003',
- 'windows nt 5.0' => 'Windows 2000',
- 'windows nt 5.1' => 'Windows XP',
- 'windows nt 4.0' => 'Windows NT 4.0',
- 'winnt4.0' => 'Windows NT 4.0',
- 'winnt 4.0' => 'Windows NT',
- 'winnt' => 'Windows NT',
- 'windows 98' => 'Windows 98',
- 'win98' => 'Windows 98',
- 'windows 95' => 'Windows 95',
- 'win95' => 'Windows 95',
- 'windows' => 'Unknown Windows OS',
- 'os x' => 'Mac OS X',
- 'ppc mac' => 'Power PC Mac',
- 'freebsd' => 'FreeBSD',
- 'ppc' => 'Macintosh',
- 'linux' => 'Linux',
- 'debian' => 'Debian',
- 'sunos' => 'Sun Solaris',
- 'beos' => 'BeOS',
- 'apachebench' => 'ApacheBench',
- 'aix' => 'AIX',
- 'irix' => 'Irix',
- 'osf' => 'DEC OSF',
- 'hp-ux' => 'HP-UX',
- 'netbsd' => 'NetBSD',
- 'bsdi' => 'BSDi',
- 'openbsd' => 'OpenBSD',
- 'gnu' => 'GNU/Linux',
- 'unix' => 'Unknown Unix OS'
-);
-
-
-// The order of this array should NOT be changed. Many browsers return
-// multiple browser types so we want to identify the sub-type first.
-$browsers = array
-(
- 'Opera' => 'Opera',
- 'MSIE' => 'Internet Explorer',
- 'Internet Explorer' => 'Internet Explorer',
- 'Shiira' => 'Shiira',
- 'Firefox' => 'Firefox',
- 'Chimera' => 'Chimera',
- 'Phoenix' => 'Phoenix',
- 'Firebird' => 'Firebird',
- 'Camino' => 'Camino',
- 'Netscape' => 'Netscape',
- 'OmniWeb' => 'OmniWeb',
- 'Mozilla' => 'Mozilla',
- 'Safari' => 'Safari',
- 'Konqueror' => 'Konqueror',
- 'icab' => 'iCab',
- 'Lynx' => 'Lynx',
- 'Links' => 'Links',
- 'hotjava' => 'HotJava',
- 'amaya' => 'Amaya',
- 'IBrowse' => 'IBrowse'
-);
-
-$mobiles = array
-(
- 'mobileexplorer' => 'Mobile Explorer',
- 'openwave' => 'Open Wave',
- 'opera mini' => 'Opera Mini',
- 'operamini' => 'Opera Mini',
- 'elaine' => 'Palm',
- 'palmsource' => 'Palm',
- 'digital paths' => 'Palm',
- 'avantgo' => 'Avantgo',
- 'xiino' => 'Xiino',
- 'palmscape' => 'Palmscape',
- 'nokia' => 'Nokia',
- 'ericsson' => 'Ericsson',
- 'blackBerry' => 'BlackBerry',
- 'motorola' => 'Motorola'
-);
-
-// There are hundreds of bots but these are the most common.
-$robots = array
-(
- 'googlebot' => 'Googlebot',
- 'msnbot' => 'MSNBot',
- 'slurp' => 'Inktomi Slurp',
- 'yahoo' => 'Yahoo',
- 'askjeeves' => 'AskJeeves',
- 'fastcrawler' => 'FastCrawler',
- 'infoseek' => 'InfoSeek Robot 1.0',
- 'lycos' => 'Lycos'
-);
-
-?>
15 application/controllers/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/controllers/welcome.php
View
@@ -1,15 +0,0 @@
-<?php
-
-class Welcome extends Controller {
-
- function Welcome()
- {
- parent::Controller();
- }
-
- function index()
- {
- $this->load->view('welcome_message');
- }
-}
-?>
35 application/errors/error_404.php
View
@@ -1,35 +0,0 @@
-<?php header("HTTP/1.1 404 Not Found"); ?>
-<html>
-<head>
-<title>404 Page Not Found</title>
-<style type="text/css">
-
-body {
-background-color: #fff;
-margin: 40px;
-font-family: Lucida Grande, Verdana, Sans-serif;
-font-size: 12px;
-color: #000;
-}
-
-#content {
-border: #999 1px solid;
-background-color: #fff;
-padding: 20px 20px 12px 20px;
-}
-
-h1 {
-font-weight: normal;
-font-size: 14px;
-color: #990000;
-margin: 0 0 4px 0;
-}
-</style>
-</head>
-<body>
- <div id="content">
- <h1><?php echo $heading; ?></h1>
- <?php echo $message; ?>
- </div>
-</body>
-</html>
34 application/errors/error_db.php
View
@@ -1,34 +0,0 @@
-<html>
-<head>
-<title>Database Error</title>
-<style type="text/css">
-
-body {
-background-color: #fff;
-margin: 40px;
-font-family: Lucida Grande, Verdana, Sans-serif;
-font-size: 12px;
-color: #000;
-}
-
-#content {
-border: #999 1px solid;
-background-color: #fff;
-padding: 20px 20px 12px 20px;
-}
-
-h1 {
-font-weight: normal;
-font-size: 14px;
-color: #990000;
-margin: 0 0 4px 0;
-}
-</style>
-</head>
-<body>
- <div id="content">
- <h1><?php echo $heading; ?></h1>
- <?php echo $message; ?>
- </div>
-</body>
-</html>
34 application/errors/error_general.php
View
@@ -1,34 +0,0 @@
-<html>
-<head>
-<title>Error</title>
-<style type="text/css">
-
-body {
-background-color: #fff;
-margin: 40px;
-font-family: Lucida Grande, Verdana, Sans-serif;
-font-size: 12px;
-color: #000;
-}
-
-#content {
-border: #999 1px solid;
-background-color: #fff;
-padding: 20px 20px 12px 20px;
-}
-
-h1 {
-font-weight: normal;
-font-size: 14px;
-color: #990000;
-margin: 0 0 4px 0;
-}
-</style>
-</head>
-<body>
- <div id="content">
- <h1><?php echo $heading; ?></h1>
- <?php echo $message; ?>
- </div>
-</body>
-</html>
10 application/errors/error_php.php
View
@@ -1,10 +0,0 @@
-<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
-
-<h4>A PHP Error was encountered</h4>
-
-<p>Severity: <?php echo $severity; ?></p>
-<p>Message: <?php echo $message; ?></p>
-<p>Filename: <?php echo $filepath; ?></p>
-<p>Line Number: <?php echo $line; ?></p>
-
-</div>
15 application/errors/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/helpers/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/hooks/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/libraries/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/logs/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/models/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/plugins/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
15 application/views/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
62 application/views/welcome_message.php
View
@@ -1,62 +0,0 @@
-<html>
-<head>
-<title>Welcome to Kohana</title>
-
-<style type="text/css">
-
-body {
- background-color: #fff;
- margin: 40px;
- font-family: Lucida Grande, Verdana, Sans-serif;
- font-size: 14px;
- color: #4F5155;
-}
-
-a {
- color: #003399;
- background-color: transparent;
- font-weight: normal;
-}
-
-h1 {
- color: #444;
- background-color: transparent;
- border-bottom: 1px solid #D0D0D0;
- font-size: 16px;
- font-weight: bold;
- margin: 24px 0 2px 0;
- padding: 5px 0 6px 0;
-}
-
-code {
- font-family: Monaco, Verdana, Sans-serif;
- font-size: 12px;
- background-color: #f9f9f9;
- border: 1px solid #D0D0D0;
- color: #002166;
- display: block;
- margin: 14px 0 14px 0;
- padding: 12px 10px 12px 10px;
-}
-
-</style>
-</head>
-<body>
-
-<h1>Welcome to Kohana!</h1>
-
-<p>The page you are looking at is being generated dynamically by Kohana.</p>
-
-<p>If you would like to edit this page you'll find it located at:</p>
-<code>application/views/welcome_message.php</code>
-
-<p>The corresponding controller for this page is found at:</p>
-<code>application/controllers/welcome.php</code>
-
-<p>If you are exploring Kohana for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
-
-
-<p><br />Page rendered in {elapsed_time} seconds</p>
-
-</body>
-</html>
15 system/cache/index.html
View
@@ -1,15 +0,0 @@
-<html>
-
-<head>
-
-<title>403 Forbidden</title>
-
-</head>
-
-<body bgcolor='#ffffff'>
-
-<p>Directory access is forbidden.<p>
-
-</body>
-
-</html>
152 system/database/DB.php
View
@@ -1,152 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/**
- * Kohana
- *
- * An open source application development framework for PHP 4.3.2 or newer
- *
- * @package Kohana
- * @author Kohana Development Team
- * @copyright Copyright (c) 2007, Kohana Framework Team
- * @link http://kohanaphp.com
- * @license http://kohanaphp.com/user_guide/license.html
- * @since Version 1.0
- * @orig_package CodeIgniter
- * @orig_author Rick Ellis
- * @orig_copyright Copyright (c) 2006, EllisLab, Inc.
- * @orig_license http://www.codeignitor.com/user_guide/license.html
- * @filesource
- */
-
-// ------------------------------------------------------------------------
-
-/**
- * Initialize the database
- *
- * @category Database
- * @author Rick Ellis
- * @link http://kohanaphp.com/user_guide/database/
- */
-function &DB($params = '')
-{
- // Load the DB config file if a DSN string wasn't passed
- if (is_string($params))
- {
- if (strpos($params, '://'))
- {
- $params = (array) _parse_db_dsn($params['database']);
- }
- else
- {
- include(APPPATH.'config/database'.EXT);
-
- $group = ($params == '') ? $active_group : $params;
-
- if ( ! isset($db[$group]))
- {
- show_error('You have specified an invalid database connection group: '.$group);
- }
-
- $params = $db[$group];
- }
-
- // Make sure defaults are defined
- $params += array
- (
- 'hostname' => '',
- 'username' => '',
- 'password' => '',
- 'database' => '',
- 'conn_id' => FALSE,
- 'dbdriver' => 'mysql',
- 'dbprefix' => '',
- 'port' => '',
- 'pconnect' => FALSE,
- 'db_debug' => FALSE,
- 'cachedir' => '',
- 'cache_on' => FALSE,
- 'charset' => ''
- );
-
- if (strpos($params['database'], '://'))
- {
- $params = array_merge($params, (array) _parse_db_dsn($params['database']));
- }
- }
-
- // No DB specified yet? Beat them senseless...
- if ($params['dbdriver'] == '')
- {
- show_error('You have not selected a database type to connect to.');
- }
-
- // Load the DB classes. Note: Since the active record class is optional
- // we need to dynamically create a class that extends proper parent class
- // based on whether we're using the active record class or not.
- // Kudos to Paul for discovering this clever use of eval()
-
- require_once(BASEPATH.'database/DB_driver'.EXT);
-
- $CI =& get_instance();
- if ($CI->config->item('disable_ar')==FALSE)
- {
- require_once(BASEPATH.'database/DB_active_rec'.EXT);
-
- if ( ! class_exists('CI_DB'))
- {
- eval('class CI_DB extends CI_DB_active_record { }');
- }
- }
- else
- {
- if ( ! class_exists('CI_DB'))
- {
- eval('class CI_DB extends CI_DB_driver { }');
- }
- }
-
- require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver'.EXT);
-
- // Instantiate the DB adapter
- $driver = 'CI_DB_'.$params['dbdriver'].'_driver';
- $DB =& new $driver($params);
-
- return $DB;
-}
-
-// ------------------------------------------------------------------------
-
-/**
- * Parse a Database DSN
- *
- * @category Database
- * @author Rick Ellis
- * @link http://kohanaphp.com/user_guide/database/
- */
-function _parse_db_dsn($dsn)
-{
- if (($dsn = @parse_url($dsn)) == FALSE)
- return FALSE;
-
- $keys = array
- (
- 'scheme' => 'dbdriver',
- 'host' => 'hostname',
- 'user' => 'username',
- 'pass' => 'password',
- 'path' => 'database'
- );
-
- foreach($keys as $val => $key)
- {
- if ( ! isset($dsn[$val]))
- continue;
-
- $val = ($key == 'database') ? substr($dsn[$val], 1) : $dsn[$val];
- $config[$key] = rawurldecode($val);
- }
-
- return $config;
-}
-
-
-?>
940 system/database/DB_active_rec.php
View
@@ -1,940 +0,0 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-/**
- * Kohana
- *
- * An open source application development framework for PHP 4.3.2 or newer
- *
- * NOTE: This file has been modified from the original CodeIgniter version for
- * the Kohana framework by the Kohana Development Team.
- *
- * @package Kohana
- * @author Kohana Development Team
- * @copyright Copyright (c) 2007, Kohana Framework Team
- * @link http://kohanaphp.com
- * @license http://kohanaphp.com/user_guide/license.html
- * @since Version 1.0
- * @orig_package CodeIgniter
- * @orig_author Rick Ellis
- * @orig_copyright Copyright (c) 2006, EllisLab, Inc.
- * @orig_license http://www.codeignitor.com/user_guide/license.html
- * @filesource
- */
-
-// ------------------------------------------------------------------------
-
-/**
- * Active Record Class
- *
- * This is the platform-independent base Active Record implementation class.
- *
- * @package Kohana
- * @subpackage Drivers
- * @category Database
- * @author Rick Ellis, Kohana Development Team
- */
-class CI_DB_active_record extends CI_DB_driver {
-
- var $ar_select = array();
- var $ar_distinct = FALSE;
- var $ar_from = array();
- var $ar_join = array();
- var $ar_where = array();
- var $ar_like = array();
- var $ar_groupby = array();
- var $ar_having = array();
- var $ar_limit = FALSE;
- var $ar_offset = FALSE;
- var $ar_order = FALSE;
- var $ar_orderby = array();
- var $ar_set = array();
-
- /**
- * Select
- *
- * Generates the SELECT portion of the query
- *
- * @access public
- * @param string
- * @return object
- */
- function select($select = '*')
- {
- if (is_string($select))
- {
- $select = explode(',', $select);
- }
-
- foreach ($select as $val)
- {
- $val = trim($val);
-
- if ($val != '')
- {
- $this->ar_select[] = $val;
- }
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * DISTINCT
- *
- * Sets a flag which tells the query string compiler to add DISTINCT
- *
- * @access public
- * @param bool
- * @return object
- */
- function distinct($val = TRUE)
- {
- $this->ar_distinct = (is_bool($val)) ? $val : TRUE;
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * From
- *
- * Generates the FROM portion of the query
- *
- * @access public
- * @param mixed can be a string or array
- * @return object
- */
- function from($from)
- {
- foreach ((array)$from as $val)
- {
- $this->ar_from[] = $this->dbprefix.$val;
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Join
- *
- * Generates the JOIN portion of the query
- *
- * @access public
- * @param string
- * @param string the join condition
- * @param string the type of join
- * @return object
- */
- function join($table, $cond, $type = '')
- {
- if ($type != '')
- {
- $type = strtoupper(trim($type));
-
- if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))
- {
- $type = '';
- }
- else
- {
- $type .= ' ';
- }
- }
-
- // If a DB prefix is used we might need to add it to the column names
- if ($this->dbprefix)
- {
- // First we remove any existing prefixes in the condition to avoid duplicates
- $cond = preg_replace('|('.$this->dbprefix.')([\w\.]+)([\W\s]+)|', "$2$3", $cond);
-
- // Next we add the prefixes to the condition
- $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond);
- }
-
- $this->ar_join[] = $type.'JOIN '.$this->dbprefix.$table.' ON '.$cond;
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Where
- *
- * Generates the WHERE portion of the query. Separates
- * multiple calls with AND
- *
- * @access public
- * @param mixed
- * @param mixed
- * @param bool
- * @return object
- */
- function where($key, $value = NULL, $quote = TRUE)
- {
- if (func_num_args() < 2)
- {
- $quote = -1;
- }
-
- return $this->_where($key, $value, 'AND ', $quote);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * OR Where
- *
- * Generates the WHERE portion of the query. Separates
- * multiple calls with OR
- *
- * @access public
- * @param mixed
- * @param mixed
- * @param bool
- * @return object
- */
- function orwhere($key, $value = NULL, $quote = TRUE)
- {
- if (func_num_args() < 2)
- {
- $quote = -1;
- }
-
- return $this->_where($key, $value, 'OR ', $quote);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Where
- *
- * Called by where() or orwhere()
- *
- * @access private
- * @param mixed
- * @param mixed
- * @param string
- * @param bool
- * @return object
- */
- function _where($key, $value = NULL, $type = 'AND ', $quote = TRUE)
- {
- if ( ! is_array($key))
- {
- $key = array($key => $value);
- }
-
- foreach ($key as $k => $v)
- {
- $prefix = (count($this->ar_where) == 0) ? '' : $type;
-
- if ($quote === -1)
- {
- $v = '';
- }
- else
- {
- if ($v === NULL)
- {
- if ( ! $this->_has_operator($k))
- {
- $k .= ' IS';
- }
-
- $v = ' NULL';
- }
- elseif ($v === FALSE OR $v === TRUE)
- {
- if ( ! $this->_has_operator($k))
- {
- $k .= ' =';
- }
-
- $v = ($v == TRUE) ? ' 1' : ' 0';
- }
- else
- {
- if ( ! $this->_has_operator($k))
- {
- $k .= ' =';
- }
-
- $v = ' '.(($quote == TRUE) ? $this->escape($v) : $v);
- }
- }
-
- $this->ar_where[] = $prefix.$k.$v;
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Like
- *
- * Generates a %LIKE% portion of the query. Separates
- * multiple calls with AND
- *
- * @access public
- * @param mixed
- * @param mixed
- * @return object
- */
- function like($field, $match = '')
- {
- return $this->_like($field, $match, 'AND ');
- }
-
- // --------------------------------------------------------------------
-
- /**
- * OR Like
- *
- * Generates a %LIKE% portion of the query. Separates
- * multiple calls with OR
- *
- * @access public
- * @param mixed
- * @param mixed
- * @return object
- */
- function orlike($field, $match = '')
- {
- return $this->_like($field, $match, 'OR ');
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Like
- *
- * Called by like() or orlike()
- *
- * @access private
- * @param mixed
- * @param mixed
- * @param string
- * @return object
- */
- function _like($field, $match = '', $type = 'AND ')
- {
- if ( ! is_array($field))
- {
- $field = array($field => $match);
- }
-
- foreach ($field as $k => $v)
- {
- $prefix = (count($this->ar_like) == 0) ? '' : $type;
-
- $v = $this->escape_str($v);
-
- $this->ar_like[] = $prefix." $k LIKE '%{$v}%'";
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * GROUP BY
- *
- * @access public
- * @param string
- * @return object
- */
- function groupby($by)
- {
- if ( ! is_array($by))
- {
- $by = explode(',', (string) $by);
- }
-
- foreach ($by as $val)
- {
- $val = trim($val);
-
- if ($val != '')
- $this->ar_groupby[] = $val;
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the HAVING value
- *
- * Separates multiple calls with AND
- *
- * @access public
- * @param string
- * @param string
- * @return object
- */
- function having($key, $value = '')
- {
- return $this->_having($key, $value, 'AND');
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the OR HAVING value
- *
- * Separates multiple calls with OR
- *
- * @access public
- * @param string
- * @param string
- * @return object
- */
- function orhaving($key, $value = '')
- {
- return $this->_having($key, $value, 'OR');
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the HAVING values
- *
- * Called by having() or orhaving()
- *
- * @access private
- * @param string
- * @param string
- * @return object
- */
- function _having($key, $value = '', $type = 'AND')
- {
- $type = trim($type).' ';
-
- if ( ! is_array($key))
- {
- $key = array($key => $value);
- }
-
- foreach ($key as $k => $v)
- {
- $prefix = (count($this->ar_having) < 1) ? '' : $type;
-
- if ($v != '')
- {
- $v = ' '.$this->escape($v);
- }
-
- $this->ar_having[] = $prefix.$k.$v;
- }
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the ORDER BY value
- *
- * @access public
- * @param string
- * @param string direction: asc or desc
- * @return object
- */
- function orderby($orderby, $direction = '')
- {
- $direction = strtoupper(trim($direction));
-
- if ($direction != '')
- {
- $direction = (in_array($direction, array('ASC', 'DESC', 'RAND()'))) ? " $direction" : " ASC";
- }
-
- $this->ar_orderby[] = $orderby.$direction;
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the LIMIT value
- *
- * @access public
- * @param integer the limit value
- * @param integer the offset value
- * @return object
- */
- function limit($value, $offset = '')
- {
- $this->ar_limit = $value;
-
- if ($offset != '')
- {
- $this->ar_offset = $offset;
- }
-
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Sets the OFFSET value
- *
- * @access public
- * @param integer the offset value
- * @return object
- */
- function offset($value)
- {
- $this->ar_offset = $value;
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * The "set" function. Allows key/value pairs to be set for inserting or updating
- *
- * @access public
- * @param mixed
- * @param string
- * @return object
- */
- function set($key, $value = '')
- {
- $key = $this->_object_to_array($key);
-
- if ( ! is_array($key))
- {
- $key = array($key => $value);
- }
-
- foreach ($key as $k => $v)
- {
- $this->ar_set[$k] = $this->escape($v);
- }
-
- return $this;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Get
- *
- * Compiles the select statement based on the other functions called
- * and runs the query
- *
- * @access public
- * @param string the limit clause
- * @param string the offset clause
- * @return object
- */
- function get($table = '', $limit = null, $offset = null)
- {
- if ($table != '')
- {
- $this->from($table);
- }
-
- if ( ! is_null($limit))
- {
- $this->limit($limit, $offset);
- }
-
- $sql = $this->_compile_select();
-
- $result = $this->query($sql);
- $this->_reset_select();
- return $result;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * GetWhere
- *
- * Allows the where clause, limit and offset to be added directly
- *
- * @access public
- * @param string the where clause
- * @param string the limit clause
- * @param string the offset clause
- * @return object
- */
- function getwhere($table = '', $where = null, $limit = null, $offset = null)
- {
- if ($table != '')
- {
- $this->from($table);
- }
-
- if ( ! is_null($where))
- {
- $this->where($where);
- }
-
- if ( ! is_null($limit))
- {
- $this->limit($limit, $offset);
- }
-
- $sql = $this->_compile_select();
-
- $result = $this->query($sql);
- $this->_reset_select();
- return $result;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Insert
- *
- * Compiles an insert string and runs the query
- *
- * @access public
- * @param string the table to retrieve the results from
- * @param array an associative array of insert values
- * @return object
- */
- function insert($table = '', $set = NULL)
- {
- if ( ! is_null($set))
- {
- $this->set($set);
- }
-
- if ($this->ar_set == FALSE)
- {
- return ($this->db_debug ? $this->display_error('db_must_use_set') : FALSE);
- }
-
- if ($table == '')
- {
- if ( ! isset($this->ar_from[0]))
- {
- return ($this->db_debug ? $this->display_error('db_must_set_table') : FALSE);
- }
-
- $table = $this->ar_from[0];
- }
-
- $sql = $this->_insert($this->dbprefix.$table, array_keys($this->ar_set), array_values($this->ar_set));
-
- $this->_reset_write();
- return $this->query($sql);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Update
- *
- * Compiles an update string and runs the query
- *
- * @access public
- * @param string the table to retrieve the results from
- * @param array an associative array of update values
- * @param mixed the where clause
- * @return object
- */
- function update($table = '', $set = NULL, $where = null)
- {
- if ( ! is_null($set))
- {
- $this->set($set);
- }
-
- if ($this->ar_set == FALSE)
- {
- return ($this->db_debug ? $this->display_error('db_must_use_set') : FALSE);
- }
-
- if ($table == '')
- {
- if ( ! isset($this->ar_from[0]))
- {
- return ($this->db_debug ? $this->display_error('db_must_set_table') : FALSE);
- }
-
- $table = $this->ar_from[0];
- }
-
- if ($where != null)
- {
- $this->where($where);
- }
-
- $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where);
-
- $this->_reset_write();
- return $this->query($sql);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Delete
- *
- * Compiles a delete string and runs the query
- *
- * @access public
- * @param string the table to retrieve the results from
- * @param mixed the where clause
- * @return object
- */
- function delete($table = '', $where = '')
- {
- if ($table == '')
- {
- if ( ! isset($this->ar_from[0]))
- {
- return ($this->db_debug ? $this->display_error('db_must_set_table') : FALSE);
- }
-
- $table = $this->ar_from[0];
- }
-
- if ($where != '')
- {
- $this->where($where);
- }
-
- if (count($this->ar_where) < 1)
- {
- return (($this->db_debug) ? $this->display_error('db_del_must_use_where') : FALSE);
- }
-
- $sql = $this->_delete($this->dbprefix.$table, $this->ar_where);
-
- $this->_reset_write();
- return $this->query($sql);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Count Records
- *
- * Count table records by using active record conditions
- *
- * @access public
- * @param string name of table
- * @return string
- */
- function count_records($table = FALSE)
- {
- if (count($this->ar_from) < 1)
- {
- if ($table == FALSE)
- {
- return FALSE;
- }
- else
- {
- $this->from($table);
- }
- }
-
- $this->select('COUNT(*)');
- $query = $this->get();
- $result = array_shift($query->row_array());
- // No one likes a mess
- $query->free_result();
-
- return $result;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Use Table - DEPRECATED
- *
- * @deprecated use $this->db->from instead
- */
- function use_table($table)
- {
- return $this->from($table);
- }
-
- // --------------------------------------------------------------------
-
- /**