-
Notifications
You must be signed in to change notification settings - Fork 66
Embedded PHPCR Shell #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded PHPCR Shell #151
Conversation
Command/PhpcrShellCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to handle the exit code of the embedded application, to reutnr it as the exit code of the command
|
removing the existing commands is a BC break. I'm not sure such cleanup justifies a bump to 2.0 now. you may keep the old commands around (deprecating them instead of removing them) |
|
@stof yeah the PR in its current state would be a major version change, we could also conditionally support the phpcr-shell only if it is installed. |
|
@dantleech my suggestion is to keep the existing command and to add the new phpcr shell command => no BC break but a new feature => next minor version. |
|
and the composer.json needs to be updated to require the PHPCR shell if you use it |
|
i agree with stof: lets keep the old commands for now but deprecate them and start requiring the shell for the 1.2 version. the commands will be unmaintained but can stay for a while, but surely wont get any new features. it would be really nice if we can disable parsing the arguments, or as a workaround have the phpcr command expect any parameters and forward them, if that is possible. |
|
I don't think that's possible |
|
Its possible if we can change the |
|
I have mitigated the quoting problem somewhat by making the argument an array, concatenating the values with space and then passing this to the nested command. If options are needed then the entire command still needs to be quoted however. |
Command/PhpcrShellCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument is now an array
|
Reverted the removal of the legacy commands, updated help and added suggest to composer. If the |
Command/PhpcrShellCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument is now an array
|
looks good! can you squash the commits please? and update the symfony-cmf-docs (dev branch) with some documentation and a link to the shell? btw, if i don't specify a command for the shell, do i get into the interactive shell with this command? |
Command/PhpcrShellCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... SELECT SQL2 queries ...
|
Re. launching the shell, thats something I should add, but not sure how - spec |
|
Ifying nothing lists all the commands, and adding a --shell option might be the way forward. Btw. This also beeds a a PR merge on the shell. |
|
+1 for a --shell option. or maybe --interactive / -i ? i changed the heading to WCM to remind us we wait for the shell PR to be merged. |
|
|
|
gnarc. what if we say without arguments you go into the interactive shell and you need to run list to get a list of commands? otherwise, |
|
I think without arguments for the shell is OK - its probably the preferred way to execute commands unless you are scripting. |
|
ok updated.
|
Command/NodeDumpCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this is copy/pasted in each command, we can't use inheritance and we can't use traits due to BC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am -1 on this. not due to copy-paste but because it in effect means a BC break for the user. he can't use the command he was used to anymore. i think we should just update the description to append the deprecated info, but otherwise leave them in until we do a phpcr-odm 2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @dbu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.. I reasoned that the user explicitly adds PHPCR-Shell to their dependencies, and only then do the commands disappear. So its an option. Is that still a BC break?
Christophe Coevoet [email protected] wrote:
@@ -94,4 +94,12 @@ protected function execute(InputInterface $input,
OutputInterface $output)return parent::execute($input, $output); }
- /**
\* Only enable this command if PHPCR Shell is not installed.*/- public function isEnabled()
- {
return !DoctrineCommandHelper::isPhpcrShellInstalled();I agree with @dbu
Reply to this email directly or view it on GitHub:
https://github.com/doctrine/DoctrinePHPCRBundle/pull/151/files#r13833585
Sent from my Android device with K-9 Mail. Please excuse my brevity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. If you have a deploy script using the existing command, you might still want to add PHPCR-Shell in your project to get the new features without breaking your deployment for instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just ran into that very problem :)
|
This PR should also wait until PHPCR-Shell has some issues fixed - e.g. the table formatting seems broken in embedded mode, and also in my test project i am using Symfony 2.5 and |
|
cool with the default shell. about creating a file: what is the point of that? history of commands? global configuration? maybe it would make more sense to create that file in the project root, or even the app/cache/ , depending on what exactly it does. |
|
I will try and get this ready for the 1.2 release. @dbu the configuration folder currently stores two types of configuration: aliases (e.g. Connection profiles will not be created in the embedded mode, the alias file is always created however, its global configuration. (and can be reinitialized / reloaded with Personally I don't see any reason to disable this, but still feels wierd - one option might be to read the file if it is there but never create it. |
|
i would expect the aliases to be read from symfony configuration in embedded mode. additionally reading the config file if it happens to be there seems ok to me. that way a user can share his alias between projects, or have his preferred personal aliases. precedence in case of name conflicts is a bit tricky, not sure what makes more sense. btw, this needs a rebase. |
|
Reading aliases from the SF configuration might be interesting, e.g.
Will need some refactoring on the Shell PR, but sounds good. |
|
:y: |
|
ok. I have updated and rebased this PR and the corresponding PHPCR-Shell PR has been updated also. Regarding config creation, in shell mode a config file will never be created automatically, but if the configuration is there it will be used. (the user can still manually create the config with I decided against adding configuration for project specific shell configuration at this point. So, for me this is good. |
|
Also I changed the command from |
Command/PhpcrShellCommand.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now phpcr:shell, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use %command.full_name% in the help text instead of app/console phpcr:shell. Symfony does the replacement automatically (there is also ``%command.name%for just thephpcr:shell` part). this way, you don't need to change the help when the command name changes (or when the user renames the `app/console` file to something else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done as @stof said, and changed the name to doctrine:phpcr:shell -- which I think is the most correct.
- Added `doctrine:phpcr:shell` command to launch either single commands or start a shell session based on the default or given doctrine session.
|
Updated and squashed and I have merged the related PHPCR-Shell PR. |
|
+1 to merge. @lsmith77 happy too? we should add a note to the symfony-cmf-docs somewhere. btw, you could also check if you find a place in phpcr-odm-documentation to point to the shell, as its useful in standalone phpcr-odm usage as well. |
Replaces existing commands with embedded PHPCR Shell.
Depends on: phpcr/phpcr-shell#40
For example
Or launch a shell session