Changeset 573
- Timestamp:
- 04/24/08 11:09:59 (7 months ago)
- Files:
-
- branches/bermi/plugins/admin/installer/admin_installer.php (modified) (4 diffs)
- plugins/admin/installer/admin_files/app/installers/admin_plugin_installer.php (modified) (1 diff)
- plugins/admin/installer/admin_installer.php (modified) (4 diffs)
- plugins/akismet/test/akismet.php (modified) (1 diff)
- trunk/lib/AkInstaller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/bermi/plugins/admin/installer/admin_installer.php
r519 r573 47 47 function modifyRoutes() 48 48 { 49 $preffix = '/'.trim($this->prom tUserVar('Admin url preffix', array('default'=>'/admin/')), "\t /").'/';49 $preffix = '/'.trim($this->promptUserVar('Admin url preffix', array('default'=>'/admin/')), "\t /").'/'; 50 50 $path = AK_CONFIG_DIR.DS.'routes.php'; 51 51 Ak::file_put_contents($path, str_replace('<?php',"<?php \n\n \$Map->connect('$preffix:controller/:action/:id', array('controller' => 'dashboard', 'action' => 'index', 'module' => 'admin'));",Ak::file_get_contents($path))); … … 59 59 60 60 $Installer->root_details = array( 61 'email' => $this->prom tUserVar('Master account login. Must be a valid email', array('default'=>'root@example.com')),62 'password' => $this->prom tUserVar('Root password.', array('default'=>'admin')),61 'email' => $this->promptUserVar('Master account login. Must be a valid email', array('default'=>'root@example.com')), 62 'password' => $this->promptUserVar('Root password.', array('default'=>'admin')), 63 63 ); 64 64 … … 70 70 } 71 71 72 function prom tUserVar($message, $options = array())72 function promptUserVar($message, $options = array()) 73 73 { 74 74 $f = fopen("php://stdin","r"); … … 87 87 echo "\n\nThis setting is not optional."; 88 88 fclose($f); 89 return $this->prom tUserVar($message, $options);89 return $this->promptUserVar($message, $options); 90 90 } 91 91 fclose($f); plugins/admin/installer/admin_files/app/installers/admin_plugin_installer.php
r564 r573 32 32 if(AK_ENVIRONMENT != 'testing' && empty($this->root_details)){ 33 33 $this->root_details = array( 34 'login' => $this->prom tUserVar('Master account login.', array('default'=>'admin')),35 'email' => $this->prom tUserVar('Master account email.', array('default'=>'root@example.com')),36 'password' => $this->prom tUserVar('Root password.', array('default'=>'admin')),34 'login' => $this->promptUserVar('Master account login.', array('default'=>'admin')), 35 'email' => $this->promptUserVar('Master account email.', array('default'=>'root@example.com')), 36 'password' => $this->promptUserVar('Root password.', array('default'=>'admin')), 37 37 ); 38 38 } plugins/admin/installer/admin_installer.php
r526 r573 47 47 function modifyRoutes() 48 48 { 49 $preffix = '/'.trim($this->prom tUserVar('Admin url preffix', array('default'=>'/admin/')), "\t /").'/';49 $preffix = '/'.trim($this->promptUserVar('Admin url preffix', array('default'=>'/admin/')), "\t /").'/'; 50 50 $path = AK_CONFIG_DIR.DS.'routes.php'; 51 51 Ak::file_put_contents($path, str_replace('<?php',"<?php \n\n \$Map->connect('$preffix:controller/:action/:id', array('controller' => 'dashboard', 'action' => 'index', 'module' => 'admin'));",Ak::file_get_contents($path))); … … 59 59 60 60 $Installer->root_details = array( 61 'email' => $this->prom tUserVar('Master account login. Must be a valid email', array('default'=>'root@example.com')),62 'password' => $this->prom tUserVar('Root password.', array('default'=>'admin')),61 'email' => $this->promptUserVar('Master account login. Must be a valid email', array('default'=>'root@example.com')), 62 'password' => $this->promptUserVar('Root password.', array('default'=>'admin')), 63 63 ); 64 64 … … 70 70 } 71 71 72 function prom tUserVar($message, $options = array())72 function promptUserVar($message, $options = array()) 73 73 { 74 74 $f = fopen("php://stdin","r"); … … 87 87 echo "\n\nThis setting is not optional."; 88 88 fclose($f); 89 return $this->prom tUserVar($message, $options);89 return $this->promptUserVar($message, $options); 90 90 } 91 91 fclose($f); plugins/akismet/test/akismet.php
r557 r573 9 9 10 10 11 !defined('AK_AKISMET_API_KEY') && define('AK_AKISMET_API_KEY', (!empty($argv[1])?$argv[1]:AkInstaller::prom tUserVar('Akismet API key')));12 !defined('AK_AKISMET_SITE_URL') && define('AK_AKISMET_SITE_URL', (!empty($argv[2])?$argv[2]:AkInstaller::prom tUserVar('Akismet site URL')));11 !defined('AK_AKISMET_API_KEY') && define('AK_AKISMET_API_KEY', (!empty($argv[1])?$argv[1]:AkInstaller::promptUserVar('Akismet API key'))); 12 !defined('AK_AKISMET_SITE_URL') && define('AK_AKISMET_SITE_URL', (!empty($argv[2])?$argv[2]:AkInstaller::promptUserVar('Akismet site URL'))); 13 13 14 14 require_once(dirname(__FILE__).DS.'..'.DS.'lib'.DS.'akismet_helper.php'); trunk/lib/AkInstaller.php
r561 r573 619 619 * Promts for a variable on console scripts 620 620 */ 621 function prom tUserVar($message, $options = array())621 function promptUserVar($message, $options = array()) 622 622 { 623 623 $f = fopen("php://stdin","r"); … … 636 636 echo "\n\nThis setting is not optional."; 637 637 fclose($f); 638 return $this->prom tUserVar($message, $options);638 return $this->promptUserVar($message, $options); 639 639 } 640 640 fclose($f); 641 641 return empty($value) ? $options['default'] : $value; 642 } 643 644 //DEPRECATED 645 function promtUserVar($message, $options = array()) 646 { 647 trigger_error(Ak::t('AkInstaller::promtUserVar is deprecated and will be removed on future versions. Please use AkInstaller::promptUserVar instead.'), E_USER_NOTICE); 648 return $this->promptUserVar($message, $options); 642 649 } 643 650
