My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Cakewell Magic Config File
*
* This file is called at the end of the Cakewell version of the CakePhp core
* config file. It dynamically determines the context in which the application
* is running based on the $_SERVER['SERVER_NAME'] value and sets App.mode
* and App.domain values.
*
* NOTE WELL: YOU SHOULD NOT NEED TO EDIT THIS FILE.
*/

/*
Set $_SERVER['SERVER_NAME'] for command line

Since $_SERVER['SERVER_NAME'] is not set when php is run from the
command line, we give the command line call an opportunity to set
the server environment as the last parameter, following this example:
http://bakery.cakephp.org/articles/view/one-core-one-app-multiple-domains
*/
if ( empty($_SERVER['SERVER_NAME']) )
{
// look at last cli value
if ( count($_SERVER['argv']) ) {
$_SERVER['SERVER_NAME'] = $_SERVER['argv'][count($_SERVER['argv'])-1];
}
}

// Set App.Mode Value
// defaults
Configure::write('App.mode', 'production');
Configure::write('App.domain', $_SERVER['SERVER_NAME']);

// from ConfigDomainMap in core config file
foreach ( $ConfigDomainMap as $server_name => $app_mode )
{
if ( $server_name == $_SERVER['SERVER_NAME'] )
{
Configure::write('App.mode', $app_mode);
Configure::write('App.domain', $server_name);
}
}

/**
* Mode-Specific Config Files
* If a file with name match App.mode settings found in config/domains
* folder, load it. An example file: config/domains/test.php
*/
$app_mode_config_file = sprintf( '%s%s/%s.php',
CONFIGS,
'modes',
Configure::read('App.mode') );
if ( file_exists($app_mode_config_file) )
require_once($app_mode_config_file);

/**
* Domain-Specific Config Files
* If a file with name match App.domain settings found in config/modes
* folder, load it. An example file: config/domains/cakewell.klenwell.com.php
*/
$app_domain_config_file = sprintf( '%s%s/%s.php',
CONFIGS,
'domains',
Configure::read('App.domain') );
if ( file_exists($app_domain_config_file) )
require_once($app_domain_config_file);

?>

Change log

77cbeb687827 by klenwell on Mar 1, 2010   Diff
updating cron documentation
Go to: 
Project members, sign in to write a code review

Older revisions

ea7b663b3c81 by klenwell on Nov 1, 2009   Diff
updating cron script to function more
cleanly with config magic
0d67591c0675 by klenwell on Sep 3, 2009   Diff
T438: editing config files comments
56bf75497dd4 by klenwell on Aug 31, 2009   Diff
T438: updating config file to handle
domain and mode-specific settings
All revisions of this file

File info

Size: 2457 bytes, 68 lines
Powered by Google Project Hosting