• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中setup函数的典型用法代码示例。如果您正苦于以下问题:PHP setup函数的具体用法?PHP setup怎么用?PHP setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: main

function main()
{
    if ($_SERVER['argc'] <= 1 || false === is_dir($_SERVER['argv'][1])) {
        echo usage();
        exit(-1);
    } else {
        setup();
        init($_SERVER['argv'][1]);
    }
}
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:10,代码来源:runner.php


示例2: test_setup

 /** 
  * Test load method.
  */
 public function test_setup()
 {
     // Setup
     \WP_Mock::expectActionAdded('init', 'TenUp\\WP_Documentor_Tools\\Core\\i18n');
     \WP_Mock::expectActionAdded('init', 'TenUp\\WP_Documentor_Tools\\Core\\init');
     \WP_Mock::expectAction('wpd_tools_loaded');
     // Act
     setup();
     // Verify
     $this->assertConditionsMet();
 }
开发者ID:lkwdwrd,项目名称:wp-doc-tools,代码行数:14,代码来源:Core_Tests.php


示例3: test_setup

 /**
  * Test setup method.
  */
 public function test_setup()
 {
     // Setup
     \WP_Mock::expectActionAdded('after_setup_theme', 'TenUp\\WP_Documenter\\Core\\i18n');
     \WP_Mock::expectActionAdded('wp_head', 'TenUp\\WP_Documenter\\Core\\header_meta');
     \WP_Mock::expectActionAdded('wp_enqueue_scripts', 'TenUp\\WP_Documenter\\Core\\scripts');
     \WP_Mock::expectActionAdded('wp_enqueue_scripts', 'TenUp\\WP_Documenter\\Core\\styles');
     // Act
     setup();
     // Verify
     $this->assertConditionsMet();
 }
开发者ID:lkwdwrd,项目名称:wp-doc-highlighter,代码行数:15,代码来源:Core_Tests.php


示例4: melbourneit_register

function melbourneit_register($account, $domain)
{
    require_once $path . "melbourneit.setup.php";
    // GET THE DOMAIN DETAILS
    $subject = "New Melbourneit Domain Registration ({$domain_name})";
    // Determine the correct tld and get the email body...
    $mbit = new MELBOURNEIT_MAIL();
    $tld = strtolower(determine_domain_tld($domain_name));
    // co.uk
    if ($tld == "co.uk") {
        $email = $mbit->mail_co_uk($account, $domain);
        if (MELBOURNIT_MODE == "TEST") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "LIVE") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "OTHER") {
            define('EMAIL_TO', MELBOURNIT_OTHER);
        } else {
            define('EMAIL_TO', setup("email"));
        }
    } elseif ($tld == "com" || $tld == "net" || $tld == "org") {
        $email = $mbit->mail_c_n_o($account, $domain);
        if (MELBOURNIT_MODE == "TEST") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "LIVE") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "OTHER") {
            define('EMAIL_TO', MELBOURNIT_OTHER);
        } else {
            define('EMAIL_TO', setup("email"));
        }
    } elseif ($tld == "info" || $tld == "biz") {
        $email = $mbit->mail_info_biz($account, $domain);
        if (MELBOURNIT_MODE == "TEST") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "LIVE") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "OTHER") {
            define('EMAIL_TO', MELBOURNIT_OTHER);
        } else {
            define('EMAIL_TO', setup("email"));
        }
    } elseif ($tld == "name") {
        $email = $mbit->mail_name($account, $domain);
        if (MELBOURNIT_MODE == "TEST") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "LIVE") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "OTHER") {
            define('EMAIL_TO', MELBOURNIT_OTHER);
        } else {
            define('EMAIL_TO', setup("email"));
        }
    } elseif ($tld == "us") {
        $email = $mbit->mail_us($account, $domain);
        if (MELBOURNIT_MODE == "TEST") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "LIVE") {
            define('EMAIL_TO', '[email protected]');
        } elseif (MELBOURNIT_MODE == "OTHER") {
            define('EMAIL_TO', MELBOURNIT_OTHER);
        } else {
            define('EMAIL_TO', setup("email"));
        }
    } else {
        if ($DEBUG) {
            echo "<BR>The melbourneit registrar module does not support '{$tld}' type domains!<BR>";
        }
        return FALSE;
    }
    // Now, send the mail..
    mail(EMAIL_TO, $subject, $email, $headers);
    // Display debug info
    if ($DEBUG) {
        echo "<pre> {$email} </pre>";
    }
    return TRUE;
}
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:78,代码来源:MELBOURNEIT.php


示例5: main

function main()
{
    global $stage;
    setup();
    if ($stage == 2) {
        boot_vm();
    }
}
开发者ID:suzizi,项目名称:xvp,代码行数:8,代码来源:booton.php


示例6: throw_the_bum_out

        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
    }
    if ($_POST["sessions"] == 0) {
        delete_log($db, $state);
    } else {
        update_log($db, $state);
    }
    return true;
}
//Main State Gate: (the while (1==1) allows a loop back through the switch using a 'break 1')
while (1 == 1) {
    switch ($_STATE->status) {
        case STATE::INIT:
            $_STATE->title_singular = $_SESSION["_EXTENSION"]["title_singular"];
            $_STATE->title_plural = $_SESSION["_EXTENSION"]["title_plural"];
            setup($_DB, $_STATE);
            //	$_STATE->msgGreet = "Enter the ".$_STATE->title_singular." data";
            $_STATE->msgGreet = "Add or change info: click on the lefthand column";
            $_STATE->EC_status = "";
            //no line selected
            STATE_new_status($_STATE, FILL_CELLS);
            break 2;
        case FILL_CELLS:
            //fill cells (if edit, starts with Sessions)
            if (isset($_GET["getdesc"])) {
                //asking for the description of a cell
                cell_desc($_DB, $_STATE);
                break 2;
            }
            if (isset($_GET["reset"])) {
                log_list($_DB, $_STATE);
开发者ID:bbogin,项目名称:sr2s,代码行数:31,代码来源:event_count+(another+copy).php


示例7: main

function main()
{
    global $stage;
    setup();
    if ($stage == 2) {
        resume_vm();
    }
}
开发者ID:suzizi,项目名称:xvp,代码行数:8,代码来源:resumeon.php


示例8: function

// $view = $app->view();
$app->configureMode('development', function () use($app, $config) {
    $app->config(array('debug' => true));
    $connection_name = 'testing';
    include '../app/app.php';
});
$app->configureMode('production', function () use($app, $config) {
    $app->config(array('debug' => false));
    $connection_name = 'default';
    include '../app/app.php';
});
$app->get('/', function () use($app, $config) {
    if ($config['maintenance']) {
        $app->render('home/maintenance.php', array());
    } else {
        $app->render('home/index.php', array());
    }
});
$app->get('/setup', function () use($app, $config) {
    include '../app/functions.setup.php';
    setup($config);
});
$app->notFound(function () use($app) {
    $app->render('404.html');
});
$app->error(function (\Exception $e) use($app) {
    $app->log->error($e->getFile() . ' on ' . $e->getLine() . ' ' . ' because : ' . $e->getMessage());
    $app->response->headers->set('Content-Type', 'text/html');
    $app->render('500.html');
});
$app->run();
开发者ID:BitPrepared,项目名称:OnlineOnsiteOngoing,代码行数:31,代码来源:index.php


示例9: report

if (!defined('EXTENDED') || EXTENDED !== 0 && EXTENDED !== 1) {
    report('EXTENDED should be defined to 0 or 1', true);
}
if (!defined('MODE') || MODE != 'SPLIT' && MODE != 'AGGREGATE') {
    report('MODE should be \'SPLIT\' or \'AGGREGATE\'', true);
    exit(1);
}
if (!defined('AC') || AC !== 0 && AC !== 1) {
    report('AC should be defined to 0 or 1', true);
    exit(1);
}
if (MODE == 'SPLIT' && count($systemid) != IDCOUNT) {
    report('In SPLIT mode, define IDCOUNT systemid mappings', true);
    exit(1);
}
$socket = setup();
loop($socket);
socket_close($socket);
/*
 * class for connection maintenance
 */
class Connection
{
    public $socket;
    public $buf = '';
    public $lastkeepalive = 0;
    public $last_read;
    public function __construct($socket)
    {
        $this->socket = $socket;
        $this->last_read = time();
开发者ID:rc126627,项目名称:Profielwerkstuk-Enecsys,代码行数:31,代码来源:e2pv.php


示例10: session_start

<?php

session_start();
require_once __DIR__ . '/../functions/gamefunctions.php';
setup($_SESSION["user_id"], $_POST["city"]);
开发者ID:Kaarel94,项目名称:Veebirakenduste-loomine,代码行数:5,代码来源:firstLogin.php


示例11: setup

<?php

require_once 'subtask/connect.inc.php';
require_once 'subtask/readymade_functions.inc.php';
function setup($field)
{
    if (isset($_REQUEST[$field]) && !empty($_REQUEST[$field])) {
        return true;
    } else {
        return false;
    }
}
if (setup('zeit_event')) {
    $event = mysqli_real_escape_string($connect, htmlentities($_REQUEST['zeit_event']));
    if ($_SESSION['id'] == NULL) {
        //user is trying to fraud with the system
        echo json_encode(array('status' => 'false', 'error' => 'Attacked'));
        return;
    }
    //checking if id already exists in events table
    $myquery = sprintf("SELECT id,%s FROM %s WHERE id='%s'", $event, $table_event, $_SESSION['id']);
    if ($resQuery = mysqli_query($connect, $myquery)) {
        // echo 'Query2</ br>';
        mysqli_data_seek($resQuery, 0);
        if ($myValue = mysqli_fetch_row($resQuery)) {
            echo json_encode(array('status' => 'true', 'reg' => $myValue[1]));
            return;
        } else {
            //Id doesnt exist
            echo json_encode(array('status' => 'false', 'error' => 'Login First'));
            return;
开发者ID:deCodeIt,项目名称:soclog,代码行数:31,代码来源:event_status.php


示例12: json_encode

                 echo json_encode($det_array);
                 // echo json_encode(array('status'=>'false','error'=>'S Query Error'));
                 // return;
             }
         } else {
             // echo 'A8';
             echo json_encode(array('status' => 'false', 'error' => 'no such event exists'));
             return;
         }
     } else {
         // echo 'A9';
         echo json_encode(array('status' => 'false', 'error' => 'Query Failure'));
         return;
     }
 } else {
     if (setup('team-member')) {
         //getting the event details for submission
         $min = 0;
         $max = 0;
         $event = mysqli_real_escape_string($connect, htmlentities($_REQUEST['zeit_event']));
         $myquery = sprintf("SELECT team_size_min,team_size_max FROM %s WHERE event='%s'", $table_event_detail, $event);
         // echo 'A10';
         if ($resQuery = mysqli_query($connect, $myquery)) {
             // echo 'Query2</ br>';
             // echo 'A11';
             mysqli_data_seek($resQuery, 0);
             if ($myValue = mysqli_fetch_row($resQuery)) {
                 // echo 'A12';
                 //setting up min and max team members limit
                 $min = $myValue[0];
                 $max = $myValue[1];
开发者ID:deCodeIt,项目名称:soclog,代码行数:31,代码来源:event_reg_team.php


示例13: get_filter_data

        }
    }
}
function get_filter_data($expected, $redis)
{
    if (USE_IGBINARY) {
        foreach ($expected as $sm => $countries) {
            $result = igbinary_unserialize($redis->get($sm));
        }
    } else {
        foreach ($expected as $sm => $countries) {
            $result = json_decode($redis->get($sm), true);
        }
    }
}
$redis = setup();
//$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
//$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
$filename = 'data-' . SM_COUNT . '-' . COUNTRY_COUNT . '.json';
on_the_fly($redis);
exit;
if (GEN_DATA_ON_FLY) {
    $data = generate_data();
    $json_str = json_encode($data);
    file_put_contents($filename, $json_str);
} else {
    $json_str = file_get_contents($filename);
    $data = json_decode($json_str, true);
}
$start_write_time = microtime(true);
开发者ID:kcyeu,项目名称:RedOp,代码行数:31,代码来源:poc.php


示例14: htmlspecialchars

// redirect
if (isset($_GET["url"])) {
    $cloak = new \Anax\Cloak\CCloak($app->form, $app->pdo);
    $url = htmlspecialchars($_GET["url"]);
    $results = $cloak->goToUrl($url);
}
// add routes
$app->router->add('', function () use($app) {
    $title = 'Skapa redirect';
    // Create the CCloak service
    $cloak = new \Anax\Cloak\CCloak($app->form, $app->pdo);
    // Setup if not already done
    $status = $cloak->isSetup();
    if ($status = false) {
        $cloak->setup();
    }
    // check if set url
    if (!isset($_GET["url"])) {
        $linkContent = $cloak->addCloakedLink();
        $content = $linkContent['form'];
        $content .= $linkContent['text'];
        $content .= '<a href="redirect.php/setup">Setup plugin</a>';
        $app->views->add('default/page', ['content' => $content, 'title' => $title]);
    }
});
$app->router->add('setup', function () use($app) {
    $cloak = new \Anax\Cloak\CCloak($app->form, $app->pdo);
    $cloak - setup();
});
$app->router->handle();
$app->theme->render();
开发者ID:alcr33k,项目名称:ccloak,代码行数:31,代码来源:redirect.php


示例15: assert_equals

            assert_equals("/your regex/", $smoothie->filter);
        });
        should("accept --filter", function () {
            $smoothie = new Smoothie(array("--filter", "your regex"));
            assert_equals("/your regex/", $smoothie->filter);
        });
        should("add slashes if missing", function () {
            $smoothie = new Smoothie(array("-n", "your regex"));
            assert_equals("/your regex/", $smoothie->filter);
        });
        should("not add slahes if already there", function () {
            $smoothie = new Smoothie(array("-n", "/your regex/"));
            assert_equals("/your regex/", $smoothie->filter);
        });
        should("return true if no filter was set", function () {
            $smoothie = new Smoothie();
            assert_true($smoothie->passes_filter("my awesome test"));
        });
        context("tests with passes_filter()", function () {
            setup(function () {
                transient()->smoothie = new Smoothie(array("-n", "/my awesome test/"));
            });
            should("return true if filter was set and passes", function () {
                assert_true(transient()->smoothie->passes_filter("this is my awesome test that is awesome"));
            });
            should("return false if filter was set and does not pass", function () {
                assert_false(transient()->smoothie->passes_filter("blah"));
            });
        });
    });
});
开发者ID:kla,项目名称:smoothie,代码行数:31,代码来源:SmoothieTest.php


示例16: resend

    $result = $client->documents->upload($name, $options);
    return $result->document->key;
}
/**
 * Resend a document
 */
function resend($key)
{
    global $client;
    $email = "[email protected]";
    $message = "Rapotchus";
    return $client->documents->resend($key, $email, $message);
}
/**
 * Cancel a document
 */
function cancel($key)
{
    global $client;
    return $client->documents->cancel($key);
}
$client = setup();
all();
$key = "sample_uuid";
find($key);
try {
    cancel($key);
} catch (Clicksign\ClicksignException $e) {
    var_dump($e);
}
find($key);
开发者ID:fabioperrella,项目名称:clicksign-php,代码行数:31,代码来源:sample2.php


示例17: exit

<?php

require_once 'libs/lib.php';
//global used fonctions
@(include 'config.php');
//configuration file generated by install.php
if (!defined('CONFIG')) {
    exit(setup());
}
clean_token();
//Destroy tokens for more security
clean_add_token();
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<link rel="stylesheet" type="text/css" href="design/default.css" media="screen,projection" />
	<link rel="alternate" type="application/rss+xml" title="<?php 
echo $config['team'];
?>
 Releases RSS Feed" href="rss.xml" />
	<link rel="shortcut icon" href="design/favicon.ico" />
	<title><?php 
echo $config['team'];
?>
 Release Portal</title>
</head>
<body>
	<div id="contentwrapper">
开发者ID:NecroApps,项目名称:Xylitol.Release.System.Final.v1.0.6.Tool-RED,代码行数:31,代码来源:index.php


示例18: context

 context("nested in a context", function () {
     setup(function () {
         transient()->setup2 = true;
     });
     teardown(function () {
         $GLOBALS['I_RAN_TEARDOWN'] = true;
     });
     should("have called its parent setup", function () {
         assert_equals(true, transient()->setup1);
     });
     should("have called its own setup", function () {
         assert_equals(true, transient()->setup2);
     });
     context("nested in a context", function () {
         setup(function () {
             transient()->setup3 = true;
         });
         should("have called all three setups", function () {
             assert_equals(true, transient()->setup1);
             assert_equals(true, transient()->setup2);
             assert_equals(true, transient()->setup3);
         });
         should("have the proper test description", function () {
             assert_equals("a context nested in a context nested in a context should have the proper test description", Smoothie::instance()->test_description());
         });
     });
 });
 should("have ran teardown", function () {
     assert_true($GLOBALS['I_RAN_TEARDOWN']);
 });
 context("with no setup", function () {
开发者ID:kla,项目名称:smoothie,代码行数:31,代码来源:ContextTest.php


示例19: suite

<?php

namespace Preview\DSL\Qunit;

require_once 'stack.php';
require_once __DIR__ . '/../ok.php';
suite("Stack");
setup(function () {
    $this->stack = new \Stack(array(1, 2, 3));
});
test("#size returns the size of stack", function () {
    ok($this->stack->size() == 3);
});
test("#peek eturns the last element", function () {
    ok($this->stack->peek() == 3);
});
test("#push pushes an element to stack", function () {
    $this->stack->push(4);
    ok($this->stack->peek() == 4);
    ok($this->stack->size() == 4);
});
test("#pop pops out the last element", function () {
    ok($this->stack->pop() == 3);
    ok($this->stack->size() == 2);
});
开发者ID:v2e4lisp,项目名称:preview,代码行数:25,代码来源:qunit_spec.php


示例20: setup

 /**
  * Sets up the TinyQueries environment
  *
  */
 public function setup()
 {
     $setupFile = dirname(__FILE__) . '/../config/setup.php';
     // Don't throw error, but just return informative message
     if (!file_exists($setupFile)) {
         return array('message' => 'Nothing to do - No setup script found');
     }
     include $setupFile;
     if (!function_exists('TinyQueries\\setup')) {
         throw new \Exception('There is no function \'TinyQueries\\setup\' defined in setup.php');
     }
     $result = setup();
     if (Arrays::isAssoc($result)) {
         return $result;
     }
     return array('message' => 'TinyQueries setup complete');
 }
开发者ID:wdiesveld,项目名称:tiny-queries-php-api,代码行数:21,代码来源:TinyQueries.php



注:本文中的setup函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setupConfigVariables函数代码示例发布时间:2022-05-15
下一篇:
PHP setunits函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap