Hot answers tagged

20

If you need to access a variable repeatedly then you should generally place it within a constructor method and assign it as a class property, rather than continuously checking config values. This approach also gives you the opportunity to set a default value which you can use class-wide if the config item is not found. <?php class Myplugin { var $...


15

I can recommend Focus Lab's EE Master Config. It's easy to set up and easy to add options to as needed and it is perfect for multi server environments. I usually don't bother with the multi server set up, and am just building the site on a subdomain and then just transferring to the live domain. But even in this basic case, the master config makes going ...


15

$assign_to_config is an EE-native array used in the index.php file. Here's part of the comments EllisLab left for us to provide context: The $assign_to_config array below will be passed dynamically to the config class. This allows you to set custom config items or override any default config values found in the config.php file. This can be handy ...


13

Yes, there is $config['word_separator'] = "dash"; or $config['word_separator'] = "underscore";


12

Solutions mentioned in the thread are all nice, but I think you learn a lot by creating your own config bootstrap. To that end, I found the following resources can help a great deal: DRY applied to EE2 config Three in-depth articles by Jamie Rumbelow on the EE config file Hidden Config variables in EE2 Armed with those, it is easy to create bootstrap ...


11

It's not that using admin.php is a security benefit in itself, it's that it allows you to move your entire /system folder outside of the web root. If you don't take that step then you will see no benefits whatsoever. In fact, if you leave both admin.php and /system in your public_html folder (or equivalent) that's arguably detrimental to security, as you've ...


10

To be able to actually use the "site_name" and for it to work, you need to hack the core https://support.ellislab.com/bugs/detail/15461/#8283 or install an extension i developed for this. http://devot-ee.com/add-ons/override_site_name edit Instead of in the config.php file, You can override site_name in the main index.php $assign_to_config['site_name'] ='...


9

Since ExpressionEngine is based on Codeigniter, you can use the CI Config class to fetch config items. http://codeigniter.com/user_guide/libraries/config.html class Myplugin { public $return_data; function Method() { $this->EE =& get_instance(); $item = $this->EE->config->item('myplugin_config_item'); } ...


8

This largely depends on what you are trying to do. So many of my sites are so different that I wouldn't get much of a time savings by setting up much of anything in the DB for re-use. However, here are your options in general. The NSM site genator looks promising and it's all open, but it seems to have been light on activity lately. The last commit appears ...


8

Devot:ee has a page dedicated to this: http://devot-ee.com/ee-config-vars


7

We setup a folder called "private_ee" (to compliment "public_html") above the web root which contains directories for snippets, system, templates, and third_party. As you said, if someone gets access above the web root, you've got bigger problems. In other words, there's no need to rename it for security's sake; the security advantage you obtain is gained ...


7

You can't set up Snippets, but you can set up Global Variables in your config.php file. Below is a code example from this blog post titled ExpressionEngine config.php. $default_global_vars = array( // Tag parameters - Short hand tag params 'global:disable_default' => 'disable="categories|pagination|member_data"', 'global:disable_all' ...


7

In cases like these it's likely that there is something unique about how the host sets certain environment variables within PHP. A few questions: Who is the host? Do you have access to server error logs? If so, what's in the error log? If you have a 500 error you should have a log of the reason somewhere on the server. If there isn't, as your host where ...


7

That would be the save templates as files feature. Once you've configured a template path you can save individual templates as files or you can sync all of your templates to file via the Templates > Synchronize Templates page. Once you've done that any changes you make to the template files will take effect immediately, without you needing to manually sync ...


7

Take a look at your main index.php file, you should see this line: // $assign_to_config['global_vars'] = array(); // This array must be associative Once that's uncommented and populated the variables should be available in your templates. For example: $assign_to_config['global_vars'] = array('analytics_key' => 'UA-XXXXXXX-XX'); That should be ...


6

Yes. Go to Admin -> Security and Privacy -> Security and Sessions and if you're using Sessions for the CP session type then you can select "no" for Allow Multiple Log-ins From a Single Account.


6

Many options are available as stated in other posts. To add to that here is the default config.php & database.php file templates for ExpressionEngine we use.


6

The NSM Bootstrap technique has never let us down in multi-server environments.


6

As of 2.8 it's changed slightly... So if you want to disable "secure forms" you'll need to use this in config.php instead of what is posted elsewhere. $config['disable_csrf_protection'] = "y"; More info here: http://ellislab.com/blog/entry/sessions-login-modals-and-secure-forms-in-expressionengine-2.8


5

You need to fill in the array for all of your domains that are part of MSM. I copied this from config.php for a 9 site MSM install and reduced it to just 3 sites to demonstrate: // ce_img stuff here $config['ce_image_src_regex'] = array( '^http://maindomain.com/' => '/var/www/vhosts/maindomain.com/httpdocs/', '^http://domain1.com/' => '/var/www/...


5

I'm still not certain what your overall question is, but I can explain $env_config['disable_all_tracking'] = 'y';. $env_config['disable_all_tracking'] = 'y'; Is part of ExpressionEngine's option for Handling Extreme Traffic. If you disable_all_tracking then you do not have to individually set the options for: $env_config['...


5

I believe the main and immediate advantage to using admin.php, wether you move the system folder above root or not, is that it hides the name of the system directory from http request logs. So if you have renamed your system folder (for security reasons), your browser is only making requests to admin.php, not secret_system_folder/index.php. It's the same ...


5

Rick, I poked around and found what I think are the allowable settings for those first two in /system/expressionengine/models/admin_model.php. It looks like 'y/n' are the only allowable values for redirect_submitted_links or banish_masked_ips. I found the values for req_mbr_activation in /system/expressionengine/controllers/cp/members.php at line 1674 (...


5

This error may caused if EE couldn't make database connection. Check your hostname, username, password within "/system/expressionengine/config/database.php". Also could you check "exp_sites" database table if its having at least one record (multiple records for MSM site) if not, import this table properly.


5

I was almost certain that Custom System Messages was causing this problem. The template offline message could be set in the preferences, but it was not. As Custom System Message has a greater priority over EE offline template, and no template was set, it was not working. The template was set inside Custom System Message The problem is solved.


4

No, you can't generate them dynamically but you can use Snippet Sync or Libraree to use snippets as files and port them into other projects. I use Libraree as part of my base install with a couple base snippets for a header and footer that I carry through projects. Using config overrides (Focus Lab's Master Config) I set where to store the files and edit ...


4

In your index.php & admin.php are you pointing your system path to the correct spot? I keep my system above root: $system_path = '../system'; On a related note, can you turn on debugging in your index/admin files? Earlier this week I had the same issue until I enabled debugging and got: Your system folder path does not appear to be set correctly. ...


4

Not sure about pre-populating sites with channels etc as every project is different but Made by Hippo posted an article re getting EE up and running quickly, might be useful to you, I've adopted a couple of things like pulling out config file to assets folder.


4

I'll second tidy's vote for the Focus Labs EE Master config. We are using it in a multi server deployment set up and it's awesome. Saves lots of time and I no longer worry about code deploying out with the wrong environment configs.


4

I built my own config file, because I had a setup that most of the prebuilt configs didn't have... My normal setup is, Local, Staging (Located on subdirectory, inside a folder) and then Production. A lot of hooks were added for NSM .htaccess, CE Image, CE Tweet etc... Just pushed the latest version of it to my Github. https://github.com/madebymayo/...


Only top voted, non community-wiki answers of a minimum length are eligible