Jump to content

rot

Members
  • Posts

    26
  • Joined

  • Last visited

  • Days Won

    1

rot last won the day on April 4 2015

rot had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,675 profile views

rot's Achievements

Jr. Member

Jr. Member (3/6)

46

Reputation

  1. Hi arjen! Yes, I am still using the module but with an old processwire install. I just never published it to the repository. Just send me the pull requests and I will recheck and finally publish the module. I did't find the time to do so when I first did it and then I just forgot. It would be a waste if it works fine and others don't find it.
  2. I changed the directory structure to conform with Processwire standards and renamed the module classname to FormDiceCapture to conform naming conventions. The version number has been increased to 0.1.1. In case you have the module installed you will have to change the calls to $modules->get('DiceCaptcha') to $modules->get('FormDiceCaptcha'). Sorry for any inconvenience caused by that. I though I might rather change that now than later when there is more users.
  3. I changed the directory layout to conform with Processwire module standards. To do so, the github repository had to be renamed. The version number was increased to 0.11 BTW: I asked myself if one should extend this module to allow for arbitrary class additions to parent elements. If there is the need for another selector that adds a class to an element based on the existence of a sub-element I could change the class to allow for that.
  4. So i would like to rename the Module to "FormDiceCapture" and rename the github repository. Is this OK to do? I assume hardly anybody has installed the modlue yet but it might break their update path? One can NOT create zip files of subdirectories. So the correct proces is to: set up a repository called "ProcessMakeCoffee" and put ProcessMakeCoffee.module into it
  5. Thanks for the reply. Unfortunately I did not really completely understand it. First there ist this CamelCase naming. The module directory and the "main" module should have that CategoryCamelCase.module name. Like ProcessMakeCoffee.module. I think I understood that one but I could not think of a good category for the DiceCapture. Maybe "Form" or something like that? On github the default zip file packs all file into a directory called like the "repository-name". So if you would set up a repository called "make-coffee" and then create a directory called "ProcessMakeCoffee" and put ProcessMakeCoffee.module into it The zip layout would be as follows: make-coffee ^-ProcessMakeCoffee ^-ProcessMakeCoffee.module Is this a good layout? Or should I rather: set up a repository called "ProcessMakeCoffee" and put ProcessMakeCoffee.module into it The zip layout would be as follows: ProcessMakeCoffee ^-ProcessMakeCoffee.module Maybe one can also create zip files from subdirectories on github. No idea about that. Else the repository name would have match. Should I rather use the first or the second project layout?
  6. Anyway I just updated the git files to 'version' => 10. Hope that solves the issue. One more question: I have the zip file pointing to a file that contains two subdirectories (s. https://github.com/romanseidl/dice-captcha/archive/master.zip) as the module is in a subdirectory. Is this a good thing to have?
  7. Oh. Sorry. Thanks for the info. What version should I set in the files to correspond to 0.1? 10? Or 0.1?
  8. I did not mean to criticise or offend you. Its great that you shared your work.I just did not understand what made you write the module and not use the other one from the intro provided with this post and thought it might be of help if you tried to answer that question here. I asked for the USP if you want to call it that way.
  9. Just a stupid question: What is the advantage over using the GUMP-based module?
  10. rot

    Integration needed

    What do you want to achieve? Integrate search results?
  11. I have also been considering to use a file for this kind of thing. Probably it would be the easiest way also to provide some kind of "safe transactions" as for my case this is about long running processes that might die somewhere in the making. But I could also write that to the db as I am using that anyway to get process config info. So I would have to set a start flag (in the db or to a file) and consider the job as dead if it doesn't reply within a certain amount of time.
  12. Concerning the locking issue: Is there even something like locking? Or am I just confused? As thre is no middleware (confuses me ) there should be no problem with setting such a module to singular and still serve multiple requests in paralell. All locking there is is in the db. Or am I wrong? I studied $modules->getModule() and it shows that : $modules->get tries to find the module in the WireArray of $modules that should contain all installed modules. Those who are on autoload have been initialized. If it is NOT singular it gets recreated. And if it has not been initialized (because it is not on autoload or not singular) it get initialized. This seem to imply that a module that is on autoload and not singular produces an autoload instance and then a new one for each $modules->get(). LazyCron is autoload but not singular and it hooks onto: $this->addHookAfter('ProcessPageView::finished', $this, 'afterPageView'); Maybe it is not important that it is not singular as LazyCron is should not be directly called but hooked: $this->addHook('LazyCron::every30Minutes', $this, 'myHook'); Also concerning the hook I looked at "Jumplinks" and this hooks to "Page not Found" which seems pretty nice for something that should try not to slow down the regular page view process: $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'scanAndRedirect', array('priority' => 10)); Funny enough I could not find out what Jumplinks is doing in terms of liefecycle. Probably it is using the getMolduleInfo defaults and thus it is not singular (but is it autoload? i suppose it has to be)
  13. The problem was a database timeout. I fixed the timout problem by using the following to reconnect if needed. $data = $backup->run($web); //force reconnect if database has been lost due to long job runtime try { $this->setJobData($id, $data); } catch (Exception $e) { $this->modules->wire('database')->closeConnection(); $this->setJobData($id, $data); } Not the most beautiful solution. I would prefer to have a $db->ping() method as there was with mysqli. Maybe that would be a good extension to the DBO? I created a pull request: https://github.com/ryancramerdesign/ProcessWire/pull/1097 Its not dead important but I think it would be nice.
  14. max_execution_time is set (by calling set_time_limit() - it probably only works if the php setup allows so - ill have to check). You can set that in the admin:) The Script runs until it is nearly finished. Then I want to save the result (info the job was successful and the log) to the database. So its probably what you call a "summary". So maybe this is a seperate database timeout? Does processwire open a mysql connection for every request? Maybe that connection just dies after some minutes of doing nothing. There can always be more Like e.g. class based loggin in a LOG4J style. But more is not always better. At the moment I don't log to files by default (which might be a bad Idea considering the database timeouts...) but I used to log to an own log file.
  15. I use my own log file(s) by using the LogFile class. Is that all there is? There is this $this->message and $this->error functions. Maybe one should implement them too. At the moment I only implement log() and it does not forward to the Wire baseclass logger. I will look at LazyCron Thx. For the moment I seem to lose the database connection on long runninng jobs which is a problem because I want to save the results to the database: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/.sites/306/site1268/web/wire/core/Modules.php line 2416) This error message was shown because you are logged in as a Superuser. Error has been logged.xception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/.sites/306/site1268/web/wire/core/Modules.php line 2416) This error message was shown because you are logged in as a Superuser. Error has been logged. Any ideas on how to avoid that?
×
×
  • Create New...