Pop\Project\Install::instructions PHP Метод

instructions() публичный статический Метод

Display CLI instructions
public static instructions ( ) : string
Результат string
    public static function instructions()
    {
        $msg1 = "This process will create and install the base foundation of your project under the folder specified in the install file. Minimally, the install file should return a Pop\\Config object containing your project install settings, such as project name, folders, forms, controllers, views and any database credentials.";
        $msg2 = "Besides creating the base folders and files for you, one of the main benefits is ability to test and install the database and the corresponding configuration and class files. You can take advantage of this by having the database SQL files in the same folder as your install file, like so:";
        echo wordwrap(I18n::factory()->__($msg1), 70, PHP_EOL) . PHP_EOL . PHP_EOL;
        echo wordwrap(I18n::factory()->__($msg2), 70, PHP_EOL) . PHP_EOL . PHP_EOL;
        echo 'projectname' . DIRECTORY_SEPARATOR . 'project.install.php' . PHP_EOL;
        echo 'projectname' . DIRECTORY_SEPARATOR . '*.sql' . PHP_EOL . PHP_EOL;
    }

Usage Example

Пример #1
0
 if ($argv[1] == '-c' || $argv[1] == '--check') {
     echo 'Dependencies Check' . PHP_EOL;
     echo '------------------' . PHP_EOL;
     echo Version::check() . PHP_EOL;
     // Else, display help
 } else {
     if ($argv[1] == '-h' || $argv[1] == '--help') {
         echo 'Help' . PHP_EOL;
         echo '----' . PHP_EOL;
         Install::cliHelp();
         // Else, show instructions
     } else {
         if ($argv[1] == '-s' || $argv[1] == '--show') {
             echo 'Project Install Instructions' . PHP_EOL;
             echo '----------------------------' . PHP_EOL;
             Install::instructions();
             // Else, set default project language
         } else {
             if ($argv[1] == '-l' || $argv[1] == '--lang') {
                 echo 'Set Default Project Language' . PHP_EOL;
                 echo '----------------------------' . PHP_EOL;
                 // Create list of available languages
                 $langs = I18n::getLanguages();
                 $langsList = null;
                 $i = 0;
                 foreach ($langs as $key => $value) {
                     $num = $i < 10 ? ' ' . $i : $i;
                     $langsList .= '  ' . $num . ' : [' . $key . '] ' . $value . PHP_EOL;
                     $i++;
                 }
                 // Prompt user to select language