本文整理汇总了PHP中Preference::fix_preferences方法的典型用法代码示例。如果您正苦于以下问题:PHP Preference::fix_preferences方法的具体用法?PHP Preference::fix_preferences怎么用?PHP Preference::fix_preferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preference
的用法示例。
在下文中一共展示了Preference::fix_preferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$results['cookie_secure'] = $results['session_cookiesecure'];
// Library and module includes we can't do with the autoloader
require_once $prefix . '/modules/getid3/getid3.php';
require_once $prefix . '/modules/phpmailer/class.phpmailer.php';
require_once $prefix . '/modules/phpmailer/class.smtp.php';
require_once $prefix . '/modules/infotools/AmazonSearchEngine.class.php';
require_once $prefix . '/modules/infotools/lastfm.class.php';
require_once $prefix . '/modules/musicbrainz/MusicBrainz.php';
require_once $prefix . '/modules/musicbrainz/Exception.php';
require_once $prefix . '/modules/musicbrainz/Clients/MbClient.php';
require_once $prefix . '/modules/musicbrainz/Clients/RequestsMbClient.php';
require_once $prefix . '/modules/ampacheapi/AmpacheApi.lib.php';
require_once $prefix . '/modules/EchoNest/Autoloader.php';
EchoNest_Autoloader::register();
/* Temp Fixes */
$results = Preference::fix_preferences($results);
AmpConfig::set_by_array($results, true);
// Modules (These are conditionally included depending upon config values)
if (AmpConfig::get('ratings')) {
require_once $prefix . '/lib/rating.lib.php';
}
/* Set a new Error Handler */
$old_error_handler = set_error_handler('ampache_error_handler');
/* Check their PHP Vars to make sure we're cool here */
$post_size = @ini_get('post_max_size');
if (substr($post_size, strlen($post_size) - 1, strlen($post_size)) != 'M') {
/* Sane value time */
ini_set('post_max_size', '8M');
}
// In case the local setting is 0
ini_set('session.gc_probability', '5');