Jump to content

Search the Community

Showing results for tags 'initialization'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 3 results

  1. Does anyone have a recommendation for creating a MySQL connection pool on an Apache httpd server? Every invocation of PW is slowed on this system with about 1 second taken up before any useful work is done, primarily in establishing a database server connection. This is on a VPS, so admittedly it isn't fully under our control, but still...
  2. I've created an Inputfield module but have some questions about how the initialization works. The field works, but I don't understand how the class is being initialized and default values supplied to ___render. If I don't set the value in my code that executes wire('modules')->get('InputfieldMine') then no default value is supplied to ___render even though it's clearly set in __construct. Excerpted logic for my module/class (InputfieldMine): public function __construct() { parent::__construct(); $this->set('minLength', 6); wire('log')->save('trace', "__construct $this->minLength"); } public function init() { parent::init(); // other stuff $ml = $this->minLength; wire('log')->save('trace', "init $ml"); } public function ___render() { $ml = $this->minLength; wire('log')->save('trace', "___render $ml"); } I'm writing a log in __construct, init, and ___render. Excerpted logic from where I'm using the InputfieldMine: // get a my field wire('log')->save('trace', 'B4 LOAD'); $field = wire('modules')->get("InputfieldMine"); wire('log')->save('trace', "AFTER LOAD $field->minLength"); // ellided setting of attributes and properties $field->minLength = 6; wire('log')->save('trace', "AFTER SET $field->minLength"); $form->add($field); I'm writing a log before loading the module, right after loading the module, and after setting the minLength. The log sequence I get is: B4 LOAD __construct init AFTER LOAD AFTER SET 6 ___render 6 So it's clear that the ->get method causes both the constructor and the init function to get invoked as I'd expect. What's not clear to me is why the value set in __construct isn't get-able after $this->set('minLength', 6); is executed. The 6 is present in a var_dump - it's in the data: array['minLength']. If I remove the line: $field->minLength = 6; right before the "AFTER SET" log call then the value is null when ___render is called. What is the purpose of setting minLength to 6 in the constructor? And how would I cause the Inputfield to use it?
  3. Hi, I want to write up a module that upon installation generates my site fields, templates, and roles... What hook do I use? This is a better approach than simply exporting a Site Profile, no? Thanks...
×
×
  • Create New...