Jump to content
marcus

wireshell - an extendable ProcessWire command line interface

Recommended Posts

Currently it's not easy for me to find the time to properly prepare a Virtual Windows10 machine with PHP/composer in order to reproduce. Are there any other Window users out there that can?

I assume you are using wireshell 1.0.2?

Share this post


Link to post
Share on other sites
18 minutes ago, netcarver said:

@Mike Rockett Have the permissions changed on the containing directory such that there is no longer any write permission?

I'm on Windows, so there aren't any. If there were, the zip file would not have been written to the directory anyway. The issue seems to be with deleting the temp file, which causes the rename function to return false, which is when the IOException is thrown.

  • Like 1

Share this post


Link to post
Share on other sites

Hello

I am on windows 10 and I am having the same problem like Mike Rockett,  [Symfony\Component\Filesystem\Exception\IOException] Cannot rename ... 

Share this post


Link to post
Share on other sites

@justb3a or @marcus, maybe a dump question, but when I want to upgrade an existing wire core installation with the latest dev-version, do I need to pass a sha-key to the command?

Share this post


Link to post
Share on other sites

Yes. For version 3.0.106 this would be

$ wireshell upgrade --sha 643c9d3a87ddd8d579c4879c2382a9170466344b

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the clarification, now I know that I haven't overseen something. 🙂

But wouldn't it be better to have an alias for the lates-dev version, something like:

$ wireshell upgrade --latestdev

Otherwise I have to look up every time, (sometimes multiple times a week), for the latest dev sha-key and copy paste it into my CLI.

For example: As you can see, only one hour later than your post, the sha key to the latest dev has changed to: 637f81579e121af8ab4c4a12e21227b36ae0cd8a

  • Like 2

Share this post


Link to post
Share on other sites
On 6/20/2018 at 7:11 PM, horst said:

But wouldn't it be better to have an alias for the lates-dev version, something like:


$ wireshell upgrade --latestdev

Otherwise I have to look up every time, (sometimes multiple times a week), for the latest dev sha-key and copy paste it into my CLI.

For example: As you can see, only one hour later than your post, the sha key to the latest dev has changed to: 637f81579e121af8ab4c4a12e21227b36ae0cd8a

Bump! @marcus, any chance to get an alias for upgrading to the latest dev?

Share this post


Link to post
Share on other sites

Won't find the time to implement this anytime soon, sorry. Everybody feel free to submit a PR regarding this and maybe ping core contributor @justb3a regarding release

  • Like 2

Share this post


Link to post
Share on other sites
On 10/29/2018 at 7:15 PM, horst said:

Bump! @marcus, any chance to get an alias for upgrading to the latest dev?

Just in case, I use those alias to install or upgrade my installs :

# ProcessWire Wireshell bash alias
# grab and install the latest ProcessWire development version from the latest commit
alias pwnew='wireshell new --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`'
# upgrade to the latest ProcessWire development version from the latest commit
alias pwup='wireshell upgrade --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`'

https://gist.github.com/flydev-fr/addcf54fa8348de20115d3c1314ddb3d

  • Like 4

Share this post


Link to post
Share on other sites

Hi everyone, wireshell currently conflicts with newer versions of symfony/console – to workaround this, you cam use cgr to install wireshell.

$ composer global require consolidation/cgr

Make sure to add the correct bin directory to your PATH:

PATH="$(composer config -g home)/vendor/bin:$PATH"

Then add wireshell:

$ cgr wireshell/wireshell

Reload the console, voila – wireshell again.

  • Like 3

Share this post


Link to post
Share on other sites

hi,

as you might noticed I'm no longer active in the field of PHP and ProcessWire. I tried to continue supporting my modules and wireshell but it turned out that it just doesn't work well if you don't work with it yourself anymore.
I would be very happy if someone would be interested in taking over and developing this further.
Just write me a message. 😀 😊

  • Like 11
  • Thanks 1

Share this post


Link to post
Share on other sites
On 10/13/2019 at 12:07 PM, justb3a said:

I'm no longer active in the field of PHP and ProcessWire

😢

@justb3a Good luck on your (new) way and many, many thanks for all your contributions !! 😄 ❤️ 👍

  • Like 9

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By VeiJari
      Hello forum,
      This is really a weird one, because front end editing works in a earlier website we did to a customer. 
      When I check the source code for current website it does initiate front end edit: 
      <span id=pw-edit-1 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=1021 data-lang='1017' style='position:relative'><span class=pw-edit-orig>Tekijät</span><span class=pw-edit-copy id=pw-editor-title-1021 style='display:none;-webkit-user-select:text;user- select:text;' contenteditable>Tekijät</span></span>  But when I double click nothing happens (yes I'm 100% sure I'm superuser and logged in)
      I also tried to apply the front end with other methods than:
      $page->edit('title'); But didn't work either.
      We are using jquery 2.2.4, so it should not be a problem.
      Is this a bug related to current master or something else?
      Someone else having this problem as well?
    • By jom
      Hi everyone
      It seems that I don't fully understand the wireTempPath() function and I need some help.
      I use wireTempPath() to create a new location in assets/cache/WireTempDir and than copy a pdf from the assets/files/page folder to the new folder. I want the file to be accessible only for a limited time, that's why I use wireTempPath.
      The file seems to be copied to the right location, but gets deleted right afterwards, according to 
      As mentioned in the topic above, 
      $wireTempDir->setRemove(false); prevents the file to be deleted. But I like the file to be automatically deleted after a few days. So, how can I do that?
      My code so far (everything works, but the automatic removal of the tempDir folder):
      //generate and show download link $folder = time(); // timestamp as temporary folder $maxAge = (int) $settings->options_downloadlink_valid_hours * 3600; //tempDir wants maxAge as seconds $options = array( 'maxAge' => $maxAge ); $wireTempDir = wireTempDir($folder, $options); $wireTempDir->setRemove(false); $src_file = $page->ebook_download->filename; // Create a new directory in ProcessWire's cache dir if(wire('files')->mkdir($wireTempDir, $recursive = true)) { if(wire('files')->copy($src_file, $wireTempDir)){ //get subdirs from tempDir: $pos = strpos($wireTempDir, "WireTempDir"); $subdir = substr($wireTempDir, $pos, 100); $out .= "<p><a href='" . wire('pages')->get('template=passthrough')->httpUrl . "?file=" . $subdir . $page->ebook_download->basename . "' target='_blank'>$page->title</a></p>"; } } I appreciate any ideas - thanks!
      Oliver
    • By VeiJari
      Hello forum, this is my first security related post, so I'm a bit of a newbie.
      I understand that when I have direct front-input from user I should sanitize the input, but how about when I use a secret key for showing a API for a third-party supplier? Should I sanitize the input->get() key?
      I've tested this issue and I tried ?key=<?php echo $page->field; ?> And without adding any sanitization it comes back: /?key=<?php%20echo%20$page->field;%20?>
      So can I rely on this, or should I still use $sanitizer just in case?
       
      Thanks for the help!
    • By EyeDentify
      I have been experimenting with the new $page->meta() method and find it useful.

      Once i figured out that the data i "save" with it is tied to the page where i called the method from.

      So this is not obvious at least not for me in the documentation:
      https://processwire.com/api/ref/page/meta/
       
      So i just wanted to share that revelation with the community so you don´t get as confused as i was.

      Happy Coding Everyone.
    • By louisstephens
      Going through my long quest to get better with ajax and utilizing the api, I have hit yet another roadblock. I currently have a form with an image field (thanks to flydev for getting that sorted), "title" text input, and a select field set to multiple. In my ajax call, I added in:
      tags = $("#select-tags").val(); form_data.append('tags', tags); $.ajax({ type: 'POST', data: form_data, contentType: false, processData: false, url: '/ajax/upload-preview/', success: function(data) { console.log("Woo"); }, error: function(xhr, ajaxOptions, thrownError) { alert(xhr.responseText); } }); And in the ajax template: 
      $tags = $sanitizer->text($_POST['tags']); $image = $sanitizer->text($_POST['image']); $p = new Page(); $p->template = "preview"; $p->parent = $pages->get("/previews/"); $p->name = $title; $p->title = $title; $p->tags = $tags; $p->save(); If I select a "tag" from the select input and submit, it does indeed add it to the Page Reference field in the backend. However, this does not work with an array being passed to it of multiple options.

      So it does appear that my ajax call is trying to submit multiple options, but I am really just unsure how to get these two added in. I saw in other forums posts of add($page) and even add(array()). Do I need to handle this js array differently or do  I need to foreach through the $tags to add it like:
      foreach($tags as $tag) { $p->tags->add($tag); $p->save(); } I tried this approach, but apparently I am still missing something.
       
      Edit:
      I was doing some tweaking, and I know I can split the js array out like:
      for (i = 0, len = tags.length; i < len; i++) { console.log(tags[i]); } However, I am not sure then how to handle the POST in php if I were to split it out.
×
×
  • Create New...