Jump to content

constants.php


Jpeg

Recommended Posts

  • 3 years later...
On 12/24/2014 at 8:33 PM, Ryan Ashbrook said:

This file is not shipped with the software, but rather needs to be manually created. We don't ship with it as that would result in overwriting the file, which defeats its purpose.

When creating the file, it should go in the root of your site, alongside init.php.

Why not just ship a file named like _constants.php with some often used functions, for example:

<?php
/*
------------
In this file you can add some special commands and configuration options which alter the normal behavior of the Suite.
We added some often used commands below. If you need to make use of them please just remove the // 
More help and explanation of this file please visit invisioncommunity.com/constantshelp
Attention, be careful and only change this file if you really know what you are doing.
------------
*/

//define( 'EMAIL_DEBUG_PATH', "pathtoyourfolder" ); // this configuration prevent the board from sending emails, you have to create a directory and make it writable
//define( 'USE_DEVELOPMENT_BUILDS', TRUE ); // this configuration will give you the option to receive development builds in your acp
//define('RECOVERY_MODE',True); //enable this line if you can't access your acp and if you need tools to recover your community
//define('UPGRADING_PAGE', 'pathtoyourupgradefile'); // Here you can add the path to a replacement of your upgrade page

 

Link to comment
Share on other sites

I would suspect the risk of that is people may play with it and break something, :biggrin: for instance a typo or suchlike would possibly result in a broken site or more likely a blank page (php error) , no doubt ending up in a support ticket.

As an example to this if "define" was accidental enteted as "dfine" that would cause it.

If it was to be included I think it should not contain anything apart from the opening php tag perhaps, and be given a different file extension to prevent it overwriting those who already have one , for instance constants.php.dist

Link to comment
Share on other sites

18 minutes ago, AndyF said:

I would suspect the risk of that is people may play with it and break something, :biggrin: for instance a typo or suchlike would possibly result in a broken site or more likely a blank page (php error) , no doubt ending up in a support ticket.

Don't think so, the average user doesn't opens any file, he even don't know what the constants.php file is about. So there should be no danger if there is a file _constants.php included by default.

18 minutes ago, AndyF said:

If it was to be included I think it should not contain anything apart from the opening php tag perhaps, and be given a different file extension to prevent it overwriting those who already have one , for instance constants.php.dist

That's what I wrote in my post:

2 hours ago, Ramsesx said:

Why not just ship a file named like _constants.php

If it doesn't contains (disabled) sample content (config options) and descriptions it doesn't makes any sense at all to include such a file....

The intention for the suggestion is to save more advanced users time. 

Link to comment
Share on other sites

5 hours ago, Ramsesx said:

Why not just ship a file named like _constants.php with some often used functions, for example:


<?php
/*
------------
In this file you can add some special commands and configuration options which alter the normal behavior of the Suite.
We added some often used commands below. If you need to make use of them please just remove the // 
More help and explanation of this file please visit invisioncommunity.com/constantshelp
Attention, be careful and only change this file if you really know what you are doing.
------------
*/

//define( 'EMAIL_DEBUG_PATH', "pathtoyourfolder" ); // this configuration prevent the board from sending emails, you have to create a directory and make it writable
//define( 'USE_DEVELOPMENT_BUILDS', TRUE ); // this configuration will give you the option to receive development builds in your acp
//define('RECOVERY_MODE',True); //enable this line if you can't access your acp and if you need tools to recover your community
//define('UPGRADING_PAGE', 'pathtoyourupgradefile'); // Here you can add the path to a replacement of your upgrade page

 

Excluding the ones that need to be outside of settings for technical reasons and are generated in the AdminCP (like cache configuration), nothing in constants.php is really "often used" (otherwise they'd be a normal setting).

The most common one used is USE_DEVELOPMENT_BUILDS which we're thinking of moving to a setting and even that is like less than 0.1% of communities.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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