本文整理汇总了PHP中GFForms::setup方法的典型用法代码示例。如果您正苦于以下问题:PHP GFForms::setup方法的具体用法?PHP GFForms::setup怎么用?PHP GFForms::setup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFForms
的用法示例。
在下文中一共展示了GFForms::setup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _manually_load_plugin
function _manually_load_plugin()
{
require dirname(__FILE__) . '/../../gravityforms/gravityforms.php';
GFForms::setup(true);
require dirname(__FILE__) . '/../../gravityformssurvey/survey.php';
require dirname(__FILE__) . '/../../gravityformsquiz/quiz.php';
require dirname(__FILE__) . '/../../gravityformspolls/polls.php';
require dirname(__FILE__) . '/../pdf.php';
}
示例2: load
/**
* Load GravityView
*
* @since 1.9
*/
public function load()
{
require_once $this->plugin_dir . '/tmp/gravityforms/gravityforms.php';
$this->load_rest_api();
require_once $this->plugin_dir . '/gravityview.php';
/* Remove temporary tables which causes problems with GF */
remove_all_filters('query', 10);
// set up Gravity Forms database
@GFForms::setup(true);
$this->create_stubs();
}
示例3: setUp
public function setUp()
{
/*
* Replace set up with cut down version
* so we don't use 'temporary' tables in MySQL
*/
$this->cut_down_setup();
/* initialise GF tables */
GFForms::setup(true);
/* Load our plugin functions */
GFPDF_InstallUpdater::check_filesystem_api();
GFPDF_InstallUpdater::maybe_deploy();
/* create GF data */
$this->create_form_and_entries();
$this->setupConfiguration();
}
示例4: setUp
public function setUp()
{
/*
* For some reasons this wasn't automatically set up so
* we are running it here.
*/
$this->factory = new WP_UnitTest_Factory();
/*
* Replace set up with cut down version
* so we don't use 'temporary' tables in MySQL
*/
$this->cut_down_setup();
/* initialise GF tables */
GFForms::setup(true);
/* Load our plugin functions */
GFPDF_InstallUpdater::check_filesystem_api();
GFPDF_InstallUpdater::maybe_deploy();
/* create GF data */
$this->create_form_and_entries();
}
示例5: setUp
/** Activate the plugin, mock all the things */
public function setUp()
{
parent::setUp();
/* Activate GravityForms */
require_once WP_PLUGIN_DIR . '/gravityforms/gravityforms.php';
require_once WP_PLUGIN_DIR . '/gravityforms/export.php';
/* Something happened in newer versions, and we can't get the lead cache to initialize
properly, we need to do this manually */
global $_gform_lead_meta;
if ($_gform_lead_meta === null) {
$_gform_lead_meta = array();
}
GFForms::setup();
GFCache::flush();
/* Import some ready-made forms */
$this->assertEquals(GFExport::import_file(dirname(__FILE__) . '/forms.xml'), 2);
/* Add a faster turnaround schedule */
add_filter('cron_schedules', function ($s) {
$s['minute'] = array('interval' => 60, 'display' => 'Minutely');
return $s;
});
/* Get an instance of our plugin */
$this->digest = new GFDigestNotifications();
}
示例6: dirname
return $all_caps;
}
if (!class_exists('RGForms')) {
require GRAVITYFORMS_BASE_PATH . 'gravityforms.php';
}
//require ABSPATH . 'wp-content/plugins/gravityflow/gravityflow.php';
require dirname(__FILE__) . '/testcase.php';
require dirname(__FILE__) . '/gravityforms-testcase.php';
require dirname(__FILE__) . '/testcase-xmlrpc.php';
require dirname(__FILE__) . '/testcase-ajax.php';
require dirname(__FILE__) . '/exceptions.php';
require dirname(__FILE__) . '/utils.php';
// Update array with plugins to include ...
$plugins_to_active = array('gravityforms/gravityforms.php', 'gravityflow/gravityflow.php');
update_option('active_plugins', $plugins_to_active);
GFForms::setup(true);
GFForms::loaded();
gravity_flow()->setup();
/**
* A child class of the PHP test runner.
*
* Not actually used as a runner. Rather, used to access the protected
* longOptions property, to parse the arguments passed to the script.
*
* If it is determined that phpunit was called with a --group that corresponds
* to an @ticket annotation (such as `phpunit --group 12345` for bugs marked
* as #WP12345), then it is assumed that known bugs should not be skipped.
*
* If WP_TESTS_FORCE_KNOWN_BUGS is already set in wp-tests-config.php, then
* how you call phpunit has no effect.
*/
示例7: ensure_tables_exist
public static function ensure_tables_exist()
{
global $wpdb;
$form_table_name = self::get_form_table_name();
$form_count = $wpdb->get_var("SELECT count(0) FROM {$form_table_name}");
if ($wpdb->last_error) {
GFForms::setup(true);
}
}