зеркало из https://github.com/mozilla/pjs.git
initial import of models and other app files
This commit is contained in:
Родитель
0c623dd9cb
Коммит
2d97cacfa0
|
@ -0,0 +1,76 @@
|
|||
;<?php die() ?>
|
||||
; SVN FILE: $Id: acl.ini.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $
|
||||
;/**
|
||||
; * Short description for file.
|
||||
; *
|
||||
; *
|
||||
; * PHP versions 4 and 5
|
||||
; *
|
||||
; * CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
; * Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
; * 1785 E. Sahara Avenue, Suite 490-204
|
||||
; * Las Vegas, Nevada 89104
|
||||
; *
|
||||
; * Licensed under The MIT License
|
||||
; * Redistributions of files must retain the above copyright notice.
|
||||
; *
|
||||
; * @filesource
|
||||
; * @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
; * @package cake
|
||||
; * @subpackage cake.app.config
|
||||
; * @since CakePHP v 0.10.0.1076
|
||||
; * @version $Revision: 1.1 $
|
||||
; * @modifiedby $LastChangedBy: phpnut $
|
||||
; * @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
; * @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
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: bootstrap.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 0.10.8.2117
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @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
|
||||
?>
|
|
@ -0,0 +1,147 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: core.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* This is core configuration file.
|
||||
*
|
||||
* Use it to configure core behaviour ofCake.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* If you do not have mod rewrite on your system
|
||||
* or if you prefer to use CakePHP pretty urls.
|
||||
* uncomment the line below.
|
||||
* Note: If you do have mod rewrite but prefer the
|
||||
* CakePHP pretty urls, you also have to remove the
|
||||
* .htaccess files
|
||||
* release/.htaccess
|
||||
* release/app/.htaccess
|
||||
* release/app/webroot/.htaccess
|
||||
*/
|
||||
// define ('BASE_URL', env('SCRIPT_NAME'));
|
||||
/**
|
||||
* Set debug level here:
|
||||
* - 0: production
|
||||
* - 1: development
|
||||
* - 2: full debug with sql
|
||||
* - 3: full debug with sql and dump of the current object
|
||||
*
|
||||
* In production, the "flash messages" redirect after a time interval.
|
||||
* With the other debug levels you get to click the "flash message" to continue.
|
||||
*
|
||||
*/
|
||||
define('DEBUG', 1);
|
||||
/**
|
||||
* Turn of caching checking wide.
|
||||
* You must still use the controller var cacheAction inside you controller class.
|
||||
* You can either set it controller wide, or in each controller method.
|
||||
* use var $cacheAction = true; or in the controller method $this->cacheAction = true;
|
||||
*/
|
||||
define('CACHE_CHECK', false);
|
||||
/**
|
||||
* Error constant. Used for differentiating error logging and debugging.
|
||||
* Currently PHP supports LOG_DEBUG
|
||||
*/
|
||||
define('LOG_ERROR', 2);
|
||||
/**
|
||||
* CakePHP includes 3 types of session saves
|
||||
* database or file. Set this to your preferred method.
|
||||
* If you want to use your own save handler place it in
|
||||
* app/config/name.php DO NOT USE file or database as the name.
|
||||
* and use just the name portion below.
|
||||
*
|
||||
* Setting this to cake will save files to /cakedistro/tmp directory
|
||||
* Setting it to php will use the php default save path
|
||||
* Setting it to database will use the database
|
||||
*
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_SAVE', 'php');
|
||||
/**
|
||||
* If using you own table name for storing sessions
|
||||
* set the table name here.
|
||||
* DO NOT INCLUDE PREFIX IF YOU HAVE SET ONE IN database.php
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_TABLE', 'cake_sessions');
|
||||
/**
|
||||
* Set a random string of used in session.
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_STRING', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
||||
/**
|
||||
* Set the name of session cookie
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_COOKIE', 'CAKEPHP');
|
||||
/**
|
||||
* Set level of Cake security.
|
||||
*
|
||||
*/
|
||||
define('CAKE_SECURITY', 'high');
|
||||
/**
|
||||
* Set Cake Session time out.
|
||||
* If CAKE_SECURITY define is set
|
||||
* high: multiplied by 10
|
||||
* medium: is multiplied by 100
|
||||
* low is: multiplied by 300
|
||||
*
|
||||
* Number below is seconds.
|
||||
*/
|
||||
define('CAKE_SESSION_TIMEOUT', '120');
|
||||
/**
|
||||
* Uncomment the define below to use cake built in admin routes.
|
||||
* You can set this value to anything you want.
|
||||
* All methods related to the admin route should be prefixed with the
|
||||
* name you set CAKE_ADMIN to.
|
||||
* For example: admin_index, admin_edit
|
||||
*/
|
||||
// define('CAKE_ADMIN', 'admin');
|
||||
/**
|
||||
* The define below is used to turn cake built webservices
|
||||
* on or off. Default setting is off.
|
||||
*/
|
||||
define('WEBSERVICES', 'off');
|
||||
/**
|
||||
* Compress output CSS (removing comments, whitespace, repeating tags etc.)
|
||||
* This requires a/var/cache directory to be writable by the web server (caching).
|
||||
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag().
|
||||
*/
|
||||
define('COMPRESS_CSS', false);
|
||||
/**
|
||||
* If set to true, helpers would output data instead of returning it.
|
||||
*/
|
||||
define('AUTO_OUTPUT', false);
|
||||
/**
|
||||
* If set to false, session would not automatically be started.
|
||||
*/
|
||||
define('AUTO_SESSION', true);
|
||||
/**
|
||||
* Set the max size of file to use md5() .
|
||||
*/
|
||||
define('MAX_MD5SIZE', (5 * 1024) * 1024);
|
||||
/**
|
||||
* To use Access Control Lists with Cake...
|
||||
*/
|
||||
define('ACL_CLASSNAME', 'DB_ACL');
|
||||
define('ACL_FILENAME', 'dbacl' . DS . 'db_acl');
|
||||
?>
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: database.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* This is core configuration file.
|
||||
*
|
||||
* Use it to configure core behaviour ofCake.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @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 =>
|
||||
* mysql, postgres, sqlite, adodb, pear-drivername
|
||||
*
|
||||
* connect =>
|
||||
* MySQL set the connect to either mysql_pconnect of mysql_connect
|
||||
* PostgreSQL set the connect to either pg_pconnect of pg_connect
|
||||
* SQLite set the connect to sqlite_popen sqlite_open
|
||||
* 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)
|
||||
*
|
||||
* host =>
|
||||
* the host you connect to the database
|
||||
* MySQL 'localhost' to add a port number use 'localhost:port#'
|
||||
* PostgreSQL 'localhost' to add a port number use 'localhost port=5432'
|
||||
*
|
||||
*/
|
||||
class DATABASE_CONFIG
|
||||
{
|
||||
var $default = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
'host' => 'localhost',
|
||||
'login' => 'root',
|
||||
'password' => '',
|
||||
|
||||
'database' => 'addons',
|
||||
'prefix' => '');
|
||||
|
||||
var $test = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
'host' => 'localhost',
|
||||
'login' => 'root',
|
||||
'password' => '',
|
||||
'database' => 'addons_test',
|
||||
'prefix' => '');
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: database.php.default,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* This is core configuration file.
|
||||
*
|
||||
* Use it to configure core behaviour ofCake.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @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 =>
|
||||
* mysql, postgres, sqlite, adodb, pear-drivername
|
||||
*
|
||||
* connect =>
|
||||
* MySQL set the connect to either mysql_pconnect of mysql_connect
|
||||
* PostgreSQL set the connect to either pg_pconnect of pg_connect
|
||||
* SQLite set the connect to sqlite_popen sqlite_open
|
||||
* 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)
|
||||
*
|
||||
* host =>
|
||||
* the host you connect to the database
|
||||
* MySQL 'localhost' to add a port number use 'localhost:port#'
|
||||
* PostgreSQL 'localhost' to add a port number use 'localhost port=5432'
|
||||
*
|
||||
*/
|
||||
class DATABASE_CONFIG
|
||||
{
|
||||
var $default = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
'host' => 'localhost',
|
||||
'login' => 'user',
|
||||
'password' => 'password',
|
||||
'database' => 'project_name',
|
||||
'prefix' => '');
|
||||
|
||||
var $test = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
'host' => 'localhost',
|
||||
'login' => 'user',
|
||||
'password' => 'password',
|
||||
'database' => 'project_name-test',
|
||||
'prefix' => '');
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: inflections.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* 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 : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 1.0.0.2312
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @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);
|
||||
?>
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: routes.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* 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 : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @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)...
|
||||
*/
|
||||
$Route->connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
||||
/**
|
||||
* ...and connect the rest of 'Pages' controller's urls.
|
||||
*/
|
||||
$Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
||||
/**
|
||||
* Then we connect url '/test' to our test controller. This is helpfull in
|
||||
* developement.
|
||||
*/
|
||||
$Route->connect('/tests', array('controller' => 'tests', 'action' => 'index'));
|
||||
|
||||
//$Route->connect('/developers', array('controller' => 'developers/addons', 'action' => 'index'));
|
||||
?>
|
|
@ -0,0 +1,688 @@
|
|||
-- phpMyAdmin SQL Dump
|
||||
-- version 2.8.2.1
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Aug 14, 2006 at 01:59 PM
|
||||
-- Server version: 4.1.20
|
||||
-- PHP Version: 4.3.9
|
||||
--
|
||||
-- Database: `addons`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `addons`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `addons`;
|
||||
CREATE TABLE IF NOT EXISTS `addons` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`guid` varchar(255) NOT NULL default '',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`addontype_id` int(11) unsigned NOT NULL default '0',
|
||||
`icon` varchar(255) NOT NULL default '',
|
||||
`homepage` varchar(255) NOT NULL default '',
|
||||
`description` text NOT NULL,
|
||||
`summary` text NOT NULL,
|
||||
`averagerating` varchar(255) NOT NULL default '',
|
||||
`weeklydownloads` int(11) unsigned NOT NULL default '0',
|
||||
`totaldownloads` int(11) unsigned NOT NULL default '0',
|
||||
`developercomments` text NOT NULL,
|
||||
`inactive` tinyint(1) unsigned NOT NULL default '0',
|
||||
`prerelease` tinyint(1) unsigned NOT NULL default '0',
|
||||
`adminreview` tinyint(1) unsigned NOT NULL default '0',
|
||||
`sitespecific` tinyint(1) unsigned NOT NULL default '0',
|
||||
`externalsoftware` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`approvalnotes` text NOT NULL,
|
||||
`eula` text NOT NULL,
|
||||
`privacypolicy` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `addontype_id` (`addontype_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `addons`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `addons_tags`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `addons_tags`;
|
||||
CREATE TABLE IF NOT EXISTS `addons_tags` (
|
||||
`addon_id` int(11) unsigned NOT NULL default '0',
|
||||
`tag_id` int(11) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`addon_id`,`tag_id`),
|
||||
KEY `tag_id` (`tag_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `addons_tags`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `addons_users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `addons_users`;
|
||||
CREATE TABLE IF NOT EXISTS `addons_users` (
|
||||
`addon_id` int(11) unsigned NOT NULL default '0',
|
||||
`user_id` int(11) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`addon_id`,`user_id`),
|
||||
KEY `user_id` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `addons_users`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `addontypes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `addontypes`;
|
||||
CREATE TABLE IF NOT EXISTS `addontypes` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(255) character set latin1 NOT NULL default '',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `addontypes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `applications`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `applications`;
|
||||
CREATE TABLE IF NOT EXISTS `applications` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`guid` varchar(255) character set latin1 NOT NULL default '',
|
||||
`name` varchar(255) character set latin1 NOT NULL default '',
|
||||
`shortname` varchar(255) character set latin1 NOT NULL default '',
|
||||
`supported` tinyint(1) NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `applications`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `applications_versions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `applications_versions`;
|
||||
CREATE TABLE IF NOT EXISTS `applications_versions` (
|
||||
`application_id` int(11) unsigned NOT NULL default '0',
|
||||
`version_id` int(11) unsigned NOT NULL default '0',
|
||||
`min` varchar(255) character set latin1 NOT NULL default '',
|
||||
`max` varchar(255) character set latin1 NOT NULL default '',
|
||||
`public` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`application_id`,`version_id`),
|
||||
KEY `version_id` (`version_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `applications_versions`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `approvals`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `approvals`;
|
||||
CREATE TABLE IF NOT EXISTS `approvals` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`user_id` int(11) unsigned NOT NULL default '0',
|
||||
`action` varchar(255) character set latin1 NOT NULL default '',
|
||||
`file_id` int(11) unsigned NOT NULL default '0',
|
||||
`comments` text character set latin1 NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user_id` (`user_id`),
|
||||
KEY `file_id` (`file_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `approvals`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `appversions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `appversions`;
|
||||
CREATE TABLE IF NOT EXISTS `appversions` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`application_id` int(11) unsigned NOT NULL default '0',
|
||||
`version` varchar(255) NOT NULL default '',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `application_id` (`application_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `appversions`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `blapps`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `blapps`;
|
||||
CREATE TABLE IF NOT EXISTS `blapps` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`blitem_id` int(11) unsigned NOT NULL default '0',
|
||||
`guid` int(11) default NULL,
|
||||
`min` varchar(255) character set latin1 default NULL,
|
||||
`max` varchar(255) character set latin1 default NULL,
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `blitem_id` (`blitem_id`),
|
||||
KEY `guid` (`guid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `blapps`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `blitems`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `blitems`;
|
||||
CREATE TABLE IF NOT EXISTS `blitems` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`guid` varchar(255) character set latin1 NOT NULL default '',
|
||||
`min` varchar(255) character set latin1 default NULL,
|
||||
`max` varchar(255) character set latin1 default NULL,
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `blitems`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `cake_sessions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `cake_sessions`;
|
||||
CREATE TABLE IF NOT EXISTS `cake_sessions` (
|
||||
`id` varchar(255) NOT NULL default '',
|
||||
`data` text,
|
||||
`expires` int(11) default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `cake_sessions`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `downloads`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `downloads`;
|
||||
CREATE TABLE IF NOT EXISTS `downloads` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`file_id` int(11) unsigned default NULL,
|
||||
`userip` varchar(255) NOT NULL default '',
|
||||
`useragent` varchar(255) NOT NULL default '',
|
||||
`counted` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `file_id` (`file_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `downloads`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `features`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `features`;
|
||||
CREATE TABLE IF NOT EXISTS `features` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`addon_id` int(11) unsigned NOT NULL default '0',
|
||||
`start` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`end` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `addon_id` (`addon_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `features`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `files`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `files`;
|
||||
CREATE TABLE IF NOT EXISTS `files` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`version_id` int(11) unsigned NOT NULL default '0',
|
||||
`platform_id` int(11) unsigned NOT NULL default '0',
|
||||
`filename` varchar(255) character set latin1 NOT NULL default '',
|
||||
`size` varchar(255) character set latin1 NOT NULL default '',
|
||||
`hash` varchar(255) character set latin1 NOT NULL default '',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `version_id` (`version_id`),
|
||||
KEY `platform_id` (`platform_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `files`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `langs`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `langs`;
|
||||
CREATE TABLE IF NOT EXISTS `langs` (
|
||||
`id` varchar(255) NOT NULL default '',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`meta` varchar(255) NOT NULL default '',
|
||||
`error_text` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `langs`
|
||||
--
|
||||
|
||||
INSERT INTO `langs` (`id`, `name`, `meta`, `error_text`) VALUES ('en-US', 'en-US', 'en-US', ''),
|
||||
('en-GB', 'en-GB', 'en-GB', ''),
|
||||
('fr', 'fr', 'fr', ''),
|
||||
('de', 'de', 'de', ''),
|
||||
('ja', 'ja', 'ja', ''),
|
||||
('pl', 'pl', 'pl', ''),
|
||||
('es-ES', 'es-ES', 'es-ES', ''),
|
||||
('zh-CN', 'zh-CN', 'zh-CN', ''),
|
||||
('zh-TW', 'zh-TW', 'zh-TW', ''),
|
||||
('cs', 'cs', 'cs', ''),
|
||||
('da', 'da', 'da', ''),
|
||||
('nl', 'nl', 'nl', ''),
|
||||
('fi', 'fi', 'fi', ''),
|
||||
('hu', 'hu', 'hu', ''),
|
||||
('it', 'it', 'it', ''),
|
||||
('ko', 'ko', 'ko', ''),
|
||||
('pt-BR', 'pt-BR', 'pt-BR', ''),
|
||||
('ru', 'ru', 'ru', ''),
|
||||
('es-AR', 'es-AR', 'es-AR', ''),
|
||||
('sv-SE', 'sv-SE', 'sv-SE', ''),
|
||||
('tr', 'tr', 'tr', '');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `platforms`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `platforms`;
|
||||
CREATE TABLE IF NOT EXISTS `platforms` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`shortname` varchar(255) NOT NULL default '',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `platforms`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `previews`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `previews`;
|
||||
CREATE TABLE IF NOT EXISTS `previews` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`addon_id` int(11) unsigned NOT NULL default '0',
|
||||
`filename` varchar(255) NOT NULL default '',
|
||||
`caption` varchar(255) NOT NULL default '',
|
||||
`highlight` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `addon_id` (`addon_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `previews`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `reviewratings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `reviewratings`;
|
||||
CREATE TABLE IF NOT EXISTS `reviewratings` (
|
||||
`review_id` int(11) unsigned NOT NULL default '0',
|
||||
`user_id` int(11) unsigned NOT NULL default '0',
|
||||
`helpful` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`review_id`,`user_id`),
|
||||
KEY `user_id` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `reviewratings`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `reviews`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `reviews`;
|
||||
CREATE TABLE IF NOT EXISTS `reviews` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`version_id` int(11) unsigned NOT NULL default '0',
|
||||
`rating` int(11) unsigned NOT NULL default '0',
|
||||
`title` varchar(255) NOT NULL default '',
|
||||
`body` text NOT NULL,
|
||||
`editorreview` tinyint(1) unsigned NOT NULL default '0',
|
||||
`flag` tinyint(1) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `version_id` (`version_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `reviews`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `tags`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tags`;
|
||||
CREATE TABLE IF NOT EXISTS `tags` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`description` text NOT NULL,
|
||||
`addontype_id` int(11) unsigned NOT NULL default '0',
|
||||
`application_id` int(11) unsigned NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `addontype_id` (`addontype_id`),
|
||||
KEY `application_id` (`application_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `tags`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `translations`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `translations`;
|
||||
CREATE TABLE IF NOT EXISTS `translations` (
|
||||
`id` varchar(255) NOT NULL default '',
|
||||
`page_id` varchar(255) NOT NULL default '',
|
||||
`en-US` text,
|
||||
`en-GB` text,
|
||||
`fr` text,
|
||||
`de` text,
|
||||
`ja` text,
|
||||
`pl` text,
|
||||
`es-ES` text,
|
||||
`zh-CN` text,
|
||||
`zh-TW` text,
|
||||
`cs` text,
|
||||
`da` text,
|
||||
`nl` text,
|
||||
`fi` text,
|
||||
`hu` text,
|
||||
`it` text,
|
||||
`ko` text,
|
||||
`pt-BR` text,
|
||||
`ru` text,
|
||||
`es-AR` text,
|
||||
`sv-SE` text,
|
||||
`tr` text,
|
||||
PRIMARY KEY (`id`,`page_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `translations`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`cake_session_id` varchar(255) default NULL,
|
||||
`username` varchar(255) NOT NULL default '',
|
||||
`firstname` varchar(255) NOT NULL default '',
|
||||
`lastname` varchar(255) NOT NULL default '',
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`emailhidden` tinyint(1) unsigned NOT NULL default '0',
|
||||
`homepage` varchar(255) NOT NULL default '',
|
||||
`confirmationcode` varchar(255) NOT NULL default '',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`notes` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
KEY `cake_session_id` (`cake_session_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `users`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `versions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `versions`;
|
||||
CREATE TABLE IF NOT EXISTS `versions` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`addon_id` int(11) unsigned NOT NULL default '0',
|
||||
`version` varchar(255) NOT NULL default '',
|
||||
`dateaded` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`dateapproved` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`dateupdated` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`approved` tinyint(1) unsigned NOT NULL default '0',
|
||||
`releasenotes` text NOT NULL,
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`modifid` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `addon_id` (`addon_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `versions`
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `addons`
|
||||
--
|
||||
ALTER TABLE `addons`
|
||||
ADD CONSTRAINT `addons_ibfk_1` FOREIGN KEY (`addontype_id`) REFERENCES `addontypes` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `addons_tags`
|
||||
--
|
||||
ALTER TABLE `addons_tags`
|
||||
ADD CONSTRAINT `addons_tags_ibfk_4` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
||||
ADD CONSTRAINT `addons_tags_ibfk_3` FOREIGN KEY (`addon_id`) REFERENCES `addons` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `addons_users`
|
||||
--
|
||||
ALTER TABLE `addons_users`
|
||||
ADD CONSTRAINT `addons_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
|
||||
ADD CONSTRAINT `addons_users_ibfk_1` FOREIGN KEY (`addon_id`) REFERENCES `addons` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `applications_versions`
|
||||
--
|
||||
ALTER TABLE `applications_versions`
|
||||
ADD CONSTRAINT `applications_versions_ibfk_2` FOREIGN KEY (`version_id`) REFERENCES `versions` (`id`),
|
||||
ADD CONSTRAINT `applications_versions_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `applications` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `approvals`
|
||||
--
|
||||
ALTER TABLE `approvals`
|
||||
ADD CONSTRAINT `approvals_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`),
|
||||
ADD CONSTRAINT `approvals_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `appversions`
|
||||
--
|
||||
ALTER TABLE `appversions`
|
||||
ADD CONSTRAINT `appversions_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `applications` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `blapps`
|
||||
--
|
||||
ALTER TABLE `blapps`
|
||||
ADD CONSTRAINT `blapps_ibfk_1` FOREIGN KEY (`blitem_id`) REFERENCES `blitems` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `downloads`
|
||||
--
|
||||
ALTER TABLE `downloads`
|
||||
ADD CONSTRAINT `downloads_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `features`
|
||||
--
|
||||
ALTER TABLE `features`
|
||||
ADD CONSTRAINT `features_ibfk_1` FOREIGN KEY (`addon_id`) REFERENCES `addons` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `files`
|
||||
--
|
||||
ALTER TABLE `files`
|
||||
ADD CONSTRAINT `files_ibfk_2` FOREIGN KEY (`platform_id`) REFERENCES `platforms` (`id`),
|
||||
ADD CONSTRAINT `files_ibfk_1` FOREIGN KEY (`version_id`) REFERENCES `versions` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `previews`
|
||||
--
|
||||
ALTER TABLE `previews`
|
||||
ADD CONSTRAINT `previews_ibfk_1` FOREIGN KEY (`addon_id`) REFERENCES `addons` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `reviewratings`
|
||||
--
|
||||
ALTER TABLE `reviewratings`
|
||||
ADD CONSTRAINT `reviewratings_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
|
||||
ADD CONSTRAINT `reviewratings_ibfk_1` FOREIGN KEY (`review_id`) REFERENCES `reviews` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `reviews`
|
||||
--
|
||||
ALTER TABLE `reviews`
|
||||
ADD CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`version_id`) REFERENCES `versions` (`id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`cake_session_id`) REFERENCES `cake_sessions` (`id`);
|
|
@ -0,0 +1,11 @@
|
|||
-- @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
-- @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
-- @since CakePHP v 0.10.8.1997
|
||||
-- @version $Revision: 1.1 $
|
||||
|
||||
CREATE TABLE cake_sessions (
|
||||
id varchar(255) NOT NULL default '',
|
||||
data text,
|
||||
expires int(11) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
class AddonsController extends AppController
|
||||
{
|
||||
var $name = 'Addons';
|
||||
var $scaffold;
|
||||
|
||||
function index()
|
||||
{
|
||||
$this->layout = 'developers';
|
||||
$this->set('addons', $this->Addon->findall());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app
|
||||
* @since CakePHP v 0.10.0.1076
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
||||
?>
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
class Addon extends AppModel
|
||||
{
|
||||
var $name = 'Addon';
|
||||
var $belongsTo = array('Addontype' =>
|
||||
array('className' => 'Addontype',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'dependent' => false,
|
||||
'foreignKey' => 'addontype_id'
|
||||
)
|
||||
);
|
||||
var $hasMany = array('Version' =>
|
||||
array('className' => 'Version',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'addon_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
),
|
||||
'Preview' =>
|
||||
array('className' => 'Preview',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'addon_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
),
|
||||
'Feature' =>
|
||||
array('classname' => 'Feature',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'addon_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
)
|
||||
);
|
||||
var $hasAndBelongsToMany = array('User' =>
|
||||
array('className' => 'User',
|
||||
'joinTable' => 'addons_users',
|
||||
'foreignKey' => 'addon_id',
|
||||
'associationForeignKey'=> 'user_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
),
|
||||
'Tag' =>
|
||||
array('className' => 'Tag',
|
||||
'joinTable' => 'addons_tags',
|
||||
'foreignKey' => 'addon_id',
|
||||
'associationForeignKey'=> 'tag_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
class Addontype extends AppModel
|
||||
{
|
||||
var $name = 'Addontype';
|
||||
var $belongsTo = array('Addon' =>
|
||||
array('className' => 'Addon',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'foreignKey' => 'addontype_id'
|
||||
)
|
||||
);
|
||||
|
||||
var $hasMany = array('Tag' =>
|
||||
array('className' => 'Tag',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'addontype_id',
|
||||
'dependent' => false,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
class Application extends AppModel
|
||||
{
|
||||
var $name = 'Application';
|
||||
var $hasMany = array('Tag' =>
|
||||
array('className' => 'Tag',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'application_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
),
|
||||
'Appversion' =>
|
||||
array('className' => 'Appversion',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'application_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
)
|
||||
);
|
||||
var $hasAndBelongsToMany = array('Version' =>
|
||||
array('className' => 'Version',
|
||||
'joinTable' => 'applications_versions',
|
||||
'foreignKey' => 'application_id',
|
||||
'associationForeignKey'=> 'version_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
class Cake_Session extends AppModel
|
||||
{
|
||||
var $name = 'Cake_Session';
|
||||
var $useTable = 'cake_sessions';
|
||||
var $belongsTo = array('User' =>
|
||||
array('className' => 'User',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'foreignKey' => 'cake_session_id'
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
class Tag extends AppModel
|
||||
{
|
||||
var $name = 'Tag';
|
||||
var $hasAndBelongsToMany = array('Addon' =>
|
||||
array('className' => 'Addon',
|
||||
'joinTable' => 'addons_tags',
|
||||
'foreignKey' => 'addon_id',
|
||||
'associationForeignKey'=> 'tag_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
)
|
||||
);
|
||||
var $belongsTo = array('Addontype' =>
|
||||
array('className' => 'Addontype',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'foreignKey' => 'addontype_id'
|
||||
),
|
||||
'Application' =>
|
||||
array('className' => 'Application',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'foreignKey' => 'application_id'
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
class User extends AppModel
|
||||
{
|
||||
var $name = 'User';
|
||||
var $hasAndBelongsToMany = array('Addon' =>
|
||||
array('className' => 'Addon',
|
||||
'joinTable' => 'addons_users',
|
||||
'foreignKey' => 'addon_id',
|
||||
'associationForeignKey'=> 'user_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
)
|
||||
);
|
||||
var $hasOne = array('Cake_Session' =>
|
||||
array('className' => 'Cake_Session',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'dependent' => true,
|
||||
'foreignKey' => 'cake_session_id'
|
||||
)
|
||||
);
|
||||
var $hasMany = array('Approval' =>
|
||||
array('className' => 'Approval',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'user_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
),
|
||||
'Reviewrating' =>
|
||||
array('className' => 'Reviewrating',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'user_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
class Version extends AppModel
|
||||
{
|
||||
var $name = 'Version';
|
||||
var $belongsTo = array('Addon' =>
|
||||
array('className' => 'Addon',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'foreignKey' => 'addon_id'
|
||||
)
|
||||
);
|
||||
var $hasMany = array('Review' =>
|
||||
array('className' => 'Review',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'version_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
),
|
||||
'File' =>
|
||||
array('className' => 'File',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'foreignKey' => 'version_id',
|
||||
'dependent' => true,
|
||||
'exclusive' => false,
|
||||
'finderSql' => ''
|
||||
)
|
||||
);
|
||||
var $hasAndBelongsToMany = array('Application' =>
|
||||
array('className' => 'Application',
|
||||
'joinTable' => 'applications_versions',
|
||||
'foreignKey' => 'application_id',
|
||||
'associationForeignKey'=> 'version_id',
|
||||
'conditions' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'unique' => false,
|
||||
'finderSql' => '',
|
||||
'deleteQuery'=> '',
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,17 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Cake Unit Test Suite
|
||||
--------------------------------------------------------------------------------
|
||||
$Id: README.txt,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $
|
||||
$Date: 2006-08-14 23:54:57 $
|
||||
$LastChangedBy: phpnut $
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
RUNNING THE TESTS
|
||||
|
||||
All test cases should have the file suffix '.test.php'.
|
||||
Example: controller.test.php
|
||||
|
||||
All group tests should have the file suffix '.group.php'.
|
||||
Example: controller.group.php
|
||||
|
||||
This test suite is already in the proper directory structure for you to upload to your application.
|
|
@ -0,0 +1,37 @@
|
|||
;<?php die() ?>
|
||||
; SVN FILE: $Id: config.ini.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $
|
||||
;/**
|
||||
; * Short description for file.
|
||||
; *
|
||||
; * Long description for file
|
||||
; *
|
||||
; * PHP versions 4 and 5
|
||||
; *
|
||||
; * CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
; * Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
; * Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
; *
|
||||
; * Portions modifiied from WACT Test Suite
|
||||
; * Author(s): Harry Fuecks
|
||||
; * Jon Ramsey
|
||||
; * Jason E. Sweat
|
||||
; * Franco Ponticelli
|
||||
; * Lorenzo Alberton
|
||||
; *
|
||||
; * Licensed under The Open Group Test Suite License
|
||||
; * Redistributions of files must retain the above copyright notice.
|
||||
; *
|
||||
; * @filesource
|
||||
; * @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
; * @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
; * @link http://www.phpnut.com/projects/
|
||||
; * @package tests
|
||||
; * @since CakePHP Test Suite v 1.0.0.0
|
||||
; * @version $Revision: 1.1 $
|
||||
; * @modifiedby $LastChangedBy: phpnut $
|
||||
; * @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
; * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
; */
|
||||
|
||||
[output]
|
||||
TEST_OUTPUT = html
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: cake_reporter.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @subpackage tests.libs
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.libs
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class CakeHtmlReporter extends HtmlReporter {
|
||||
|
||||
/**
|
||||
* Does nothing yet. The first output will
|
||||
* be sent on the first test start. For use
|
||||
* by a web browser.
|
||||
* @access public
|
||||
*/
|
||||
function CakeHtmlReporter($character_set = 'ISO-8859-1') {
|
||||
parent::HtmlReporter($character_set);
|
||||
}
|
||||
/**
|
||||
* Paints the top of the web page setting the
|
||||
* title to the name of the starting test.
|
||||
* @param string $test_name Name class of test.
|
||||
* @access public
|
||||
*/
|
||||
function paintHeader($test_name) {
|
||||
$this->sendNoCacheHeaders();
|
||||
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
||||
print "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
|
||||
print "<head>\n";
|
||||
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $this->_character_set . "\" />\n";
|
||||
print "<title>CakePHP Test Suite v 1.0.0.0 :: $test_name</title>\n";
|
||||
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/cake.default.css\" />\n";
|
||||
print "<style type=\"text/css\">\n";
|
||||
print $this->_getCss() . "\n";
|
||||
print "</style>\n";
|
||||
print "</head>\n<body>\n";
|
||||
print "<div id=\"wrapper\">\n";
|
||||
print "<div id=\"header\">\n";
|
||||
print "<img src=\"/img/cake.logo.png\" alt=\"\" /></div>\n";
|
||||
print "<div id=\"content\">\n";
|
||||
print "<h1>CakePHP Test Suite v 1.0.0.0</h1>\n";
|
||||
print "<h2>$test_name</h2>\n";
|
||||
flush();
|
||||
}
|
||||
/**
|
||||
* Paints the end of the test with a summary of
|
||||
* the passes and failures.
|
||||
* @param string $test_name Name class of test.
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
function paintFooter($test_name) {
|
||||
$colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green");
|
||||
print "<div style=\"";
|
||||
print "padding: 8px; margin-top: 1em; background-color: $colour; color: white;";
|
||||
print "\">";
|
||||
print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount();
|
||||
print " test cases complete:\n";
|
||||
print "<strong>" . $this->getPassCount() . "</strong> passes, ";
|
||||
print "<strong>" . $this->getFailCount() . "</strong> fails and ";
|
||||
print "<strong>" . $this->getExceptionCount() . "</strong> exceptions.";
|
||||
print "</div>\n";
|
||||
}
|
||||
|
||||
function paintPass($message) {
|
||||
parent::paintPass($message);
|
||||
print "<span class=\"pass\">Pass</span>: ";
|
||||
$breadcrumb = $this->getTestList();
|
||||
array_shift($breadcrumb);
|
||||
print implode("->", $breadcrumb);
|
||||
print "->$message<br />\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: cake_web_test_case.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
/**
|
||||
* Short description
|
||||
*/
|
||||
SimpleTestOptions::ignore('CakeWebTestCase');
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class CakeWebTestCase extends WebTestCase {
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: cli_reporter.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
if (! defined('ST_FAILDETAIL_SEPARATOR')) {
|
||||
define('ST_FAILDETAIL_SEPARATOR', "->");
|
||||
}
|
||||
|
||||
if (! defined('ST_FAILS_RETURN_CODE')) {
|
||||
define('ST_FAILS_RETURN_CODE', 1);
|
||||
}
|
||||
|
||||
if (version_compare(phpversion(), '4.3.0', '<') ||
|
||||
php_sapi_name() == 'cgi') {
|
||||
define('STDOUT', fopen('php://stdout', 'w'));
|
||||
define('STDERR', fopen('php://stderr', 'w'));
|
||||
register_shutdown_function(
|
||||
create_function('', 'fclose(STDOUT); fclose(STDERR); return true;'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimal command line test displayer. Writes fail details to STDERR. Returns 0
|
||||
* to the shell if all tests pass, ST_FAILS_RETURN_CODE if any test fails.
|
||||
*/
|
||||
class CLIReporter extends SimpleReporter {
|
||||
var $faildetail_separator = ST_FAILDETAIL_SEPARATOR;
|
||||
|
||||
function CLIReporter($faildetail_separator = NULL) {
|
||||
$this->SimpleReporter();
|
||||
if (! is_null($faildetail_separator)) {
|
||||
$this->setFailDetailSeparator($faildetail_separator);
|
||||
}
|
||||
}
|
||||
|
||||
function setFailDetailSeparator($separator) {
|
||||
$this->faildetail_separator = $separator;
|
||||
}
|
||||
/**
|
||||
* Return a formatted faildetail for printing.
|
||||
*/
|
||||
function &_paintTestFailDetail(&$message) {
|
||||
$buffer = '';
|
||||
$faildetail = $this->getTestList();
|
||||
array_shift($faildetail);
|
||||
$buffer .= implode($this->faildetail_separator, $faildetail);
|
||||
$buffer .= $this->faildetail_separator . "$message\n";
|
||||
return $buffer;
|
||||
}
|
||||
/**
|
||||
* Paint fail faildetail to STDERR.
|
||||
*/
|
||||
function paintFail($message) {
|
||||
parent::paintFail($message);
|
||||
fwrite(STDERR, 'FAIL' . $this->faildetail_separator . $this->_paintTestFailDetail($message));
|
||||
}
|
||||
/**
|
||||
* Paint exception faildetail to STDERR.
|
||||
*/
|
||||
function paintException($message) {
|
||||
parent::paintException($message);
|
||||
fwrite(STDERR, 'EXCEPTION' . $this->faildetail_separator . $this->_paintTestFailDetail($message));
|
||||
}
|
||||
/**
|
||||
* Paint a footer with test case name, timestamp, counts of fails and exceptions.
|
||||
*/
|
||||
function paintFooter($test_name) {
|
||||
$buffer = $this->getTestCaseProgress() . '/' . $this->getTestCaseCount() . ' test cases complete: ';
|
||||
|
||||
if (0 < ($this->getFailCount() + $this->getExceptionCount())) {
|
||||
$buffer .= $this->getPassCount() . " passes";
|
||||
if (0 < $this->getFailCount()) {
|
||||
$buffer .= ", " . $this->getFailCount() . " fails";
|
||||
}
|
||||
if (0 < $this->getExceptionCount()) {
|
||||
$buffer .= ", " . $this->getExceptionCount() . " exceptions";
|
||||
}
|
||||
$buffer .= ".\n";
|
||||
fwrite(STDOUT, $buffer);
|
||||
exit(ST_FAILS_RETURN_CODE);
|
||||
} else {
|
||||
fwrite(STDOUT, $buffer . $this->getPassCount() . " passes.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,389 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: rss_writer_class.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) Manuel Lemos 2001-2002
|
||||
*
|
||||
* Licensed under The BSD License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Manuel Lemos
|
||||
* @copyright Copyright (c) 2001-2002, Manuel Lemos
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.html BSD
|
||||
*/
|
||||
|
||||
if(!defined("METAL_LIBRARY_XML_RSS_WRITER_CLASS"))
|
||||
{
|
||||
define("METAL_LIBRARY_XML_RSS_WRITER_CLASS",1);
|
||||
|
||||
|
||||
class rss_writer_class extends xml_writer_class
|
||||
{
|
||||
/*
|
||||
* Protected variables
|
||||
*
|
||||
*/
|
||||
var $root="";
|
||||
var $channel="";
|
||||
var $image="";
|
||||
var $textinput="";
|
||||
var $items=0;
|
||||
var $itemsequence="";
|
||||
|
||||
/*
|
||||
* Public variables
|
||||
*
|
||||
*/
|
||||
var $specification="1.0";
|
||||
var $about="";
|
||||
var $rssnamespaces=array();
|
||||
var $allownoitems=0;
|
||||
var $generatedcomment="Generated by: http://www.phpclasses.org/rsswriter";
|
||||
|
||||
|
||||
/*
|
||||
* Protected functions
|
||||
*
|
||||
*/
|
||||
Function addrssproperties(&$properties,$parent,&$required,&$optional,$scope)
|
||||
{
|
||||
$noattributes=array();
|
||||
$required_properties=0;
|
||||
Reset($properties);
|
||||
$end=(GetType($property=Key($properties))!="string");
|
||||
for(;!$end;)
|
||||
{
|
||||
if(IsSet($required[$property]))
|
||||
{
|
||||
if($required[$property])
|
||||
{
|
||||
$this->error=("required ".$scope." property \"".$property."\" is already set");
|
||||
return 0;
|
||||
}
|
||||
$required[$property]=1;
|
||||
$required_properties++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(IsSet($optional[$property]))
|
||||
{
|
||||
if($optional[$property])
|
||||
{
|
||||
$this->error=("optional ".$scope." property \"".$property."\" is already set");
|
||||
return 0;
|
||||
}
|
||||
$optional[$property]=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetType($colon=strpos($property,":",0))=="integer")
|
||||
{
|
||||
$namespace=substr($property,0,$colon);
|
||||
if(!(!strcmp($namespace,"rdf") || IsSet($this->rssnamespaces[$namespace])))
|
||||
$this->error=("the name space of property \"".$property."\" was not declared");
|
||||
}
|
||||
else
|
||||
$this->error=("\"".$property."\" is not a supported ".$scope." property");
|
||||
}
|
||||
}
|
||||
if(!($this->adddatatag($property,$noattributes,$properties[$property],$parent,$path)))
|
||||
return 0;
|
||||
Next($properties);
|
||||
$end=(GetType($property=Key($properties))!="string");
|
||||
}
|
||||
if($required_properties<count($required))
|
||||
{
|
||||
Reset($required);
|
||||
$end=(GetType($property=Key($required))!="string");
|
||||
for(;!$end;)
|
||||
{
|
||||
if(!($required[$property]))
|
||||
{
|
||||
$this->error=("it was not specified the required ".$scope." property \"".$property."\"");
|
||||
return 0;
|
||||
}
|
||||
Next($required);
|
||||
$end=(GetType($property=Key($required))!="string");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Public functions
|
||||
*
|
||||
*/
|
||||
Function addchannel(&$properties)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(strcmp($this->channel,""))
|
||||
{
|
||||
$this->error="a channel was already added";
|
||||
return 0;
|
||||
}
|
||||
$channel_attributes=array();
|
||||
switch($this->specification)
|
||||
{
|
||||
case "0.9":
|
||||
$root="rdf:RDF";
|
||||
$attributes=array("xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns"=>"http://my.netscape.com/rdf/simple/0.9/");
|
||||
$required=array("description"=>0,"link"=>0,"title"=>0);
|
||||
$optional=array();
|
||||
break;
|
||||
case "0.91":
|
||||
$root="rss";
|
||||
$attributes=array("version"=>$this->specification);
|
||||
$required=array("description"=>0,"language"=>0,"link"=>0,"title"=>0);
|
||||
$optional=array("copyright"=>0,"docs"=>0,"lastBuildDate"=>0,"managingEditor"=>0,"pubDate"=>0,"rating"=>0,"webMaster"=>0);
|
||||
break;
|
||||
case "1.0":
|
||||
if(!strcmp($this->about,""))
|
||||
{
|
||||
$this->error="it was not specified the about URL attribute";
|
||||
return 0;
|
||||
}
|
||||
$root="rdf:RDF";
|
||||
$attributes=array("xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns"=>"http://purl.org/rss/1.0/");
|
||||
Reset($this->rssnamespaces);
|
||||
$end=(GetType($namespace=Key($this->rssnamespaces))!="string");
|
||||
for(;!$end;)
|
||||
{
|
||||
if(!strcmp($namespace,"rdf"))
|
||||
{
|
||||
$this->error="the rdf namespace is being redeclared";
|
||||
return 0;
|
||||
}
|
||||
$attributes[("xmlns:".$namespace)]=$this->rssnamespaces[$namespace];
|
||||
Next($this->rssnamespaces);
|
||||
$end=(GetType($namespace=Key($this->rssnamespaces))!="string");
|
||||
}
|
||||
$channel_attributes=array("rdf:about"=>$this->about);
|
||||
$required=array("description"=>0,"link"=>0,"title"=>0);
|
||||
$optional=array();
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a supported RSS specification version";
|
||||
return 0;
|
||||
}
|
||||
$this->addtag($root,$attributes,"",$path,1);
|
||||
$this->root=$path;
|
||||
if(!($this->addtag("channel",$channel_attributes,$this->root,$path,1)))
|
||||
return 0;
|
||||
if(!($this->addrssproperties($properties,$path,$required,$optional,"channel")))
|
||||
return 0;
|
||||
$this->channel=$path;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function additem(&$properties)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!strcmp($this->channel,""))
|
||||
{
|
||||
$this->error="the channel was not yet added";
|
||||
return 0;
|
||||
}
|
||||
if(strcmp($this->textinput,""))
|
||||
{
|
||||
$this->error="items can not be added to the channel after defining the textinput";
|
||||
return 0;
|
||||
}
|
||||
$attributes=array();
|
||||
switch($this->specification)
|
||||
{
|
||||
case "0.9":
|
||||
$parent=$this->root;
|
||||
break;
|
||||
case "0.91":
|
||||
$parent=$this->channel;
|
||||
break;
|
||||
case "1.0":
|
||||
if(IsSet($properties["link"]))
|
||||
$attributes["rdf:about"]=$properties["link"];
|
||||
$parent=$this->root;
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a supported RSS specification version";
|
||||
return 0;
|
||||
}
|
||||
if(!($this->addtag("item",$attributes,$parent,$path,1)))
|
||||
return 0;
|
||||
$required=array("link"=>0,"title"=>0);
|
||||
$optional=array("description"=>0);
|
||||
if(!($this->addrssproperties($properties,$path,$required,$optional,"item")))
|
||||
return 0;
|
||||
if(!strcmp($this->specification,"1.0"))
|
||||
{
|
||||
if(!strcmp($this->itemsequence,""))
|
||||
{
|
||||
$attributes=array();
|
||||
if(!($this->addtag("items",$attributes,$this->channel,$path,1) && $this->addtag("rdf:Seq",$attributes,$path,$path,1)))
|
||||
return 0;
|
||||
$this->itemsequence=$path;
|
||||
}
|
||||
$attributes=array("rdf:resource"=>$properties["link"]);
|
||||
if(!($this->addtag("rdf:li",$attributes,$this->itemsequence,$path,0)))
|
||||
return 0;
|
||||
}
|
||||
$this->items++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function addimage(&$properties)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!strcmp($this->channel,""))
|
||||
{
|
||||
$this->error="the channel was not yet added";
|
||||
return 0;
|
||||
}
|
||||
if(strcmp($this->image,""))
|
||||
{
|
||||
$this->error="the channel image was already associated";
|
||||
return 0;
|
||||
}
|
||||
if($this->items!=0)
|
||||
{
|
||||
$this->error="the image can only be defined before adding the channel items";
|
||||
return 0;
|
||||
}
|
||||
$attributes=array();
|
||||
switch($this->specification)
|
||||
{
|
||||
case "0.9":
|
||||
$parent=$this->root;
|
||||
break;
|
||||
case "0.91":
|
||||
$parent=$this->channel;
|
||||
break;
|
||||
case "1.0":
|
||||
if(IsSet($properties["url"]))
|
||||
$attributes["rdf:about"]=$properties["url"];
|
||||
$parent=$this->root;
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a supported RSS specification version";
|
||||
return 0;
|
||||
}
|
||||
if(!($this->addtag("image",$attributes,$parent,$path,1)))
|
||||
return 0;
|
||||
$this->image=$path;
|
||||
$required=array("link"=>0,"title"=>0,"url"=>0);
|
||||
$optional=array("description"=>0,"width"=>0,"height"=>0);
|
||||
if(!($this->addrssproperties($properties,$this->image,$required,$optional,"image")))
|
||||
return 0;
|
||||
if(!strcmp($this->specification,"1.0"))
|
||||
{
|
||||
$attributes=array("rdf:resource"=>$properties["url"]);
|
||||
return $this->addtag("image",$attributes,$this->channel,$path,0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function addtextinput(&$properties)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!strcmp($this->channel,""))
|
||||
{
|
||||
$this->error="the channel was not yet added";
|
||||
return 0;
|
||||
}
|
||||
if(strcmp($this->textinput,""))
|
||||
{
|
||||
$this->error="the channel text input was already associated";
|
||||
return 0;
|
||||
}
|
||||
if($this->items==0 && !$this->allownoitems)
|
||||
{
|
||||
$this->error="it were not specified any items before defining the channel text input";
|
||||
return 0;
|
||||
}
|
||||
$attributes=array();
|
||||
switch($this->specification)
|
||||
{
|
||||
case "0.9":
|
||||
$parent=$this->root;
|
||||
break;
|
||||
case "0.91":
|
||||
$parent=$this->channel;
|
||||
break;
|
||||
case "1.0":
|
||||
if(IsSet($properties["link"]))
|
||||
$attributes["rdf:about"]=$properties["link"];
|
||||
$parent=$this->root;
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a supported RSS specification version";
|
||||
return 0;
|
||||
}
|
||||
if(!($this->addtag("textinput",$attributes,$parent,$path,1)))
|
||||
return 0;
|
||||
$this->textinput=$path;
|
||||
$required=array("description"=>0,"link"=>0,"name"=>0,"title"=>0);
|
||||
$optional=array();
|
||||
if(!($this->addrssproperties($properties,$this->textinput,$required,$optional,"textinput")))
|
||||
return 0;
|
||||
if(!strcmp($this->specification,"1.0"))
|
||||
{
|
||||
$attributes=array("rdf:resource"=>$properties["link"]);
|
||||
return $this->addtag("textinput",$attributes,$this->channel,$path,0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function writerss(&$output)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!strcmp($this->channel,""))
|
||||
{
|
||||
$this->error="it was not defined the RSS channel";
|
||||
return 0;
|
||||
}
|
||||
if($this->items==0 && !$this->allownoitems)
|
||||
{
|
||||
$this->error="it were not defined any RSS channel items";
|
||||
return 0;
|
||||
}
|
||||
switch($this->specification)
|
||||
{
|
||||
case "0.9":
|
||||
$this->dtdtype="PUBLIC";
|
||||
$this->dtddefinition="-//Netscape Communications//DTD RSS 0.9//EN";
|
||||
$this->dtdurl="http://my.netscape.com/publish/formats/rss-0.9.dtd";
|
||||
break;
|
||||
case "0.91":
|
||||
$this->dtdtype="PUBLIC";
|
||||
$this->dtddefinition="-//Netscape Communications//DTD RSS 0.91//EN";
|
||||
$this->dtdurl="http://my.netscape.com/publish/formats/rss-0.91.dtd";
|
||||
break;
|
||||
case "1.0":
|
||||
$this->dtdtype="";
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a supported RSS specification version";
|
||||
return 0;
|
||||
}
|
||||
return $this->write($output);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,549 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: test_manager.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: dho $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class TestManager {
|
||||
var $_testExtension = '.test.php';
|
||||
var $_groupExtension = '.group.php';
|
||||
var $usersAppTest = false;
|
||||
|
||||
function TestManager() {
|
||||
$this->_installSimpleTest();
|
||||
if (isset($_GET['app'])) {
|
||||
$this->usersAppTest = true;
|
||||
}
|
||||
}
|
||||
|
||||
function _installSimpleTest() {
|
||||
vendor('simpletest'.DS.'unit_tester', 'simpletest'.DS.'web_tester', 'simpletest'.DS.'mock_objects');
|
||||
require_once(LIB_TESTS.'cake_web_test_case.php');
|
||||
}
|
||||
|
||||
function setOutputFromIni($iniFile) {
|
||||
if (! file_exists($iniFile)) {
|
||||
trigger_error("Missing configuration file {$iniFile}", E_USER_ERROR);
|
||||
}
|
||||
$config = parse_ini_file($iniFile, TRUE);
|
||||
foreach ($config['output'] as $key => $value) {
|
||||
define($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
function runAllTests(&$reporter) {
|
||||
$manager =& new TestManager();
|
||||
|
||||
if(!empty($manager->usersAppTest)) {
|
||||
$testCasePath = APP_TEST_CASES . DIRECTORY_SEPARATOR;
|
||||
} else {
|
||||
$testCasePath = CORE_TEST_CASES . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$testCases =& $manager->_getTestFileList($testCasePath);
|
||||
$test =& new GroupTest('All Core Tests');
|
||||
|
||||
if (isset($_GET['app'])) {
|
||||
$test =& new GroupTest('All App Tests');
|
||||
} else {
|
||||
$test =& new GroupTest('All Core Tests');
|
||||
}
|
||||
|
||||
foreach ($testCases as $testCase) {
|
||||
$test->addTestFile($testCase);
|
||||
}
|
||||
$test->run($reporter);
|
||||
}
|
||||
|
||||
function runTestCase($testCaseFile, &$reporter) {
|
||||
$manager =& new TestManager();
|
||||
|
||||
if(!empty($manager->usersAppTest)) {
|
||||
$testCaseFileWithPath = APP_TEST_CASES . DIRECTORY_SEPARATOR . $testCaseFile;
|
||||
} else {
|
||||
$testCaseFileWithPath = CORE_TEST_CASES . DIRECTORY_SEPARATOR . $testCaseFile;
|
||||
}
|
||||
if (! file_exists($testCaseFileWithPath)) {
|
||||
trigger_error("Test case {$testCaseFile} cannot be found", E_USER_ERROR);
|
||||
}
|
||||
$test =& new GroupTest("Individual test case: " . $testCaseFile);
|
||||
$test->addTestFile($testCaseFileWithPath);
|
||||
$test->run($reporter);
|
||||
}
|
||||
|
||||
function runGroupTest($groupTestName, $groupTestDirectory, &$reporter) {
|
||||
$manager =& new TestManager();
|
||||
$filePath = $groupTestDirectory . DIRECTORY_SEPARATOR .
|
||||
strtolower($groupTestName) . $manager->_groupExtension;
|
||||
|
||||
if (! file_exists($filePath)) {
|
||||
trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR);
|
||||
}
|
||||
|
||||
require_once $filePath;
|
||||
$test =& new GroupTest($groupTestName . ' group test');
|
||||
|
||||
foreach ($manager->_getGroupTestClassNames($filePath) as $groupTest) {
|
||||
$test->addTestCase(new $groupTest());
|
||||
}
|
||||
$test->run($reporter);
|
||||
}
|
||||
|
||||
function addTestCasesFromDirectory(&$groupTest, $directory = '.') {
|
||||
$manager =& new TestManager();
|
||||
$testCases =& $manager->_getTestFileList($directory);
|
||||
foreach ($testCases as $testCase) {
|
||||
$groupTest->addTestFile($testCase);
|
||||
}
|
||||
}
|
||||
|
||||
function &getTestCaseList($directory = '.') {
|
||||
$manager =& new TestManager();
|
||||
$return = $manager->_getTestCaseList($directory);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function &_getTestCaseList($directory = '.') {
|
||||
$fileList =& $this->_getTestFileList($directory);
|
||||
$testCases = array();
|
||||
foreach ($fileList as $testCaseFile) {
|
||||
$testCases[$testCaseFile] = str_replace($directory . DS, '', $testCaseFile);
|
||||
}
|
||||
return $testCases;
|
||||
}
|
||||
|
||||
function &_getTestFileList($directory = '.') {
|
||||
$return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestCaseFile'));
|
||||
return $return;
|
||||
}
|
||||
|
||||
function &getGroupTestList($directory = '.') {
|
||||
$manager =& new TestManager();
|
||||
$return = $manager->_getTestGroupList($directory);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function &_getTestGroupFileList($directory = '.') {
|
||||
$return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestGroupFile'));
|
||||
return $return;
|
||||
}
|
||||
|
||||
function &_getTestGroupList($directory = '.') {
|
||||
$fileList =& $this->_getTestGroupFileList($directory);
|
||||
$groupTests = array();
|
||||
|
||||
foreach ($fileList as $groupTestFile) {
|
||||
$groupTests[$groupTestFile] = str_replace($this->_groupExtension, '', basename($groupTestFile));
|
||||
}
|
||||
sort($groupTests);
|
||||
return $groupTests;
|
||||
}
|
||||
|
||||
function &_getGroupTestClassNames($groupTestFile) {
|
||||
$file = implode("\n", file($groupTestFile));
|
||||
preg_match("~lass\s+?(.*)\s+?extends GroupTest~", $file, $matches);
|
||||
if (! empty($matches)) {
|
||||
unset($matches[0]);
|
||||
return $matches;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
function &_getRecursiveFileList($directory = '.', $fileTestFunction) {
|
||||
$dh = opendir($directory);
|
||||
if (! is_resource($dh)) {
|
||||
trigger_error("Couldn't open {$directory}", E_USER_ERROR);
|
||||
}
|
||||
|
||||
$fileList = array();
|
||||
while ($file = readdir($dh)) {
|
||||
$filePath = $directory . DIRECTORY_SEPARATOR . $file;
|
||||
if (0 === strpos($file, '.')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_dir($filePath)) {
|
||||
$fileList = array_merge($fileList, $this->_getRecursiveFileList($filePath, $fileTestFunction));
|
||||
}
|
||||
if ($fileTestFunction[0]->$fileTestFunction[1]($file)) {
|
||||
$fileList[] = $filePath;
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return $fileList;
|
||||
}
|
||||
|
||||
function _isTestCaseFile($file) {
|
||||
return $this->_hasExpectedExtension($file, $this->_testExtension);
|
||||
}
|
||||
|
||||
function _isTestGroupFile($file) {
|
||||
return $this->_hasExpectedExtension($file, $this->_groupExtension);
|
||||
}
|
||||
|
||||
function _hasExpectedExtension($file, $extension) {
|
||||
return $extension == strtolower(substr($file, (0 - strlen($extension))));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class CliTestManager extends TestManager {
|
||||
|
||||
function &getGroupTestList($directory = '.') {
|
||||
$manager =& new CliTestManager();
|
||||
$groupTests =& $manager->_getTestGroupList($directory);
|
||||
$buffer = "Available Group Test:\n";
|
||||
|
||||
foreach ($groupTests as $groupTest) {
|
||||
$buffer .= " " . $groupTest . "\n";
|
||||
}
|
||||
return $buffer . "\n";
|
||||
}
|
||||
|
||||
function &getTestCaseList($directory = '.') {
|
||||
$manager =& new CliTestManager();
|
||||
$testCases =& $manager->_getTestCaseList($directory);
|
||||
$buffer = "Available Test Cases:\n";
|
||||
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
$buffer .= " " . $testCaseFile . "\n";
|
||||
}
|
||||
return $buffer . "\n";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class TextTestManager extends TestManager {
|
||||
var $_url;
|
||||
|
||||
function TextTestManager() {
|
||||
$this->_url = $_SERVER['PHP_SELF'];
|
||||
}
|
||||
|
||||
function getBaseURL() {
|
||||
return $this->_url;
|
||||
}
|
||||
|
||||
function &getGroupTestList($directory = '.') {
|
||||
$manager =& new TextTestManager();
|
||||
$groupTests =& $manager->_getTestGroupList($directory);
|
||||
|
||||
if (1 > count($groupTests)) {
|
||||
$noGroups = "No test groups set up!\n";
|
||||
return $noGroups;
|
||||
}
|
||||
$buffer = "Available test groups:\n";
|
||||
$buffer .= $manager->getBaseURL() . "?group=all All tests<\n";
|
||||
|
||||
foreach ($groupTests as $groupTest) {
|
||||
$buffer .= "<li><a href='" . $manager->getBaseURL() . "?group={$groupTest}'>" . $groupTest . "&output=txt"."</a></li>\n";
|
||||
}
|
||||
return $buffer . "</ul>\n";
|
||||
}
|
||||
|
||||
function &getTestCaseList($directory = '.') {
|
||||
$manager =& new TextTestManager();
|
||||
$testCases =& $manager->_getTestCaseList($directory);
|
||||
|
||||
if (1 > count($testCases)) {
|
||||
$noTestCases = "No test cases set up!";
|
||||
return $noTestCases;
|
||||
}
|
||||
$buffer = "Available test cases:\n";
|
||||
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
$buffer .= $_SERVER['SERVER_NAME']. $manager->getBaseURL()."?case=" . $testCase . "&output=txt"."\n";
|
||||
}
|
||||
return $buffer . "\n";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class HtmlTestManager extends TestManager {
|
||||
var $_url;
|
||||
|
||||
function HtmlTestManager() {
|
||||
$this->_url = $_SERVER['PHP_SELF'];
|
||||
}
|
||||
|
||||
function getBaseURL() {
|
||||
return $this->_url;
|
||||
}
|
||||
|
||||
function &getGroupTestList($directory = '.') {
|
||||
$userApp = '';
|
||||
if (isset($_GET['app'])) {
|
||||
$userApp = '&app=true';
|
||||
}
|
||||
$manager =& new HtmlTestManager();
|
||||
$groupTests =& $manager->_getTestGroupList($directory);
|
||||
|
||||
if (isset($_GET['app'])){
|
||||
$buffer = "<p>Available App Test Groups:</p>\n<ul>";
|
||||
} else {
|
||||
$buffer = "<p>Available Core Test Groups:</p>\n<ul>";
|
||||
}
|
||||
$buffer .= !class_exists('CakeDummyTestClass')
|
||||
? "<li><a href='/tests/?group=all$userApp'>All tests</a></li>\n"
|
||||
: "<li><a href='" . $manager->getBaseURL() . "?group=all$userApp'>All tests</a></li>\n";
|
||||
|
||||
foreach ($groupTests as $groupTest) {
|
||||
$buffer .= !class_exists('CakeDummyTestClass')
|
||||
? "<li><a href='/tests/groups/?group={$groupTest}" . "{$userApp}'>" . $groupTest . "</a></li>\n"
|
||||
: "<li><a href='" . $manager->getBaseURL() . "?group={$groupTest}" . "{$userApp}'>" . $groupTest . "</a></li>\n";
|
||||
}
|
||||
$buffer .= "</ul>\n";
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
function &getTestCaseList($directory = '.') {
|
||||
$userApp = '';
|
||||
if (isset($_GET['app'])) {
|
||||
$userApp = '&app=true';
|
||||
}
|
||||
$manager =& new HtmlTestManager();
|
||||
$testCases =& $manager->_getTestCaseList($directory);
|
||||
|
||||
if (1 > count($testCases)) {
|
||||
$noTestCases = "<p>No test cases set up!</p>";
|
||||
return $noTestCases;
|
||||
}
|
||||
if (isset($_GET['app'])) {
|
||||
$buffer = "<p>Available App Test Cases:</p>\n<ul>";
|
||||
} else {
|
||||
$buffer = "<p>Available Core Test Cases:</p>\n<ul>";
|
||||
}
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
$buffer .= !class_exists('CakeDummyTestClass')
|
||||
? "<li><a href='cases?case=" . urlencode($testCase) . $userApp ."'>" . $testCase . "</a></li>\n"
|
||||
: "<li><a href='" . $manager->getBaseURL() . "?case=" . urlencode($testCase) . $userApp ."'>" . $testCase . "</a></li>\n";
|
||||
}
|
||||
$buffer .= "</ul>\n";
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class XmlTestManager extends HtmlTestManager {
|
||||
|
||||
function XmlTestManager() {
|
||||
parent::HtmlTestManager();
|
||||
}
|
||||
|
||||
function &getGroupTestList($directory = '.') {
|
||||
$userApp = '';
|
||||
if (isset($_GET['app'])) {
|
||||
$userApp = '&app=true';
|
||||
}
|
||||
$manager =& new XmlTestManager();
|
||||
$groupTests =& $manager->_getTestGroupList($directory);
|
||||
$rss = & $manager->_getRssWriter();
|
||||
|
||||
if (1 > count($groupTests)) {
|
||||
$rss->writeRss($output);
|
||||
return $output;
|
||||
}
|
||||
$properties["title"]="All Tests";
|
||||
$properties["description"]="All Tests";
|
||||
$properties["link"]='http://'.$_SERVER['SERVER_NAME'].
|
||||
$manager->getBaseURL()."?group=all&output=xml".$userApp;
|
||||
$rss->additem($properties);
|
||||
|
||||
foreach ($groupTests as $groupTest) {
|
||||
$properties["title"]=$groupTest;
|
||||
$properties["description"]=$groupTest;
|
||||
$properties["link"]='http://'.$_SERVER['SERVER_NAME']. $manager->getBaseURL(). "?group={$groupTest}&output=xml.$userApp";
|
||||
$rss->additem($properties);
|
||||
}
|
||||
$rss->writeRss($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
function &getTestCaseList($directory = '.') {
|
||||
$userApp = '';
|
||||
if (isset($_GET['app'])) {
|
||||
$userApp = '&app=true';
|
||||
}
|
||||
$manager =& new XmlTestManager();
|
||||
$testCases =& $manager->_getTestCaseList($directory);
|
||||
$rss = & $manager->_getRssWriter();
|
||||
|
||||
if (1 > count($testCases)) {
|
||||
$rss->writeRss($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
$properties["title"]=$testCase;
|
||||
$properties["description"]=$testCase;
|
||||
$properties["link"]='http://'.$_SERVER['SERVER_NAME']. $manager->getBaseURL()."?case=" . urlencode($testCase) . "&output=xml" . $userApp;
|
||||
// Comment this out for performance?
|
||||
$properties["dc:date"]=gmdate("Y-m-d\TH:i:sO",filemtime($testCaseFile));
|
||||
$rss->additem($properties);
|
||||
}
|
||||
$rss->writeRss($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
function &_getRssWriter() {
|
||||
|
||||
$cakeUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('index.php','',$_SERVER['PHP_SELF']);
|
||||
require_once TESTS . 'lib'.DIRECTORY_SEPARATOR.'xml_writer_class.php';
|
||||
require_once TESTS . 'lib'.DIRECTORY_SEPARATOR.'rss_writer_class.php';
|
||||
$rssWriterObject =& new rss_writer_class();
|
||||
$rssWriterObject->specification="1.0";
|
||||
$rssWriterObject->about=$cakeUrl."index.php?output=xml";
|
||||
$rssWriterObject->stylesheet=$cakeUrl."rss2html.xsl";
|
||||
$rssWriterObject->rssnamespaces["dc"]="http://purl.org/dc/elements/1.1/";
|
||||
// Channel Properties
|
||||
$properties=array();
|
||||
$properties["title"]="CakePHP Test Suite :: Unit Test Cases";
|
||||
$properties["description"]="CakePHP Unit Test Cases";
|
||||
$properties["link"]="http://www.cakephp.org/";
|
||||
$properties["dc:date"]=gmdate("Y-m-d\TH:i:sO");
|
||||
$rssWriterObject->addchannel($properties);
|
||||
|
||||
$properties=array();
|
||||
$properties["url"]="http://www.cakephp.org//img/cake.logo.png";
|
||||
$properties["link"]="http://www.cakephp.org/";
|
||||
$properties["title"]="CakePHP Logo";
|
||||
$properties["description"]="CakePHP Test Suite :: CakePHP :: Rapid Development Framework";
|
||||
$rssWriterObject->addimage($properties);
|
||||
|
||||
return $rssWriterObject;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
*/
|
||||
class RemoteTestManager extends TestManager {
|
||||
|
||||
function RemoteTestManager() {
|
||||
parent::TestManager();
|
||||
}
|
||||
|
||||
function _installSimpleTest() {
|
||||
parent::_installSimpleTest();
|
||||
vendor('simpletest'.DS.'remote');
|
||||
}
|
||||
|
||||
function runAllTests(&$reporter, $url = FALSE) {
|
||||
$groups = RemoteTestManager::getGroupTestList($url);
|
||||
$T =& new RemoteTestCase($groups['All Tests']);
|
||||
$T->run($reporter);
|
||||
}
|
||||
|
||||
function runTestCase($caseFile,& $reporter, $url = FALSE) {
|
||||
$cases = RemoteTestManager::getTestCaseList($url);
|
||||
$T =& new RemoteTestCase($cases[$caseFile]);
|
||||
$T->run($reporter);
|
||||
}
|
||||
|
||||
function runGroupTest($groupName, &$reporter, $url = FALSE) {
|
||||
$groups = RemoteTestManager::getGroupTestList($url);
|
||||
$T =& new RemoteTestCase($groups[$groupName]);
|
||||
$T->run($reporter);
|
||||
}
|
||||
|
||||
function & getGroupTestList($url = FALSE) {
|
||||
if (!$url) {
|
||||
$url = REMOTE_TEST_HTTP_PATH;
|
||||
}
|
||||
|
||||
$url .= '?output=xml';
|
||||
$manager =& new RemoteTestManager();
|
||||
$rss = & $manager->_getRssReader($url);
|
||||
$groupList = array();
|
||||
|
||||
foreach ($rss->getItems() as $item) {
|
||||
$groupList[$item['title']] = $item['link'];
|
||||
}
|
||||
return $groupList;
|
||||
}
|
||||
|
||||
function &getTestCaseList($url = FALSE) {
|
||||
if (!$url) {
|
||||
$url = REMOTE_TEST_HTTP_PATH;
|
||||
}
|
||||
$url .= '?show=cases&output=xml';
|
||||
$manager =& new RemoteTestManager();
|
||||
$rss = & $manager->_getRssReader($url);
|
||||
$caseList = array();
|
||||
|
||||
foreach ($rss->getItems() as $item) {
|
||||
$caseList[$item['title']] = $item['link'];
|
||||
}
|
||||
return $caseList;
|
||||
}
|
||||
|
||||
function &_getRssReader($url) {
|
||||
require_once "XML/RSS.php";
|
||||
$rssReader =& new XML_RSS($url);
|
||||
$status = $rssReader->parse();
|
||||
if (PEAR::isError($status) ) {
|
||||
trigger_error($status->getMessage(),E_USER_WARNING);
|
||||
}
|
||||
return $rssReader;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,312 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id:*/
|
||||
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* Copyright (c) Manuel Lemos 2001-2002
|
||||
*
|
||||
* Licensed under The BSD License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Manuel Lemos
|
||||
* @copyright Copyright (c) 2001-2002, Manuel Lemos
|
||||
* @package tests
|
||||
* @subpackage tests.lib
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.html BSD
|
||||
*/
|
||||
|
||||
if(!defined("METAL_LIBRARY_XML_XML_WRITER_CLASS"))
|
||||
{
|
||||
define("METAL_LIBRARY_XML_XML_WRITER_CLASS",1);
|
||||
|
||||
|
||||
class xml_writer_class
|
||||
{
|
||||
/*
|
||||
* Protected variables
|
||||
*
|
||||
*/
|
||||
var $structure=array();
|
||||
var $nodes=array();
|
||||
|
||||
/*
|
||||
* Public variables
|
||||
*
|
||||
*/
|
||||
var $stylesheet="";
|
||||
var $stylesheettype="text/xsl";
|
||||
var $dtdtype="";
|
||||
var $dtddefinition="";
|
||||
var $dtdurl="";
|
||||
var $outputencoding="utf-8";
|
||||
var $inputencoding="iso-8859-1";
|
||||
var $linebreak="\n";
|
||||
var $indenttext=" ";
|
||||
var $generatedcomment="Generated by: http://www.phpclasses.org/xmlwriter";
|
||||
var $error="";
|
||||
|
||||
|
||||
/*
|
||||
* Protected functions
|
||||
*
|
||||
*/
|
||||
Function escapedata($data)
|
||||
{
|
||||
$position=0;
|
||||
$length=strlen($data);
|
||||
$escapeddata="";
|
||||
for(;$position<$length;)
|
||||
{
|
||||
$character=substr($data,$position,1);
|
||||
$code=Ord($character);
|
||||
switch($code)
|
||||
{
|
||||
case 34:
|
||||
$character=""";
|
||||
break;
|
||||
case 38:
|
||||
$character="&";
|
||||
break;
|
||||
case 39:
|
||||
$character="'";
|
||||
break;
|
||||
case 60:
|
||||
$character="<";
|
||||
break;
|
||||
case 62:
|
||||
$character=">";
|
||||
break;
|
||||
default:
|
||||
if($code<32)
|
||||
$character=("&#".strval($code).";");
|
||||
break;
|
||||
}
|
||||
$escapeddata.=$character;
|
||||
$position++;
|
||||
}
|
||||
return $escapeddata;
|
||||
}
|
||||
|
||||
Function encodedata($data,&$encodeddata)
|
||||
{
|
||||
if(!strcmp($this->inputencoding,$this->outputencoding))
|
||||
$encodeddata=$this->escapedata($data);
|
||||
else
|
||||
{
|
||||
switch(strtolower($this->outputencoding))
|
||||
{
|
||||
case "utf-8":
|
||||
if(!strcmp(strtolower($this->inputencoding),"iso-8859-1"))
|
||||
{
|
||||
$encoded_data=utf8_encode($this->escapedata($data));
|
||||
$encodeddata=$encoded_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=("can not encode iso-8859-1 data in ".$this->outputencoding);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case "iso-8859-1":
|
||||
if(!strcmp(strtolower($this->inputencoding),"utf-8"))
|
||||
{
|
||||
$decoded=utf8_decode($data);
|
||||
$encodeddata=$this->escapedata($decoded);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=("can not encode utf-8 data in ".$this->outputencoding);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->error=("can not encode data in ".$this->inputencoding);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function writetag(&$output,$path,$indent)
|
||||
{
|
||||
$tag=$this->structure[$path]["Tag"];
|
||||
$output.=("<".$tag);
|
||||
$attributecount=count($this->structure[$path]["Attributes"]);
|
||||
if($attributecount>0)
|
||||
{
|
||||
$attributes=$this->structure[$path]["Attributes"];
|
||||
Reset($attributes);
|
||||
$end=(GetType($key=Key($attributes))!="string");
|
||||
for(;!$end;)
|
||||
{
|
||||
$output.=(" ".$key."=\"".$attributes[$key]."\"");
|
||||
Next($attributes);
|
||||
$end=(GetType($key=Key($attributes))!="string");
|
||||
}
|
||||
}
|
||||
$elements=$this->structure[$path]["Elements"];
|
||||
if($elements>0)
|
||||
{
|
||||
$output.=">";
|
||||
$doindent=$this->structure[$path]["Indent"];
|
||||
$elementindent=(($doindent) ? $this->linebreak.$indent.$this->indenttext : "");
|
||||
$element=0;
|
||||
for(;$element<$elements;)
|
||||
{
|
||||
$elementpath=($path.",".strval($element));
|
||||
$output.=$elementindent;
|
||||
if(IsSet($this->nodes[$elementpath]))
|
||||
{
|
||||
if(!($this->writetag($output,$elementpath,$indent.$this->indenttext)))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
$output.=$this->structure[$elementpath];
|
||||
$element++;
|
||||
}
|
||||
$output.=((($doindent) ? $this->linebreak.$indent : "")."</".$tag.">");
|
||||
}
|
||||
else
|
||||
$output.="/>";
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Public functions
|
||||
*
|
||||
*/
|
||||
Function write(&$output)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!(IsSet($this->structure["0"])))
|
||||
{
|
||||
$this->error="XML document structure is empty";
|
||||
return 0;
|
||||
}
|
||||
$output=("<?xml version=\"1.0\" encoding=\"".$this->outputencoding."\"?>".$this->linebreak);
|
||||
if(strcmp($this->dtdtype,""))
|
||||
{
|
||||
$output.=("<!DOCTYPE ".$this->structure["0"]["Tag"]." ");
|
||||
switch($this->dtdtype)
|
||||
{
|
||||
case "INTERNAL":
|
||||
if(!strcmp($this->dtddefinition,""))
|
||||
{
|
||||
$this->error="it was not specified a valid internal DTD definition";
|
||||
return 0;
|
||||
}
|
||||
$output.=("[".$this->linebreak.$this->dtddefinition.$this->linebreak."]");
|
||||
break;
|
||||
case "SYSTEM":
|
||||
if(!strcmp($this->dtdurl,""))
|
||||
{
|
||||
$this->error="it was not specified a valid system DTD url";
|
||||
return 0;
|
||||
}
|
||||
$output.="SYSTEM";
|
||||
if(strcmp($this->dtddefinition,""))
|
||||
$output.=(" \"".$this->dtddefinition."\"");
|
||||
$output.=(" \"".$this->dtdurl."\"");
|
||||
break;
|
||||
case "PUBLIC":
|
||||
if(!strcmp($this->dtddefinition,""))
|
||||
{
|
||||
$this->error="it was not specified a valid public DTD definition";
|
||||
return 0;
|
||||
}
|
||||
$output.=("PUBLIC \"".$this->dtddefinition."\"");
|
||||
if(strcmp($this->dtdurl,""))
|
||||
$output.=(" \"".$this->dtdurl."\"");
|
||||
break;
|
||||
default:
|
||||
$this->error="it was not specified a valid DTD type";
|
||||
return 0;
|
||||
}
|
||||
$output.=(">".$this->linebreak);
|
||||
}
|
||||
if(strcmp($this->stylesheet,""))
|
||||
{
|
||||
if(!strcmp($this->stylesheettype,""))
|
||||
{
|
||||
$this->error="it was not specified a valid stylesheet type";
|
||||
return 0;
|
||||
}
|
||||
$output.=("<?xml-stylesheet type=\"".$this->stylesheettype."\" href=\"".$this->stylesheet."\"?>".$this->linebreak);
|
||||
}
|
||||
if(strcmp($this->generatedcomment,""))
|
||||
$output.=("<!-- ".$this->generatedcomment." -->".$this->linebreak);
|
||||
return $this->writetag($output,"0","");
|
||||
}
|
||||
|
||||
Function addtag($tag,&$attributes,$parent,&$path,$indent)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
$path=((!strcmp($parent,"")) ? "0" : ($parent.",".strval($this->structure[$parent]["Elements"])));
|
||||
if(IsSet($this->structure[$path]))
|
||||
{
|
||||
$this->error=("tag with path ".$path." is already defined");
|
||||
return 0;
|
||||
}
|
||||
$encodedattributes=array();
|
||||
Reset($attributes);
|
||||
$end=(GetType($attribute_name=Key($attributes))!="string");
|
||||
for(;!$end;)
|
||||
{
|
||||
$encodedattributes[$attribute_name]="";
|
||||
if(!($this->encodedata($attributes[$attribute_name],$encoded_data)))
|
||||
return 0;
|
||||
$encodedattributes[$attribute_name]=$encoded_data;
|
||||
Next($attributes);
|
||||
$end=(GetType($attribute_name=Key($attributes))!="string");
|
||||
}
|
||||
$this->structure[$path]=array(
|
||||
"Tag"=>$tag,
|
||||
"Attributes"=>$encodedattributes,
|
||||
"Elements"=>0,
|
||||
"Indent"=>$indent
|
||||
);
|
||||
$this->nodes[$path]=1;
|
||||
if(strcmp($parent,""))
|
||||
$this->structure[$parent]["Elements"]=($this->structure[$parent]["Elements"]+1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function adddata($data,$parent,&$path)
|
||||
{
|
||||
if(strcmp($this->error,""))
|
||||
return 0;
|
||||
if(!(IsSet($this->structure[$parent])))
|
||||
{
|
||||
$this->error=("the parent tag path".$path."is not defined");
|
||||
return 0;
|
||||
}
|
||||
if(!strcmp($data,""))
|
||||
return 1;
|
||||
$path=($parent.",".strval($this->structure[$parent]["Elements"]));
|
||||
if(!($this->encodedata($data,$encoded_data)))
|
||||
return 0;
|
||||
$this->structure[$path]=$encoded_data;
|
||||
$this->structure[$parent]["Elements"]=($this->structure[$parent]["Elements"]+1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Function adddatatag($tag,&$attributes,$data,$parent,&$path)
|
||||
{
|
||||
return $this->addtag($tag,$attributes,$parent,$path,0) && $this->adddata($data,$path,$datapath);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!--
|
||||
@(#) $Id: rss2html.xsl,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss="http://purl.org/rss/1.0/" xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<xsl:output method="html"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
||||
<style type="text/css">
|
||||
div.channel-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.image { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.image-description { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.item-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.item-description { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.textinput-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.textinput-form { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<title>
|
||||
<xsl:for-each select="rdf:RDF/rss:channel">
|
||||
<xsl:value-of select="rss:description"/>
|
||||
</xsl:for-each>
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:image">
|
||||
<center><div class="image">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="src"><xsl:value-of select="rss:url"/></xsl:attribute>
|
||||
<xsl:attribute name="alt"><xsl:value-of select="rss:title"/></xsl:attribute>
|
||||
<xsl:attribute name="border">0</xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
<center><div class="image-description">
|
||||
<xsl:value-of select="rss:description"/>
|
||||
</div></center>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:channel">
|
||||
<center><div class="channel-title">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:value-of select="rss:title"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="dc:date"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
</xsl:for-each>
|
||||
|
||||
<ul>
|
||||
<hr />
|
||||
<xsl:for-each select="rdf:RDF/rss:item">
|
||||
<div class="item-title"><li>
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:value-of select="rss:title"/>
|
||||
</xsl:element>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="dc:date"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</li></div>
|
||||
<div class="item-description"><xsl:value-of select="rss:description"/></div>
|
||||
<hr />
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:textinput">
|
||||
<center><b><div class="textinput-title"><xsl:value-of select="rss:description"/></div></b></center>
|
||||
<xsl:element name="form">
|
||||
<xsl:attribute name="action"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:attribute name="method">POST</xsl:attribute>
|
||||
<center><div class="textinput-form">
|
||||
<xsl:element name="input">
|
||||
<xsl:attribute name="name"><xsl:value-of select="rss:name"/></xsl:attribute>
|
||||
<xsl:attribute name="type">text</xsl:attribute>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:element name="input">
|
||||
<xsl:attribute name="value"><xsl:value-of select="rss:title"/></xsl:attribute>
|
||||
<xsl:attribute name="type">submit</xsl:attribute>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
</xsl:element>
|
||||
</xsl:for-each>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: test_paths.php,v 1.1 2006-08-14 23:54:56 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:56 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
/**
|
||||
* Path to the simpletest directory and unit tests.
|
||||
*/
|
||||
define ('CORE_TEST_CASES', TESTS. 'core' .DS. 'cases');
|
||||
define ('CORE_TEST_GROUPS', TESTS. 'core' .DS. 'groups');
|
||||
define ('APP_TEST_CASES', TESTS. 'app' .DS. 'cases');
|
||||
define ('APP_TEST_GROUPS', TESTS. 'app' .DS. 'groups');
|
||||
?>
|
|
@ -0,0 +1,298 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: tests.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
error_reporting(E_ALL);
|
||||
set_time_limit(600);
|
||||
ini_set('memory_limit','128M');
|
||||
/**
|
||||
* Get root directory
|
||||
*/
|
||||
if (!defined('DS')){
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
if (!defined('ROOT')){
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))).DS);
|
||||
}
|
||||
if (!defined('WWW_ROOT')){
|
||||
define('WWW_ROOT', dirname(__FILE__).DS);
|
||||
}
|
||||
if (!defined('APP_DIR')){
|
||||
define ('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
}
|
||||
if (!defined('CORE_PATH')){
|
||||
define('CORE_PATH', ROOT.DS);
|
||||
}
|
||||
require_once 'cake'.DS.'basics.php';
|
||||
require_once 'cake'.DS.'config'.DS.'paths.php';
|
||||
require_once TESTS . 'test_paths.php';
|
||||
require_once TESTS . 'lib'.DS.'test_manager.php';
|
||||
vendor('simpletest'.DS.'reporter');
|
||||
if (!isset($_SERVER['SERVER_NAME'])){
|
||||
$_SERVER['SERVER_NAME'] = '';
|
||||
}
|
||||
if (empty( $_GET['output'])){
|
||||
TestManager::setOutputFromIni(TESTS . 'config.ini.php');
|
||||
$_GET['output'] = TEST_OUTPUT;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Used to determine output to display
|
||||
*/
|
||||
define('CAKE_TEST_OUTPUT_HTML',1);
|
||||
define('CAKE_TEST_OUTPUT_XML',2);
|
||||
define('CAKE_TEST_OUTPUT_TEXT',3);
|
||||
|
||||
if (isset($_GET['output']) && $_GET['output'] == 'xml'){
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_XML);
|
||||
} elseif (isset($_GET['output']) && $_GET['output'] == 'html') {
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML);
|
||||
} else {
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
|
||||
}
|
||||
|
||||
function &CakeTestsGetReporter() {
|
||||
static $Reporter = NULL;
|
||||
if ( !$Reporter ){
|
||||
switch (CAKE_TEST_OUTPUT){
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
vendor('simpletest'.DS.'xml');
|
||||
$Reporter = new XmlReporter();
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
require_once TESTS . 'lib'.DS.'cake_reporter.php';
|
||||
$Reporter = new CakeHtmlReporter();
|
||||
break;
|
||||
default:
|
||||
$Reporter = new TextReporter();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $Reporter;
|
||||
}
|
||||
|
||||
function CakePHPTestRunMore() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$link = class_exists('Object') ? "<p><a href='/tests/'>Run more tests</a></p>\n"
|
||||
: "<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>\n";
|
||||
echo $link;
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestCaseList() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
if (isset($_GET['app'])) {
|
||||
echo XmlTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
} else {
|
||||
echo XmlTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
if (isset($_GET['app'])) {
|
||||
echo HtmlTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
} else {
|
||||
echo HtmlTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
if (isset($_GET['app'])) {
|
||||
echo TextTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
} else {
|
||||
echo TextTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestGroupTestList() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
if (isset($_GET['app'])) {
|
||||
echo XmlTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
} else {
|
||||
echo XmlTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
if (isset($_GET['app'])) {
|
||||
echo HtmlTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
} else {
|
||||
echo HtmlTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
if (isset($_GET['app'])) {
|
||||
echo TextTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
} else {
|
||||
echo TextTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestHeader() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
header(' content-Type: text/xml; charset="utf-8"');
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$header = <<<EOF
|
||||
<!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>
|
||||
<meta http-equiv=' content-Type' content='text/html; charset=iso-8859-1' />
|
||||
<title>CakePHP Test Suite v 1.0.0.0</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/cake.default.css" />
|
||||
</head>
|
||||
<body>
|
||||
EOF;
|
||||
echo $header;
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
header(' content-type: text/plain');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestSuiteHeader() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$groups = class_exists('Object') ? 'groups' : $_SERVER['PHP_SELF'].'?show=groups';
|
||||
$cases = class_exists('Object') ? 'cases' : $_SERVER['PHP_SELF'].'?show=cases';
|
||||
$suiteHeader = <<<EOD
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<img src="/img/cake.logo.png" alt="" />
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>CakePHP Test Suite v 1.0.0.0</h1>
|
||||
<p><a href='$groups'>Core Test Groups</a> || <a href='$cases'>Core Test Cases</a></p>
|
||||
<p><a href='$groups&app=true'>App Test Groups</a> || <a href='$cases&app=true'>App Test Cases</a></p>
|
||||
EOD;
|
||||
echo $suiteHeader;
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestSuiteFooter() {
|
||||
switch (CAKE_TEST_OUTPUT) {
|
||||
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$footer = <<<EOD
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>
|
||||
<a href="https://trac.cakephp.org/wiki/Developement/TestSuite">CakePHP Test Suite </a> ::
|
||||
<a href="http://www.phpnut.com/projects/"> © 2006, Larry E. Masters.</a>
|
||||
</p> <br />
|
||||
<p>
|
||||
<!--PLEASE USE ONE OF THE POWERED BY CAKEPHP LOGO-->
|
||||
<a href="http://www.cakephp.org/" target="_new">
|
||||
<img src="/img/cake.power.png" alt="CakePHP :: Rapid Development Framework" height = "15" width = "80" /> </a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://validator.w3.org/check?uri=referer">
|
||||
<img src="/img/w3c_xhtml10.png" alt="Valid XHTML 1.0 Transitional" height = "15" width = "80" /> </a>
|
||||
<a href="http://jigsaw.w3.org/css-validator/check/referer">
|
||||
<img src="/img/w3c_css.png" alt="Valid CSS!" height = "15" width = "80" /> </a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOD;
|
||||
echo $footer;
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['group'])) {
|
||||
|
||||
if ('all' == $_GET['group']) {
|
||||
TestManager::runAllTests(CakeTestsGetReporter());
|
||||
} else {
|
||||
if (isset($_GET['app'])) {
|
||||
TestManager::runGroupTest(ucfirst($_GET['group']), APP_TEST_GROUPS, CakeTestsGetReporter());
|
||||
} else {
|
||||
TestManager::runGroupTest(ucfirst($_GET['group']), CORE_TEST_GROUPS, CakeTestsGetReporter());
|
||||
}
|
||||
}
|
||||
|
||||
CakePHPTestRunMore();
|
||||
CakePHPTestSuiteFooter();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_GET['case'])) {
|
||||
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
|
||||
CakePHPTestRunMore();
|
||||
CakePHPTestSuiteFooter();
|
||||
exit();
|
||||
}
|
||||
|
||||
CakePHPTestHeader();
|
||||
CakePHPTestSuiteHeader();
|
||||
|
||||
if (isset($_GET['show']) && $_GET['show'] == 'cases') {
|
||||
CakePHPTestCaseList();
|
||||
} else {
|
||||
CakePHPTestGroupTestList();
|
||||
}
|
||||
CakePHPTestSuiteFooter();
|
||||
?>
|
|
@ -0,0 +1 @@
|
|||
<?php pr($addons); ?>
|
|
@ -0,0 +1,26 @@
|
|||
<?php header("Content-type: ", "text/xhtml") ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" href="css/screen.css"
|
||||
type="text/css" media="screen" />
|
||||
<title>Mozilla Add-ons :: Add Features to Mozilla Software</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center;"><img src="images/remora2.png" /></div>
|
||||
<?php echo $content_for_layout ?>
|
||||
<!-- included for sake of consistency with current site -->
|
||||
<div style="clear:both"><br /></div>
|
||||
<div id="footer">
|
||||
<p><span>Copyright © 2004-2006</span> <a href="http://www.xramp.com/">256-bit SSL Encryption provided by XRamp</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="disclaimer">
|
||||
Mozilla is providing links to these applications as a courtesy, and makes no representations regarding the applications or any information related thereto. Any questions, complaints or claims regarding the applications must be directed to the appropriate software vendor. See our <a href="/support.php">Support Page</a> for support information and contacts.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,101 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: css.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
require(CONFIGS . 'paths.php');
|
||||
require(CAKE . 'basics.php');
|
||||
require(LIBS . 'folder.php');
|
||||
require(LIBS . 'file.php');
|
||||
require(LIBS . 'legacy.php');
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
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;
|
||||
?>
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @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 seperate your directories
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
}
|
||||
if (!defined('APP_DIR')) {
|
||||
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
|
||||
define('APP_DIR', 'remora');
|
||||
}
|
||||
/**
|
||||
* 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 seperate 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', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
|
||||
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);
|
||||
}
|
||||
}
|
||||
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
||||
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
|
||||
} else {
|
||||
$Dispatcher=new Dispatcher();
|
||||
$Dispatcher->dispatch($url);
|
||||
}
|
||||
if (DEBUG) {
|
||||
echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: vendors.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
/**
|
||||
* 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 : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot.js
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
if (is_file('../../vendors/javascript/' . $_GET['file']) && (preg_match('/(.+)\\.js/', $_GET['file']))) {
|
||||
readfile('../../vendors/javascript/' . $_GET['file']);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,399 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $ */
|
||||
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP Test Suite <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* Author(s): Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
*
|
||||
* Portions modifiied from WACT Test Suite
|
||||
* Author(s): Harry Fuecks
|
||||
* Jon Ramsey
|
||||
* Jason E. Sweat
|
||||
* Franco Ponticelli
|
||||
* Lorenzo Alberton
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @author Larry E. Masters aka PhpNut <phpnut@gmail.com>
|
||||
* @copyright Copyright (c) 2006, Larry E. Masters Shorewood, IL. 60431
|
||||
* @link http://www.phpnut.com/projects/
|
||||
* @package tests
|
||||
* @since CakePHP Test Suite v 1.0.0.0
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-08-14 23:54:57 $
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL);
|
||||
set_time_limit(600);
|
||||
ini_set('memory_limit','128M');
|
||||
class CakeDummyTestClass
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (!defined('DS'))
|
||||
{
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (!defined('ROOT'))
|
||||
{
|
||||
//define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
|
||||
define('ROOT', dirname(dirname(dirname(dirname(__FILE__)))).DS);
|
||||
}
|
||||
|
||||
if (!defined('APP_DIR'))
|
||||
{
|
||||
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
|
||||
define ('APP_DIR', basename(dirname(dirname(dirname(__FILE__)))).DS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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';
|
||||
define('CAKE_CORE_INCLUDE_PATH', ROOT);
|
||||
}
|
||||
|
||||
|
||||
if (!defined('WEBROOT_DIR'))
|
||||
{
|
||||
define ('WEBROOT_DIR', basename(dirname(dirname(__FILE__))));
|
||||
}
|
||||
|
||||
define('WWW_ROOT', dirname(dirname(__FILE__)));
|
||||
|
||||
ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
|
||||
|
||||
|
||||
require_once 'cake'.DS.'basics.php';
|
||||
require_once 'cake'.DS.'config'.DS.'paths.php';
|
||||
require_once TESTS . 'test_paths.php';
|
||||
require_once TESTS . 'lib'.DS.'test_manager.php';
|
||||
vendor('simpletest'.DS.'reporter');
|
||||
|
||||
if (!isset( $_SERVER['SERVER_NAME'] ))
|
||||
{
|
||||
$_SERVER['SERVER_NAME'] = '';
|
||||
}
|
||||
|
||||
if (empty( $_GET['output']))
|
||||
{
|
||||
TestManager::setOutputFromIni(TESTS . 'config.ini.php');
|
||||
$_GET['output'] = TEST_OUTPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Used to determine output to display
|
||||
*/
|
||||
define('CAKE_TEST_OUTPUT_HTML',1);
|
||||
define('CAKE_TEST_OUTPUT_XML',2);
|
||||
define('CAKE_TEST_OUTPUT_TEXT',3);
|
||||
|
||||
if ( isset($_GET['output']) && $_GET['output'] == 'xml' )
|
||||
{
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_XML);
|
||||
}
|
||||
elseif ( isset($_GET['output']) && $_GET['output'] == 'html' )
|
||||
{
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML);
|
||||
}
|
||||
else
|
||||
{
|
||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
|
||||
}
|
||||
|
||||
function & CakeTestsGetReporter()
|
||||
{
|
||||
static $Reporter = NULL;
|
||||
if ( !$Reporter )
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
vendor('simpletest'.DS.'xml');
|
||||
$Reporter = new XmlReporter();
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
require_once TESTS . 'lib'.DS.'cake_reporter.php';
|
||||
$Reporter = new CakeHtmlReporter();
|
||||
break;
|
||||
|
||||
default:
|
||||
$Reporter = new TextReporter();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $Reporter;
|
||||
}
|
||||
|
||||
function CakePHPTestRunMore()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$link = !class_exists('CakeDummyTestClass')
|
||||
? "<p><a href='/tests/'>Run more tests</a></p>\n"
|
||||
:
|
||||
"<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>\n";
|
||||
echo $link;
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestCaseList()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo XmlTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo XmlTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo HtmlTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo HtmlTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo TextTestManager::getTestCaseList(APP_TEST_CASES);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo TextTestManager::getTestCaseList(CORE_TEST_CASES);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestGroupTestList()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo XmlTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo XmlTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo HtmlTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo HtmlTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
echo TextTestManager::getGroupTestList(APP_TEST_GROUPS);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo TextTestManager::getGroupTestList(CORE_TEST_GROUPS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestHeader()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
header(' content-Type: text/xml; charset="utf-8"');
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$header = <<<EOF
|
||||
<!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>
|
||||
<meta http-equiv=' content-Type' content='text/html; charset=iso-8859-1' />
|
||||
<title>CakePHP Test Suite v 1.0.0.0</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/cake.default.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
EOF;
|
||||
echo $header;
|
||||
break;
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
header(' content-type: text/plain');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CakePHPTestSuiteHeader()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$groups = !class_exists('CakeDummyTestClass') ? 'groups' : $_SERVER['PHP_SELF'].'?show=groups';
|
||||
$cases = !class_exists('CakeDummyTestClass') ? 'cases' : $_SERVER['PHP_SELF'].'?show=cases';
|
||||
$suiteHeader = <<<EOD
|
||||
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<img src="/img/cake.logo.png" alt="" />
|
||||
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>CakePHP Test Suite v 1.0.0.0</h1>
|
||||
<p><a href='$groups'>Core Test Groups</a> || <a href='$cases'>Core Test Cases</a></p>
|
||||
<p><a href='$groups&app=true'>App Test Groups</a> || <a href='$cases&app=true'>App Test Cases</a></p>
|
||||
EOD;
|
||||
echo $suiteHeader;
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function CakePHPTestSuiteFooter()
|
||||
{
|
||||
switch ( CAKE_TEST_OUTPUT )
|
||||
{
|
||||
case CAKE_TEST_OUTPUT_XML:
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_HTML:
|
||||
$footer = <<<EOD
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>
|
||||
<a href="https://trac.cakephp.org/wiki/Developement/TestSuite">CakePHP Test Suite </a> ::
|
||||
<a href="http://www.phpnut.com/projects/"> © 2006, Larry E. Masters.</a>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<!--PLEASE USE ONE OF THE POWERED BY CAKEPHP LOGO-->
|
||||
<a href="http://www.cakephp.org/" target="_new">
|
||||
<img src="/img/cake.power.png" alt="CakePHP :: Rapid Development Framework" height = "15" width = "80" />
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://validator.w3.org/check?uri=referer">
|
||||
<img src="/img/w3c_xhtml10.png" alt="Valid XHTML 1.0 Transitional" height = "15" width = "80" />
|
||||
</a>
|
||||
<a href="http://jigsaw.w3.org/css-validator/check/referer">
|
||||
<img src="/img/w3c_css.png" alt="Valid CSS!" height = "15" width = "80" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOD;
|
||||
echo $footer;
|
||||
break;
|
||||
|
||||
case CAKE_TEST_OUTPUT_TEXT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_GET['group']))
|
||||
{
|
||||
if ('all' == $_GET['group'])
|
||||
{
|
||||
TestManager::runAllTests(CakeTestsGetReporter());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
TestManager::runGroupTest(ucfirst($_GET['group']),
|
||||
APP_TEST_GROUPS,
|
||||
CakeTestsGetReporter());
|
||||
}
|
||||
else
|
||||
{
|
||||
TestManager::runGroupTest(ucfirst($_GET['group']),
|
||||
CORE_TEST_GROUPS,
|
||||
CakeTestsGetReporter());
|
||||
}
|
||||
}
|
||||
|
||||
CakePHPTestRunMore();
|
||||
CakePHPTestSuiteFooter();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_GET['case']))
|
||||
{
|
||||
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
|
||||
CakePHPTestRunMore();
|
||||
CakePHPTestSuiteFooter();
|
||||
exit();
|
||||
}
|
||||
|
||||
CakePHPTestHeader();
|
||||
CakePHPTestSuiteHeader();
|
||||
|
||||
if (isset($_GET['show']) && $_GET['show'] == 'cases')
|
||||
{
|
||||
CakePHPTestCaseList();
|
||||
}
|
||||
else
|
||||
{
|
||||
CakePHPTestGroupTestList();
|
||||
}
|
||||
CakePHPTestSuiteFooter();
|
||||
|
||||
?>
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!--
|
||||
@(#) $Id: rss2html.xsl,v 1.1 2006-08-14 23:54:57 sancus%off.net Exp $
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss="http://purl.org/rss/1.0/" xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<xsl:output method="html"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
||||
<style type="text/css">
|
||||
div.channel-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.image { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.image-description { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.item-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.item-description { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.textinput-title { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<style type="text/css">
|
||||
div.textinput-form { font-family: sans-serif, arial, helvetica }
|
||||
</style>
|
||||
<title>
|
||||
<xsl:for-each select="rdf:RDF/rss:channel">
|
||||
<xsl:value-of select="rss:description"/>
|
||||
</xsl:for-each>
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:image">
|
||||
<center><div class="image">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="src"><xsl:value-of select="rss:url"/></xsl:attribute>
|
||||
<xsl:attribute name="alt"><xsl:value-of select="rss:title"/></xsl:attribute>
|
||||
<xsl:attribute name="border">0</xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
<center><div class="image-description">
|
||||
<xsl:value-of select="rss:description"/>
|
||||
</div></center>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:channel">
|
||||
<center><div class="channel-title">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:value-of select="rss:title"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="dc:date"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
</xsl:for-each>
|
||||
|
||||
<ul>
|
||||
<hr />
|
||||
<xsl:for-each select="rdf:RDF/rss:item">
|
||||
<div class="item-title"><li>
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:value-of select="rss:title"/>
|
||||
</xsl:element>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="dc:date"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</li></div>
|
||||
<div class="item-description"><xsl:value-of select="rss:description"/></div>
|
||||
<hr />
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
|
||||
<xsl:for-each select="rdf:RDF/rss:textinput">
|
||||
<center><b><div class="textinput-title"><xsl:value-of select="rss:description"/></div></b></center>
|
||||
<xsl:element name="form">
|
||||
<xsl:attribute name="action"><xsl:value-of select="rss:link"/></xsl:attribute>
|
||||
<xsl:attribute name="method">POST</xsl:attribute>
|
||||
<center><div class="textinput-form">
|
||||
<xsl:element name="input">
|
||||
<xsl:attribute name="name"><xsl:value-of select="rss:name"/></xsl:attribute>
|
||||
<xsl:attribute name="type">text</xsl:attribute>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:element name="input">
|
||||
<xsl:attribute name="value"><xsl:value-of select="rss:title"/></xsl:attribute>
|
||||
<xsl:attribute name="type">submit</xsl:attribute>
|
||||
</xsl:element>
|
||||
</div></center>
|
||||
</xsl:element>
|
||||
</xsl:for-each>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Загрузка…
Ссылка в новой задаче