Changeset 322
- Timestamp:
- 08/25/07 20:39:23 (1 year ago)
- Files:
-
- trunk/.htaccess (modified) (1 diff)
- trunk/app/models/framework_setup.php (modified) (5 diffs)
- trunk/app/views/framework_setup/compiled/set_database_details.tpl.php (modified) (2 diffs)
- trunk/app/views/framework_setup/set_database_details.tpl (modified) (1 diff)
- trunk/docs/tutorial.markdown (modified) (1 diff)
- trunk/lib/Ak.php (modified) (1 diff)
- trunk/lib/AkActionController.php (modified) (1 diff)
- trunk/lib/AkActiveRecord.php (modified) (1 diff)
- trunk/lib/AkActiveRecord/AkHasAndBelongsToMany.php (modified) (1 diff)
- trunk/lib/constants.php (modified) (1 diff)
- trunk/public/.htaccess (modified) (1 diff)
- trunk/public/404.html (deleted)
- trunk/public/500.html (deleted)
- trunk/script/setup (modified) (3 diffs)
- trunk/test/fixtures/config/config.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/.htaccess
r243 r322 49 49 </IfModule> 50 50 51 ErrorDocument 400 /public/400.html 52 ErrorDocument 500 /public/500.html 51 ErrorDocument 500 "<h2>Apache server error</h2>Akelos application failed to start properly" trunk/app/models/framework_setup.php
r306 r322 204 204 }else{ 205 205 return $this->getDatabaseType() == 'sqlite' ? 206 "sqlite://".urlencode(AK_CONFIG_DIR.DS. '.ht-'.$this->getDatabaseName($mode).'.sqlite') :206 "sqlite://".urlencode(AK_CONFIG_DIR.DS.$this->getDatabaseName($mode).'-'.$this->random.'.sqlite') : 207 207 $this->getDatabaseType($mode)."://".$this->getDatabaseUser($mode).":".$this->getDatabasePassword($mode). 208 208 "@".$this->getDatabaseHost($mode)."/".$this->getDatabaseName($mode); … … 327 327 define('AK_PUBLIC_LOCALES', '%locales'); 328 328 329 %AK_URL_REWRITINGdefined('AK_URL_REWRITE_ENABLED') ? null : define('AK_URL_REWRITE_ENABLED', true); 330 329 331 %AK_FRAMEWORK_DIR 330 332 … … 340 342 if($settings['%'.$mode.'_database_type'] == 'sqlite'){ 341 343 342 $settings['%'.$mode.'_database_file'] = AK_CONFIG_DIR.DS. '.ht-'.$this->getDatabaseName($mode).'.sqlite';344 $settings['%'.$mode.'_database_file'] = AK_CONFIG_DIR.DS.$this->getDatabaseName($mode).'-'.$this->random.'.sqlite'; 343 345 $settings['%'.$mode.'_database_user'] = 344 346 $settings['%'.$mode.'_database_password'] = … … 358 360 359 361 $settings['%locales'] = $this->getLocales(); 362 363 $settings['%AK_URL_REWRITING'] = $this->isUrlRewriteEnabled() ? '' : "// The web configuration wizard could not detect if you have mod_rewrite enabled. \n// If that is the case, you should uncomment the next line line for better performance. \n// "; 360 364 $settings['%AK_FRAMEWORK_DIR'] = defined('AK_FRAMEWORK_DIR') ? 361 365 "defined('AK_FRAMEWORK_DIR') ? null : define('AK_FRAMEWORK_DIR', '".AK_FRAMEWORK_DIR."');" : ''; … … 557 561 'ftp_user' => $this->getFtpUser(), 558 562 'ftp_host' => $this->getFtpHost(), 559 'ftp_path' => $this->getFtpPath() 563 'ftp_path' => $this->getFtpPath(), 564 565 'random' => Ak::randomString(), 560 566 ); 561 567 } trunk/app/views/framework_setup/compiled/set_database_details.tpl.php
r140 r322 28 28 <?php if($FrameworkSetup->database_type != 'sqlite') : ?> 29 29 30 <label for='<?php 31 echo $mode; 32 ?>_database_host'><?php echo $text_helper->translate('Database Host', array()); ?></label> 33 <input type='text' name='<?php 34 echo $mode; 35 ?>_database_host' id='<?php 36 echo $mode; 37 ?>_database_host' 30 <label for='<?php echo $mode; ?>_database_host'><?php echo $text_helper->translate('Database Host', array()); ?></label> 31 <input type='text' name='<?php echo $mode; ?>_database_host' id='<?php echo $mode; ?>_database_host' 38 32 value='<?php echo $FrameworkSetup->getDatabaseHost($mode)?>' /> 39 33 40 <label for='<?php 41 echo $mode; 42 ?>_database_name'><?php echo $text_helper->translate('Database name', array()); ?></label> 43 <input type='text' name='<?php 44 echo $mode; 45 ?>_database_name' id='<?php 46 echo $mode; 47 ?>_database_name' 34 <label for='<?php echo $mode; ?>_database_name'><?php echo $text_helper->translate('Database name', array()); ?></label> 35 <input type='text' name='<?php echo $mode; ?>_database_name' id='<?php echo $mode; ?>_database_name' 48 36 value='<?php echo $FrameworkSetup->getDatabaseName($mode)?>' /> 49 37 50 <label for='<?php 51 echo $mode; 52 ?>_database_user'><?php echo $text_helper->translate('User', array()); ?></label> 53 <input type='text' name='<?php 54 echo $mode; 55 ?>_database_user' id='<?php 56 echo $mode; 57 ?>_database_user' 38 <label for='<?php echo $mode; ?>_database_user'><?php echo $text_helper->translate('User', array()); ?></label> 39 <input type='text' name='<?php echo $mode; ?>_database_user' id='<?php echo $mode; ?>_database_user' 58 40 value='<?php echo $FrameworkSetup->getDatabaseUser($mode)?>' /> 59 41 60 <label for='<?php 61 echo $mode; 62 ?>_database_password'><?php echo $text_helper->translate('Password', array()); ?></label> 63 <input type='password' name='<?php 64 echo $mode; 65 ?>_database_password' id='<?php 66 echo $mode; 67 ?>_database_password' 42 <label for='<?php echo $mode; ?>_database_password'><?php echo $text_helper->translate('Password', array()); ?></label> 43 <input type='password' name='<?php echo $mode; ?>_database_password' id='<?php echo $mode; ?>_database_password' 68 44 value='<?php echo $FrameworkSetup->getDatabasePassword($mode)?>' /> 69 45 70 46 <?php else : ?> 71 47 72 <label for='<?php 73 echo $mode; 74 ?>_database_name'><?php echo $text_helper->translate('Database name', array()); ?></label> 75 <b>config/.ht-</b><input class="sqlite_database_name" type='text' 76 name='<?php 77 echo $mode; 78 ?>_database_name' id='<?php 79 echo $mode; 80 ?>_database_name' 81 value='<?php echo $FrameworkSetup->getDatabaseName($mode)?>' /><b>.sqlite</b> 48 <label for='<?php echo $mode; ?>_database_name'><?php echo $text_helper->translate('Database name', array()); ?></label> 49 <b>config/</b><input class="sqlite_database_name" type='text' 50 name='<?php echo $mode; ?>_database_name' id='<?php echo $mode; ?>_database_name' 51 value='<?php echo $FrameworkSetup->getDatabaseName($mode)?>' /><b>-<?php echo $FrameworkSetup->random?>.sqlite</b> 82 52 83 53 <?php endif; ?> … … 90 60 91 61 92 <?php 62 <?php 93 63 /** 94 64 * @todo Database creation form. Requires extensive testing before trunk/app/views/framework_setup/set_database_details.tpl
r2 r322 47 47 48 48 <label for='{mode}_database_name'>_{Database name}</label> 49 <b>config/ .ht-</b><input class="sqlite_database_name" type='text'49 <b>config/</b><input class="sqlite_database_name" type='text' 50 50 name='{mode}_database_name' id='{mode}_database_name' 51 value='<?=$FrameworkSetup->getDatabaseName($mode)?>' /><b> .sqlite</b>51 value='<?=$FrameworkSetup->getDatabaseName($mode)?>' /><b>-<?=$FrameworkSetup->random?>.sqlite</b> 52 52 53 53 <? endif; ?> trunk/docs/tutorial.markdown
r321 r322 370 370 * and many more... 371 371 372 My apologies for any typo or grammatical error you might find. English is not my mother tongue and I would really like you to help me fixing errors in this document. 373 372 My apologies for any typo or grammatical error you might find. English is not my mother tongue and I would really like you to help me [improving and fixing errors in this document](http://trac.akelos.org/newticket?keywords=booklink%20english&component=Documentation&priority=minor&type=documentation&summary=Booklin%20Tutorial%20improvements). trunk/lib/Ak.php
r312 r322 85 85 $fn(); 86 86 } 87 if(!AK_PHP5 && substr($dsn,0,6) == 'sqlite'){ 88 echo "\nWarning, sqlite support is not available by default on PHP4.\n Check your PHP version by running \"env php -v\", and change the first line in your scripts/ so they point to a php5 binary\n\n"; 89 } 87 90 die(Ak::t('Connection to the database failed.').' '. 88 (AK_DEBUG?preg_replace('/\/\/(\w+):(.*)@/i','//$1:******@', $dsn)."\n":''));91 (AK_DEBUG?preg_replace('/\/\/(\w+):(.*)@/i','//$1:******@', urldecode($dsn))."\n":'')); 89 92 } 90 93 $db[$connection_id]->debug = AK_DEBUG == 2; trunk/lib/AkActionController.php
r296 r322 983 983 } 984 984 985 $rewritten_url .= (substr($rewritten_url,-1) == '/' ? '' : (AK_URL_REWRITE_ENABLED ? '' : '/'));985 $rewritten_url .= (substr($rewritten_url,-1) == '/' ? '' : (AK_URL_REWRITE_ENABLED ? '' : (!empty($path[0]) && $path[0] != '/' ? '/' : ''))); 986 986 $rewritten_url .= $path; 987 987 $rewritten_url .= empty($options['trailing_slash']) ? '' : '/'; trunk/lib/AkActiveRecord.php
r315 r322 3597 3597 * $Person->save(); // => true (and person is now saved in the database) 3598 3598 * 3599 * An " Errors" object is automatically createdfor every Active Record.3599 * An "_errors" array is available for every Active Record. 3600 3600 * 3601 3601 */ trunk/lib/AkActiveRecord/AkHasAndBelongsToMany.php
r320 r322 25 25 * an option, it is guessed using the lexical order of the class names. So a join between Developer and Project 26 26 * will give the default join table name of "developers_projects" because "D" outranks "P". 27 *28 * Any additional fields added to the join table will be placed as attributes when pulling records out through29 * hasAndBelongsToMany associations. This is helpful when have information about the association itself30 * that you want available on retrieval. Note that any fields in the join table will override matching field names31 * in the two joined tables. As a consequence, having an "id" field in the join table usually has the undesirable32 * result of clobbering the "id" fields in either of the other two tables.33 27 * 34 28 * Adds the following methods for retrieval and query. trunk/lib/constants.php
r302 r322 46 46 // defined('AK_PUBLIC_LOCALES') ? null : define('AK_PUBLIC_LOCALES','en,es'); 47 47 48 defined('AK_URL_REWRITE_ENABLED') ? null : define('AK_URL_REWRITE_ENABLED', true);48 // defined('AK_URL_REWRITE_ENABLED') ? null : define('AK_URL_REWRITE_ENABLED', true); 49 49 50 50 defined('AK_TIME_DIFFERENCE') ? null : define('AK_TIME_DIFFERENCE', 0); // Time difference from the webserver trunk/public/.htaccess
r243 r322 52 52 </IfModule> 53 53 54 ErrorDocument 400 /400.html 55 ErrorDocument 500 /500.html 54 ErrorDocument 500 "<h2>Apache server error</h2>Akelos application failed to start properly" trunk/script/setup
r304 r322 44 44 45 45 if(empty($this->options['dependencies'])){ 46 $this->framework_dirs = array('lib', 'vendor' );46 $this->framework_dirs = array('lib', 'vendor', 'test'); 47 47 48 48 foreach ($this->framework_dirs as $framework_dir){ … … 68 68 69 69 if(empty($this->options['dependencies'])){ 70 $this->_setupApplicationTestingEnvironment(); 70 71 $this->_linkDependencies(); 71 72 } … … 79 80 80 81 } 82 83 84 function _setupApplicationTestingEnvironment() 85 { 86 $source_test_dir = $this->options['source'].DS.'test'; 87 $test_dir = $this->options['directory'].DS.'test'; 88 89 $this->_makeDir($test_dir); 90 $this->_copyFile($source_test_dir.DS.'app.php'); 91 92 $this->_makeDir($test_dir.DS.'fixtures'); 93 $this->_makeDir($test_dir.DS.'fixtures'.DS.'app'); 94 95 $this->_copyFile($source_test_dir.DS.'fixtures'.DS.'app'.DS.'application_controller.php'); 96 $this->_copyFile($source_test_dir.DS.'fixtures'.DS.'app'.DS.'shared_model.php'); 97 98 $this->_makeDir($test_dir.DS.'fixtures'.DS.'config'); 99 $this->_copyFile($source_test_dir.DS.'fixtures'.DS.'config'.DS.'config.php'); 100 101 $this->_makeDir($test_dir.DS.'fixtures'.DS.'data'); 102 $this->_makeDir($test_dir.DS.'fixtures'.DS.'public'); 103 $this->_copyFile($source_test_dir.DS.'fixtures'.DS.'public'.DS.'.htaccess'); 104 $this->_copyFile($source_test_dir.DS.'fixtures'.DS.'public'.DS.'index.php'); 105 } 106 81 107 82 108 function _linkPublicHtmlFolder() trunk/test/fixtures/config/config.php
r303 r322 22 22 defined('AK_ENABLE_AKELOS_ARGS') ? null : define('AK_ENABLE_AKELOS_ARGS', true); 23 23 //define('AK_SKIP_DB_CONNECTION',isset($db) && $db === false); 24 defined('AK_URL_REWRITE_ENABLED') ? null : define('AK_URL_REWRITE_ENABLED', true); 24 25 25 26 include_once(substr(AK_TEST_DIR,0,-5).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
