marcus

wireshell - an extendable ProcessWire command line interface

149 posts in this topic

Unfortunately no estimated time of arrival on my side, feeling sickly for a couple of weeks now, and drowning in customer work. Can't allocate time. Sorry :/

2 people like this

Share this post


Link to post
Share on other sites

@marcus,

No problem, thank you for your time on this and for your reply; I hope you feel better soon.

Regards,

Steve

2 people like this

Share this post


Link to post
Share on other sites

I'm in the process of getting wireshell PW3 ready. But I think it could use a bit more testing before I'll finally push it into the master branch. So I started a RC branch just for this purpose. If someone wanted to try and test it – which I would really appreciate: here you go (or: checkout branch feature/devns) !

9 people like this

Share this post


Link to post
Share on other sites

I tried almost every command, but haven't noticed any issues with PW3. Maybe some of the heavy users will notice something.

Thank you for this awesome CLI.  :)

3 people like this

Share this post


Link to post
Share on other sites

Since I didn't see it mentioned in any changelogs, I just want to give a heads up to the new ability to import field values via JSON files, which @justb3a implemented in top notch quality after my fiddly proof-of-concept patch :) . I find this to be a major improvement, since it enables so much easier import of data from e.g. Drupal, so just wanted to make you all aware of it.

I have outlined in very broad broad terms how I went about transferring data from a Drupal 7 site, to processwire, in this post.

4 people like this

Share this post


Link to post
Share on other sites

Battling to install devns:

  [RuntimeException]
  Error loading sha `devns`, curl request failed (status code: 0,
   url: https://raw.githubusercontent.com/ryancramerdesign/Proces
  sWire/devns/wire/core/ProcessWire.php).
  cURL error: SSL certificate problem: unable to get local issuer
   certificate

Any ideas? (Going to do manual method for now.)

Share this post


Link to post
Share on other sites

Good day!

I am playing with the new command and finding some inconsistencies:

  1. If something went wrong while installing, like wrong db credentials were provided, there is no way to start over again without downloading the whole repo once again. Should there be a --no-download flag or something like that. The best thing is to make it check the db connection before the download process or even make it interactive and allow reenter the db credentials?
  2. Even with a db connection error I still get this untruthful message in the end: Congratulations, ProcessWire has been successfully installed.
  3. It would be nice if a new db could be attempted to create if there is not one already.
  4. I still get an error in the end :(
    PHP Fatal error:  Class 'WireDatabaseBackup' not found in C:\Users\dxlab1\AppData\Roaming\Composer\vendor\wireshell\wireshell\src\Helpers\Installer.php on line 486

     

Share this post


Link to post
Share on other sites

I tried out wireshell and installed it. It seems to work but not when I try to use it on a existing local install. PW Version doesn't matter so far. I'm using MAMP Pro and can't get it to work and always get an error.

When using the mysql socket as explained I get:

Error: Exception: SQLSTATE[HY000] [2002] No such file or directory (in /Applications/MAMP/htdocs/pw28.ch/wire/core/ProcessWire.php line 293)

When using the "allow network access" option in MAMP and using 127.0.0.1 I get:

Error: Exception: SQLSTATE[HY000] [2002] Connection refused (in /Applications/MAMP/htdocs/pw28.ch/wire/core/ProcessWire.php line 293)

I'm not sure what to try.

 

Share this post


Link to post
Share on other sites

Hi Soma,

which version of MAMP do you use (3.5)? It's very hard to say what is failing here since my wireshell/MAMP experience is limited to two systems (both El Capitan).

Best,

marcus

 

Share this post


Link to post
Share on other sites
5 minutes ago, marcus said:

Hi Soma,

which version of MAMP do you use (3.5)? It's very hard to say what is failing here since my wireshell/MAMP experience is limited to two systems (both El Capitan).

Best,

marcus

 

Yes MAMP Pro 3.5 on ElCapitan.

Share this post


Link to post
Share on other sites
2 minutes ago, Soma said:

Yes MAMP Pro 3.5 on ElCapitan.

Hm. Same here, and working with the 127.0.0.1/"allow network access" thing. Have you tried szabesz' suggestion?

Share this post


Link to post
Share on other sites

I'm not sure I want to follow what is written there, renaming php doesn't even work. And I dont' want to modify .bash_profile.

Share this post


Link to post
Share on other sites

It's kinda weird I'm now again trying to use the MAMP options to allow network access. I removed the socket configs I did in mysql and php but mysql log says 

160830 15:37:00 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
160830 15:37:02 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
160830 15:37:02 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
160830 15:37:02 [Note] Plugin 'FEDERATED' is disabled.
160830 15:37:02 InnoDB: The InnoDB memory heap is disabled
160830 15:37:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160830 15:37:02 InnoDB: Compressed tables use zlib 1.2.3
160830 15:37:02 InnoDB: Initializing buffer pool, size = 128.0M
160830 15:37:02 InnoDB: Completed initialization of buffer pool
160830 15:37:02 InnoDB: highest supported file format is Barracuda.
160830 15:37:02  InnoDB: Waiting for the background threads to start
160830 15:37:03 InnoDB: 5.5.42 started; log sequence number 6123988935
160830 15:37:03 [Note] Server hostname (bind-address): '127.0.0.1'; port: 8889
160830 15:37:03 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
160830 15:37:03 [Note] Server socket created on IP: '127.0.0.1'.
160830 15:37:03 [Note] Event Scheduler: Loaded 0 events
160830 15:37:03 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.42'  socket: '/Applications/MAMP/tmp/mysql/mysql.sock'  port: 8889  Source distribution

Weird thing is that there's no file : '/Applications/MAMP/tmp/mysql/mysql.sock'  in my case. never was.

Share this post


Link to post
Share on other sites
23 minutes ago, Soma said:

I'm not sure I want to follow what is written there, renaming php doesn't even work. And I dont' want to modify .bash_profile.

The cause of the error was this "N98 will be trying to use your Macs native PHP which isn't configured for MAMP's MySQL resulting in the database errors."

N98 is a phar file, just like wireshell. This worked for me:

Change directory to /usr/bin
cd /usr/bin
Change the name of the native php to keep a backup (just incase)
sudo mv php php.old
Create a symlink to your php version
sudo ln -s /Applications/MAMP/bin/php/php.[VERSION]/bin/php php

You can redo this, so you might want to try it just to see what happens.

Edited by szabesz
missing word "is"

Share this post


Link to post
Share on other sites
4 minutes ago, Soma said:

@szabesz It doesn't allow me to rename "php" to "php.old".

Maybe because of System Integrity Protection

eg.: http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html

The mac I use for development is still running Yosemite, so I have not yet tried to apply this change on El Capitan. Note, that I use this change for wp-cli too (so, still on Yosemite).

Share this post


Link to post
Share on other sites

 

3 minutes ago, szabesz said:

Note, that I use this change for wp-cli too (so, still on Yosemite).

I even made a bash script to hack it:

Spoiler

#!/bin/bash
# This script swaps the system default php binary for MAMP's version or vice versa

set -e
date
START="\e[0;95m :: \e[0m"
BLED="\e[0;36m :: \e[0m"
RLED="\e[0;41m :: \e[0m"
GLED="\e[0;47m :: \e[0m"
DONE="\e[0;42m :: \e[0m"

VERSION="php5.4.34"

ls -la /usr/bin/php*
if [ ! -f  /usr/bin/php.original ]; then
    printf "$START The file called php.original is NOT found!\n"
    printf "$BLED Do you want to switch to MAMP $VERSION? (y/n): "
    read ANSWER
    if [ "$ANSWER" = "y" ]; then
        cd /usr/bin
        sudo mv php php.original
        sudo ln -s /Applications/MAMP/bin/php/$VERSION/bin/php php
        printf "$BLED PHP is symlinked to MAMP $VERSION\n"
    else
        printf "$RLED You DID NOT choose yes! Nothing has been changed.\n"
    fi
else 
    printf "$START The file called php.original IS found!\n"
    printf "$BLED Do you want to switch to system version? (y/n): "
    read ANSWER
    if [ "$ANSWER" = "y" ]; then
        cd /usr/bin
        sudo rm php
        sudo mv php.original php
        printf "$BLED Original system PHP is restored.\n"
    else
        printf "$RLED You DID NOT choose yes! Nothing has been changed.\n"
    fi
fi
ls -la /usr/bin/php*

printf "$DONE We have reached the end of the script!\n"

date
exit 0

 

 

1 person likes this

Share this post


Link to post
Share on other sites

wireshell 1.0.0  :)

Compatibility: ProcessWire 3.x

  • Prepares wireshell for ProcessWire 3.x, adds namespace support, only supports ProcessWire 3.x
  • Updates Github Repository: github.com/processwire/processwire
  • Improves module:upgrade command, if no argument is provided it just checks for upgrades
  • Extends new command, adds option --src=path/to/source to be able to use a pre-downloaded tgz/zip/folder
  • Extends status command, only shows database password if --pass option is provided, shows if an upgrade is available
  • Updates upgrade command, removes options dev and devns
10 people like this

Share this post


Link to post
Share on other sites

Hey guys, great work on all of this! I really like having this option.

However, while testing the 1.0.0 version [Edit: On macOS Sierra 10.12] I ran into an issue with creating a new project using a zipped site profile: It seems Wireshell fails at extracting the profile zip due to incorrect permissions? (I did not use any older version before so I do not know if this is a new problem).  

I have exported a site profile using Ryans Site Profile Export module, and have confirmed this works on a new PW 3.0.35 project: when I set it up manually (downloading & unpacking the PW zip, unpacking my profile zip into the folder and going through manual installation of the project) everything works fine. 

Also I can create new projects using the built-in profiles correctly (ie. `wireshell new projectname --profile=blank` etc).  To be sure I even checked if I could sudo run the script but to no avail (bad idea anyway). 

Below is the (truncated) result:

weps:Server eelke$ wireshell new thijmentest2 --verbose --profile=ProjectGenerator/site-ember-pw-profile.zip


 Downloading ProcessWire...
   10.21 MB/10.21 MB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  100%

 Preparing project...

 Extracting profile...

[2016-10-03 08:39:59] name.ERROR: Error: Directory /Users/eelke/Documents/Werk/Server/thijmentest2/site/assets/ must be writable. Please adjust the permissions before continuing. [] []
[2016-10-03 08:39:59] name.ERROR: Error: File /Users/eelke/Documents/Werk/Server/thijmentest2/site/config.php must be writable. Please adjust the permissions before continuing. [] []
[2016-10-03 08:39:59] name.ERROR: One or more errors were found above. We recommend you correct these issues before proceeding or contact ProcessWire support if you have questions or think the error is incorrect. But if you want to proceed anyway, click Continue below. [] []

(.. Wireshell project settings ..) 

[2016-10-03 08:40:51] name.ERROR: Please fix the error to further proceed [] []

Congratulations, ProcessWire has been successfully installed.
weps:Server eelke$

As a result, the entire installation fails. After running the script, the database is empty and this is the folder structure:

Schermafbeelding 2016-10-03 om 09.10.52.png

Any ideas?

Edit: Definitely a problem with unzipping files. Very simple command:

Schermafbeelding 2016-10-04 om 13.41.43.png

It seems to be macOS Sierra related, accidentally I ran into a same kind of problem this morning doing some Homebrew tasks.
(https://github.com/caskroom/homebrew-cask/pull/22002

The signature of Zip files has changed apparently. 
Running 'file -Izb -- ~/Server/ProjectGenerator/processwire-master.zip' on OS X 10.11 yields:

application/x-empty compressed-encoding=application/zip; charset=binary; charset=binary

But on macOS 10.12 all you get is:

application/zip; charset=binary


 

 

Share this post


Link to post
Share on other sites

This has nothing to do with the signature of the zip file. The zip file has not the right permissions to be extracted. Please change the owner (user) of the zip file.

As stated in the error message: ..or because the installer doesn't have enough permissions to uncompress and rename the package contents.

works for me:
-r-x------ 1 username staff 11M Oct 6 12:39 pw.zip

leads to the error message ProcessWire can't be installed because...:
-r-x------ 1 100 staff 11M Oct 6 12:39 pw.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By fbg13
      When echoing a date field directly from the $user variable
      echo $user->date;  the timestamp is printed. Using
      echo $users->get($user->id)->date; prints the correct formated value.
      Is this a bug or or intended?
    • By beto
      I can't add a new value to a custom PageArray field  for my user.
       
      However, when I create a new user, I CAN add the new PageArray value:
       
      I need help. Thank you very much.
       
    • By bmacnaughton
      I would like to be able to fetch the labels for fields in a language different than the current logged in user.
      For field values that's easy 
      // p is page, l is language, and f is field $p->getLanguageValue($l, $f); I'm looking for something like
      $fields->getLanguageValue('en', 'length'); The only solution I know of is to save the current user language, iterate through the languages by setting the user language and fetching the value, and then restore the user language.
       
    • By bmacnaughton
      Is there a way to tell if a field is a multi-language field?
      I am currently checking to see if the last 8 characters are 'Language' but that seems like a fragile solution.
       
       
    • By louisstephens
      I was working on a simple "to-do" style template that has a form on a page. Once the form is submitted, I use the API to  create a new subpage under a pre-existing page, but I notice that it does resubmit the form data (as to be expected) if a user were to refresh the page. Is there a way to prevent this behavior so duplicate content will not be posted by using something like exit(), or is this not proper due to usability?  I guess I am curious as to how other developers handle the same hurdle.