- Katılım
- 30 Eki 2016
- Mesajlar
- 6,974
- Beğeniler
- 12
- Puanları
- 18,020
- Konum
- Zonguldak
- Ad Soyad
- Turhan Karabulut
- Meslek
- Emlak
- Yaş
- 45
xenforo Development tools
XF2 provides developers with a number of built in tools you can use to expedite development of add-ons and we'll go through some of these below.Debug mode
Debug mode can be enabled in your config.php which will allow you to access certain development tools in the Admin CP (such as creating routes, permissions, admin navigation etd.) and it will also enable an output at the bottom of every page which details how long the page took to process, how many queries were executed to render the page and how much memory was used. A tooltip containing information about the current controller, action and template name is available on hover. You can also click on the time output and this will give you a detailed look at exactly what queries ran and the stack trace that led to that query being executed.You can enable debug mode by adding the following to config.php:
$config['debug'] = true;
Enabling development mode
Development mode is a special mode, activated in your config.php file which will trigger XF to automatically write out your development files to your _output directory. This mode needs to be enabled for filesystem template editing to be enabled. As development mode will be writing files to your file system it is important to ensure you have the appropriate file permissions in place. This may vary depending on environment, but a typical configuration would be to ensure that for any add-on you are working on, you have its _output directory set chmod to 0777. For example, if you are working on an add-on with an ID of Demo, its development output will be written out to src/addons/Demo/_output and therefore that directory will need to be fully writable.Enabling development mode, also enables
You do not have permission to view link
Giriş yap veya üye ol.
automatically.To enable development mode, add the following lines to your config.php file:
CSS:
$config['development']['enabled'] = true;
$config['development']['defaultAddOn'] = 'SomeCompany/MyAddOn';
The defaultAddOn value is optional, but adding that will automatically populate the specified add-on in the XF Admin CP when creating new content which will be associated to an add-on.
In addition to the above, you may find it necessary to add some additional configuration, especially if you are using more than one XF installation.
CSS:
$config['enableMail'] = false;
This will disable all mail from being sent from your board. This is especially important if you are using a copy of live data with real users and real email addresses (though we would advise against this!).
As an alternative to disabling mail directly, you may want to consider using a service such as
You do not have permission to view link
Giriş yap veya üye ol.
. This provides you with a free mailbox that will receive all emails sent from your board, which is very useful for testing any emails your new add-on may be sending.
CSS:
$config['cookie']['prefix'] = 'anything_';
If you're using two or more XF installs on the same domain, you may experience issues with cookies being overwritten, which is caused by the installations sharing the same cookie prefix. It's therefore recommended to ensure you change the cookie prefix for each XF install you have set up. Without doing that, you will experience issues, for example, getting logged out of one XF install when logging into another.
Preventing frequent logout for users with a dynamic IP
XenForo sessions are usually bound to your IP address. If your IP address is dynamic or you are using a VPN, proxy or load balancer, you may get loggout frequently. You can prevent this by adding the following to your src/config.php file:
CSS:
$c->extend('session', function(\XF\Session\Session $session)
{
$session->setConfig([
'ipv4CidrMatch' => 0,
'ipv6CidrMatch' => 0
]);
return $session;
});
You do not have permission to view link
Giriş yap veya üye ol.
Son düzenleme:
