本文整理汇总了PHP中export函数的典型用法代码示例。如果您正苦于以下问题:PHP export函数的具体用法?PHP export怎么用?PHP export使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了export函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_ou_http
function export_ou_http($ou, $session)
{
$sock = new sockets();
$ldap = new clladp();
$path = "/root";
echo "Exporting meta informations session {$session} for ou=`{$ou}`\n";
export($ou, $path);
$sock = new sockets();
$ini = new Bs_IniHandler();
echo "Reading session {$session} for ou=`{$ou}`\n";
if ($ou == null) {
echo "Failed, no such ou set....\n";
die;
}
$ini->loadString($sock->GET_INFO($session));
$filepath = "{$path}/{$ou}.gz";
if (!is_file($filepath)) {
echo "{$filepath} no such file";
}
echo "Uploading to https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}\n";
$uri = "https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}/cyrus.murder.listener.php";
$command = "?export-ou=yes&admin={$ini->_params["CONF"]["username"]}&pass={$ini->_params["CONF"]["password"]}&original-suffix={$ldap->suffix}";
//lic.users.import.php
$http = new httpget();
$http->uploads["EXPORT-OU"] = "{$filepath}";
$body = $http->send("https://{$ini->_params["CONF"]["servername"]}:{$ini->_params["CONF"]["port"]}/cyrus.murder.listener.php", "post", array("AUTH" => base64_encode(serialize($ini->_params["CONF"])), "ORG" => $ou));
@unlink($filepath);
echo $body;
}
示例2: ping_home
/**
* Run once and only once.
*
* @param ElggSite $site The site who's information to use
*/
function ping_home(ElggSite $site)
{
global $NOTIFICATION_SERVER, $CONFIG;
// Get version information
$version = get_version();
$release = get_version(true);
// Get export
$export = export($site->guid);
return send_api_post_call($NOTIFICATION_SERVER, array('method' => 'elgg.system.ping', 'url' => $site->url, 'version' => $version, 'release' => $release), array(), $export, 'text/xml');
}
示例3: px_display_export
function px_display_export()
{
?>
<div class="wrap">
<h2 class=""><?php
_e('Export', 'px_gcm');
?>
</h2>
<div id="poststuff">
<?php
if (isset($_POST['ok'])) {
$li = export();
?>
<div id="message" class="updated">
<p><strong><?php
_e('GCM export finished', 'px_gcm');
?>
</strong></p>
<p><?php
printf(__('%1$s click here %2$s to download', 'px_gcm'), '<a href=' . $li . ' download>', '</a>');
?>
</p>
</div>
<?php
}
?>
<div id="post-body" class="metabox-holder columns-1">
<!-- Inhalt beginnt hier -->
<div id="post-body-content">
<div class="postbox">
<div class="inside">
<form method="post" action="#">
<p>
<input type="hidden" name="ok" value="ok">
<?php
_e('Export the whole Database into an excel readable file.', 'px_gcm');
?>
</p>
<p>
<?php
submit_button(__('Export', 'px_gcm'));
?>
</p>
</form>
</div>
</div>
</div>
</div>
<br class="clear">
</div>
</div>
<?php
}
示例4: exportExcel
public function exportExcel()
{
$type = I('get.params');
//首行数据
$firstrow = array("真实姓名", "省", "市", "区", "街道地址", "手机", "提交时间", "生日", "状态", "生日", "邮编");
switch ($type) {
case 'all':
$data = M('weal')->field('realname,province,city,county,address,phone,
createtime,state,birthday,zipcode')->select();
export($data, '微信福利用户表', 'weal', $firstrow);
break;
}
}
示例5: plug_export
function plug_export()
{
$ret .= '<a href="?export=_art">_art</a> ';
$ret .= '<a href="?export=_txtt">_txt</a> ';
$ret .= '<a href="?export=_user">_user</a> ';
$ret .= '<a href="?export=_eye">_eye</a> ';
$ret .= '<a href="?export=_idy">_idy</a>';
$ret .= '<br><br>';
//export
if ($_GET['export'] != "" && $_SESSION["auth"] > 5) {
$file = $qd . $_GET['export'];
$ret .= export($host, $user, $pass, $db, $file);
}
return $ret;
}
示例6: testEmailExport
/**
* Check if non-primary mails are being exported properly
* as semi-colon separated values
*
* @dataProvider providerEmailExport
*/
public function testEmailExport($module, $mails)
{
// Add non-primary mails
foreach ($mails as $mail) {
$this->{$module}->emailAddress->addAddress($mail);
}
$this->{$module}->emailAddress->save($this->{$module}->id, $this->{$module}->module_dir);
// Export the record
$content = export($module, $this->{$module}->id, false, false);
// Because we can't guess the order of the exported non-primary emails, check for separator if there are 2 or more
if (count($mails) > 1) {
$this->assertContains(";", $content, "Non-primary mail not exported properly.");
}
// Check if the mails got exported properly
foreach ($mails as $mail) {
$this->assertContains($mail, $content, "Non-primary mail not exported properly: {$mail}.");
}
}
示例7: process
function process($argv)
{
mapidefs();
mapitags();
if (!isset($argv[1]) || !isset($argv[2]) || !isset($argv[3]) || !isset($argv[4])) {
return INVALID_ARGS;
}
// Process parameters.
$username = $argv[2];
$password = $argv[3];
$csv_file = $argv[4];
$store = openMsgStore($username, $password);
if ($argv[1] == "import") {
if (!isset($argv[5]) || $argv[5] != "add" && $argv[5] != "replace") {
return INVALID_ARGS;
}
if (!file_exists($csv_file)) {
print "File {$csv_file} not found.\n";
return 1;
}
$delete_old_items = $argv[5] == "replace";
$categories = isset($argv[6]) ? $argv[6] : "";
print "Importing {$csv_file}...\n";
import($store, $csv_file, $delete_old_items, $categories);
} else {
if ($argv[1] == "export") {
if (isset($argv[5]) && $argv[5] != "overwrite") {
return INVALID_ARGS;
}
$overwrite = isset($argv[5]) && $argv[5] == "overwrite";
if (!$overwrite && file_exists($csv_file)) {
print "File {$csv_file} already existing, you can use the overwrite option.\n";
return 1;
}
print "Exporting to {$csv_file}...\n";
export($store, $csv_file);
} else {
return INVALID_ARGS;
}
}
return 0;
}
示例8: exportExcel
public function exportExcel()
{
$type = I('get.params');
$m = I('get.month');
$y = date("Y");
$startMonth = mktime(0, 0, 0, $m, 1, $y);
$endMonth = getMonthLastDay($y, $m);
//首行数据
$firstrow = array("id", "用户名", "真实姓名", "地区", "学校", "邮箱", "手机号码", "创建时间", "状态", "qq", "学历", "省份", "城市", "区县");
switch ($type) {
case 'all':
if (empty($m)) {
$data = M('user_seeker')->field('id,username,realname,area,school,email,phone,
createtime,state,qq,education,province,city,county')->order('createtime desc')->limit('5000')->select();
export($data, '注册用户数据表', 'user_seeker', $firstrow);
} else {
$data = M('user_seeker')->field('id,username,realname,area,school,email,phone,
createtime,state,qq,education,province,city,county')->order('createtime desc')->where("UNIX_TIMESTAMP(createtime)>={$startMonth} AND UNIX_TIMESTAMP(createtime)<{$endMonth}")->select();
export($data, $m . '月份注册用户数据表', 'user_seeker', $firstrow);
}
break;
case 'check':
if (empty($m)) {
$data = M('user_seeker')->field('id,username,realname,area,school,email,phone,
createtime,state,qq,education,province,city,county')->order('createtime desc')->where('state=1')->limit('5000')->select();
export($data, '认证用户表数据', 'user_seeker', $firstrow);
} else {
$data = M('user_seeker')->field('id,username,realname,area,school,email,phone,
createtime,state,qq,education,province,city,county')->where("UNIX_TIMESTAMP(createtime)>={$startMonth} AND UNIX_TIMESTAMP(createtime)<{$endMonth} AND state=1")->select();
export($data, $m . '月份认证用户表数据', 'user_seeker', $firstrow);
}
break;
case 'company':
$firstrow = array('id', '用户名', '公司名', '地址', '营业执照号码', '公司邮箱', '电话', '联系人', '联系人手机号', '公司类型', '注册时间');
$data = M('user_company')->field('id,username,companyname,address,buslicense,
companyemail,phone,contacter,contacterphone,companytype,createtime')->select();
export($data, '萝卜兼职企业表数据', 'user_company', $firstrow);
break;
}
}
示例9: userinput
function userinput()
{
global $handle, $user;
$option = 1;
echo "Succesfully logged in.\n";
echo "Enter h for help.\n";
while ($option != "q\n") {
echo "Enter an option: ";
$option = fgets($handle);
if ($option == "a\n") {
newsite();
}
if ($option == "h\n") {
help();
}
if ($option == "l\n") {
listsite();
}
if ($option == "o\n") {
openurl();
}
if ($option == "d\n") {
deleteurl();
}
if ($option == "r\n") {
replaceurl();
}
if ($option == "s\n") {
search();
}
if ($option == "e\n") {
export();
}
if ($option == "i\n") {
import();
}
}
}
示例10: error
$message = 'File upload error (' . $err . ')';
}
} else {
$titlebb = defined('IMPORT_SINGLE') && !IMPORT_SINGLE ? array($title, $bbcode) : array('', '');
$titlebb = import($_FILES['file']['tmp_name'], $titlebb);
$title = $titlebb[0];
$bbcode = $titlebb[1];
if ($api) {
return_json(array('title' => $title, 'bbcode' => $bbcode));
}
}
}
if (isset($_REQUEST['format']) && preg_match('/^[a-z]+$/', $_REQUEST['format'])) {
$format = $_REQUEST['format'];
header('Access-Control-Allow-Origin: *');
$result = export($format, $title, $bbcode, isset($scodeid) ? $scodeid : '', !isset($_REQUEST['direct']));
if ($result == CONVERT_OK) {
exit;
}
if ($result == CONVERT_NOT_SUPPORTED) {
if ($action == 'export') {
$message = 'Unknown or unimplemented export type: ' . $format;
} else {
header('HTTP/1.1 415 Format Not Suppoprted');
exit;
}
} elseif ($result == CONVERT_EMPTY) {
if ($action == 'export') {
$message = 'Output file is empty';
} else {
header('HTTP/1.1 400 No Data In BBCode');
示例11: exec
$cmd = 'rm -rf /opt/unetlab/tmp/*/' . $lab->getId() . '/' . $node_id . '/';
} else {
// Removing all temporary files in all tenants
$cmd = 'rm -rf /opt/unetlab/tmp/*/' . $lab->getId() . '/';
}
exec($cmd, $o, $rc);
break;
case 'export':
// Exporting node(s) running-config
if (isset($node_id)) {
// Node ID is set, export a single node
export($node_id, $lab->getNodes()[$node_id], $lab);
} else {
// Node ID is not set, export all nodes
foreach ($lab->getNodes() as $node_id => $node) {
export($node_id, $node, $lab);
}
}
break;
case 'fixpermissions':
// Default permissions for directories
$cmd = '/usr/bin/find /opt/unetlab -type d -exec chown root:root {} \\; > /dev/null 2>&1';
exec($cmd, $o, $rc);
$cmd = '/usr/bin/find /opt/unetlab -type d -exec chmod 755 {} \\; > /dev/null 2>&1';
exec($cmd, $o, $rc);
// Default permissions for files
$cmd = '/usr/bin/find /opt/unetlab -type f -exec chown root:root {} \\; > /dev/null 2>&1';
exec($cmd, $o, $rc);
$cmd = '/usr/bin/find /opt/unetlab -type f -exec chmod 644 {} \\; > /dev/null 2>&1';
exec($cmd, $o, $rc);
// /opt/unetlab/scripts
示例12: exportTAR
public static function exportTAR(Blueprint $blueprint, $where = NULL, array $filters = NULL)
{
return export($blueprint, "tar", $where, $filters);
}
示例13: array
<?php
/*
* Basic usage
*/
namespace Preview\DSL\Export;
require_once __DIR__ . '/../ok.php';
$suite1 = array("create a test case" => function () {
ok(true);
}, "create a another test case" => function () {
ok(true);
});
$suite2 = array("create a test case" => function () {
ok(true);
}, "create a another test case" => function () {
ok(true);
}, "nested test suite" => array("test case passed" => function () {
ok(true);
}, "test case failed" => function () {
ok(false);
}));
export("test suite", $suite1);
export($suite2);
// load suite without description.
示例14: exportBase
/**
*
*Exporte la structure de la base de donnees courante à la racine
*avec pour nom le nom de la base de données.
*
*/
function exportBase()
{
export("S", NULL, nomBase() . ".sql");
}
示例15: require_lib
# get settings
require "settings.php";
require "core-settings.php";
require "salwages/emp-functions.php";
require_lib("time");
## Decide
if (isset($_REQUEST["key"])) {
switch (strtolower($_REQUEST["key"])) {
case "emp":
$OUTPUT = slctEmployee();
break;
case "slip":
$OUTPUT = slip($_REQUEST);
break;
case "export to spreadsheet":
$OUTPUT = export($_REQUEST);
break;
default:
$OUTPUT = slctDate();
}
} else {
$OUTPUT = slctDate();
}
# display output
require "template.php";
function slctEmployee()
{
db_connect();
#check what we have permission to
$get_perm = "SELECT payroll_groups FROM users WHERE username = '{$_SESSION['USER_NAME']}' LIMIT 1";
$run_perm = db_exec($get_perm) or errDie("Unable to get payroll groups permission information.");