public function Setup($prompt = true) { $config = array(); foreach ($_SESSION as $k => $v) { $config[$k] = $v; } if ($prompt) { $config['mojo_js_dir'] = promptUser('Please provide the full system path to your Mojo installation ' . '- This is directory that contains SiteMap.js - (Include trailing slash)'); $arr = explode(DIRECTORY_SEPARATOR, $config['mojo_js_dir']); $config['mojo_app_name'] = $arr[count($arr) - 2]; } $arr = explode(DIRECTORY_SEPARATOR, self::get('mojo_task_lib')); $config['mojo_bin_dir'] = join(DIRECTORY_SEPARATOR, array_slice($arr, 0, count($arr) - 2)) . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR; foreach ($config as $key => $value) { switch ($key) { case 'mojo_js_dir': $sitemap = getFile('SiteMap.js', $value); if ($sitemap) { $value = str_replace(basename($sitemap), "", $sitemap); } else { self::Clear(false); Mojo::exception('SiteMap.js not found at ' . $value); } break; } $_SESSION[$key] = $value; if ($prompt) { Mojo::prompt('Updated config for ' . $key . ' to ' . $value); } } MojoFile::write(self::get('mojo_task_lib') . 'mojo.config', json_encode($_SESSION)); if (array_key_exists('mojo_js_dir', $config) && $prompt) { Mojo::prompt('Congratulations, your project is now setup, please read the docs below:'); MojoHelp::Docs(); } }
function gotDTMF($text) { global $state; global $mailbox; global $collect_user; global $collect_pass; Yate::Debug("gotDTMF('{$text}') state: {$state}"); switch ($state) { case "user": if ($text == "*") { promptUser(); return; } if ($text == "#") { checkUser(); } else { $collect_user .= $text; } return; case "pass": if ($text == "*") { promptPass(); return; } if ($text == "#") { checkPass(); } else { $collect_pass .= $text; } return; } if ($mailbox == "") { return; } navigate($text); }
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with wordpress-install. If not, see <http://www.gnu.org/licenses/>. */ require_once 'includes/tools.inc.php'; $tab = chr(9); $WEBROOT = promptUser("Your webroot directory? (Include trailing slash. i.e. /Users/johnsmith/Sites/mysite/www/)"); $VHOSTPATH = promptUser("Enter your vhost file path: (i.e. /etc/apache2/users/mysite.conf)"); $SERVERNAME = promptUser("What is your development server name? DO NOT include http:// (i.e. mysite.dev)"); $APACHEUSER = promptUser("What is the user apache runs under? (i.e. www or yourusername)"); $MYSQLDB = promptUser("Enter MySQL Database name:"); $MYSQLHOST = promptUser("Enter MySQL host:", "127.0.0.1"); $MYSQLUSER = promptUser("Enter MySQL user:"******"root"); $MYSQLPWD = promptUser("Enter MySQL password: (leave blank if not sure)", ""); //Need this to emulate the browser-based installation $_SERVER['HTTP_HOST'] = $SERVERNAME; $_SERVER['REQUEST_URI'] = "/"; msg('Creating DB ...'); if (strlen($MYSQLPWD)) { exc("mysql -h" . $MYSQLHOST . " -u" . $MYSQLUSER . " -p" . $MYSQLPWD . " -e 'CREATE DATABASE IF NOT EXISTS '" . $MYSQLDB . ";"); } else { exc("mysql -h" . $MYSQLHOST . " -u" . $MYSQLUSER . " -e 'CREATE DATABASE IF NOT EXISTS '" . $MYSQLDB . ";"); } msg('Downloading Wordpress ...'); exc('wget http://wordpress.org/latest.tar.gz'); msg('Unpacking WordPresss ...'); exc('tar xzf latest.tar.gz'); msg('moving wordpress into the webroot ' . $WEBROOT); //make sure webroot exists