├── .gitignore ├── CHANGELOG.md ├── package.yml ├── lib ├── shell.php └── shell_command.php ├── composer.json ├── README.md ├── LICENSE └── composer.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | Version 1.0.0 – 02.07.2020 5 | -------------------------- 6 | 7 | * Initiale Version 8 | -------------------------------------------------------------------------------- /package.yml: -------------------------------------------------------------------------------- 1 | package: shell 2 | version: 1.0.0 3 | author: Friends Of REDAXO 4 | supportpage: https://github.com/FriendsOfREDAXO/shell 5 | 6 | console_commands: 7 | shell: rex_shell_command 8 | 9 | requires: 10 | php: 11 | version: '>=7.1' 12 | redaxo: ^5.11 13 | -------------------------------------------------------------------------------- /lib/shell.php: -------------------------------------------------------------------------------- 1 | setDescription('Interactive shell (REPL) via PsySH'); 17 | } 18 | 19 | protected function execute(InputInterface $input, OutputInterface $output) 20 | { 21 | $addon = rex_addon::get('shell'); 22 | 23 | require_once $addon->getPath('vendor/psy/psysh/src/functions.php'); 24 | 25 | $output = new ShellOutput(); 26 | 27 | $config = Configuration::fromInput($input); 28 | $config->setOutput($output); 29 | $config->setConfigDir($addon->getDataPath()); 30 | $config->setRuntimeDir($addon->getCachePath()); 31 | $config->setUpdateCheck(Checker::NEVER); 32 | $config->setStartupMessage(' '); // force additional line after "Psy Shell ..." 33 | $config->setEraseDuplicates(true); 34 | $config->setFormatterStyles([ 35 | 'aside' => ['yellow'], 36 | 'comment' => ['yellow'], 37 | 'object' => ['magenta'], 38 | 'class' => ['magenta'], 39 | ]); 40 | 41 | $commands = $this->getApplication()->all(); 42 | unset($commands['help']); 43 | unset($commands['list']); 44 | unset($commands['shell']); 45 | $config->addCommands($commands); 46 | 47 | $shell = new rex_shell($config); 48 | 49 | $io = $this->getStyle($input, $output); 50 | $io->title('REDAXO '.rex::getVersion().' shell'); 51 | 52 | return $shell->run(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "4a651449f590fbabf9fe7e4d70e30e2e", 8 | "packages": [ 9 | { 10 | "name": "dnoegel/php-xdg-base-dir", 11 | "version": "v0.1.1", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/dnoegel/php-xdg-base-dir.git", 15 | "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", 20 | "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.3.2" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" 28 | }, 29 | "type": "library", 30 | "autoload": { 31 | "psr-4": { 32 | "XdgBaseDir\\": "src/" 33 | } 34 | }, 35 | "notification-url": "https://packagist.org/downloads/", 36 | "license": [ 37 | "MIT" 38 | ], 39 | "description": "implementation of xdg base directory specification for php", 40 | "support": { 41 | "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", 42 | "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" 43 | }, 44 | "time": "2019-12-04T15:06:13+00:00" 45 | }, 46 | { 47 | "name": "nikic/php-parser", 48 | "version": "v4.6.0", 49 | "source": { 50 | "type": "git", 51 | "url": "https://github.com/nikic/PHP-Parser.git", 52 | "reference": "c346bbfafe2ff60680258b631afb730d186ed864" 53 | }, 54 | "dist": { 55 | "type": "zip", 56 | "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c346bbfafe2ff60680258b631afb730d186ed864", 57 | "reference": "c346bbfafe2ff60680258b631afb730d186ed864", 58 | "shasum": "" 59 | }, 60 | "require": { 61 | "ext-tokenizer": "*", 62 | "php": ">=7.0" 63 | }, 64 | "require-dev": { 65 | "ircmaxell/php-yacc": "0.0.5", 66 | "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" 67 | }, 68 | "bin": [ 69 | "bin/php-parse" 70 | ], 71 | "type": "library", 72 | "extra": { 73 | "branch-alias": { 74 | "dev-master": "4.3-dev" 75 | } 76 | }, 77 | "autoload": { 78 | "psr-4": { 79 | "PhpParser\\": "lib/PhpParser" 80 | } 81 | }, 82 | "notification-url": "https://packagist.org/downloads/", 83 | "license": [ 84 | "BSD-3-Clause" 85 | ], 86 | "authors": [ 87 | { 88 | "name": "Nikita Popov" 89 | } 90 | ], 91 | "description": "A PHP parser written in PHP", 92 | "keywords": [ 93 | "parser", 94 | "php" 95 | ], 96 | "support": { 97 | "issues": "https://github.com/nikic/PHP-Parser/issues", 98 | "source": "https://github.com/nikic/PHP-Parser/tree/v4.6.0" 99 | }, 100 | "time": "2020-07-02T17:12:47+00:00" 101 | }, 102 | { 103 | "name": "psy/psysh", 104 | "version": "v0.10.4", 105 | "source": { 106 | "type": "git", 107 | "url": "https://github.com/bobthecow/psysh.git", 108 | "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560" 109 | }, 110 | "dist": { 111 | "type": "zip", 112 | "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a8aec1b2981ab66882a01cce36a49b6317dc3560", 113 | "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560", 114 | "shasum": "" 115 | }, 116 | "require": { 117 | "dnoegel/php-xdg-base-dir": "0.1.*", 118 | "ext-json": "*", 119 | "ext-tokenizer": "*", 120 | "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", 121 | "php": "^8.0 || ^7.0 || ^5.5.9", 122 | "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", 123 | "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" 124 | }, 125 | "require-dev": { 126 | "bamarni/composer-bin-plugin": "^1.2", 127 | "hoa/console": "3.17.*" 128 | }, 129 | "suggest": { 130 | "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", 131 | "ext-pdo-sqlite": "The doc command requires SQLite to work.", 132 | "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", 133 | "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", 134 | "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." 135 | }, 136 | "bin": [ 137 | "bin/psysh" 138 | ], 139 | "type": "library", 140 | "extra": { 141 | "branch-alias": { 142 | "dev-master": "0.10.x-dev" 143 | } 144 | }, 145 | "autoload": { 146 | "files": [ 147 | "src/functions.php" 148 | ], 149 | "psr-4": { 150 | "Psy\\": "src/" 151 | } 152 | }, 153 | "notification-url": "https://packagist.org/downloads/", 154 | "license": [ 155 | "MIT" 156 | ], 157 | "authors": [ 158 | { 159 | "name": "Justin Hileman", 160 | "email": "justin@justinhileman.info", 161 | "homepage": "http://justinhileman.com" 162 | } 163 | ], 164 | "description": "An interactive shell for modern PHP.", 165 | "homepage": "http://psysh.org", 166 | "keywords": [ 167 | "REPL", 168 | "console", 169 | "interactive", 170 | "shell" 171 | ], 172 | "support": { 173 | "issues": "https://github.com/bobthecow/psysh/issues", 174 | "source": "https://github.com/bobthecow/psysh/tree/master" 175 | }, 176 | "time": "2020-05-03T19:32:03+00:00" 177 | } 178 | ], 179 | "packages-dev": [], 180 | "aliases": [], 181 | "minimum-stability": "stable", 182 | "stability-flags": [], 183 | "prefer-stable": false, 184 | "prefer-lowest": false, 185 | "platform": [], 186 | "platform-dev": [], 187 | "platform-overrides": { 188 | "php": "7.1.3" 189 | }, 190 | "plugin-api-version": "2.0.0" 191 | } 192 | --------------------------------------------------------------------------------