Jump to content
Sign in to follow this  
tarkvsg

is it worth to make project on PW

Recommended Posts

Does it make sense to make a project in the ProcessWire if there are queries like "select mailbox from table" or "insert into table set field='a'" to it, and judging by the structure of ProcessWire database, you cannot make it simple. For example: postfix sql queries for  quotes, checking mailboxes and so on.

Share this post


Link to post
Share on other sites

Have you made projects before with processwire api and sql queries ? Did you prototype your new project with processwire ? I don't know of any other cms that has a better api, so please give us some more details what your new project is about.

  • Like 1

Share this post


Link to post
Share on other sites

Thank for your rocket answer! Yes, some time ago i have a small project on PW. So i look forwards PW - PW and community are best. New project is an interface to our mailuser database where pages are mailuser entries. Email server will ask db about permissions and so on. Something that.

Share this post


Link to post
Share on other sites
13 hours ago, tarkvsg said:

Does it make sense to make a project in the ProcessWire if there are queries like "select mailbox from table" or "insert into table set field='a'" to it, and judging by the structure of ProcessWire database, you cannot make it simple. For example: postfix sql queries for  quotes, checking mailboxes and so on.

With ProcessWire you don't generally want to perform your own SQL queries. It's possible, but generally I'd consider that a bad practice.

If your content is stored as ProcessWire objects (basically Pages), you should always use the Selector engine for that sort of stuff. Not only does this provide the benefits of a great API (such as $pages->find('template=mailbox, owner=[some_user_field=whatever_value]') or $pages->get('parent=some-parent, name=page-name')->setAndSave('field', 'value')), there's also zero chance of accidentally running into nasty SQL injection vulnerabilities.

Of course you can always create custom database tables and perform queries on them using the $database API variable (which is essentially a wrapper for PHP's own PDO class), but in such cases the content won't be editable within ProcessWire's admin, so you're missing a pretty important benefit there. Another alternative would be using RockFinder, which kind of provides the best of both worlds: easy to use syntax for queries combined with the performance of raw SQL and lightweight PHP arrays/objects.

So, long story short: if you want a nice GUI and an easy-to-use API for managing your content, ProcessWire is a great choice. If you ultimately just want to use your custom database tables, write a few SQL clauses to update a few rows here and there, and there's no need for a web based interface for managing said items – then perhaps you should just build it from scratch (or use something like Laravel instead).

  • Like 5

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...