Jump to content

ProcessWire and phpstorm


rick
 Share

Recommended Posts

Hello all,

I am evaluating phpstorm and would welcome any comments from those of you that use it.

Here is screen shot of a namespace test.

phpstorm.jpg.fe0321366d8a34d7d965304c920fbfcb.jpg

Ex 1 shows undefined variables, user, session, and pages. No autocomplete is available.
Ex 2 shows undefined functions, isLoggedin and redirect. No autocomplete for methods is available.
Ex 3 shows a correct validation and autocomplete is available.

I am not sure how to configure phpstorm so that I write as shown in ex 1 and have it validate as in ex 3. 

Any help is greatly appreciated.

Link to comment
Share on other sites

1 hour ago, rick said:

I am not sure how to configure phpstorm so that I write as shown in ex 1 and have it validate as in ex 3. 

There may be other solutions but this is what I do...

 

  • Like 2
Link to comment
Share on other sites

Well, I purchased that IDE a month ago and so far its works great with everything I throw at it. It's a bit slow and laggy sometimes, but the features are unmatched by any other IDE it seems. I'm new to PW so I can't comment on how well it will integrate. I will surely be interested in this as well.

Link to comment
Share on other sites

Hi @rick,

I can't share my custom profile because it contains pro modules. And it's set up to suit my preferences and idiosyncrasies which would surely be different for each person.

But it's very easy to make your own custom profile. If you find yourself installing the same modules or creating the same kinds of page structures over and over for each project then the idea is:

  • Create a new installation on your localhost using the "blank" profile
  • Customise /site/config.php how you like, e.g. imageSizerOptions, useMarkupRegions, setlocale()
  • Install your favourite modules - include the Site Profile Exporter
  • Set up any admin tweaks with AdminOnSteroids and/or AdminCustomFiles
  • Create the fields, templates and template files you tend to need for every new site (it doesn't hurt if there are some that aren't always used as you can always delete them in any project that doesn't need them)
  • Create any page structures you want to have pre-existing (I have a "news" section, and a "selects" section for Page Reference options)
  • Export your site profile

Then when you are creating a new project you just copy the profile folder to the root before installing PW and select it during the install process.

I keep my starting profile on localhost and update/re-export it from time to time with the latest module upgrades and any new tricks and tweaks I have learned.

  • Like 8
Link to comment
Share on other sites

@Robin S

This.

This right here is why you are a hero member. Props to you for the profile explanation. ^-^

I never knew the procedure. I will put this into practice immediately.

PS. Where is that damn "Buy-a-Beer" button? Somebody needs to make that happen.

  • Like 4
Link to comment
Share on other sites

  • 8 months later...
On 20.5.2017 at 1:03 AM, Robin S said:

Hi @rick,

I can't share my custom profile because it contains pro modules. And it's set up to suit my preferences and idiosyncrasies which would surely be different for each person.

But it's very easy to make your own custom profile. If you find yourself installing the same modules or creating the same kinds of page structures over and over for each project then the idea is:

  • Create a new installation on your localhost using the "blank" profile
  • Customise /site/config.php how you like, e.g. imageSizerOptions, useMarkupRegions, setlocale()
  • Install your favourite modules - include the Site Profile Exporter
  • Set up any admin tweaks with AdminOnSteroids and/or AdminCustomFiles
  • Create the fields, templates and template files you tend to need for every new site (it doesn't hurt if there are some that aren't always used as you can always delete them in any project that doesn't need them)
  • Create any page structures you want to have pre-existing (I have a "news" section, and a "selects" section for Page Reference options)
  • Export your site profile

Then when you are creating a new project you just copy the profile folder to the root before installing PW and select it during the install process.

I keep my starting profile on localhost and update/re-export it from time to time with the latest module upgrades and any new tricks and tweaks I have learned.

...or create one kickstartfile and run it:

<?php
return [
  'pw' =>'https://github.com/processwire/processwire/archive/dev.zip',
  'profile' => 'site-default', // could also be a custom profile url from gitlab
  
  'settings' => [
    // usernames + passwords
  ],
  
  'recipes' => [
    function() { $this->installModule('TracyDebugger', 'https://github.com/adrianbj/TracyDebugger/archive/master.zip'); },
    function() { $this->installModule('DemoModule1', 'url1'); },
    function() { $this->installModule('DemoModule2', 'url2'); },
    function() { $this->installModule('DemoModule3', 'url3'); },
    function() {
      // create pages or do whatever is possible via pw api
      // you could also change settings in config.php here
    },
  ],
];

Then it is literally just one click! You could create one master kickstartfile and then just comment out the recipies that you don't want.

I think this is a really, really powerful and timesaving method. Also it will always download the latest versions of all the modules. I don't get why there is no almost no response at the dedicated forum thread. Seems that nobody gave it a try so far...

  • Like 1
  • Sad 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...