Jump to content

Captain Hook - ProcessWire Hooks Cheatsheet


Soma

Recommended Posts

Any chance you could update this to the latest dev version?

http://somatonic.github.io/Captain-Hook/

Yeah if there was a 48hour day :D I already started some months ago trying owzim bash script, but didn't finish. The idea was that each new version will give a new sheet. If someone wants to contribute and have time just let us know.

Link to comment
Share on other sites

No problem, i understand that u need to do this manual and is not something with high priority among other work.

Isnt this possible to automate with the github automatic page generator and some grunt / nodejs script.

https://help.github.com/articles/creating-pages-with-the-automatic-generator/

I'm not familiar with owzim bash script. What automatic services can run on github so that it will be completely automatic?

Link to comment
Share on other sites

It doesn't need to be nodejs or some other cli. Via webhooks github could trigger any online accessable script, which could then dynamically check for a new version number and new hooks in code. The only issue would be, that this doesn't work on the github servers alone, because github only hosts the files, but there's nothing scriptable available aside from javascript.

Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...

I started to get my hands on hooks for the first time and think that Captain Hook (like the Cheatsheet) are great resources.

Unfortunately (or fortunately if you want) has the documentation inside the files moved the line numbers of the linked hooks, so that the links on Captain Hook don't point to the right direction anymore. Also they use the old repository.

If the links could be updated, that would be great. To be future-proof I saw recently this thread: 

Maybe with APIGen and the API Reference there is not much need for Captain Hook anymore, but as it is cross linked in many places (f.e. AdminThemeReno), this would be great for beginners like me. ;)

Regards, Andreas

  • Like 3
Link to comment
Share on other sites

  • 2 months later...
On 20/11/2016 at 7:55 AM, AndZyk said:

Unfortunately (or fortunately if you want) has the documentation inside the files moved the line numbers of the linked hooks, so that the links on Captain Hook don't point to the right direction anymore. Also they use the old repository.

If you haven't seen it already, check out the new Captain Hook panel in Tracy Debugger. If you have the Editor Protocol Handler configured you can jump straight to the hookable method in your code editor. Because the line links are generated from whatever PW version you are running it will always be correct. Pretty cool. :)

Plus it includes the hookable methods in module classes!

  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...

@Soma - just wanted to let you know that I have made more changes to @owzim's script. 

The new version adds this functionality

You can see my changes here: https://github.com/adrianbj/TracyDebugger/blob/master/panels/CaptainHook/CaptainHookSearch.php

Let me know if you have any questions.

  • Like 6
Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...

Hi Soma,

Just wondering if you would consider implementing the latest code from the Tracy Captain Hook parser. It us returning 830 core hooks compared to the 770 listed on this Captain Hook page.

Also, you have this error showing at the bottom of the new version:

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 82 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 83

  • Like 1
Link to comment
Share on other sites

19 minutes ago, adrian said:

Hi Soma,

Just wondering if you would consider implementing the latest code from the Tracy Captain Hook parser. It us returning 830 core hooks compared to the 770 listed on this Captain Hook page.

Also, you have this error showing at the bottom of the new version:

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 82 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 83

Oops, didn't see that, the date was added to make it dynamic.

Ah right, the script is like +300% of the old one, and I get

Fatal error: Call to undefined function wire() in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/classes/CaptainHookSearch.php on line 38

I don't want to add ProcessWire to that whole thing....

Link to comment
Share on other sites

5 minutes ago, Soma said:

Fatal error: Call to undefined function wire() in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/classes/CaptainHookSearch.php on line 38

I don't want to add ProcessWire to that whole thing....

I guess the File Compiler is taking care of that for me. Any reason you can't just namespace once at the top? Anyway, I'll leave it to you if you want to make use of it.

Link to comment
Share on other sites

6 minutes ago, Soma said:

Hmm. This is just a folder with a shell script and some php, no PW installed here.

Right. Looking at the code in that script that is making use of wire - some of it could easily be stripped out for your use case (some of it is to check the existence of the ProcessWireAPI module for directing to API docs on the PW website vs local install) and some modified to not need wire at all (that check for DOTS in the path). 

Link to comment
Share on other sites

Why don't you do it? I don't have or use Tracy. But is uses the same script now. Captain Hook, loads the dev and master repos and searches for hooks. 

I then count the hooks array and get 800.

Link to comment
Share on other sites

On 12/19/2017 at 7:40 AM, Soma said:

Why don't you do it? I don't have or use Tracy.

I thought we were working together to try to improve your Captain Hook sheet here.

I guess the difference is that you can easily install Tracy, whereas I can't replicate exactly what you have at your end.

That said, if you could send me a json_encode()'d version of $hooks, I can do a diff on the output you have vs what Tracy outputs. Maybe it's a bug in my script and I would like to improve it for everyone's benefit.

Thanks.

  • Like 2
Link to comment
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.
×
×
  • Create New...