Commit 8df26cbb authored by Jonathan.Wage's avatar Jonathan.Wage

Initial entry of website.

parent 48095c26
default:
enabled: off
with_layout: false
lifetime: 86400
<?php
// include project configuration
include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
// symfony bootstraping
require_once($sf_symfony_lib_dir.'/util/sfCore.class.php');
sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);
cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse
test:
storage:
class: sfSessionTestStorage
#all:
# controller:
# class: sfFrontWebController
#
# request:
# class: sfWebRequest
#
# response:
# class: sfWebResponse
#
# user:
# class: myUser
#
# storage:
# class: sfSessionStorage
# param:
# session_name: symfony
#
# view_cache:
# class: sfFileCache
# param:
# automaticCleaningFactor: 0
# cacheDir: %SF_TEMPLATE_CACHE_DIR%
rendering: ~
web_debug: ~
security: ~
# generally, you will want to insert your own filters here
cache: ~
common: ~
flash: ~
execution: ~
#all:
# default_culture: en
# source: XLIFF
# debug: off
# cache: on
# untranslated_prefix: "[T]"
# untranslated_suffix: "[/T]"
prod:
enabled: off
level: err
rotate: on
purge: off
#all:
# enabled: on
# level: debug
# rotate: off
# period: 7
# history: 10
# purge: on
# loggers:
# sf_web_debug:
# class: sfWebDebugLogger
# param:
# condition: %SF_WEB_DEBUG%
# sf_file_debug:
# class: sfFileLogger
# param:
# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
# default rules
homepage:
url: /
param: { module: default, action: index }
default_symfony:
url: /symfony/:action/*
param: { module: default }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
prod:
.settings:
no_script_name: off
dev:
.settings:
# E_ALL | E_STRICT = 4095
error_reporting: 4095
web_debug: on
cache: off
no_script_name: off
etag: off
test:
.settings:
# E_ALL | E_STRICT & ~E_NOTICE = 2047
error_reporting: 2047
cache: off
web_debug: off
no_script_name: off
etag: off
#all:
# .actions:
# default_module: default # Default module and action to be called when
# default_action: index # A routing rule doesn't set it
#
# error_404_module: default # To be called when a 404 error is raised
# error_404_action: error404 # Or when the requested URL doesn't match any route
#
# login_module: default # To be called when a non-authenticated user
# login_action: login # Tries to access a secure page
#
# secure_module: default # To be called when a user doesn't have
# secure_action: secure # The credentials required for an action
#
# module_disabled_module: default # To be called when a user requests
# module_disabled_action: disabled # A module disabled in the module.yml
#
# unavailable_module: default # To be called when a user requests a page
# unavailable_action: unavailable # From an application disabled via the available setting below
#
# .settings:
# available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action.
#
# # Optional features. Deactivating unused features boots performance a bit.
# use_database: on # Enable database manager. Set to off if you don't use a database.
# use_security: on # Enable security features (login and credentials). Set to off for public applications.
# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions.
# i18n: off # Enable interface translation. Set to off if your application should not be translated.
# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally.
# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
# check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page.
#
# # Output escaping settings
# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost.
# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES.
#
# # Routing settings
# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on.
# no_script_name: off # Enable the front controller name in generated URLs
#
# # Validation settings, used for error generation by the Validation helper
# validation_error_prefix: ' &darr;&nbsp;'
# validation_error_suffix: ' &nbsp;&darr;'
# validation_error_class: form_error
# validation_error_id_prefix: error_for_
#
# # Cache settings
# cache: off # Enable the template cache
# etag: on # Enable etag handling
#
# # Logging and debugging settings
# web_debug: off # Enable the web debug toolbar
# error_reporting: 341 # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341
#
# # Assets paths
# rich_text_js_dir: js/tiny_mce
# prototype_web_dir: /sf/prototype
# admin_web_dir: /sf/sf_admin
# web_debug_web_dir: /sf/sf_web_debug
#
# # Helpers included in all templates by default
# standard_helpers: [Partial, Cache, Form]
#
# # Activated modules from plugins or from the symfony core
# enabled_modules: [default]
#
# # Charset used for the response
# charset: utf-8
#
# # Miscellaneous
# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml
# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges.
# timeout: 1800 # Session timeout, in seconds
# max_forwards: 5
# path_info_array: SERVER
# path_info_key: PATH_INFO
# url_format: PATH
#
# # ORM
# orm: propel
default:
http_metas:
content-type: text/html
metas:
title: symfony project
robots: index, follow
description: symfony project
keywords: symfony, project
language: en
stylesheets: [main]
javascripts: []
has_layout: on
layout: layout
<?php
class myUser extends sfBasicSecurityUser
{
}
<!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" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<?php echo $sf_data->getRaw('sf_content') ?>
</body>
</html>
default:
enabled: off
with_layout: false
lifetime: 86400
<?php
// include project configuration
include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
// symfony bootstraping
require_once($sf_symfony_lib_dir.'/util/sfCore.class.php');
sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);
cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse
test:
storage:
class: sfSessionTestStorage
#all:
# controller:
# class: sfFrontWebController
#
# request:
# class: sfWebRequest
#
# response:
# class: sfWebResponse
#
# user:
# class: myUser
#
# storage:
# class: sfSessionStorage
# param:
# session_name: symfony
#
# view_cache:
# class: sfFileCache
# param:
# automaticCleaningFactor: 0
# cacheDir: %SF_TEMPLATE_CACHE_DIR%
rendering: ~
web_debug: ~
security: ~
# generally, you will want to insert your own filters here
cache: ~
common: ~
flash: ~
execution: ~
#all:
# default_culture: en
# source: XLIFF
# debug: off
# cache: on
# untranslated_prefix: "[T]"
# untranslated_suffix: "[/T]"
prod:
enabled: off
level: err
rotate: on
purge: off
#all:
# enabled: on
# level: debug
# rotate: off
# period: 7
# history: 10
# purge: on
# loggers:
# sf_web_debug:
# class: sfWebDebugLogger
# param:
# condition: %SF_WEB_DEBUG%
# sf_file_debug:
# class: sfFileLogger
# param:
# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
# default rules
homepage:
url: /
param: { module: main, action: index }
api_documentation_page:
url: /documentation/api/:q
param: { module: api_documentation, action: index }
about:
url: /about
param: { module: main, action: about }
download:
url: /download
param: { module: main, action: download }
manual:
url: /documentation/manual
param: { module: manual, action: index }
api_documentation:
url: /documentation/api
param: { module: api_documentation, action: index }
trac:
url: /trac
param: { module: main, action: trac }
default_symfony:
url: /symfony/:action/*
param: { module: default }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
prod:
.settings:
no_script_name: on
dev:
.settings:
# E_ALL | E_STRICT = 4095
error_reporting: 4095
web_debug: on
cache: off
no_script_name: off
etag: off
test:
.settings:
# E_ALL | E_STRICT & ~E_NOTICE = 2047
error_reporting: 2047
cache: off
web_debug: off
no_script_name: off
etag: off
#all:
# .actions:
# default_module: default # Default module and action to be called when
# default_action: index # A routing rule doesn't set it
#
# error_404_module: default # To be called when a 404 error is raised
# error_404_action: error404 # Or when the requested URL doesn't match any route
#
# login_module: default # To be called when a non-authenticated user
# login_action: login # Tries to access a secure page
#
# secure_module: default # To be called when a user doesn't have
# secure_action: secure # The credentials required for an action
#
# module_disabled_module: default # To be called when a user requests
# module_disabled_action: disabled # A module disabled in the module.yml
#
# unavailable_module: default # To be called when a user requests a page
# unavailable_action: unavailable # From an application disabled via the available setting below
#
# .settings:
# available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action.
#
# # Optional features. Deactivating unused features boots performance a bit.
# use_database: on # Enable database manager. Set to off if you don't use a database.
# use_security: on # Enable security features (login and credentials). Set to off for public applications.
# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions.
# i18n: off # Enable interface translation. Set to off if your application should not be translated.
# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally.
# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
# check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page.
#
# # Output escaping settings
# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost.
# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES.
#
# # Routing settings
# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on.
# no_script_name: off # Enable the front controller name in generated URLs
#
# # Validation settings, used for error generation by the Validation helper
# validation_error_prefix: ' &darr;&nbsp;'
# validation_error_suffix: ' &nbsp;&darr;'
# validation_error_class: form_error
# validation_error_id_prefix: error_for_
#
# # Cache settings
# cache: off # Enable the template cache
# etag: on # Enable etag handling
#
# # Logging and debugging settings
# web_debug: off # Enable the web debug toolbar
# error_reporting: 341 # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341
#
# # Assets paths
# rich_text_js_dir: js/tiny_mce
# prototype_web_dir: /sf/prototype
# admin_web_dir: /sf/sf_admin
# web_debug_web_dir: /sf/sf_web_debug
#
# # Helpers included in all templates by default
# standard_helpers: [Partial, Cache, Form]
#
# # Activated modules from plugins or from the symfony core
# enabled_modules: [default]
#
# # Charset used for the response
# charset: utf-8
#
# # Miscellaneous
# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml
# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges.
# timeout: 1800 # Session timeout, in seconds
# max_forwards: 5
# path_info_array: SERVER
# path_info_key: PATH_INFO
# url_format: PATH
#
# # ORM
# orm: propel
default:
http_metas:
content-type: text/html
metas:
title: Doctrine - Open Source PHP 5 ORM
robots: index, follow
description: Doctrine is a Open Source OO PHP 5 ORM
keywords: doctrine, php, database, orm
language: en
stylesheets: [main, layout]
javascripts: []
has_layout: on
layout: layout
<?php
class myUser extends sfBasicSecurityUser
{
}
<?php
/**
* api_documentation actions.
*
* @package doctrine_website
* @subpackage api_documentation
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class api_documentationActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
}
}
default:
stylesheets: [main, layout, api_documentation]
layout: api_documentation_layout
\ No newline at end of file
<?php
function get_documentation($q)
{
$docPath = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))).DIRECTORY_SEPARATOR.'api_documentation'.DIRECTORY_SEPARATOR.'trunk';
if( $q )
{
$q = str_replace('-sep-', '/', $q);
return get_documentation_html($docPath.'/'.$q, $q);
} else {
return get_documentation_html($docPath.'/index.html', $q);
}
}
function process_documentation($html, $q)
{
//preg_match_all('/a href="(.*)"/', $html, $matches);
preg_match_all('/<a\s[^>]*href=\"([^\"]*)\"[^>]*>/siU', $html, $matches);
$matchValues = $matches[1];
$matches = $matches[0];
foreach($matches AS $key => $match)
{
$value = $matchValues[$key];
if( $value[0] != '#' )
{
$urlQ = str_replace('../', '/', $value);
$urlQ = str_replace('/', '-sep-', $urlQ);
$html = str_replace($match, '<a href="'.url_for('@api_documentation_page?q='.$urlQ).'">', $html);
}
}
return $html;
}
function get_documentation_html($path)
{
ob_start();
if( file_exists($path) )
{
include($path);
$html = ob_get_contents();
ob_end_clean();
return process_documentation($html, $path);
}
}
\ No newline at end of file
<?php
use_helper('ApiDocumentation');
$documentation = get_documentation($sf_request->getParameter('q'));
echo $documentation;
\ No newline at end of file
<?php
/**
* main actions.
*
* @package doctrine_website
* @subpackage main
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class mainActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
}
public function executeAbout()
{
}
public function executeDownload()
{
}
public function executeTrac()
{
$this->redirect('http://phpdoctrine.net/trac');
}
}
About coming soon...
\ No newline at end of file
Download coming soon...
\ No newline at end of file
Welcome to the Doctrine website.
\ No newline at end of file
<?php
/**
* manual actions.
*
* @package doctrine_website
* @subpackage manual
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class manualActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
error_reporting(E_ALL);
$trunk = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
$vendorPath = $trunk.DIRECTORY_SEPARATOR.'vendor';
$manualPath = $trunk.DIRECTORY_SEPARATOR.'manual';
$includePath = $vendorPath.PATH_SEPARATOR.$manualPath.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.'lib';
set_include_path($includePath);
require_once('Sensei/Sensei.php');
require_once('DocTool.php');
require_once('Cache.php');
spl_autoload_register(array('Sensei', 'autoload'));
// Executes the 'svn info' command for the current directory and parses the last
// changed revision.
$revision = 0;
exec('svn info .', $output);
foreach ($output as $line) {
if (preg_match('/^Last Changed Rev: ([0-9]+)$/', $line, $matches)) {
$revision = $matches[1];
break;
}
}
$cacheDir = './cache/';
$cacheRevFile = $cacheDir . 'revision.txt';
$cacheRev = 0;
$cache = new Cache($cacheDir, 'cache');
// Checks the revision cache files were created from
if (file_exists($cacheRevFile)) {
$cacheRev = (int) file_get_contents($cacheRevFile);
}
// Empties the cache directory and saves the current revision to a file, if SVN
// revision is greater than cache revision
if ($revision > $cacheRev) {
$cache->clear();
@file_put_contents($cacheRevFile, $revision);
}
if ($cache->begin()) {
$this->tool = new DocTool($manualPath.'/new/docs/en.txt');
// $this->tool->setOption('clean-url', true);
$baseUrl = '';
$title = 'Doctrine Manual';
$section = null;
if (isset($_GET['chapter'])) {
$section = $this->tool->findByPath($_GET['chapter']);
if ($this->tool->getOption('clean-url')) {
$baseUrl = '../';
}
}
if (isset($_GET['one-page'])) {
$this->tool->setOption('one-page', true);
$this->tool->setOption('max-level', 0);
$section = null;
$baseUrl = '';
}
if ($section) {
while ($section->getLevel() > 1) {
$section = $section->getParent();
}
$this->tool->setOption('section', $section);
$title .= ' - Chapter ' . $section->getIndex() . ' ' . $section->getName();
}
if ($this->tool->getOption('clean-url')) {
$this->tool->setOption('base-url', $baseUrl);
}
$cache->end();
}
}
}
\ No newline at end of file
default:
stylesheets: [main, layout, manual]
javascripts: [manual_toc, manual_tree, mootools.v1.11]
\ No newline at end of file
<?php if( $tool->getOption('section') || $tool->getOption('one-page') ): ?>
<h1>Table of Contents</h1>
<?php $tool->renderToc(); ?>
<p>
<?php if($tool->getOption('one-page')): ?>
<a href="<?php echo ($tool->getOption('clean-url') ? "chapter/" : '?chapter=') . $tool->findByIndex('1.')->getPath(); ?>">View one chapter per page</a>
<?php else: ?>
<a href="<?php echo ($tool->getOption('clean-url') ? "one-page" : '?one-page=1') . '#' . $tool->getOption('section')->getPath(); ?>">View all in one page</a>
<?php endif; ?>
</p>
<?php else: ?>
<p>
You can view this manual online as
<ul>
<li><a href="<?php echo $tool->getOption('clean-url') ? "one-page" : '?one-page=1'; ?>">everything on a single page</a></li>
<li><a href="<?php echo $tool->makeUrl($tool->findByIndex('1.')->getPath()); ?>">one chapter per page</a></li>
</ul>
</p>
<?php endif; ?>
\ No newline at end of file
<div id="manual">
<?php if( $tool->getOption('section') || $tool->getOption('one-page') ): ?>
<?php $tool->render(); ?>
<?php else: ?>
<h1>Table of Contents</h1>
<?php $tool->renderToc(); ?>
<?php endif; ?>
</div>
<?php slot('right'); ?>
<?php echo get_partial('table_of_contents', array('tool' => $tool)); ?>
<?php end_slot(); ?>
\ No newline at end of file
<h1>Copyright Doctrine 2007</h1>
\ No newline at end of file
<h1><?php echo link_to('Doctrine', '@homepage'); ?></h1>
<h2>$follow->the('doctrine');</h2>
\ No newline at end of file
<ul>
<li id="first"><?php echo link_to('home', '@homepage'); ?></li>
<li><?php echo link_to('about', '@about'); ?></li>
<li><?php echo link_to('download', '@download'); ?></li>
<li><?php echo link_to('manual', '@manual'); ?></li>
<li><?php echo link_to('api docs', '@api_documentation'); ?></li>
<li id="last"><?php echo link_to('trac', '@trac'); ?></li>
</ul>
\ No newline at end of file
<!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" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div id="wrapper">
<div id="header">
<?php echo get_partial('global/header'); ?>
</div>
<div id="menu">
<?php echo get_partial('global/menu'); ?>
</div>
<div id="left">
&nbsp;
</div>
<?php echo $sf_data->getRaw('sf_content') ?>
<div id="footer">
<?php echo get_partial('global/footer'); ?>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!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" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div id="wrapper">
<div id="header">
<?php echo get_partial('global/header'); ?>
</div>
<div id="menu">
<?php echo get_partial('global/menu'); ?>
</div>
<div id="left">
&nbsp;
</div>
<div id="right">
<?php if( has_slot('right') ): ?>
<?php echo get_slot('right'); ?>
<?php endif; ?>
</div>
<div id="content">
<?php echo $sf_data->getRaw('sf_content') ?>
</div>
<div id="footer">
<h1>Copyright Doctrine 2007</h1>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?php
// auto-generated by sfRootConfigHandler
// date: 2007/08/31 10:38:25
$this->handlers['config/autoload.yml'] = new sfAutoloadConfigHandler();
$this->handlers['config/autoload.yml']->initialize();
$this->handlers['config/php.yml'] = new sfPhpConfigHandler();
$this->handlers['config/php.yml']->initialize();
$this->handlers['config/databases.yml'] = new sfDatabaseConfigHandler();
$this->handlers['config/databases.yml']->initialize();
$this->handlers['config/settings.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/settings.yml']->initialize(array (
'prefix' => 'sf_',
));
$this->handlers['config/app.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/app.yml']->initialize(array (
'prefix' => 'app_',
));
$this->handlers['config/factories.yml'] = new sfFactoryConfigHandler();
$this->handlers['config/factories.yml']->initialize();
$this->handlers['config/bootstrap_compile.yml'] = new sfCompileConfigHandler();
$this->handlers['config/bootstrap_compile.yml']->initialize();
$this->handlers['config/core_compile.yml'] = new sfCompileConfigHandler();
$this->handlers['config/core_compile.yml']->initialize();
$this->handlers['config/filters.yml'] = new sfFilterConfigHandler();
$this->handlers['config/filters.yml']->initialize();
$this->handlers['config/logging.yml'] = new sfLoggingConfigHandler();
$this->handlers['config/logging.yml']->initialize(array (
'prefix' => 'sf_logging_',
));
$this->handlers['config/routing.yml'] = new sfRoutingConfigHandler();
$this->handlers['config/routing.yml']->initialize();
$this->handlers['config/i18n.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/i18n.yml']->initialize(array (
'prefix' => 'sf_i18n_',
));
$this->handlers['modules/*/config/generator.yml'] = new sfGeneratorConfigHandler();
$this->handlers['modules/*/config/generator.yml']->initialize();
$this->handlers['modules/*/config/view.yml'] = new sfViewConfigHandler();
$this->handlers['modules/*/config/view.yml']->initialize();
$this->handlers['modules/*/config/mailer.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['modules/*/config/mailer.yml']->initialize(array (
'prefix' => 'sf_mailer_',
'module' => true,
));
$this->handlers['modules/*/config/security.yml'] = new sfSecurityConfigHandler();
$this->handlers['modules/*/config/security.yml']->initialize();
$this->handlers['modules/*/config/cache.yml'] = new sfCacheConfigHandler();
$this->handlers['modules/*/config/cache.yml']->initialize();
$this->handlers['modules/*/validate/*.yml'] = new sfValidatorConfigHandler();
$this->handlers['modules/*/validate/*.yml']->initialize();
$this->handlers['modules/*/config/module.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['modules/*/config/module.yml']->initialize(array (
'prefix' => 'mod_',
'module' => true,
));
$this->handlers['config/doctrine.yml'] = new sfDoctrineConfigHandler();
$this->handlers['config/doctrine.yml']->initialize();
$this->handlers['config/schemas.yml'] = new sfDoctrineSchemasConfigHandler();
$this->handlers['config/schemas.yml']->initialize();
<?php
// auto-generated by sfDoctrineConfigHandler
// date: 2007-08-31 10:38:25
$default_attributes["ATTR_EXPORT"] = Doctrine::EXPORT_ALL;
$default_attributes["ATTR_FETCHMODE"] = Doctrine::FETCH_IMMEDIATE;
$default_attributes["ATTR_COLL_LIMIT"] = 5;
$default_attributes["ATTR_LOCKMODE"] = Doctrine::LOCK_PESSIMISTIC;
$default_attributes["ATTR_VLD"] = false;
$default_attributes["ATTR_QUOTE_IDENTIFIER"] = false;
This diff is collapsed.
<?php
// auto-generated by sfRootConfigHandler
// date: 2007/08/31 18:35:25
$this->handlers['config/autoload.yml'] = new sfAutoloadConfigHandler();
$this->handlers['config/autoload.yml']->initialize();
$this->handlers['config/php.yml'] = new sfPhpConfigHandler();
$this->handlers['config/php.yml']->initialize();
$this->handlers['config/databases.yml'] = new sfDatabaseConfigHandler();
$this->handlers['config/databases.yml']->initialize();
$this->handlers['config/settings.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/settings.yml']->initialize(array (
'prefix' => 'sf_',
));
$this->handlers['config/app.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/app.yml']->initialize(array (
'prefix' => 'app_',
));
$this->handlers['config/factories.yml'] = new sfFactoryConfigHandler();
$this->handlers['config/factories.yml']->initialize();
$this->handlers['config/bootstrap_compile.yml'] = new sfCompileConfigHandler();
$this->handlers['config/bootstrap_compile.yml']->initialize();
$this->handlers['config/core_compile.yml'] = new sfCompileConfigHandler();
$this->handlers['config/core_compile.yml']->initialize();
$this->handlers['config/filters.yml'] = new sfFilterConfigHandler();
$this->handlers['config/filters.yml']->initialize();
$this->handlers['config/logging.yml'] = new sfLoggingConfigHandler();
$this->handlers['config/logging.yml']->initialize(array (
'prefix' => 'sf_logging_',
));
$this->handlers['config/routing.yml'] = new sfRoutingConfigHandler();
$this->handlers['config/routing.yml']->initialize();
$this->handlers['config/i18n.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['config/i18n.yml']->initialize(array (
'prefix' => 'sf_i18n_',
));
$this->handlers['modules/*/config/generator.yml'] = new sfGeneratorConfigHandler();
$this->handlers['modules/*/config/generator.yml']->initialize();
$this->handlers['modules/*/config/view.yml'] = new sfViewConfigHandler();
$this->handlers['modules/*/config/view.yml']->initialize();
$this->handlers['modules/*/config/mailer.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['modules/*/config/mailer.yml']->initialize(array (
'prefix' => 'sf_mailer_',
'module' => true,
));
$this->handlers['modules/*/config/security.yml'] = new sfSecurityConfigHandler();
$this->handlers['modules/*/config/security.yml']->initialize();
$this->handlers['modules/*/config/cache.yml'] = new sfCacheConfigHandler();
$this->handlers['modules/*/config/cache.yml']->initialize();
$this->handlers['modules/*/validate/*.yml'] = new sfValidatorConfigHandler();
$this->handlers['modules/*/validate/*.yml']->initialize();
$this->handlers['modules/*/config/module.yml'] = new sfDefineEnvironmentConfigHandler();
$this->handlers['modules/*/config/module.yml']->initialize(array (
'prefix' => 'mod_',
'module' => true,
));
$this->handlers['config/doctrine.yml'] = new sfDoctrineConfigHandler();
$this->handlers['config/doctrine.yml']->initialize();
$this->handlers['config/schemas.yml'] = new sfDoctrineSchemasConfigHandler();
$this->handlers['config/schemas.yml']->initialize();
<?php
// auto-generated by sfDatabaseConfigHandler
// date: 2007/08/31 18:35:26
<?php
// auto-generated by sfFactoryConfigHandler
// date: 2007/08/31 18:35:26
$this->controller = sfController::newInstance(sfConfig::get('sf_factory_controller', 'sfFrontWebController'));
$this->request = sfRequest::newInstance(sfConfig::get('sf_factory_request', 'sfWebRequest'));
$this->response = sfResponse::newInstance(sfConfig::get('sf_factory_response', 'sfWebResponse'));
$this->storage = sfStorage::newInstance(sfConfig::get('sf_factory_storage', 'sfSessionStorage'));
$this->user = sfUser::newInstance(sfConfig::get('sf_factory_user', 'myUser'));
$this->controller->initialize($this);
$this->request->initialize($this, sfConfig::get('sf_factory_request_parameters', NULL), sfConfig::get('sf_factory_request_attributes', array()));
$this->response->initialize($this, sfConfig::get('sf_factory_response_parameters', NULL));
$this->storage->initialize($this, sfConfig::get('sf_factory_storage_parameters', array (
'session_name' => 'symfony',
)));
$this->user->initialize($this, sfConfig::get('sf_factory_user_parameters', NULL));
if (sfConfig::get('sf_cache'))
{
$this->viewCacheManager = new sfViewCacheManager();
$this->viewCacheManager->initialize($this, sfConfig::get('sf_factory_view_cache', 'sfFileCache'), sfConfig::get('sf_factory_view_cache_parameters', array (
'automaticCleaningFactor' => 0,
'cacheDir' => '/Users/jwage/Sites/doctrine_trunk/website/cache/frontend/dev/template',
)));
}
<?php
// auto-generated by sfDefineEnvironmentConfigHandler
// date: 2007/08/31 18:35:26
sfConfig::add(array(
'sf_logging_enabled' => true,
'sf_logging_level' => 'debug',
'sf_logging_rotate' => false,
'sf_logging_period' => 7,
'sf_logging_history' => 10,
'sf_logging_purge' => true,
));
$logger = sfLogger::getInstance();
$logger->setLogLevel(constant('SF_LOG_'.strtoupper(sfConfig::get('sf_logging_level'))));
$log = new sfWebDebugLogger();
$log->initialize(array (
));
$logger->registerLogger($log);
$log = new sfFileLogger();
$log->initialize(array (
'file' => '/Users/jwage/Sites/doctrine_trunk/website/log/frontend_dev.log',
));
$logger->registerLogger($log);
<?php
// auto-generated by sfPhpConfigHandler
// date: 2007/08/31 18:35:26
ini_set('magic_quotes_runtime', '');
ini_set('log_errors', '1');
ini_set('arg_separator.output', '&amp;');
if (ini_get('magic_quotes_gpc') != false)
{
sfLogger::getInstance()->warning('{sfPhpConfigHandler} php.ini "magic_quotes_gpc" key is better set to "false" (current value is "\'\'" - php.ini location: "/usr/local/php5/lib/php.ini")');
}
if (ini_get('register_globals') != false)
{
sfLogger::getInstance()->warning('{sfPhpConfigHandler} php.ini "register_globals" key is better set to "false" (current value is "\'\'" - php.ini location: "/usr/local/php5/lib/php.ini")');
}
if (ini_get('session.auto_start') != false)
{
sfLogger::getInstance()->warning('{sfPhpConfigHandler} php.ini "session.auto_start" key is better set to "false" (current value is "\'0\'" - php.ini location: "/usr/local/php5/lib/php.ini")');
}
<?php
// auto-generated by sfRoutingConfigHandler
// date: 2007/08/31 18:35:26
$routes = sfRouting::getInstance();
$routes->setRoutes(
array (
'homepage' =>
array (
0 => '/',
1 => '/^[\\/]*$/',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'main',
'action' => 'index',
),
5 =>
array (
),
6 => '',
),
'api_documentation_page' =>
array (
0 => '/documentation/api/:q',
1 => '#^/documentation/api(?:\\/([^\\/]+))?$#',
2 =>
array (
0 => 'q',
),
3 =>
array (
'q' => 1,
),
4 =>
array (
'module' => 'api_documentation',
'action' => 'index',
),
5 =>
array (
),
6 => '',
),
'about' =>
array (
0 => '/about',
1 => '#^/about$#',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'main',
'action' => 'about',
),
5 =>
array (
),
6 => '',
),
'download' =>
array (
0 => '/download',
1 => '#^/download$#',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'main',
'action' => 'download',
),
5 =>
array (
),
6 => '',
),
'manual' =>
array (
0 => '/documentation/manual',
1 => '#^/documentation/manual$#',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'manual',
'action' => 'index',
),
5 =>
array (
),
6 => '',
),
'api_documentation' =>
array (
0 => '/documentation/api',
1 => '#^/documentation/api$#',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'api_documentation',
'action' => 'index',
),
5 =>
array (
),
6 => '',
),
'trac' =>
array (
0 => '/trac',
1 => '#^/trac$#',
2 =>
array (
),
3 =>
array (
),
4 =>
array (
'module' => 'main',
'action' => 'trac',
),
5 =>
array (
),
6 => '',
),
'default_symfony' =>
array (
0 => '/symfony/:action/*',
1 => '#^/symfony(?:\\/([^\\/]+))?(?:\\/(.*))?$#',
2 =>
array (
0 => 'action',
),
3 =>
array (
'action' => 1,
),
4 =>
array (
'module' => 'default',
),
5 =>
array (
),
6 => '',
),
'default_index' =>
array (
0 => '/:module',
1 => '#^(?:\\/([^\\/]+))?$#',
2 =>
array (
0 => 'module',
),
3 =>
array (
'module' => 1,
),
4 =>
array (
'action' => 'index',
),
5 =>
array (
),
6 => '',
),
'default' =>
array (
0 => '/:module/:action/*',
1 => '#^(?:\\/([^\\/]+))?(?:\\/([^\\/]+))?(?:\\/(.*))?$#',
2 =>
array (
0 => 'module',
1 => 'action',
),
3 =>
array (
'module' => 1,
'action' => 1,
),
4 =>
array (
),
5 =>
array (
),
6 => '',
),
)
);
<?php
// auto-generated by sfDefineEnvironmentConfigHandler
// date: 2007/08/31 18:35:26
sfConfig::add(array(
'sf_default_module' => 'default',
'sf_default_action' => 'index',
'sf_error_404_module' => 'default',
'sf_error_404_action' => 'error404',
'sf_login_module' => 'default',
'sf_login_action' => 'login',
'sf_secure_module' => 'default',
'sf_secure_action' => 'secure',
'sf_module_disabled_module' => 'default',
'sf_module_disabled_action' => 'disabled',
'sf_unavailable_module' => 'default',
'sf_unavailable_action' => 'unavailable',
'sf_available' => true,
'sf_use_database' => true,
'sf_use_security' => true,
'sf_use_flash' => true,
'sf_i18n' => false,
'sf_check_symfony_version' => false,
'sf_use_process_cache' => true,
'sf_compressed' => false,
'sf_check_lock' => false,
'sf_escaping_strategy' => 'bc',
'sf_escaping_method' => 'ESC_ENTITIES',
'sf_suffix' => '.',
'sf_no_script_name' => false,
'sf_validation_error_prefix' => ' &darr;&nbsp;',
'sf_validation_error_suffix' => ' &nbsp;&darr;',
'sf_validation_error_class' => 'form_error',
'sf_validation_error_id_prefix' => 'error_for_',
'sf_cache' => false,
'sf_etag' => false,
'sf_web_debug' => true,
'sf_error_reporting' => 4095,
'sf_rich_text_js_dir' => 'js/tiny_mce',
'sf_prototype_web_dir' => '/sf/prototype',
'sf_admin_web_dir' => '/sf/sf_admin',
'sf_web_debug_web_dir' => '/sf/sf_web_debug',
'sf_calendar_web_dir' => '/sf/calendar',
'sf_standard_helpers' => array (
0 => 'Partial',
1 => 'Cache',
2 => 'Form',
),
'sf_enabled_modules' => array (
0 => 'default',
),
'sf_charset' => 'utf-8',
'sf_strip_comments' => true,
'sf_autoloading_functions' => NULL,
'sf_timeout' => 1800,
'sf_max_forwards' => 5,
'sf_path_info_array' => 'SERVER',
'sf_path_info_key' => 'PATH_INFO',
'sf_url_format' => 'PATH',
'sf_orm' => 'doctrine',
));
<?php
// auto-generated by sfFilterConfigHandler
// date: 2007/08/31 18:35:36
list($class, $parameters) = (array) sfConfig::get('sf_rendering_filter', array('sfRenderingFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_web_debug_filter', array('sfWebDebugFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
// does this action require security?
if ($actionInstance->isSecure())
{
if (!in_array('sfSecurityUser', class_implements($this->context->getUser())))
{
$error = 'Security is enabled, but your sfUser implementation does not implement sfSecurityUser interface';
throw new sfSecurityException($error);
}
list($class, $parameters) = (array) sfConfig::get('sf_security_filter', array('sfBasicSecurityFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
}
list($class, $parameters) = (array) sfConfig::get('sf_common_filter', array('sfCommonFilter', null));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_flash_filter', array('sfFlashFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_execution_filter', array('sfExecutionFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
<?php
// auto-generated by sfDefineEnvironmentConfigHandler
// date: 2007/08/31 18:35:36
sfConfig::add(array(
'mod_'.strtolower($moduleName).'_enabled' => true,
'mod_'.strtolower($moduleName).'_view_class' => 'sfPHP',
'mod_'.strtolower($moduleName).'_is_internal' => false,
));
<?php
// auto-generated by sfSecurityConfigHandler
// date: 2007/08/31 18:35:36
$this->security = array (
'all' =>
array (
'is_secure' => false,
),
);
<?php
// auto-generated by sfViewConfigHandler
// date: 2007/08/31 18:35:36
$context = $this->getContext();
$response = $context->getResponse();
$templateName = $response->getParameter($this->moduleName.'_'.$this->actionName.'_template', $this->actionName, 'symfony/action/view');
$this->setTemplate($templateName.$this->viewName.$this->getExtension());
if (!$context->getRequest()->isXmlHttpRequest())
{
$this->setDecoratorTemplate('api_documentation_layout'.$this->getExtension());
}
$response->addHttpMeta('content-type', 'text/html', false);
$response->addMeta('title', 'Doctrine - Open Source PHP 5 ORM', false, false);
$response->addMeta('robots', 'index, follow', false, false);
$response->addMeta('description', 'Doctrine is a Open Source OO PHP 5 ORM', false, false);
$response->addMeta('keywords', 'doctrine, php, database, orm', false, false);
$response->addMeta('language', 'en', false, false);
$response->addStylesheet('main', '', array ());
$response->addStylesheet('layout', '', array ());
$response->addStylesheet('api_documentation', '', array ());
<?php
// auto-generated by sfFilterConfigHandler
// date: 2007/08/31 18:35:26
list($class, $parameters) = (array) sfConfig::get('sf_rendering_filter', array('sfRenderingFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_web_debug_filter', array('sfWebDebugFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
// does this action require security?
if ($actionInstance->isSecure())
{
if (!in_array('sfSecurityUser', class_implements($this->context->getUser())))
{
$error = 'Security is enabled, but your sfUser implementation does not implement sfSecurityUser interface';
throw new sfSecurityException($error);
}
list($class, $parameters) = (array) sfConfig::get('sf_security_filter', array('sfBasicSecurityFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
}
list($class, $parameters) = (array) sfConfig::get('sf_common_filter', array('sfCommonFilter', null));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_flash_filter', array('sfFlashFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
list($class, $parameters) = (array) sfConfig::get('sf_execution_filter', array('sfExecutionFilter', array (
)));
$filter = new $class();
$filter->initialize($this->context, $parameters);
$filterChain->register($filter);
<?php
// auto-generated by sfDefineEnvironmentConfigHandler
// date: 2007/08/31 18:35:26
sfConfig::add(array(
'mod_'.strtolower($moduleName).'_enabled' => true,
'mod_'.strtolower($moduleName).'_view_class' => 'sfPHP',
'mod_'.strtolower($moduleName).'_is_internal' => false,
));
<?php
// auto-generated by sfSecurityConfigHandler
// date: 2007/08/31 18:35:26
$this->security = array (
'all' =>
array (
'is_secure' => false,
),
);
<?php
// auto-generated by sfViewConfigHandler
// date: 2007/08/31 18:35:26
$context = $this->getContext();
$response = $context->getResponse();
$templateName = $response->getParameter($this->moduleName.'_'.$this->actionName.'_template', $this->actionName, 'symfony/action/view');
$this->setTemplate($templateName.$this->viewName.$this->getExtension());
if (!$context->getRequest()->isXmlHttpRequest())
{
$this->setDecoratorTemplate('layout'.$this->getExtension());
}
$response->addHttpMeta('content-type', 'text/html', false);
$response->addMeta('title', 'Doctrine - Open Source PHP 5 ORM', false, false);
$response->addMeta('robots', 'index, follow', false, false);
$response->addMeta('description', 'Doctrine is a Open Source OO PHP 5 ORM', false, false);
$response->addMeta('keywords', 'doctrine, php, database, orm', false, false);
$response->addMeta('language', 'en', false, false);
$response->addStylesheet('main', '', array ());
$response->addStylesheet('layout', '', array ());
$response->addStylesheet('manual', '', array ());
$response->addJavascript('manual_toc');
$response->addJavascript('manual_tree');
$response->addJavascript('mootools.v1.11');
<?php
// symfony directories
$sf_symfony_lib_dir = '/usr/local/php5/lib/php/symfony';
$sf_symfony_data_dir = '/usr/local/php5/lib/php/data/symfony';
#all:
# doctrine:
# class: sfDoctrineDatabase
# param:
# dsn: mysql://user:pass@localhost/doctrine
\ No newline at end of file
[symfony]
name=doctrine_website
.svn
/web/uploads/*
/cache/*
/log/*
CREATE TABLE sf_guard_user_permission(
created_at DATETIME,
updated_at DATETIME,
user_id INTEGER,
permission_id INTEGER,
PRIMARY KEY(user_id,
permission_id));
CREATE TABLE sf_guard_user_group(
created_at DATETIME,
updated_at DATETIME,
group_id INTEGER,
user_id INTEGER,
PRIMARY KEY(group_id,
user_id));
CREATE TABLE sf_guard_user(
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATETIME,
updated_at DATETIME,
username VARCHAR(128)
NOT NULL,
algorithm VARCHAR(128)
DEFAULT 'sha1' NOT NULL,
salt VARCHAR(128)
NOT NULL,
password VARCHAR(128)
NOT NULL,
last_login DATETIME,
is_active INTEGER DEFAULT 1 NOT NULL,
is_super_admin INTEGER DEFAULT 0 NOT NULL);
CREATE TABLE sf_guard_remember_key(
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATETIME,
updated_at DATETIME,
user_id INTEGER,
remember_key VARCHAR(32),
ip_address VARCHAR(15));
CREATE TABLE sf_guard_permission(
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATETIME,
updated_at DATETIME,
name VARCHAR(255)
NOT NULL,
description VARCHAR(4000));
CREATE TABLE sf_guard_group_permission(
created_at DATETIME,
updated_at DATETIME,
group_id INTEGER,
permission_id INTEGER NOT NULL,
PRIMARY KEY(group_id,
permission_id));
CREATE TABLE sf_guard_group(
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATETIME,
updated_at DATETIME,
name VARCHAR(255)
NOT NULL,
description VARCHAR(4000));
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardGroup extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_group');
$this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,));
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('name', 'string', 255, array ( 'notnull' => true,));
$this->hasColumn('description', 'string', 4000, array ());
}
public function setUp()
{
$this->hasMany('sfGuardUser as users', array('refClass' => 'sfGuardUserGroup', 'local' => 'group_id', 'foreign' => 'user_id'));
$this->hasMany('sfGuardPermission as permissions', array('refClass' => 'sfGuardGroupPermission', 'local' => 'group_id', 'foreign' => 'permission_id'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardGroupPermission extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_group_permission');
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('group_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('permission_id', 'integer', 4, array ( 'notnull' => true, 'primary' => true,));
}
public function setUp()
{
$this->hasOne('sfGuardGroup as sfGuardGroup', array('local' => 'group_id', 'foreign' => 'id'));
$this->hasOne('sfGuardPermission as sfGuardPermission', array('local' => 'permission_id', 'foreign' => 'id'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardPermission extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_permission');
$this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,));
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('name', 'string', 255, array ( 'notnull' => true,));
$this->hasColumn('description', 'string', 4000, array ());
}
public function setUp()
{
$this->hasMany('sfGuardUser as users', array('refClass' => 'sfGuardUserPermission', 'local' => 'permission_id', 'foreign' => 'user_id'));
$this->hasMany('sfGuardGroup as groups', array('refClass' => 'sfGuardGroupPermission', 'local' => 'permission_id', 'foreign' => 'group_id'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardRememberKey extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_remember_key');
$this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,));
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('remember_key', 'string', 32, array ());
$this->hasColumn('ip_address', 'string', 15, array ( 'primary' => true,));
}
public function setUp()
{
$this->hasOne('sfGuardUser as user', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardUser extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_user');
$this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,));
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('username', 'string', 128, array ( 'notnull' => true,));
$this->hasColumn('algorithm', 'string', 128, array ( 'default' => 'sha1', 'notnull' => true,));
$this->hasColumn('salt', 'string', 128, array ( 'notnull' => true,));
$this->hasColumn('password', 'string', 128, array ( 'notnull' => true,));
$this->hasColumn('last_login', 'timestamp', null, array ());
$this->hasColumn('is_active', 'boolean', null, array ( 'default' => 1, 'notnull' => true,));
$this->hasColumn('is_super_admin', 'boolean', null, array ( 'default' => 0, 'notnull' => true,));
}
public function setUp()
{
$this->hasMany('sfGuardGroup as groups', array('refClass' => 'sfGuardUserGroup', 'local' => 'user_id', 'foreign' => 'group_id'));
$this->hasMany('sfGuardPermission as permissions', array('refClass' => 'sfGuardUserPermission', 'local' => 'user_id', 'foreign' => 'permission_id'));
$this->hasMany('sfGuardRememberKey as remember_key', array('local' => 'id', 'foreign' => 'user_id'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardUserGroup extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_user_group');
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('group_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,));
}
public function setUp()
{
$this->hasOne('sfGuardGroup as sfGuardGroup', array('local' => 'group_id', 'foreign' => 'id'));
$this->hasOne('sfGuardUser as sfGuardUser', array('local' => 'user_id', 'foreign' => 'id'));
}
}
<?php
/*
* Base class; DO NOT EDIT
*
* auto-generated by the sfDoctrine plugin
*/
class BasesfGuardUserPermission extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('sf_guard_user_permission');
$this->hasColumn('created_at', 'timestamp', null, array ());
$this->hasColumn('updated_at', 'timestamp', null, array ());
$this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,));
$this->hasColumn('permission_id', 'integer', 4, array ( 'primary' => true,));
}
public function setUp()
{
$this->hasOne('sfGuardUser as sfGuardUser', array('local' => 'user_id', 'foreign' => 'id'));
$this->hasOne('sfGuardPermission as sfGuardPermission', array('local' => 'permission_id', 'foreign' => 'id'));
}
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardGroup extends PluginsfGuardGroup
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardGroupPermission extends PluginsfGuardGroupPermission
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardGroupPermissionTable extends PluginsfGuardGroupPermissionTable
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardGroupTable extends PluginsfGuardGroupTable
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardPermission extends PluginsfGuardPermission
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardPermissionTable extends PluginsfGuardPermissionTable
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardRememberKey extends PluginsfGuardRememberKey
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardRememberKeyTable extends PluginsfGuardRememberKeyTable
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUser extends PluginsfGuardUser
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUserGroup extends PluginsfGuardUserGroup
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUserGroupTable extends PluginsfGuardUserGroupTable
{
}
<?php
/*
* Edit this file to customise your model class
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUserPermission extends PluginsfGuardUserPermission
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUserPermissionTable extends PluginsfGuardUserPermissionTable
{
}
<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class sfGuardUserTable extends PluginsfGuardUserTable
{
}
This diff is collapsed.
Copyright (c) 2004-2006 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sfDoctrine symfony plugin
=========================
Overview
--------
The sfDoctrine plugin allows you to totally replace propel with doctrine (http://www.phpdoctrine.com/) which is a powerful and easy-to-use ORM.
Contents
--------
This plugin contains:
- necessary tools to use doctrine: the main tool is sfDoctrine::getTable() which will allow you to send queries
- pake tasks that convert between doctrine and propel schema formats and build doctrine model classes automatically
- an admin generator: to use it just specify sfDoctrineAdmin as the main class in your generator.yml config
You will find more information in the wiki page dedicated to sfDoctrine: http://www.symfony-project.com/trac/wiki/sfDoctrine.
License
-------
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
<?php
/*
* This file is part of the sfDoctrine package.
* (c) 2006-2007 Olivier Verdier <Olivier.Verdier@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @package symfony.plugins
* @subpackage sfDoctrine
* @author Olivier Verdier <Olivier.Verdier@gmail.com>
* @version SVN: $Id: sfDoctrineDatabaseSchema.class.php 3455 2007-02-14 16:17:48Z chtito $
*/
/*
- class: contains a bunch of columns, toMany relationships, inheritance
information, i18n information
- table: a special class that is actually a table
- column: contains the doctrine properties (name, type, size) and the toOne relation information
*/
class sfDoctrineDatabaseSchema
{
// the class descriptions
protected $classes = array();
// a subset of the array above: classes which are also tables
protected $tables = array();
public function getClasses()
{
return $this->classes;
}
protected function getClass($className)
{
if (isset($this->classes[$className]))
return $this->classes[$className];
throw new sfDoctrineSchemaException(sprintf('The class "%s" has no description', $className));
}
// retrieves a class object from its table name
protected function findClassByTableName($tableName)
{
foreach ($this->tables as $table)
if ($table->getName() == $tableName)
{
$tableClasses = $table->getClasses();
if (count($tableClasses) != 1)
throw new sfDoctrineSchemaException(sprintf('No unique class is associated to table "%s"', $tableName));
return array_pop($tableClasses);
}
throw new sfDoctrineSchemaException(sprintf('Table "%s" not found', $tableName));
}
// set the one to many and many to many relationships
// finds out what are the foreign classes or foreign tables
protected function fixRelationships()
{
foreach ($this->classes as $className => $class)
{
foreach ($class->getColumns() as $relCol)
if ($relation = $relCol->getRelation())
{
// if no foreignClass was specified (import from propel) we find it out
if (!$relation->get('foreignClass'))
{
$foreignClass = $this->findClassByTableName($relation->get('foreignTable'));
$relation->set('foreignClass', $foreignClass->getPhpName());
}
// if foreignTable was not set (only used for export to propel)
// we figure it out
if (!$relation->get('foreignTable'))
{
$className = $relation->get('foreignClass');
$relation->set('foreignTable', $this->getClass($className)->getTableName());
}
// the relation is a many2many
if ($relation->get('counterpart'))
{
$counterpartRel = $class->getRelation($relation->get('counterpart'));
$relation->set('otherClass', $counterpartRel->get('foreignClass'));
}
// we copy all the toOne relations to the corresponding
// foreign class
$rel = $relCol->getRelation();
$this->getClass($rel->get('foreignClass'))->addToMany($rel); // FIXME: don't copy here
}
}
}
// exports the current schema as a propel xml file
public function asPropelXml()
{
$xml = new SimpleXmlElement(sprintf('<?xml version="1.0" encoding="UTF-8" ?>
<database name="%s" defaultIdMethod="native"></database>', 'connection'));
foreach ($this->tables as $table)
{
$table->addPropelXmlClasses($xml);
}
return array('source'=>$xml->asXml());
}
// exports the current schema in a sfDoctrine yml file
public function asDoctrineYml()
{
$ymlClasses = array();
foreach ($this->classes as $class)
{
$ymlClasses[$class->getPhpName()] = $class->asDoctrineYml();
}
return array('source'=>sfYaml::dump($ymlClasses));
}
public function debug()
{
$debug = array();
foreach ($this->classes as $class)
{
$debug[$class->getPhpName()] = $class->debug();
}
return $debug;
}
}
class sfDoctrineSchemaException extends sfException
{
public function __construct($message = null, $code = 0)
{
$this->setName('sfDoctrineSchemaException');
parent::__construct($message, $code);
}
}
\ No newline at end of file
<?php
/*
* This file is part of the sfDoctrine package.
* (c) 2006-2007 Olivier Verdier <Olivier.Verdier@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @package symfony.plugins
* @subpackage sfDoctrine
* @author Olivier Verdier <Olivier.Verdier@gmail.com>
* @version SVN: $Id: sfDoctrineRelationSchema.class.php 4705 2007-07-24 20:45:46Z Jonathan.Wage $
*/
class sfDoctrineRelationSchema
{
protected $relationInfo = array();
public function __construct($relationInfo)
{
foreach ($relationInfo as $key => $value)
{
$this->set($key, $value);
}
}
public function set($key, $value)
{
// we set the default foreign name
if ($key == 'foreignClass')
{
if (!isset($this->relationInfo['foreignName']))
{
$this->relationInfo['foreignName'] = $value;
}
}
$this->relationInfo[$key] = $value;
}
public function get($key)
{
if (isset($this->relationInfo[$key]))
{
return $this->relationInfo[$key];
}
else if (isset($this->relationInfo['options']))
{
if ($option = $this->relationInfo['options']->get($key))
{
return $option;
}
}
return null;
}
public function asDoctrineYml()
{
$output = array();
foreach(array('foreignClass', 'foreignReference', 'localName', 'foreignName', 'cascadeDelete', 'unique') as $key)
{
if ($value = $this->get($key))
{
$output[$key] = $value;
}
}
// FIXME: this is clumsy: change the schema syntax?
if ($verb == 'owns')
{
$output['cascadeDelete'] = true;
}
return $output;
}
public function asPhpArray($array)
{
$phpArray = 'array(';
if( !empty($array) )
{
foreach($array AS $key => $value)
{
$phpArray .= "'{$key}' => '{$value}', ";
}
$phpArray = substr($phpArray, 0, strlen($phpArray) - 2);
}
$phpArray .= ')';
return $phpArray;
}
public function asOnePhp()
{
// special behaviour for xref tables with cascade delete
$verb = ($this->get('cascadeDelete') && ($this->get('counterpart') || $this->get('unique'))) ? 'owns' : 'has';
$options['local'] = $this->get('localReference');
$options['foreign'] = $this->get('foreignReference');
//support old and new cascade declarations
if ($verb == 'owns' || $this->get('cascadeDelete') === true)
{
$options['onDelete'] = 'CASCADE';
}
if ($this->get('onDelete'))
{
$options['onDelete'] = strtoupper($this->get('onDelete'));
}
$phpOptions = $this->asPhpArray($options);
return "\$this->$verb"."One('{$this->get('foreignClass')} as {$this->get('foreignName')}', $phpOptions);";
}
public function asManyPhp()
{
$quantity = $this->get('unique') ? 'One':'Many';
// using "owns" for cascade delete except in xref table
$verb = ($this->get('cascadeDelete') && !$this->get('counterpart')) ? 'has':'has';
$otherClass = $this->get('localClass');
if ($quantity == 'Many' && $this->get('counterpart'))
{
$localReference = $this->relationInfo['localReference'];
$foreignReference = $this->relationInfo['options']->get('counterpart');
$otherClass = $this->get('otherClass');
} else {
$localReference = $this->get('foreignReference');
$foreignReference = $this->get('localReference');
}
$localClass = $this->get('localClass');
// Set refClass to localClass if it is a Many-Many relationship
if ($quantity == 'Many' && $this->get('counterpart'))
{
$refClass = $this->get('localClass');
}
if (isset($refClass) && $refClass)
{
$options['refClass'] = $refClass;
}
if ($localReference)
{
$options['local'] = $localReference;
}
if ($foreignReference)
{
$options['foreign'] = $foreignReference;
}
$phpOptions = $this->asPhpArray($options);
return "\$this->$verb$quantity('$otherClass as {$this->get('localName')}', $phpOptions);";
}
public function debug()
{
return $this->relationInfo;
}
}
\ No newline at end of file
<?php
/*
* This file is part of the sfDoctrine package.
* (c) 2006-2007 Olivier Verdier <Olivier.Verdier@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @package symfony.plugins
* @subpackage sfDoctrine
* @author Olivier Verdier <Olivier.Verdier@gmail.com>
* @version SVN: $Id: sfDoctrineSchemaDoctrineLoader.class.php 3455 2007-02-14 16:17:48Z chtito $
*/
class sfDoctrineSchemaDoctrineLoader extends sfDoctrineDatabaseSchema
{
// recursively finds out what a class table is
// FIXME: check for infinite loop?
protected function parentTable($class)
{
if ($class->hasTable())
return $class->getTable();
return $this->parentTable($this->getClass($class->getParentClassName()));
}
// associate a table to each class
protected function fixTables()
{
foreach ($this->classes as $className => $class)
{
$table = $this->parentTable($class);
$table->addClass($class);
}
}
// set up the necessary fields in the i18n table: culture, id
protected function addI18nFields()
{
foreach ($this->classes as $className => $class)
{
if (!$class->hasI18n())
continue;
$i18nClass = $this->getClass($class->getI18n('class'));
$cultureColumn = new sfDoctrineColumnSchema($class->getI18n('cultureField'), array('type'=> 'string', 'size'=> 100, 'primary'=> true));
$i18nClass->addColumn($cultureColumn);
// add the foreign key to the main table
$idDesc = array('foreignClass'=>$className, 'localName'=>$i18nClass->getPhpName(), 'onDelete'=>'cascade', 'primary'=>true);
$i18nClass->addColumn(new sfDoctrineColumnSchema('id', $idDesc));
}
}
// adds the class key fields
protected function addInheritanceFields()
{
foreach ($this->classes as $className => $class)
if ($class->hasOneTableInheritance())
{
$inh = $class->getInheritance();
$class->getTable()->addColumn(new sfDoctrineColumnSchema($inh['keyField'], array('type'=>'integer')));
}
}
public function load($file, $package = null)
{
$schema = sfYaml::load($file);
foreach ($schema as $className => $cd)
{
if (!isset($cd['tableName']) && !isset($cd['inheritance']))
throw new sfDoctrineSchemaException(sprintf('Class "%s" must have either a table or a parent', $className));
$class = new sfDoctrineClassSchema($className, $cd);
// add a table if necessary
if (isset($cd['tableName']))
{
// this top class is actually a table
$table = new sfDoctrineTableSchema($cd['tableName'], $package);
$table->addClass($class);
$this->tables[$cd['tableName']] = $table;
}
$this->classes[$className] = $class;
}
}
public function process()
{
$this->fixTables();
$this->addI18nFields();
$this->fixRelationships();
$this->addInheritanceFields();
}
}
\ No newline at end of file
<?php
/*
* This file is part of the sfDoctrine package.
* (c) 2006-2007 Olivier Verdier <Olivier.Verdier@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @package symfony.plugins
* @subpackage sfDoctrine
* @author Olivier Verdier <Olivier.Verdier@gmail.com>
* @version SVN: $Id: sfDoctrineSchemaPropelLoader.class.php 3455 2007-02-14 16:17:48Z chtito $
*/
class sfDoctrineSchemaPropelLoader extends sfDoctrineDatabaseSchema
{
// get the attributes parsed by the sfPropelDatabaseSchema class
protected function getAttribute($tag, $attribute)
{
return isset($tag['_attributes'][$attribute]) ? $tag['_attributes'][$attribute] : null;
}
public function load($file, $package = null)
{
// we figure out what kind of file we are given
$type = array_pop(explode('.', $file));
$type2method = array('yml'=>'loadYAML', 'xml'=>'loadXML');
if (isset($type2method[$type]))
$method = $type2method[$type];
else
throw new sfDoctrineSchemaException(sprintf('Unkwnown method for extension "%s"', $type));
$propelDatabaseSchema = new sfPropelDatabaseSchema();
$propelDatabaseSchema->$method($file);
$data = $propelDatabaseSchema->asArray();
foreach ($propelDatabaseSchema->getTables() as $tb_name => $tableDesc)
{
// special table class
// propel has only such classes (no inheritance support)
$table = new sfDoctrineTableSchema($tb_name, $package);
$this->tables[$tb_name] = $table;
if (!($className = $this->getAttribute($tableDesc, 'phpName')))
$className = sfInflector::camelize($tb_name); // wild guess
$class = new sfDoctrineClassSchema($className);
$table->addClass($class);
// columns
foreach ($propelDatabaseSchema->getChildren($tableDesc) as $col_name => $columnDescription)
{
if (($col_name == 'id')) // id is automatically generated in doctrine
continue;
$docCol = new sfDoctrineColumnSchema($col_name, $columnDescription, true);
$class->addColumn($docCol);
}
$this->classes[$class->getPhpName()] = $class;
}
}
public function process()
{
$this->fixRelationships();
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment