• Many plugins have an “includes” folder with one or more PHP files, but with a “.inc” extension instead of “.php” and which are intended to be loaded via includes from other PHP files. Other than the extensions, there is no real difference internally.

    And yet, Synchi currently shows only a generic icon for them, and reports “File not supported!” on any attempt to open one.

    I attempted to edit “synchi.php” line 59 as follows:

    // define supported extensions
    $synchi_extensions = array('php', 'js', 'css', 'sql', 'html', 'htm', 'txt', 'xml', '.inc');

    (In addition to adding “, ‘.inc’” before the closing parenthesis, I also replaced all double quotes with single quotes aka apostrophes because that’s more efficient in PHP when you don’t need the escapes that double-quoted strings support.)

    Doing this allowed me to open .inc files, but they did not appear in a proper IDE window. Instead, on WinIE 11, they appeared in a two-line narrow scrolling textbox, and froze much of the Synchi IDE except for the full-screen toggle which I was able to use to get out of it. Removing the “, ‘.inc’” and relaunching the Synchi plugin editor then recognized the .inc file I had open as not supported and automatically closed it, restoring full functionality.

    So apparently something else has to be done somewhere to make .inc files work. Can this be added? I can see no good reason to lock us out of editing those.

    https://www.ads-software.com/plugins/synchi/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author mdjekic

    (@mdjekic)

    Hi,

    Can you elaborate on what plugins use “.inc” files so that I can avoid them forever?

    Since you’re clearly doing some improvements – why not checkout the code – improve and become a contributor?

    Thread Starter Joel MMCC

    (@joel-mmcc)

    I’m not doing improvements so much as merely trying to solve a problem I was having the best I can. I’m not very familiar with PHP, having come from a WISA (Windows / IIS / SQL Server / ASP.NET) instead of LAMP background.

    As for plugins using .inc files, Query Wrangler is the one that I was trying to look into seeing if I could fix a pressing issue with. That’s a pretty major one, being the primary free method of bringing much of Drupal Views functionality to WordPress and making it a peer in the CMS market (its only real competitor there is Toolset’s Views which is commercial).

    I suppose I could try to rename all of Query Wrangler’s .inc files to .php and fix all include[_once]() and require[_once]() references to them in code, but that’s difficult to do in Synchi when I can’t edit them in the first place. The key to the piggy-bank is in the piggy-bank, as it were.

    Thread Starter Joel MMCC

    (@joel-mmcc)

    For the record, I posted a request on the Query Wrangler support forum to change their .inc files to .php, as in addition to being uneditable with Synchi, the use of that extension is not best practices (as @mdjekic observed), and they agreed to do so. Their latest update release from about a month ago should implement this.

    That said, there are some other extensions that should be editable, such as .scss, .less, etc.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Allow editing .inc files’ is closed to new replies.