Raymond Geerts Posted December 8, 2014 Share Posted December 8, 2014 Any chance you could update this to the latest dev version? http://somatonic.github.io/Captain-Hook/ Link to comment Share on other sites More sharing options...
Soma Posted December 9, 2014 Author Share Posted December 9, 2014 Any chance you could update this to the latest dev version? http://somatonic.github.io/Captain-Hook/ Yeah if there was a 48hour day 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 More sharing options...
Raymond Geerts Posted December 9, 2014 Share Posted December 9, 2014 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 More sharing options...
LostKobrakai Posted December 10, 2014 Share Posted December 10, 2014 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 More sharing options...
bernhard Posted September 11, 2015 Share Posted September 11, 2015 what do you think - would modifying captain hook in this direction make sense? https://processwire.com/talk/topic/10857-making-hooks-visible-hookrecorder/?p=102219 Link to comment Share on other sites More sharing options...
AndZyk Posted November 19, 2016 Share Posted November 19, 2016 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 3 Link to comment Share on other sites More sharing options...
Soma Posted January 25, 2017 Author Share Posted January 25, 2017 I just updated the Captain Hook cheatseheet to latest version 3.x now there's a master and dev version. Thanks to @owzim for providing a cli script to parse the repos automaticly and generate a array to use. It helps a lot to update. https://somatonic.github.io/Captain-Hook/index.html 14 Link to comment Share on other sites More sharing options...
Robin S Posted January 25, 2017 Share Posted January 25, 2017 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! 6 Link to comment Share on other sites More sharing options...
adrian Posted February 3, 2017 Share Posted February 3, 2017 @Soma - just wanted to let you know that I have made more changes to @owzim's script. The new version adds this functionality adds dynamically added hooks like Page::viewable which were not previously detected cleans up code within a function when it's on the same line as the function definition, eg. https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/NullPage.php#L112 removes any comments from the returned info - previously if a comment was on the same line as the function definition it would be returned also. 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. 6 Link to comment Share on other sites More sharing options...
iLav Posted June 9, 2017 Share Posted June 9, 2017 Thanks it will help me a lot in learning process. Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 I updated the Cheatsheet just today to contain the latest dev. 4 Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 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 1 Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 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 More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 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 More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 Hmm. This is just a folder with a shell script and some php, no PW installed here. Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 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 More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 I removed the wire stuff and comments. I now get 800 hooks on dev and 775 on dev. Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 4 minutes ago, Soma said: I removed the wire stuff and comments. I now get 800 hooks on dev and 775 on dev. I wonder why I am getting 830 on dev vs your 800? Can you figure out which ones are missing? 1 Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 I have no idea and not keen to go count 800+ hooks. Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 2 minutes ago, Soma said: I have no idea and not keen to go count 800+ hooks. haha - I thought you could do a diff on it somehow. Maybe before generating the html you could compare the php array? Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 Compare to what? It's 800 that's all I got. Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2017 Share Posted December 19, 2017 Just now, Soma said: Compare to what? It's 800 that's all I got. Compare it to the array of results when you run the Captain Hook panel in Tracy where I am getting 830 Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2017 Author Share Posted December 19, 2017 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 More sharing options...
diogo Posted December 20, 2017 Share Posted December 20, 2017 Soma has the délicatesse of Captain Hook when he gets annoyed 3 1 Link to comment Share on other sites More sharing options...
adrian Posted December 20, 2017 Share Posted December 20, 2017 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. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now