fdee1bd569ac844c265f63d7c55d54462399bcee

Author: gwoo

Date: 2008-09-09 13:41:08 -0400

initial add of creampuff

diff --git a/.htaccess b/.htaccess new file mode 100755 index 0000000..0ed8662 --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ +<IfModule mod_rewrite.c> + RewriteEngine on + RewriteRule ^$ webroot/ [L] + RewriteRule (.*) webroot/$1 [L] + </IfModule> \ No newline at end of file diff --git a/app_controller.php b/app_controller.php new file mode 100755 index 0000000..5784c9c --- /dev/null +++ b/app_controller.php @@ -0,0 +1,53 @@ +<?php +/* SVN FILE: $Id: app_controller.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Short description for class. + * + * Add your application-wide methods in the class below, your controllers + * will inherit them. + * + * @package cake + * @subpackage cake.app + */ +class AppController extends Controller { + + var $helpers = array( + 'Html', 'Form', 'Javascript' + ); + + function appError() { + if ($this->params['controller'] == Inflector::camelize($this->params['controller'])) { + $this->params['controller'] = 'Wiki'; + } else if ($this->params['action'] == Inflector::camelize($this->params['action'])) { + $this->redirect(array('controller' => 'wiki', 'action' => $this->params['action'], $this->passedArgs)); + } + } +} +?> \ No newline at end of file diff --git a/app_helper.php b/app_helper.php new file mode 100755 index 0000000..ef70de1 --- /dev/null +++ b/app_helper.php @@ -0,0 +1,42 @@ +<?php +/* SVN FILE: $Id: app_helper.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * This file is application-wide helper file. You can put all + * application-wide helper-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * This is a placeholder class. + * Create the same file in app/app_helper.php + * + * Add your application-wide methods in the class below, your helpers + * will inherit them. + * + * @package cake + * @subpackage cake.cake + */ +class AppHelper extends Helper { +} +?> \ No newline at end of file diff --git a/app_model.php b/app_model.php new file mode 100755 index 0000000..2e0fb8d --- /dev/null +++ b/app_model.php @@ -0,0 +1,43 @@ +<?php +/* SVN FILE: $Id: app_model.php 6296 2008-01-01 22:18:17Z phpnut $ */ + +/** + * Application model for Cake. + * + * This file is application-wide model file. You can put all + * application-wide model-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Application model for Cake. + * + * Add your application-wide methods in the class below, your models + * will inherit them. + * + * @package cake + * @subpackage cake.app + */ +class AppModel extends Model{ +} +?> \ No newline at end of file diff --git a/config/acl.ini.php b/config/acl.ini.php new file mode 100755 index 0000000..a189a37 --- /dev/null +++ b/config/acl.ini.php @@ -0,0 +1,76 @@ +;<?php die() ?> +; SVN FILE: $Id: acl.ini.php 6296 2008-01-01 22:18:17Z phpnut $ +;/** +; * Short description for file. +; * +; * +; * PHP versions 4 and 5 +; * +; * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> +; * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. +; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +; * @package cake +; * @subpackage cake.app.config +; * @since CakePHP(tm) v 0.10.0.1076 +; * @version $Revision: 6296 $ +; * @modifiedby $LastChangedBy: phpnut $ +; * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ +; * @license http://www.opensource.org/licenses/mit-license.php The MIT License +; */ + +; acl.ini.php - Cake ACL Configuration +; --------------------------------------------------------------------- +; Use this file to specify user permissions. +; aco = access control object (something in your application) +; aro = access request object (something requesting access) +; +; User records are added as follows: +; +; [uid] +; groups = group1, group2, group3 +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; Group records are added in a similar manner: +; +; [gid] +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; The allow, deny, and groups sections are all optional. +; NOTE: groups names *cannot* ever be the same as usernames! +; +; ACL permissions are checked in the following order: +; 1. Check for user denies (and DENY if specified) +; 2. Check for user allows (and ALLOW if specified) +; 3. Gather user's groups +; 4. Check group denies (and DENY if specified) +; 5. Check group allows (and ALLOW if specified) +; 6. If no aro, aco, or group information is found, DENY +; +; --------------------------------------------------------------------- + +;------------------------------------- +;Users +;------------------------------------- + +[username-goes-here] +groups = group1, group2 +deny = aco1, aco2 +allow = aco3, aco4 + +;------------------------------------- +;Groups +;------------------------------------- + +[groupname-goes-here] +deny = aco5, aco6 +allow = aco7, aco8 \ No newline at end of file diff --git a/config/bootstrap.php b/config/bootstrap.php new file mode 100755 index 0000000..7713ee1 --- /dev/null +++ b/config/bootstrap.php @@ -0,0 +1,46 @@ +<?php +/* SVN FILE: $Id: bootstrap.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.10.8.2117 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * + * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded + * This is an application wide file to load any function that is not used within a class define. + * You can also use this to include or require any files in your application. + * + */ +/** + * The settings below can be used to set additional paths to models, views and controllers. + * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) + * + * $modelPaths = array('full path to models', 'second full path to models', 'etc...'); + * $viewPaths = array('this path to views', 'second full path to views', 'etc...'); + * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); + * + */ +//EOF +?> \ No newline at end of file diff --git a/config/core.php b/config/core.php new file mode 100755 index 0000000..99f6cb0 --- /dev/null +++ b/config/core.php @@ -0,0 +1,229 @@ +<?php +/* SVN FILE: $Id: core.php 6314 2008-01-02 21:33:51Z phpnut $ */ +/** + * This is core configuration file. + * + * Use it to configure core behavior of Cake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6314 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-02 13:33:51 -0800 (Wed, 02 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * CakePHP Debug Level: + * + * Production Mode: + * 0: No error messages, errors, or warnings shown. Flash messages redirect. + * + * Development Mode: + * 1: Errors and warnings shown, model caches refreshed, flash messages halted. + * 2: As in 1, but also with full debug messages and SQL output. + * 3: As in 2, but also with full controller dump. + * + * In production mode, flash messages redirect after a time interval. + * In development mode, you need to click the flash message to continue. + */ + Configure::write('debug', 2); +/** + * Application wide charset encoding + */ + Configure::write('App.encoding', 'UTF-8'); +/** + * To configure CakePHP *not* to use mod_rewrite and to + * use CakePHP pretty URLs, remove these .htaccess + * files: + * + * /.htaccess + * /app/.htaccess + * /app/webroot/.htaccess + * + * And uncomment the App.baseUrl below: + */ + //Configure::write('App.baseUrl', env('SCRIPT_NAME')); +/** + * Uncomment the define below to use CakePHP admin routes. + * + * The value of the define determines the name of the route + * and its associated controller actions: + * + * 'admin' -> admin_index() and /admin/controller/index + * 'superuser' -> superuser_index() and /superuser/controller/index + */ + //Configure::write('Routing.admin', 'admin'); + +/** + * Turn off all caching application-wide. + * + */ + //Configure::write('Cache.disable', true); +/** + * Enable cache checking. + * + * If set to true, for view caching you must still use the controller + * var $cacheAction inside your controllers to define caching settings. + * You can either set it controller-wide by setting var $cacheAction = true, + * or in each action using $this->cacheAction = true. + * + */ + //Configure::write('Cache.check', true); +/** + * Defines the default error type when using the log() function. Used for + * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG. + */ + define('LOG_ERROR', 2); +/** + * The preferred session handling method. Valid values: + * + * 'php' Uses settings defined in your php.ini. + * 'cake' Saves session files in CakePHP's /tmp directory. + * 'database' Uses CakePHP's database sessions. + * + * To define a custom session handler, save it at /app/config/<name>.php. + * Set the value of 'Session.save' to <name> to utilize it in CakePHP. + * + * To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql. + * + */ + Configure::write('Session.save', 'php'); +/** + * The name of the table used to store CakePHP database sessions. + * + * 'Session.save' must be set to 'database' in order to utilize this constant. + * + * The table name set here should *not* include any table prefix defined elsewhere. + */ + //Configure::write('Session.table', 'cake_sessions'); +/** + * The DATABASE_CONFIG::$var to use for database session handling. + * + * 'Session.save' must be set to 'database' in order to utilize this constant. + */ + //Configure::write('Session.database', 'default'); +/** + * The name of CakePHP's session cookie. + */ + Configure::write('Session.cookie', 'CAKEPHP'); +/** + * Session time out time (in seconds). + * Actual value depends on 'Security.level' setting. + */ + Configure::write('Session.timeout', '120'); +/** + * If set to false, sessions are not automatically started. + */ + Configure::write('Session.start', true); +/** + * When set to false, HTTP_USER_AGENT will not be checked + * in the session + */ + Configure::write('Session.checkAgent', true); +/** + * The level of CakePHP security. The session timeout time defined + * in 'Session.timeout' is multiplied according to the settings here. + * Valid values: + * + * 'high' Session timeout in 'Session.timeout' x 10 + * 'medium' Session timeout in 'Session.timeout' x 100 + * 'low' Session timeout in 'Session.timeout' x 300 + * + * CakePHP session IDs are also regenerated between requests if + * 'Security.level' is set to 'high'. + */ + Configure::write('Security.level', 'high'); +/** + * A random string used in security hashing methods. + */ + Configure::write('Security.salt', '92d93dcd20418c007ad867ee97650b29d7c6cb75'); +/** + * Compress CSS output by removing comments, whitespace, repeating tags, etc. + * This requires a/var/cache directory to be writable by the web server for caching. + * and /vendors/csspp/csspp.php + * + * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css(). + */ + //Configure::write('Asset.filter.css', 'css.php'); +/** + * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the + * output, and setting the config below to the name of the script. + * + * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link(). + */ + //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php'); +/** + * The classname and database used in CakePHP's + * access control lists. + */ + Configure::write('Acl.classname', 'DB_ACL'); + Configure::write('Acl.database', 'default'); +/** + * Cache Engine Configuration + * + * File storage engine. + * default dir is /app/tmp/cache/ + * Cache::config('default', array('engine' => 'File' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'path' => '/tmp', //[optional] use system tmp directory - remember to use absolute path + * 'prefix' => 'cake_', //[optional] prefix every cache file with this string + * 'lock' => false, //[optional] use file locking + * 'serialize' => true, [optional] + * ) + * ); + * + * APC (Alternative PHP Cache) + * Cache::config('default', array('engine' => 'Apc' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * ) + * ); + * + * Xcache (PHP opcode cacher) + * Cache::config('default', array('engine' => 'Xcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'user' => 'admin', //user from xcache.admin.user settings + * password' => 'your_password', //plaintext password (xcache.admin.pass) + * ) + * ); + * + * Memcache + * Cache::config('default', array('engine' => 'Memcache' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'servers' => array( + * '127.0.0.1', // localhost, default port + * '10.0.0.1:12345', // port 12345 + * ), //[optional] + * 'compress' => true, // [optional] compress data in Memcache (slower, but uses less memory) + * ) + * ); + * + * Cake Model + * Cache::config('default', array('engine' => 'Model' //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'className' => 'Cache', //[optional] + * 'fields' => array('data' => 'data', 'expires' => 'expires'), //[optional] + * 'serialize' => true, [optional] + * ) + * ); + */ + Cache::config('default', array('engine' => 'File')); +?> \ No newline at end of file diff --git a/config/database.php.default b/config/database.php.default new file mode 100755 index 0000000..3fa3a0f --- /dev/null +++ b/config/database.php.default @@ -0,0 +1,103 @@ +<?php +/* SVN FILE: $Id: database.php.default 6429 2008-02-03 01:28:43Z nate $ */ +/** + * This is core configuration file. + * + * Use it to configure core behaviour ofCake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6429 $ + * @modifiedby $LastChangedBy: nate $ + * @lastmodified $Date: 2008-02-02 20:28:43 -0500 (Sat, 02 Feb 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * In this file you set up your database connection details. + * + * @package cake + * @subpackage cake.config + */ +/** + * Database configuration class. + * You can specify multiple configurations for production, development and testing. + * + * driver => The name of a supported driver; valid options are as follows: + * mysql - MySQL 4 & 5, + * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only), + * sqlite - SQLite (PHP5 only), + * postgres - PostgreSQL 7 and higher, + * mssql - Microsoft SQL Server 2000 and higher, + * db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2) + * oracle - Oracle 8 and higher + * firebird - Firebird/Interbase + * sybase - Sybase ASE + * adodb-[drivername] - ADOdb interface wrapper (see below), + * pear-[drivername] - PEAR::DB wrapper + * + * You can add custom database drivers (or override existing drivers) by adding the + * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php', + * where 'x' is the name of the database. + * + * persistent => true / false + * Determines whether or not the database should use a persistent connection + * + * connect => + * ADOdb set the connect to one of these + * (http://phplens.com/adodb/supported.databases.html) and + * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent) + * For all other databases, this setting is deprecated. + * + * host => + * the host you connect to the database. To add a socket or port number, use 'port' => # + * + * prefix => + * Uses the given prefix for all the tables in this database. This setting can be overridden + * on a per-table basis with the Model::$tablePrefix property. + * + * schema => + * For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to + * 'public', DB2 defaults to empty. + * + * encoding => + * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the + * database. Defaults to 'UTF-8' for DB2. Uses database default for all others. + * + */ +class DATABASE_CONFIG { + + var $default = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'database_name', + 'prefix' => '', + ); + + var $test = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'test_database_name', + 'prefix' => '', + ); +} +?> \ No newline at end of file diff --git a/config/inflections.php b/config/inflections.php new file mode 100755 index 0000000..e0c1df2 --- /dev/null +++ b/config/inflections.php @@ -0,0 +1,72 @@ +<?php +/* SVN FILE: $Id: inflections.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Custom Inflected Words. + * + * This file is used to hold words that are not matched in the normail Inflector::pluralize() and + * Inflector::singularize() + * + * PHP versions 4 and % + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 1.0.0.2312 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * This is a key => value array of regex used to match words. + * If key matches then the value is returned. + * + * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice'); + */ + $pluralRules = array(); +/** + * This is a key only array of plural words that should not be inflected. + * Notice the last comma + * + * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox'); + */ + $uninflectedPlural = array(); +/** + * This is a key => value array of plural irregular words. + * If key matches then the value is returned. + * + * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers') + */ + $irregularPlural = array(); +/** + * This is a key => value array of regex used to match words. + * If key matches then the value is returned. + * + * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i') + */ + $singularRules = array(); +/** + * This is a key only array of singular words that should not be inflected. + * You should not have to change this value below if you do change it use same format + * as the $uninflectedPlural above. + */ + $uninflectedSingular = $uninflectedPlural; +/** + * This is a key => value array of singular irregular words. + * Most of the time this will be a reverse of the above $irregularPlural array + * You should not have to change this value below if you do change it use same format + * + * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother') + */ + $irregularSingular = array_flip($irregularPlural); +?> \ No newline at end of file diff --git a/config/routes.php b/config/routes.php new file mode 100755 index 0000000..32a984c --- /dev/null +++ b/config/routes.php @@ -0,0 +1,48 @@ +<?php +/* SVN FILE: $Id: routes.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * In this file, you set up routes to your controllers and their actions. + * Routes are very important mechanism that allows you to freely connect + * different urls to chosen controllers and their actions (functions). + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Here, we are connecting '/' (base path) to controller called 'Pages', + * its action called 'display', and we pass a param to select the view file + * to use (in this case, /app/views/pages/home.thtml)... + */ + Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); +/** + * ...and connect the rest of 'Pages' controller's urls. + */ + Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); +/** + * Then we connect url '/test' to our test controller. This is helpfull in + * developement. + */ + Router::connect('/wiki/add', array('controller' => 'wiki', 'action' => 'add')); + + Router::connect('/wiki/*', array('controller' => 'wiki', 'action' => 'index')); +?> \ No newline at end of file diff --git a/config/sql/db_acl.php b/config/sql/db_acl.php new file mode 100755 index 0000000..3fdc0ea --- /dev/null +++ b/config/sql/db_acl.php @@ -0,0 +1,81 @@ +<?php +/* SVN FILE: $Id: db_acl.php 6354 2008-01-10 07:02:33Z nate $ */ +/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/ +/** + * This is Acl Schema file + * + * Use it to configure database for ACL + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config.sql + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6354 $ + * @modifiedby $LastChangedBy: nate $ + * @lastmodified $Date: 2008-01-09 23:02:33 -0800 (Wed, 09 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/* + * + * Using the Schema command line utility + * cake schema run create DbAcl + * + */ +class DbAclSchema extends CakeSchema { + + var $name = 'DbAcl'; + + function before($event = array()) { + return true; + } + + function after($event = array()) { + } + + var $acos = array( + 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'model' => array('type'=>'string', 'null' => true), + 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'alias' => array('type'=>'string', 'null' => true), + 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + + var $aros = array( + 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'model' => array('type'=>'string', 'null' => true), + 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'alias' => array('type'=>'string', 'null' => true), + 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + + var $aros_acos = array( + 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), + 'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10), + '_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), + '_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), + '_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), + '_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1)) + ); + +} +?> \ No newline at end of file diff --git a/config/sql/db_acl.sql b/config/sql/db_acl.sql new file mode 100755 index 0000000..0224bd2 --- /dev/null +++ b/config/sql/db_acl.sql @@ -0,0 +1,42 @@ +# $Id: db_acl.sql 6314 2008-01-02 21:33:51Z phpnut $ +# +# Copyright 2005-2008, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE TABLE aros_acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + aro_id INTEGER(10) UNSIGNED NOT NULL, + aco_id INTEGER(10) UNSIGNED NOT NULL, + _create CHAR(2) NOT NULL DEFAULT 0, + _read CHAR(2) NOT NULL DEFAULT 0, + _update CHAR(2) NOT NULL DEFAULT 0, + _delete CHAR(2) NOT NULL DEFAULT 0, + PRIMARY KEY(id) +); + +CREATE TABLE aros ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/config/sql/i18n.php b/config/sql/i18n.php new file mode 100755 index 0000000..02e9f0e --- /dev/null +++ b/config/sql/i18n.php @@ -0,0 +1,58 @@ +<?php +/* SVN FILE: $Id: i18n.php 6354 2008-01-10 07:02:33Z nate $ */ +/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/ +/** + * This is i18n Schema file + * + * Use it to configure database for i18n + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config.sql + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6354 $ + * @modifiedby $LastChangedBy: nate $ + * @lastmodified $Date: 2008-01-09 23:02:33 -0800 (Wed, 09 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/* + * + * Using the Schema command line utility + * cake schema run create i18n + * + */ +class i18nSchema extends CakeSchema { + + var $name = 'i18n'; + + function before($event = array()) { + return true; + } + + function after($event = array()) { + } + + var $i18n = array( + 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'), + 'model' => array('type'=>'string', 'null' => false, 'key' => 'index'), + 'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), + 'field' => array('type'=>'string', 'null' => false, 'key' => 'index'), + 'content' => array('type'=>'text', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0)) + ); + +} +?> \ No newline at end of file diff --git a/config/sql/i18n.sql b/config/sql/i18n.sql new file mode 100755 index 0000000..64f7a8e --- /dev/null +++ b/config/sql/i18n.sql @@ -0,0 +1,28 @@ +# $Id: i18n.sql 6314 2008-01-02 21:33:51Z phpnut $ +# +# Copyright 2005-2008, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE i18n ( + id int(10) NOT NULL auto_increment, + locale varchar(6) NOT NULL, + model varchar(255) NOT NULL, + foreign_key int(10) NOT NULL, + field varchar(255) NOT NULL, + content mediumtext, + PRIMARY KEY (id), +# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field), +# INDEX I18N_LOCALE_ROW(locale, model, foreign_key), +# INDEX I18N_LOCALE_MODEL(locale, model), +# INDEX I18N_FIELD(model, foreign_key, field), +# INDEX I18N_ROW(model, foreign_key), + INDEX locale (locale), + INDEX model (model), + INDEX row_id (foreign_key), + INDEX field (field) +); \ No newline at end of file diff --git a/config/sql/schema.php b/config/sql/schema.php new file mode 100644 index 0000000..6dc29f4 --- /dev/null +++ b/config/sql/schema.php @@ -0,0 +1,124 @@ +<?php +/* SVN FILE: $Id$ */ +/* Creampuff schema generated on: 2008-09-09 13:09:31 : 1220981071*/ +class CreampuffSchema extends CakeSchema { + var $name = 'Creampuff'; + + function before($event = array()) { + return true; + } + + function after($event = array()) { + } + + var $tickets = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'type_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'feature_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'owner' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'reporter' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'summary' => array('type' => 'string', 'null' => false, 'length' => 200), + 'body' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'status' => array('type' => 'integer', 'null' => false, 'default' => '1', 'length' => 2), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $comments = array( + 'id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'key' => 'primary'), + 'ticket_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'body' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $configs = array( + 'id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'key' => 'primary'), + 'key' => array('type' => 'string', 'null' => false, 'length' => 50), + 'value' => array('type' => 'string', 'null' => false), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $features = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'milestone_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'title' => array('type' => 'string', 'null' => false, 'length' => 200), + 'points' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 2), + 'difficulty' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 2), + 'story' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $milestones = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'title' => array('type' => 'string', 'null' => false, 'length' => 200), + 'due_date' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $sprints = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'feature_id' => array('type' => 'integer', 'null' => false, 'default' => '0'), + 'title' => array('type' => 'string', 'null' => false, 'length' => 200), + 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $tags = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'key' => array('type' => 'string', 'null' => false, 'length' => 100), + 'name' => array('type' => 'string', 'null' => false, 'length' => 100), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $tags_tickets = array( + 'tag_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'ticket_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'indexes' => array() + ); + var $tags_features = array( + 'tag_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'feature_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'indexes' => array() + ); + var $tags_tasks = array( + 'tag_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'task_id' => array('type' => 'integer', 'null' => true, 'default' => NULL), + 'indexes' => array() + ); + var $tasks = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'sprint_id' => array('type' => 'integer', 'null' => false), + 'title' => array('type' => 'string', 'null' => false), + 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $users = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'username' => array('type' => 'string', 'null' => false, 'length' => 40), + 'password' => array('type' => 'string', 'null' => false, 'length' => 40), + 'role' => array('type' => 'string', 'null' => false, 'default' => 'Chicken', 'length' => 100), + 'email' => array('type' => 'string', 'null' => false, 'length' => 200), + 'last_login' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + var $wiki = array( + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), + 'slug' => array('type' => 'string', 'null' => false, 'length' => 200), + 'raw' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'transformed' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); +} +?> \ No newline at end of file diff --git a/config/sql/sessions.php b/config/sql/sessions.php new file mode 100755 index 0000000..76bfd3c --- /dev/null +++ b/config/sql/sessions.php @@ -0,0 +1,55 @@ +<?php +/* SVN FILE: $Id: sessions.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/ +/** + * This is Sessions Schema file + * + * Use it to configure database for Sessions + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config.sql + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/* + * + * Using the Schema command line utility + * cake schema run create Sessions + * + */ +class SessionsSchema extends CakeSchema { + + var $name = 'Sessions'; + + function before($event = array()) { + return true; + } + + function after($event = array()) { + } + + var $cake_sessions = array( + 'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'), + 'data' => array('type'=>'text', 'null' => true, 'default' => NULL), + 'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL), + 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + ); + +} +?> \ No newline at end of file diff --git a/config/sql/sessions.sql b/config/sql/sessions.sql new file mode 100755 index 0000000..5d124d4 --- /dev/null +++ b/config/sql/sessions.sql @@ -0,0 +1,16 @@ +# $Id: sessions.sql 6314 2008-01-02 21:33:51Z phpnut $ +# +# Copyright 2005-2008, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE cake_sessions ( + id varchar(255) NOT NULL default '', + data text, + expires int(11) default NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/controllers/components/svn.php b/controllers/components/svn.php new file mode 100644 index 0000000..adfbb84 --- /dev/null +++ b/controllers/components/svn.php @@ -0,0 +1,110 @@ +<?php +App::import('Overloadable'); + +class SvnComponent extends Overloadable { + +/* configuration settings + * + * svn: the system path to svn defaut: svn + * tmp: tmp directory default: TMP + * path: file or directory path + * username: you know what that is + * password: another obvious one + * + */ + + var $config = array('svn' => 'svn', 'tmp' => TMP, 'path' => 'file://repo', 'username' => '', 'password' => ''); + + var $__commands = array( + //standard commands + 'add', 'annotate', 'blame', 'cat', 'checkout', 'cleanup', 'commit', 'copy', 'delete', 'diff', 'export', 'help', + 'import', 'info', 'list', 'log', 'merge', 'mkdir', 'move', 'praise', 'propdel', 'propedit', 'propget', 'proplist', + 'propset', 'remove', 'rename', 'resolved', 'revert', 'status', 'switch', 'update', + //shortcuts + 'ann', 'co', 'ci', 'cp', 'del', 'rm', 'ls', 'mv', 'ren', 'pdel', 'pd', 'pedit', 'pe', 'pget', 'pg', 'plist', 'pl', + 'pset', 'ps', 'stat', 'st', 'sw', 'up' + ); + + var $__adminCommands = array('create', 'dump', 'help', 'hotcopy', 'load', 'lstxns', 'recover', 'rmtxns', 'setlog'); + + var $__lookCommands = array('author', 'cat', 'changed', 'date', 'diff', 'dirs-changed', 'help', 'history', 'info', 'log', 'proplist', 'tree', 'youngest'); + + var $__debug = array(); +/** + * call the svn method + * + * + */ + function call__($method, $params) { + extract($this->config); + $extra = null; + $count = count($params); + if ($count == 1) { + $path = rtrim($path, '/') . '/' . join('/', $params);; + } else { + $extra = join(' ', $params); + } + + if (in_array($method, $this->__commands)) { + $command = "{$svn} {$method} {$path}{$extra} --username {$username} --password {$password}"; + } else if (preg_match('/^(admin)([^.]+)/', $method, $matches)) { + if (isset($matches[1]) && in_array($matches[1], $this->__adminCommands)) { + $method = $matches[1]; + $command = "{$svn}admin {$method} {$path}{$extra} --username {$username} --password {$password}"; + } + }else if (preg_match('/^(look)([^.]+)/', $method, $matches)) { + if (isset($matches[1]) && in_array($matches[1], $this->__lookCommands)) { + $method = $matches[1]; + $command = "{$svn}look {$method} {$path}{$extra} --username {$username} --password {$password}"; + } + } + + if (empty($command)) { + trigger_error("{$method} could not be found.", E_USER_ERROR); + return false; + } else { + $this->__debug[] = $command; + $result = shell_exec(trim($command)); + $last_line = system($command, $retval); + var_dump($result); + var_dump($last_line); + var_dump($retval); + return $result; + } + } +/** +* sets or returns config +* +*/ + function config($config = array()) { + if (empty($config)) { + return $this->config; + } + return $this->config = array_merge($this->config, $config); + } +/** +* returns debug info +* +*/ + function trace($config = array()) { + return $this->__debug; + } + + function checkout() { + + } + + function blame() { + + } + +/** +* callbacks that need to be overriden for call__ +* +*/ + function initialize(&$controller) {} + function startup(&$controller) {} + function beforeRender() {} + function beforeRedirect() {} + function shutdown() {} +} \ No newline at end of file diff --git a/controllers/pages_controller.php b/controllers/pages_controller.php new file mode 100755 index 0000000..dd3d981 --- /dev/null +++ b/controllers/pages_controller.php @@ -0,0 +1,94 @@ +<?php +/* SVN FILE: $Id: pages_controller.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Static content controller. + * + * This file will render views from views/pages/ + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.controller + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Static content controller + * + * Override this controller by placing a copy in controllers directory of an application + * + * @package cake + * @subpackage cake.cake.libs.controller + */ +class PagesController extends AppController{ +/** + * Controller name + * + * @var string + * @access public + */ + var $name = 'Pages'; +/** + * Default helper + * + * @var array + * @access public + */ + var $helpers = array('Html'); +/** + * This controller does not use a model + * + * @var array + * @access public + */ + var $uses = array(); +/** + * Displays a view + * + * @param mixed What page to display + * @access public + */ + function display() { + if (!func_num_args()) { + $this->redirect('/'); + } + $path = func_get_args(); + + if (!count($path)) { + $this->redirect('/'); + } + $count = count($path); + $page = null; + $subpage = null; + $title = null; + + if (!empty($path[0])) { + $page = $path[0]; + } + if (!empty($path[1])) { + $subpage = $path[1]; + } + if (!empty($path[$count - 1])) { + $title = Inflector::humanize($path[$count - 1]); + } + $this->set('page', $page); + $this->set('subpage', $subpage); + $this->set('title', $title); + $this->render(join('/', $path)); + } +} +?> \ No newline at end of file diff --git a/controllers/svn_controller.php b/controllers/svn_controller.php new file mode 100644 index 0000000..6fe38b0 --- /dev/null +++ b/controllers/svn_controller.php @@ -0,0 +1,20 @@ +<?php +class SvnController extends AppController { + + var $name = 'Svn'; + + var $components = array('Svn'); + + var $uses = array(); + + function index() { + + } + + function blame() { + if (!empty($this->data)) { + + } + } +} +?> \ No newline at end of file diff --git a/controllers/wiki_controller.php b/controllers/wiki_controller.php new file mode 100644 index 0000000..de81810 --- /dev/null +++ b/controllers/wiki_controller.php @@ -0,0 +1,34 @@ +<?php +class WikiController extends AppController { + + var $name = 'Wiki'; + + function index($slug = null) { + if(count($this->passedArgs) > 1) { + $slug = join('/', $this->passedArgs); + } + + $this->pageTitle = Inflector::humanize(Inflector::slug($slug)); + + if ($wiki = $this->Wiki->findBySlug($slug)) { + $this->set('wiki', $wiki); + } else { + $this->data['Wiki']['slug'] = $slug; + $this->render('add'); + } + } + + function add() { + if (!empty($this->data)) { + $this->Wiki->create(); + if ($data = $this->Wiki->save($this->data)) { + $this->Session->setFlash('Wiki Page created'); + $this->set('wiki', $data); + $this->render('view'); + } else { + $this->Session->setFlash('Wiki Page broken'); + } + } + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..ce9c7a1 --- /dev/null +++ b/index.php @@ -0,0 +1,26 @@ +<?php +/* SVN FILE: $Id: index.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; +?> \ No newline at end of file diff --git a/models/svn.php b/models/svn.php new file mode 100644 index 0000000..f5da85b --- /dev/null +++ b/models/svn.php @@ -0,0 +1,127 @@ +<?php +class Svn extends Object { + + var $name = 'Svn'; + + var $useTable = false; + + var $__config = array('svn' => '/usr/bin/svn', 'tmp' => TMP, 'username' => '', 'password' => ''); + + var $debug = array(); + + var $workingCopy = null; + + var $repo = null; +/** + * Create a new repo; initialize the branches, tags, trunk; checkout a working copy to TMP + * + * @param string $project name of the project + * @param string $repo path to the new repository + * @example $this->Svn->create('demo', TMP . 'svn/repo'); + * @return void + * + **/ + function create($project, $repo) { + extract($this->__config); + + if (is_dir(dirname($repo))) { + if (!is_dir($repo)) { + $result = $this->admin('create', $repo); + } + + if (is_dir($repo)) { + + $this->repo = $repo; + + $this->workingCopy = TMP . $project; + + if (!is_dir($this->workingCopy . '/branches')) { + $file = 'file://' . rtrim($repo, '/') . '/' . $project; + $result = $this->sub('import', array(TMP . 'svn/project', $file, '--message "Initial project import"')); + $result = $this->sub('checkout', array($file, $this->workingCopy)); + } + } + } + } +/** + * Get the info about a directory or file + * + * @param string $path path inside of workingCopy with preceeding / + * @example $this->Svn->info('/branches'); + * @return void + * + **/ + function info($path = null) { + return $this->sub('info', array($this->workingCopy . $path)); + } +/** + * Run svnadmin, Besides providing the ability to create Subversion repositories, + * this program allows you to perform several maintenance operations on those repositories. + * + * @param string $command + * @param mixed $params + * @example $this->Svn->admin('create', '/path/to/new/repo'); + * @return void + * + **/ + function admin($command, $params) { + extract($this->__config); + if (is_string($params)) { + $params = array($params); + } + $c = $this->debug[] = trim("{$svn}admin {$command} " . join(' ', $params) . ' ' . $this->__creds()); + umask(0); + return shell_exec($c); + } +/** + * Run svnlook, is a command-line utility for examining different aspects of a Subversion repository. + * It does not make any changes to the repository—it's just used for “peeking” + * + * @param string $command + * @param mixed $params + * @example $this->Svn->look('author', 'file:///path/to/repo'); + * @return void + * + **/ + function look($command, $params) { + extract($this->__config); + if (is_string($params)) { + $params = array($params); + } + $c = $this->debug[] = trim("{$svn}look {$command} " . join(' ', $params) . ' ' . $this->__creds()); + umask(0); + return shell_exec($c); + } +/** + * Run svn subcommands + * + * @param string $command + * @param mixed $params + * @example $this->Svn->sub('checkout', array('file:///path/to/repo', /path/to/new/working/copy')); + * @return void + * + **/ + function sub($command, $params) { + extract($this->__config); + if (is_string($params)) { + $params = array($params); + } + $c = $this->debug[] = trim("{$svn} {$command} " . join(' ', $params) . ' ' . $this->__creds()); + umask(0); + return shell_exec($c); + } +/** + * Get the config credentials + * + * @return void + * + **/ + function __creds() { + extract($this->__config); + if (!empty($username) && !empty($password)) { + return "--username {$username} --password {$password}"; + } + return null; + } +} +?> \ No newline at end of file diff --git a/models/wiki.php b/models/wiki.php new file mode 100644 index 0000000..41ec9cc --- /dev/null +++ b/models/wiki.php @@ -0,0 +1,20 @@ +<?php +class Wiki extends AppModel { + + var $name = 'Wiki'; + + var $useTable = 'wiki'; + + + var $validate = array('content' => array('notEmpty')); + + + function beforeSave() { + ini_set('include_path', APP . 'vendors' . DS . 'Pear' . PATH_SEPARATOR . ini_get('include_path')); + App::import('Vendor', 'Text_Wiki_Creole', array('file' => 'Text/Wiki/Creole.php')); + $TextWiki = new Text_Wiki_Creole(); + $this->data['Wiki']['content'] = $TextWiki->transform($this->data['Wiki']['content'], 'Xhtml'); + return true; + } +} +?> \ No newline at end of file diff --git a/tests/cases/components/svn.test.php b/tests/cases/components/svn.test.php new file mode 100644 index 0000000..d44f9b9 --- /dev/null +++ b/tests/cases/components/svn.test.php @@ -0,0 +1,35 @@ +<?php +App::import('Component', 'Svn'); + +class SvnTest extends CakeTestCase { + + function setUp() { + $this->Svn = new SvnComponent(); + $this->Svn->config(array('path' => 'file://Volumes/Home/htdocs/cake/repo/branches/1.2.x.x')); + } + + function tearDown() { + pr($this->Svn->trace()); + } + + function testCheckout() { + //pr($this->Svn->checkout('https://svn.cakephp.org/repo/branches/1.2.x.x')); + } + + function testInfo() { + pr($this->Svn->info()); + } + + function testBlame() { + pr($this->Svn->blame('index.php')); + } + + function testLs() { + pr($this->Svn->ls()); + } + + function testAdmin() { + } + +} +?> \ No newline at end of file diff --git a/tests/cases/controllers/svn_controller.test.php b/tests/cases/controllers/svn_controller.test.php new file mode 100644 index 0000000..cb0d65b --- /dev/null +++ b/tests/cases/controllers/svn_controller.test.php @@ -0,0 +1,25 @@ +<?php +/* SVN FILE: $Id$ */ +/* SvnController Test cases generated on: 2008-03-11 20:03:05 : 1205293445*/ +App::import('Controller', 'Svn'); + +class TestSvn extends SvnController { + var $autoRender = false; +} + +class SvnControllerTest extends CakeTestCase { + var $Svn = null; + + function setUp() { + $this->Svn = new TestSvn(); + } + + function testSvnControllerInstance() { + $this->assertTrue(is_a($this->Svn, 'SvnController')); + } + + function tearDown() { + unset($this->Svn); + } +} +?> \ No newline at end of file diff --git a/tests/cases/controllers/wiki_controller.test.php b/tests/cases/controllers/wiki_controller.test.php new file mode 100644 index 0000000..762cf06 --- /dev/null +++ b/tests/cases/controllers/wiki_controller.test.php @@ -0,0 +1,26 @@ +<?php +/* SVN FILE: $Id$ */ +/* WikiController Test cases generated on: 2008-08-28 17:08:49 : 1219968829*/ +App::import('Controller', 'Wiki'); + +class TestWiki extends WikiController { + var $autoRender = false; +} + +class WikiControllerTest extends CakeTestCase { + var $Wiki = null; + + function setUp() { + $this->Wiki = new TestWiki(); + $this->Wiki->constructClasses(); + } + + function testWikiControllerInstance() { + $this->assertTrue(is_a($this->Wiki, 'WikiController')); + } + + function tearDown() { + unset($this->Wiki); + } +} +?> \ No newline at end of file diff --git a/tests/cases/models/svn.test.php b/tests/cases/models/svn.test.php new file mode 100644 index 0000000..9a8a802 --- /dev/null +++ b/tests/cases/models/svn.test.php @@ -0,0 +1,79 @@ +<?php +/* SVN FILE: $Id$ */ +/* Svn Test cases generated on: 2008-08-28 13:08:20 : 1219956320*/ +App::import('Model', 'Svn'); +App::import('Core', 'File'); +class TestSvn extends Svn { + + var $cacheSources = false; + +} + +class SvnTest extends CakeTestCase { + + function start() { + parent::start(); + $this->Svn = new TestSvn(); + + $this->Svn->repo = TMP . 'svn/repo'; + + $this->Svn->workingCopy = TMP . 'demo'; + } + + function end() { + parent::end(); + pr($this->Svn->debug); + } + + function getTests() { + return array_merge(array('start', 'startCase'), array('testCheckout'), array('end', 'endCase')); + } + + function testSvnInstance() { + $this->assertTrue(is_a($this->Svn, 'Svn')); + } + + function testCreate() { + $this->Svn->create('demo', TMP . 'svn/repo'); + } + + function testRead() { + $this->Svn->repo = TMP . 'svn/repo'; + + $this->Svn->workingCopy = TMP . 'demo'; + + pr($this->Svn->info('/branches')); + + pr($this->Svn->look('author', $this->Svn->repo)); + } + + function testCommit() { + $this->Svn->workingCopy = TMP . 'demo'; + $File = new File($this->Svn->workingCopy . '/branches/demo_1.0.x.x/index.php', true); + $File->write("this is a new php file with plain text"); + pr($this->Svn->sub('add', array(dirname($File->pwd())))); + pr($this->Svn->sub('commit', array($this->Svn->workingCopy, '--message "Adding index.php"'))); + pr($this->Svn->info('/branches/demo_1.0.x.x/index.php')); + } + + function testTree() { + $this->Svn->repo = TMP . 'svn/repo'; + $this->Svn->repo = 'https://svn.cakephp.org/repo/branches'; + $this->Svn->workingCopy = TMP . 'demo'; + + pr($this->Svn->look('tree', $this->Svn->workingCopy)); + } + + function testCheckout() { + pr($this->Svn->sub('co', array( + 'https://svn.cakephp.org/repo/branches/1.2.x.x/cake', + $this->Svn->workingCopy .'/branches/demo_1.0.x.x/cake', '--force' + ))); + } + + function testBlame() { + $this->Svn->workingCopy = '/Volumes/Home/htdocs/cake/repo/branches/1.2.x.x'; + pr($this->Svn->sub('blame', $this->Svn->workingCopy . '/cake/libs/file.php')); + } +} +?> \ No newline at end of file diff --git a/views/elements/email/html/default.ctp b/views/elements/email/html/default.ctp new file mode 100755 index 0000000..cea8b8c --- /dev/null +++ b/views/elements/email/html/default.ctp @@ -0,0 +1,33 @@ +<?php +/* SVN FILE: $Id: default.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.elements.email.html + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<?php +$content = explode("\n", $content); + +foreach($content as $line): + echo '<p> ' . $line . '</p>'; +endforeach; +?> \ No newline at end of file diff --git a/views/elements/email/text/default.ctp b/views/elements/email/text/default.ctp new file mode 100755 index 0000000..0084039 --- /dev/null +++ b/views/elements/email/text/default.ctp @@ -0,0 +1,27 @@ +<?php +/* SVN FILE: $Id: default.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.elements.email.text + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<?php echo $content; ?> \ No newline at end of file diff --git a/views/layouts/ajax.ctp b/views/layouts/ajax.ctp new file mode 100755 index 0000000..62e15ab --- /dev/null +++ b/views/layouts/ajax.ctp @@ -0,0 +1,27 @@ +<?php +/* SVN FILE: $Id: ajax.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<?php echo $content_for_layout; ?> \ No newline at end of file diff --git a/views/layouts/default.ctp b/views/layouts/default.ctp new file mode 100755 index 0000000..ce58c4a --- /dev/null +++ b/views/layouts/default.ctp @@ -0,0 +1,75 @@ +<?php +/* SVN FILE: $Id: default.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.templates.skel.views.layouts + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title> + <?php __('CakePHP: the rapid development php framework:'); ?> + <?php echo $title_for_layout;?> + </title> + <?php + echo $html->charset(); + echo $html->meta('icon'); + + echo $html->css('creampuff'); + + echo $javascript->link('MeatballSocietyCreoleV0.4'); + + echo $scripts_for_layout; + ?> + <script> + var text = $("description").innerHtml; + toXHTML('=== this is a an h3'); + </script> +</head> +<body> + <div id="container"> + <div id="header"> + <h1><?php echo $html->link(__('CakePHP: the rapid development php framework', true), 'http://cakephp.org');?></h1> + </div> + <div id="content"> + <?php + if ($session->check('Message.flash')): + $session->flash(); + endif; + ?> + + <?php echo $content_for_layout;?> + + </div> + <div id="footer"> + <?php echo $html->link( + $html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")), + 'http://www.cakephp.org/', + array('target'=>'_new'), null, false + ); + ?> + </div> + </div> + <?php echo $cakeDebug?> +</body> +</html> \ No newline at end of file diff --git a/views/layouts/email/html/default.ctp b/views/layouts/email/html/default.ctp new file mode 100755 index 0000000..625dd37 --- /dev/null +++ b/views/layouts/email/html/default.ctp @@ -0,0 +1,39 @@ +<?php +/* SVN FILE: $Id: default.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts.email.html + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> + +<html> +<head> + <title><?php echo $title_for_layout;?></title> +</head> + +<body> + <?php echo $content_for_layout;?> + + <p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p> +</body> +</html> diff --git a/views/layouts/email/text/default.ctp b/views/layouts/email/text/default.ctp new file mode 100755 index 0000000..4acd5a2 --- /dev/null +++ b/views/layouts/email/text/default.ctp @@ -0,0 +1,31 @@ +<?php +/* SVN FILE: $Id: default.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts.email.text + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> + +<?php echo $content_for_layout;?> + +This email was sent using the CakePHP Framework, http://cakephp.org. + diff --git a/views/layouts/flash.ctp b/views/layouts/flash.ctp new file mode 100755 index 0000000..f48d14c --- /dev/null +++ b/views/layouts/flash.ctp @@ -0,0 +1,45 @@ +<?php +/* SVN FILE: $Id: flash.ctp 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title><?php echo $page_title?></title> +<?php echo $html->charset(); ?> + +<?php if (Configure::read() == 0) { ?> +<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/> +<?php } ?> +<style><!-- +P { text-align:center; font:bold 1.1em sans-serif } +A { color:#444; text-decoration:none } +A:HOVER { text-decoration: underline; color:#44E } +--></style> +</head> +<body> +<p><a href="<?php echo $url?>"><?php echo $message?></a></p> +</body> +</html> \ No newline at end of file diff --git a/views/layouts/js/default.ctp b/views/layouts/js/default.ctp new file mode 100755 index 0000000..d94dc90 --- /dev/null +++ b/views/layouts/js/default.ctp @@ -0,0 +1,2 @@ +<?php echo $scripts_for_layout; ?> +<script type="text/javascript"><?php echo $content_for_layout; ?></script> \ No newline at end of file diff --git a/views/layouts/rss/default.ctp b/views/layouts/rss/default.ctp new file mode 100755 index 0000000..94067f2 --- /dev/null +++ b/views/layouts/rss/default.ctp @@ -0,0 +1,17 @@ +<?php +echo $rss->header(); + +if (!isset($channel)) { + $channel = array(); +} +if (!isset($channel['title'])) { + $channel['title'] = $title_for_layout; +} + +echo $rss->document( + $rss->channel( + array(), $channel, $content_for_layout + ) +); + +?> \ No newline at end of file diff --git a/views/layouts/xml/default.ctp b/views/layouts/xml/default.ctp new file mode 100755 index 0000000..c688702 --- /dev/null +++ b/views/layouts/xml/default.ctp @@ -0,0 +1,2 @@ +<?php e($xml->header()); ?> +<?php echo $content_for_layout; ?> \ No newline at end of file diff --git a/views/pages/home.ctp b/views/pages/home.ctp new file mode 100644 index 0000000..5c96e3d --- /dev/null +++ b/views/pages/home.ctp @@ -0,0 +1,7 @@ +<h2>Creampuff</h2> + +<div id="description"> + === this is a an h3 + * list? + * list? +</div> \ No newline at end of file diff --git a/views/svn/blame.ctp b/views/svn/blame.ctp new file mode 100644 index 0000000..e69de29 diff --git a/views/svn/index.ctp b/views/svn/index.ctp new file mode 100644 index 0000000..d11d76f --- /dev/null +++ b/views/svn/index.ctp @@ -0,0 +1,40 @@ +<div class="svn index"> +<h2><?php __('Svn');?></h2> +<p> +<?php +echo $paginator->counter(array( +'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) +)); +?></p> +<table cellpadding="0" cellspacing="0"> +<tr> + <th class="actions"><?php __('Actions');?></th> +</tr> +<?php +$i = 0; +foreach ($svn as $svn): + $class = null; + if ($i++ % 2 == 0) { + $class = ' class="altrow"'; + } +?> + <tr<?php echo $class;?>> + <td class="actions"> + <?php echo $html->link(__('View', true), array('action'=>'view', $svn['Svn'][''])); ?> + <?php echo $html->link(__('Edit', true), array('action'=>'edit', $svn['Svn'][''])); ?> + <?php echo $html->link(__('Delete', true), array('action'=>'delete', $svn['Svn']['']), null, sprintf(__('Are you sure you want to delete # %s?', true), $svn['Svn'][''])); ?> + </td> + </tr> +<?php endforeach; ?> +</table> +</div> +<div class="paging"> + <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | <?php echo $paginator->numbers();?> + <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> +</div> +<div class="actions"> + <ul> + <li><?php echo $html->link(__('New Svn', true), array('action'=>'add')); ?></li> + </ul> +</div> diff --git a/views/wiki/add.ctp b/views/wiki/add.ctp new file mode 100644 index 0000000..48e5fcb --- /dev/null +++ b/views/wiki/add.ctp @@ -0,0 +1,11 @@ +<div class="wiki form"> +<?php echo $form->create();?> + <fieldset> + <legend>Create <?php echo $this->pageTitle; ?></legend> + <?php + echo $form->hidden('slug'); + echo $form->input('content'); + ?> + </fieldset> +<?php echo $form->end('Submit');?> +</div> \ No newline at end of file diff --git a/views/wiki/view.ctp b/views/wiki/view.ctp new file mode 100644 index 0000000..f1c8285 --- /dev/null +++ b/views/wiki/view.ctp @@ -0,0 +1,3 @@ +<div class="wiki view"> + <?php echo $html->clean($wiki['Wiki']['content']); ?> +</div> \ No newline at end of file diff --git a/webroot/.htaccess b/webroot/.htaccess new file mode 100755 index 0000000..f9d8b93 --- /dev/null +++ b/webroot/.htaccess @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] +</IfModule> \ No newline at end of file diff --git a/webroot/css.php b/webroot/css.php new file mode 100755 index 0000000..b3d7eef --- /dev/null +++ b/webroot/css.php @@ -0,0 +1,102 @@ +<?php +/* SVN FILE: $Id: css.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +if (!defined('CAKE_CORE_INCLUDE_PATH')) { + header('HTTP/1.1 404 Not Found'); + exit('File Not Found'); +} +/** + * Enter description here... + */ + uses('file'); +/** + * Enter description here... + * + * @param unknown_type $path + * @param unknown_type $name + * @return unknown + */ + function make_clean_css($path, $name) { + require(VENDORS . 'csspp' . DS . 'csspp.php'); + $data = file_get_contents($path); + $csspp = new csspp(); + $output = $csspp->compress($data); + $ratio = 100 - (round(strlen($output) / strlen($data), 3) * 100); + $output = " /* file: $name, ratio: $ratio% */ " . $output; + return $output; + } +/** + * Enter description here... + * + * @param unknown_type $path + * @param unknown_type $content + * @return unknown + */ + function write_css_cache($path, $content) { + if (!is_dir(dirname($path))) { + mkdir(dirname($path)); + } + $cache = new File($path); + return $cache->write($content); + } + + if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) { + die('Wrong file name.'); + } + + $filename = 'css/' . $regs[1]; + $filepath = CSS . $regs[1]; + $cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]); + + if (!file_exists($filepath)) { + die('Wrong file name.'); + } + + if (file_exists($cachepath)) { + $templateModified = filemtime($filepath); + $cacheModified = filemtime($cachepath); + + if ($templateModified > $cacheModified) { + $output = make_clean_css($filepath, $filename); + write_css_cache($cachepath, $output); + } else { + $output = file_get_contents($cachepath); + } + } else { + $output = make_clean_css($filepath, $filename); + write_css_cache($cachepath, $output); + $templateModified = time(); + } + + header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT'); + header("Content-Type: text/css"); + header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT"); + header("Cache-Control: cache"); // HTTP/1.1 + header("Pragma: cache"); // HTTP/1.0 + print $output; +?> \ No newline at end of file diff --git a/webroot/css/cake.generic.css b/webroot/css/cake.generic.css new file mode 100755 index 0000000..b52b439 --- /dev/null +++ b/webroot/css/cake.generic.css @@ -0,0 +1,418 @@ +/* SVN FILE: $Id: cake.generic.css 6314 2008-01-02 21:33:51Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot.css + * @since CakePHP(tm) + * @version $Revision: 6314 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-02 13:33:51 -0800 (Wed, 02 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +* { +margin:0; +padding:0; +} + +/* General Style Info */ +body { + background-color: #003d4c; + color: #fff; + font-family:'lucida grande',verdana,helvetica,arial,sans-serif; + font-size:90%; + margin: 0; +} +a { + background-color: inherit; + color: #003d4c; + text-decoration: underline; + font-weight: bold; +} +a:hover { + background-color: inherit; + color: #003d4c; + text-decoration:none; +} +a img { + border:none; +} +h1, h2, h3, h4 { + background-color: inherit; + font-weight: normal; +} +h1 { + color: #003d4c; + font-size: 100%; + margin: 0.1em 0; +} +h2 { + color: #e32; + font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-size: 190%; + margin: 0.3em 0; + padding-top: 0.8em; +} +h3 { + color: #993; + font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-size: 165%; + padding-top: 1.5em; +} +h4 { + color: #993; + font-weight: normal; + padding-top: 0.5em; +} +ul, li { + margin: 0 12px; +} + +/* Layout */ +#container { + text-align: left; +} + +#header{ + padding: 10px 20px; +} +#header h1 { + background: url('../img/cake.icon.gif') no-repeat left; + color: #ffffff; + padding: 0px 30px; +} +#header h1 a { + color: #ffffff; + background: #003d4c; + font-weight: normal; + text-decoration: none; +} +#header h1 a:hover { + color: #ffffff; + background: #003d4c; + text-decoration: underline; +} +#content{ + background-color: #fff; + clear: both; + color: #333; + padding: 10px 20px 40px 20px; + overflow: auto; +} +#footer { + clear: both; + padding: 6px 10px; + text-align: right; +} + +/* Tables */ +table { + background-color: #fff; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-bottom: 1px solid #ccc; + clear: both; + color: #333; + margin-bottom: 10px; + width: 100%; +} +th { + background-color: #f2f2f2; + border-top: 1px solid #fff; + border-left: 1px solid #fff; + border-right: 1px solid #bbb; + border-bottom: 1px solid #bbb; + text-align: center; +} +th a { + display: block; + padding: 2px 4px; + text-decoration: none; +} +th a:hover { + background-color: #ccc; + color: #333; + text-decoration: none; +} +table tr td { + background: #fff; + border-right: 1px solid #ccc; + padding: 4px; + text-align: center; + vertical-align: top; +} +table tr.altrow td { + background: #f4f4f4; +} +td.actions { + text-align: center; + white-space: nowrap; +} +td.actions a { + display: inline; + margin: 0px 6px; +} +.cake-sql-log table { + background: #f4f4f4; +} +.cake-sql-log td { + padding: 4px 8px; + text-align: left; +} + +/* Paging */ +div.paging { + color: #ccc; + margin-bottom: 2em; +} +div.paging div.disabled { + color: #ddd; + display: inline; +} +div.paging span { +} +div.paging span.current { + color: #000; +} +div.paging span a { +} + +/* Scaffold View */ +dl { + line-height: 2em; + margin: 0em 0em; + width: 60%; +} +dl.altrow { + background: #f4f4f4; +} +dt { + font-weight: bold; + padding-left: 4px; + vertical-align: top; +} +dd { + margin-left: 10em; + margin-top: -2em; + vertical-align: top; +} + +/* Forms */ +form { + clear: both; + margin-right: 20px; + padding: 0; + width: 80%; +} +fieldset { + border: 1px solid #ccc; + margin-top: 30px; + padding: 16px 20px; +} +fieldset legend { + color: #e32; + font-size: 160%; + font-weight: bold; +} +fieldset fieldset { + margin-top: 0px; + margin-bottom: 20px; + padding: 16px 0; +} +fieldset fieldset legend { + font-size: 120%; + font-weight: normal; + margin-left: 20px; +} +fieldset fieldset div { + clear: left; + margin: 0 20px; +} +form div { + clear: both; + margin-bottom: 1em; + padding: .5em; + vertical-align: text-top; +} +form div.input { + color: #444; +} +form div.required { + color: #333; + font-weight: bold; +} +form div.submit { + border: 0; + clear: both; + margin-top: 10px; + margin-left: 140px; +} +label { + display: block; + font-size: 110%; + padding-right: 20px; +} +input, textarea { + clear: both; + display: block; + font-size: 140%; + font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif; + padding: 2px; + width: 100%; +} +select { + clear: both; + font-size: 120%; + vertical-align: text-bottom; +} +select[multiple=multiple] { + width: 100%; +} +option { + font-size: 120%; + padding: 0 3px; +} +input[type=checkbox] { + clear: left; + float: left; + margin: 0px 6px 7px 2px; + width: auto; +} +input[type=submit] { + display: inline; + font-size: 110%; + padding: 2px 5px; + width: auto; + vertical-align: bottom; +} + +/* Notices and Errors */ +div.message { + clear: both; + color: #900; + font-size: 140%; + font-weight: bold; + margin: 1em 0; +} +div.error-message { + clear: both; + color: #900; + font-weight: bold; +} +p.error { + background-color: #e32; + color: #fff; + font-family: Courier, monospace; + font-size: 120%; + line-height: 140%; + padding: 0.8em; + margin: 1em 0; +} +p.error em { + color: #000; + font-weight: normal; + line-height: 140%; +} +.notice { + background-color: #ffcc00; + color: #000; + display: block; + font-family: Courier, monospace; + font-size: 120%; + line-height: 140%; + padding: 0.8em; + margin: 1em 0; +} +.success { + background-color: green; + color: #FFF; +} + +/* Actions */ +div.actions ul { + margin: 0px 0; + padding: 0; +} +div.actions li { + display: inline; + list-style-type: none; + line-height: 2em; + margin: 0 2em 0 0; + white-space: nowrap; +} +div.actions ul li a { + color: #003d4c; + text-decoration: none; +} +div.actions ul li a:hover { + color: #333; + text-decoration: underline; +} + +/* Related */ +div.related { + clear: both; + display: block; +} + +/* Debugging */ +pre { + color: #000; + background: #f0f0f0; + padding: 1em; +} +pre.cake-debug { + background: #ffcc00; + font-size: 120%; + line-height: 140%; + margin-top: 1em; + overflow: auto; + position: relative; +} +div.cake-stack-trace { + background: #fff; + border: 4px dotted #ffcc00; + color: #333; + margin: 0px; + padding: 6px; + font-size: 120%; + line-height: 140%; + overflow: auto; + position: relative; +} +div.cake-code-dump pre { + position: relative; + overflow: auto; +} +div.cake-stack-trace pre, div.cake-code-dump pre { + color: #000000; + background-color: #F0F0F0; + margin: 0px; + padding: 1em; + overflow: auto; +} +div.cake-code-dump pre, div.cake-code-dump pre code { + clear: both; + font-size: 12px; + line-height: 15px; + margin: 4px 2px; + padding: 4px; + overflow: auto; +} +div.cake-code-dump span.code-highlight { + background-color: #FFFF00; + padding: 4px; +} \ No newline at end of file diff --git a/webroot/favicon.ico b/webroot/favicon.ico new file mode 100755 index 0000000..1bc32bd Binary files /dev/null and b/webroot/favicon.ico differ diff --git a/webroot/img/cake.icon.gif b/webroot/img/cake.icon.gif new file mode 100755 index 0000000..3421445 Binary files /dev/null and b/webroot/img/cake.icon.gif differ diff --git a/webroot/img/cake.power.gif b/webroot/img/cake.power.gif new file mode 100755 index 0000000..c9a6052 Binary files /dev/null and b/webroot/img/cake.power.gif differ diff --git a/webroot/index.php b/webroot/index.php new file mode 100755 index 0000000..062091c --- /dev/null +++ b/webroot/index.php @@ -0,0 +1,89 @@ +<?php +/* SVN FILE: $Id: index.php 6314 2008-01-02 21:33:51Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6314 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-02 13:33:51 -0800 (Wed, 02 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Do not change + */ + if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } +/** + * These defines should only be edited if you have cake installed in + * a directory layout other than the way it is distributed. + * Each define has a commented line of code that explains what you would change. + */ + if (!defined('ROOT')) { + //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR'); + //You should also use the DS define to separate your directories + define('ROOT', dirname(dirname(dirname(__FILE__)))); + } + if (!defined('APP_DIR')) { + //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION'); + define('APP_DIR', basename(dirname(dirname(__FILE__)))); + } +/** + * This only needs to be changed if the cake installed libs are located + * outside of the distributed directory structure. + */ + if (!defined('CAKE_CORE_INCLUDE_PATH')) { + //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR'); + //You should also use the DS define to separate your directories + define('CAKE_CORE_INCLUDE_PATH', ROOT); + } +/////////////////////////////// +//DO NOT EDIT BELOW THIS LINE// +/////////////////////////////// + if (!defined('WEBROOT_DIR')) { + define('WEBROOT_DIR', basename(dirname(__FILE__))); + } + if (!defined('WWW_ROOT')) { + define('WWW_ROOT', dirname(__FILE__) . DS); + } + if (!defined('CORE_PATH')) { + if (function_exists('ini_set')) { + ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path')); + define('APP_PATH', null); + define('CORE_PATH', null); + } else { + define('APP_PATH', ROOT . DS . APP_DIR . DS); + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + } + } + if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) { + trigger_error("Can't find CakePHP core. Check the value of CAKE_CORE_INCLUDE_PATH in app/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR); + } + if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { + return; + } else { + $Dispatcher = new Dispatcher(); + $Dispatcher->dispatch($url); + } + if (Configure::read() > 0) { + echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->"; + } +?> \ No newline at end of file diff --git a/webroot/js/MeatballSocietyCreoleV0.4.js b/webroot/js/MeatballSocietyCreoleV0.4.js new file mode 100644 index 0000000..81db154 --- /dev/null +++ b/webroot/js/MeatballSocietyCreoleV0.4.js @@ -0,0 +1,291 @@ +// Copyright (c) 2007 Chris Purcell. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +// Original source: http://www.meatballsociety.org/Creole/0.4/ + +function $(element) { + if (document.getElementById) + return document.getElementById(element); + else if (document.all) + return document.all[element]; + else + return null; +} + +String.prototype.replaceEvalGl = function(regex, fn) { + var head = ""; + var tail = "" + this; + while (m = tail.match(regex)) { + head += tail.substring(0,m.index) + fn(m); + tail = tail.substring(m.index + m[0].length); + } + return head + tail; +} + +//// The markup rules //////////////////////////////////////////////////////// +MarkupRule = function(regex, rule) { + this.regex = regex; + this.rule = rule; + this.children = [ ]; +} +MarkupRule.prototype.clone = function() { + var objectClone = new this.constructor(); + for (var property in this) + objectClone[property] = this[property]; + return objectClone; +} +MarkupRule.prototype.setChildren = function(children) { + this.children = children; +} +ElementRule = function(params) { + return new MarkupRule(params["regex"], function (r) { + var text = ""; + if ("capture" in params) + text = r[params["capture"]]; + if (text) { + if ("replaceRegex" in params) + text = text.replace(params["replaceRegex"], params["replaceString"]); + var tag = "<" + params["tag"] + ">"; + var endtag = "</" + params["tag"] + ">"; + if (!("tag" in params)) + tag = endtag = ""; + return tag + this.markUp(text) + endtag; + } else if ("tag" in params) + return "<" + params["tag"] + " />"; + else + return ""; + }); +} + +function toXHTML(wikiText) { + wikiText = wikiText.replace(/&/g, "&amp;"); + wikiText = wikiText.replace(/</g, "&lt;"); + wikiText = wikiText.replace(/>/g, "&gt;"); + wikiText = wikiText.replace(/"/g, "&quot;"); + return toXHTML.root.markUp(wikiText); +} + + // A header is text within equals signs (=) +toXHTML.h1 = new ElementRule({ tag: "h1", capture: 2, + regex: /(^|\n)[ \t]*={1}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); +toXHTML.h2 = new ElementRule({ tag: "h2", capture: 2, + regex: /(^|\n)[ \t]*={2}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); +toXHTML.h3 = new ElementRule({ tag: "h3", capture: 2, + regex: /(^|\n)[ \t]*={3}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); +toXHTML.h4 = new ElementRule({ tag: "h4", capture: 2, + regex: /(^|\n)[ \t]*={4}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); +toXHTML.h5 = new ElementRule({ tag: "h5", capture: 2, + regex: /(^|\n)[ \t]*={5}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); +toXHTML.h6 = new ElementRule({ tag: "h6", capture: 2, + regex: /(^|\n)[ \t]*={6}[ \t](.+?)[ \t]*=*\s*(\n|$)/ }); + + // hr is a line of 4 dashes (-) +toXHTML.hr = new ElementRule({ tag: "hr", regex: /(^|\n)\s*----\s*(\n|$)/ }); + + // br is two backslashes (\) +toXHTML.br = new ElementRule({ tag: "br", regex: /\\\\/ }); + + // Preformatted blocks are wrapped in {{{...}}} +toXHTML.preBlock = new ElementRule({ tag: "pre", capture: 2, + regex: /(^|\n){{{\n?(.*?(\n.*?)*?)}}}(\n|$)/ }); + + // tt inlines are also wrapped in {{{...}}} +toXHTML.tt = new ElementRule({ tag: "tt", + regex: /{{{(.*?(?:\n.*?)*?)}}}/, capture: 1 }); + + // Unordered and ordered lists start with * or # +toXHTML.ulist = new ElementRule({ tag: "ul", + regex: /(^|\n)(\*[^*#].*(\n|$)([*#]{2}.*(\n|$))*)+/, capture: 0, + replaceRegex: /(^|\n)[*#]/g, replaceString: "$1" }); +toXHTML.olist = new ElementRule({ tag: "ol", + regex: /(^|\n)(#[^*#].*(\n|$)([*#]{2}.*(\n|$))*)+/, capture: 0, + replaceRegex: /(^|\n)[*#]/g, replaceString: "$1" }); +toXHTML.li = new ElementRule({tag:"li",regex:/.+(\n[*#].+)*/,capture:0}); + + // Tables +toXHTML.table = new ElementRule({ tag: "table", + regex: /(^|\n)(\|.*\|[ \t]*(\n|$))+/, capture: 0 }); +toXHTML.tr = new ElementRule({ tag: "tr", + regex: /(^|\n)(\|.*)\|[ \t]*(\n|$)/, capture: 2 }); +toXHTML.td = new ElementRule({ tag: "td", + regex: /[|]+([^|]*)/, capture: 1 }); + + // Kinds of text block: + // - paragraph is the fallback for the root rule + // and consists of blocks of text separated by blank lines + // - singleLine is used within lists +toXHTML.singleLine = new ElementRule({ regex: /.+/, capture: 0 }); +toXHTML.paragraph = new ElementRule({ tag: "p", + regex: /(^|\n)([ \t]*[^\s].*(\n|$))+/, capture: 0 }); + + // Strongly emphasised text is surrounded by double-* characters +toXHTML.strong = new ElementRule({ tag: "strong", capture: 1, + regex:/\*\*([^*]*(?:\*[^*]+)*)\*\*/ }); + + // Emphasised text is surrounded by double-/ characters + // It must skip http:// or ftp:// internally + // (This would be a lot easier to write with negative lookbehind!) +toXHTML.em = new ElementRule({ tag: "em", capture: 1, + regex:"\\/\\/(" + // Starts with a double-/ + "[^\\/hf]*(?:" + + "\\/?(?:http:\\/?|ftp:\\/?)*(?:" + + "h(?:t(?:tp?)?)?" + "|" + + "f(?:tp?)?" + "|" + + "(?:" + + "h[^t\\/hf]" + "|" + + "ht[^t\\/hf]" + "|" + + "htt[^p\\/hf]" + "|" + + "http[^:\\/hf]" + "|" + + "http:[^\\/hf]" + "|" + + "http:\\/[^\\/hf]" + "|" + + "http:\\/\\/" + "|" + + "f[^t\\/hf]" + "|" + + "ft[^p\\/hf]" + "|" + + "ftp[^:\\/hf]" + "|" + + "ftp:[^\\/hf]" + "|" + + "ftp:\\/[^\\/hf]" + "|" + + "ftp:\\/\\/" + + ")" + + "[^\\/hf]*" + + ")" + "|" + + "\\/[^\\/hf][^\\/hf]*" + + ")*" + + ")" + + "\\/\\/" // Ends with a double-/ +}); + + // Links +toXHTML.linkPattern = "[^\\]|\\n]*(?:\\][^\\]|\\n]+)*"; +toXHTML.urlProtocols = "(?:http|https|ftp|afs|news|nntp|mid|cid|mailto|" + + "wais|prospero|telnet|gopher)"; +toXHTML.urlPattern = toXHTML.urlProtocols + ":" + + "[^\\]|\\n]*(?:\\][^\\]|\\n]+)*"; +toXHTML.loneURLPattern = "(?:" + toXHTML.urlProtocols + + ":[\\$-:=\\?-Z_a-z~]+[\\$-+\\/-Z_a-z~-])"; + +toXHTML.rawURL = new MarkupRule( "(" + toXHTML.loneURLPattern + ")", + function(r) { + return "<a href=\"" + r[1] + "\">" + r[1] + "</a>"; + } +); +toXHTML.unnamedURL = new MarkupRule( + "\\[\\[(" + toXHTML.urlPattern + ")\\]\\]", + function(r) { + return "<a href=\"" + r[1] + "\">" + r[1] + "</a>"; + } +); +toXHTML.unnamedLink = new MarkupRule( + "\\[\\[(" + toXHTML.linkPattern + ")\\]\\]", + function(r) { + return "<a href=\"" + r[1] + "\">" + r[1] + "</a>"; + } +); +toXHTML.namedURL = new MarkupRule( + "\\[\\[(" + toXHTML.urlPattern + ")\\|(.*?)\\]\\]", + function(r) { + return "<a href=\"" + r[1] + "\">" + r[2] + "</a>"; + } +); +toXHTML.namedLink = new MarkupRule( + "\\[\\[(" + toXHTML.linkPattern + ")\\|(.*?)\\]\\]", + function(r) { + return "<a href=\"" + r[1] + "\">" + r[2] + "</a>"; + } +); + + // Images +toXHTML.img = new MarkupRule( + "{{([^|\\n{}][^|\\n}]*(?:}[^|\\n}]+)*)\\|([^|\\n}]*(?:}[^|\\n}]+)*)}}", + function(r) { + return "<img src=\"" + r[1] + "\" alt=\"" + r[2] + "\"/>"; + } +); + + // Children of lists +toXHTML.ulist.children = toXHTML.olist.children = [ toXHTML.li ]; +toXHTML.li.children = [ toXHTML.olist, toXHTML.ulist, toXHTML.singleLine ]; + + // Children of table items +toXHTML.table.children = [ toXHTML.tr ]; +toXHTML.tr.children = [ toXHTML.td ]; +toXHTML.td.children = [ toXHTML.singleLine ]; + + // Children within blocks +toXHTML.singleLine.children = toXHTML.paragraph.children = + toXHTML.strong.children = toXHTML.em.children = toXHTML.tt.children = + [ toXHTML.strong, toXHTML.em, toXHTML.br, toXHTML.rawURL, + toXHTML.unnamedURL, toXHTML.unnamedLink, toXHTML.namedURL, + toXHTML.namedLink, toXHTML.tt, toXHTML.img ]; + + + // The root rule used to start the parser +toXHTML.root = new MarkupRule(); +toXHTML.root.children = [ toXHTML.h1, toXHTML.h2, toXHTML.h3, + toXHTML.h4, toXHTML.h5, toXHTML.h6, + toXHTML.hr, toXHTML.olist, + toXHTML.ulist, toXHTML.preBlock, + toXHTML.table ]; +toXHTML.root.fallback = new MarkupRule(); +toXHTML.root.fallback.children = [ toXHTML.paragraph ]; + + +//// Do the rendering //////////////////////////////////////////////////////// +// Apply each rule, and use whichever matches first in the text +// If there is a tie, use whichever is first in the list of rules +MarkupRule.prototype.markUp = function(text) { + var head = ""; + var tail = "" + text; + var matches = [ ]; + for (var i = 0; i < this.children.length; i++) { + matches[i] = tail.match(this.children[i].regex); + } + var best = false; + var b_i = false; + for (var i = 0; i < this.children.length; i++) + if (matches[i] && (!best || best.index > matches[i].index)) { + best = matches[i]; + b_i = i; + } + while (best) { + if ((best.index > 0) && (this.fallback)) + head += this.fallback.markUp(tail.substring(0,best.index)); + else + head += tail.substring(0,best.index); + head += this.children[b_i].rule(best); + var chopped = best.index + best[0].length; + tail = tail.substring(chopped); + for (var i = 0; i < this.children.length; i++) + if (matches[i]) + if (matches[i].index >= chopped) + matches[i].index -= chopped; + else + matches[i] = tail.match(this.children[i].regex); + best = false; + for (var i = 0; i < this.children.length; i++) + if (matches[i] && (!best || best.index > matches[i].index)) { + best = matches[i]; + b_i = i; + } + } + if (tail.length > 0 && this.fallback) + tail = this.fallback.markUp(tail); + return head + tail; +} diff --git a/webroot/js/vendors.php b/webroot/js/vendors.php new file mode 100755 index 0000000..8a9c5d8 --- /dev/null +++ b/webroot/js/vendors.php @@ -0,0 +1,43 @@ +<?php +/* SVN FILE: $Id: vendors.php 6296 2008-01-01 22:18:17Z phpnut $ */ +/** + * Short description for file. + * + * This file includes js vendor-files from /vendor/ directory if they need to + * be accessible to the public. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, 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 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot.js + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 6296 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2008-01-01 14:18:17 -0800 (Tue, 01 Jan 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ +$file = $_GET['file']; +$pos = strpos($file, '..'); +if ($pos === false) { + if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file))) + { + readfile('../../vendors/javascript/'.$file); + } +} else { + header('HTTP/1.1 404 Not Found'); +} +?> \ No newline at end of file diff --git a/webroot/test.php b/webroot/test.php new file mode 100755 index 0000000..6d65f52 --- /dev/null +++ b/webroot/test.php @@ -0,0 +1,183 @@ +<?php +/* SVN FILE: $Id: test.php 7214 2008-06-19 14:45:54Z gwoo $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.cake.tests.libs + * @since CakePHP(tm) v 1.2.0.4433 + * @version $Revision: 7214 $ + * @modifiedby $LastChangedBy: gwoo $ + * @lastmodified $Date: 2008-06-19 07:45:54 -0700 (Thu, 19 Jun 2008) $ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +error_reporting(E_ALL); +set_time_limit(0); +ini_set('memory_limit','128M'); +ini_set('display_errors', 1); +/** + * Use the DS to separate the directories in other defines + */ + if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } +/** + * These defines should only be edited if you have cake installed in + * a directory layout other than the way it is distributed. + * When using custom settings be sure to use the DS and do not add a trailing DS. + */ + +/** + * The full path to the directory which holds "app", WITHOUT a trailing DS. + * + */ + if (!defined('ROOT')) { + define('ROOT', dirname(dirname(dirname(__FILE__)))); + } +/** + * The actual directory name for the "app". + * + */ + if (!defined('APP_DIR')) { + define('APP_DIR', basename(dirname(dirname(__FILE__)))); + } +/** + * The absolute path to the "cake" directory, WITHOUT a trailing DS. + * + */ + if (!defined('CAKE_CORE_INCLUDE_PATH')) { + define('CAKE_CORE_INCLUDE_PATH', ROOT); + } + +/** + * Editing below this line should not be necessary. + * Change at your own risk. + * + */ +if (!defined('WEBROOT_DIR')) { + define('WEBROOT_DIR', basename(dirname(__FILE__))); +} +if (!defined('WWW_ROOT')) { + define('WWW_ROOT', dirname(__FILE__) . DS); +} +if (!defined('CORE_PATH')) { + if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) { + define('APP_PATH', null); + define('CORE_PATH', null); + } else { + define('APP_PATH', ROOT . DS . APP_DIR . DS); + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + } +} +if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) { + trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR); +} + +$corePath = Configure::corePaths('cake'); +if (isset($corePath[0])) { + define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); +} else { + define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH); +} + +require_once CAKE_TESTS_LIB . 'test_manager.php'; + +if (Configure::read('debug') < 1) { + die(__('Debug setting does not allow access to this url.', true)); +} + +if (!isset($_SERVER['SERVER_NAME'])) { + $_SERVER['SERVER_NAME'] = ''; +} +if (empty( $_GET['output'])) { + $_GET['output'] = 'html'; +} +/** + * + * Used to determine output to display + */ +define('CAKE_TEST_OUTPUT_HTML', 1); +define('CAKE_TEST_OUTPUT_TEXT', 2); + +if (isset($_GET['output']) && $_GET['output'] == 'html') { + define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML); +} else { + Debugger::output('txt'); + define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); +} + +if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { + CakePHPTestHeader(); + include CAKE_TESTS_LIB . 'simpletest.php'; + CakePHPTestSuiteFooter(); + exit(); +} + +$analyzeCodeCoverage = false; +if (isset($_GET['code_coverage'])) { + $analyzeCodeCoverage = true; + require_once CAKE_TESTS_LIB . 'code_coverage_manager.php'; + if (!extension_loaded('xdebug')) { + CakePHPTestHeader(); + include CAKE_TESTS_LIB . 'xdebug.php'; + CakePHPTestSuiteFooter(); + exit(); + } +} + +CakePHPTestHeader(); +CakePHPTestSuiteHeader(); +define('RUN_TEST_LINK', $_SERVER['PHP_SELF']); + +if (isset($_GET['group'])) { + if ('all' == $_GET['group']) { + TestManager::runAllTests(CakeTestsGetReporter()); + } else { + if ($analyzeCodeCoverage) { + CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter()); + } + TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter()); + if ($analyzeCodeCoverage) { + CodeCoverageManager::report(); + } + } + + CakePHPTestRunMore(); + CakePHPTestAnalyzeCodeCoverage(); +} elseif (isset($_GET['case'])) { + if ($analyzeCodeCoverage) { + CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter()); + } + + TestManager::runTestCase($_GET['case'], CakeTestsGetReporter()); + + if ($analyzeCodeCoverage) { + CodeCoverageManager::report(); + } + + CakePHPTestRunMore(); + CakePHPTestAnalyzeCodeCoverage(); +} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') { + CakePHPTestCaseList(); +} else { + CakePHPTestGroupTestList(); +} +CakePHPTestSuiteFooter(); +$output = ob_get_clean(); +echo $output; +?> \ No newline at end of file