コード例 #1
0
define('ROOT_PDIR', realpath(dirname(__DIR__) . '/src/') . '/');

// Include the core bootstrap, this will get the system functional.
require_once(ROOT_PDIR . 'core/bootstrap.php');


if(!DEVELOPMENT_MODE){
	die('Installation cannot proceed while site is NOT in Development mode.');
}

// I need a few variables first about the user...
$packagername = '';
$packageremail = '';

\Core\CLI\CLI::LoadSettingsFile('packager');

if(!$packagername){
	$packagername = \Core\CLI\CLI::PromptUser('Please provide your name you wish to use for packaging', 'text-required');
}
if(!$packageremail){
	$packageremail = \Core\CLI\CLI::Promptuser('Please provide your email you wish to use for packaging.', 'text-required');
}

\Core\CLI\CLI::SaveSettingsFile('packager', array('packagername', 'packageremail'));


if(!is_dir(ROOT_PDIR . '_gen/')) mkdir(ROOT_PDIR . '_gen/');

$backend = Core::DB();
コード例 #2
0
ファイル: CLI.class.php プロジェクト: nicholasryan/CorePlus
	/**
	 * Set the 'EDITOR' variable to be set.
	 * This is a linux-specific thing that svn shares also.
	 *
	 * The user will usually set their preferred EDITOR, be it vi/vim, emacs or nano.
	 * If they didn't, ask the user for their choice.
	 */
	public static function RequireEditor() {
		global $previous_editor;

		// First, check the editor in the "session" file.
		\Core\CLI\CLI::LoadSettingsFile('editor');
		if (isset($previous_editor)) $_SERVER['EDITOR'] = $previous_editor;


		if (!isset($_SERVER['EDITOR']) || $_SERVER['EDITOR'] == '') {
			// I need to assemble a list of editors currently on the system.
			$opts    = array();
			$default = false;
			if (($loc = trim(`which vi`))) $opts[$loc] = $loc;
			if (($loc = trim(`which vim`))) $opts[$loc] = $loc;
			if (($loc = trim(`which emacs`))) $opts[$loc] = $loc;
			if (($loc = trim(`which nano`))) {
				$opts[$loc] = $loc;
				$default    = $loc;
			}

			$_SERVER['EDITOR'] = \Core\CLI\CLI::PromptUser(
				'Which editor do you want to use for editing text files?  If you are unsure, simply press enter if there is a default option.',
				$opts,
				$default
			);

			// And remember this option.
			$previous_editor = $_SERVER['EDITOR'];
			\Core\CLI\CLI::SaveSettingsFile('editor', array('previous_editor'));
		}
	}