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; }
/** * 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'); }
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 }
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; } }
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; }
/** * 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}."); } }
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; }
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; } }
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(); } } }
$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');
$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
public static function exportTAR(Blueprint $blueprint, $where = NULL, array $filters = NULL) { return export($blueprint, "tar", $where, $filters); }
<?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.
/** * *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"); }
# 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 = '******'USER_NAME']}' LIMIT 1"; $run_perm = db_exec($get_perm) or errDie("Unable to get payroll groups permission information.");
/** * calls export method to build up a delimited string and some sample instructional text on how to use this file * @param string type the bean-type to export * @return string delimited string for export with some tutorial text */ function exportSample($type) { global $app_strings; //first grab the $_REQUEST['all'] = true; //retrieve the export content $content = export($type, null, false, true); //add details on removing the sample data return $content . $app_strings['LBL_IMPORT_SAMPLE_FILE_TEXT']; }
function export_pre_ftp_upload($stExportDir) { global $config, $aFtpExport; /* export variable as global */ $config["config_options_array"]["path_html_export"] = $stExportDir; /* clean-up after last cacti instance */ if (is_dir($stExportDir)) { del_directory($stExportDir, FALSE); } else { @mkdir($stExportDir); } /* go export */ $total_graphs_created = export(); /* force reaing of the variable from the database */ unset($config["config_options_array"]["path_html_export"]); $aFtpExport['server'] = read_config_option('export_ftp_host'); if (empty($aFtpExport['server'])) { export_fatal("FTP Hostname is not expected to be blank!"); } $aFtpExport['remotedir'] = read_config_option('path_html_export'); if (empty($aFtpExport['remotedir'])) { export_fatal("FTP Remote export path is not expected to be blank!"); } $aFtpExport['port'] = read_config_option('export_ftp_port'); $aFtpExport['port'] = empty($aFtpExport['port']) ? '21' : $aFtpExport['port']; $aFtpExport['username'] = read_config_option('export_ftp_user'); $aFtpExport['password'] = read_config_option('export_ftp_password'); if (empty($aFtpExport['username'])) { $aFtpExport['username'] = '******'; $aFtpExport['password'] = ''; export_log("Using Anonymous transfer method."); } if (read_config_option('export_ftp_passive') == 'on') { $aFtpExport['passive'] = TRUE; export_log("Using passive transfer method."); } else { $aFtpExport['passive'] = FALSE; export_log("Using active transfer method."); } return $total_graphs_created; }
/** Output each row information */ echo $line; } $log->debug("Exiting export method ..."); return true; } /** Send the output header and invoke function for contents output */ $moduleName = $_REQUEST['module']; $moduleName = getTranslatedString($moduleName, $moduleName); $moduleName = str_replace(" ", "_", $moduleName); header("Content-Disposition:attachment;filename={$moduleName}.csv"); header("Content-Type:text/csv;charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: post-check=0, pre-check=0", false); export(vtlib_purify($_REQUEST['module'])); exit; /** * this class will provide utility functions to process the export data. * this is to make sure that the data is sanitized before sending for export */ class ExportUtils { var $fieldsArr = array(); var $picklistValues = array(); function ExportUtils($module, $fields_array) { self::__init($module, $fields_array); } function __init($module, $fields_array) {
function export_pre_ftp_upload($stExportDir) { global $aFtpExport; /* export variable as global */ $_SESSION["sess_config_array"]["path_html_export"] = $stExportDir; /* clean-up after last cacti instance */ if (is_dir($stExportDir)) { if ($dh = opendir($stExportDir)) { while (($file = readdir($dh)) !== false) { $filePath = $stExportDir."/".$file; if ($file != "." && $file != ".." && !is_dir($filePath)) { unlink($filePath); } } closedir($dh); } }else { @mkdir($stExportDir); } /* go export */ $total_graphs_created = export(); /* force reaing of the variable from the database */ unset($_SESSION["sess_config_array"]["path_html_export"]); $aFtpExport['server'] = read_config_option('export_ftp_host'); if (empty($aFtpExport['server'])) { die("EXPORT (fatal): FTP Hostname is not expected to be blank!"); } $aFtpExport['remotedir'] = read_config_option('path_html_export'); if (empty($aFtpExport['remotedir'])) { die("EXPORT (fatal): FTP Remote export path is not expected to be blank!"); } $aFtpExport['port'] = read_config_option('export_ftp_port'); $aFtpExport['port'] = empty($aFtpExport['port']) ? '21' : $aFtpExport['port']; $aFtpExport['username'] = read_config_option('export_ftp_user'); $aFtpExport['password'] = read_config_option('export_ftp_password'); if (empty($aFtpExport['username'])) { $aFtpExport['username'] = '******'; $aFtpExport['password'] = ''; export_log("Using Anonymous transfer method."); } if (read_config_option('export_ftp_passive') == 'on') { $aFtpExport['passive'] = TRUE; export_log("Using passive transfer method."); }else { $aFtpExport['passive'] = FALSE; export_log("Using active transfer method."); } return $total_graphs_created; }
<?php /* * How to use before_each hook */ namespace Preview\DSL\Export; require_once __DIR__ . '/../ok.php'; $suite = array("before each" => function () { $this->usage = "run before each test case."; $this->ref = new \stdClass(); $this->ref->name = "wenjun.yan"; $this->value = "string"; }, "test case have access to vars defined " . "in before each hook" => function () { ok($this->usage); ok($this->ref->name); ok($this->value); $this->ref->name = null; $this->value = null; }, "before hook only run once" => function () { // ref and value are reassigned. ok($this->ref->name); // object is passed by "ref" ok($this->value); // string is passed by value. }); export("[before each]", $suite);
<?php namespace Preview\DSL\Export; require_once 'ok.php'; $suite = ["yay" => function () { ok(false); }]; export("sample", $suite);
* Copyright (c) 2012-2014 Toha <*****@*****.**> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // show errors error_reporting(E_ALL); include 'util.php'; // enable autoloading of classes autoload(); use MwbExporter\Formatter\Doctrine2\Annotation\Formatter; // formatter setup $setup = array(Formatter::CFG_USE_LOGGED_STORAGE => true, Formatter::CFG_INDENTATION => 4, Formatter::CFG_FILENAME => '%entity%.%extension%', Formatter::CFG_ANNOTATION_PREFIX => 'ORM\\', Formatter::CFG_BUNDLE_NAMESPACE => 'MyBundle', Formatter::CFG_ENTITY_NAMESPACE => 'Entity', Formatter::CFG_REPOSITORY_NAMESPACE => '', Formatter::CFG_AUTOMATIC_REPOSITORY => true, Formatter::CFG_SKIP_GETTER_SETTER => false); // lets do it export('doctrine2-annotation', $setup);
* Copyright (c) 2012-2013 Toha <*****@*****.**> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // show errors error_reporting(E_ALL); include 'util.php'; // enable autoloading of classes autoload(); use MwbExporter\Formatter\Doctrine2\Yaml\Formatter; // formatter setup $setup = array(Formatter::CFG_USE_LOGGED_STORAGE => true, Formatter::CFG_INDENTATION => 4, Formatter::CFG_FILENAME => '%entity%.orm.%extension%', Formatter::CFG_BUNDLE_NAMESPACE => '', Formatter::CFG_ENTITY_NAMESPACE => '', Formatter::CFG_REPOSITORY_NAMESPACE => '', Formatter::CFG_EXTEND_TABLENAME_WITH_SCHEMA => false, Formatter::CFG_AUTOMATIC_REPOSITORY => true); // lets do it export('doctrine2-yaml', $setup);
/** * calls export method to build up a delimited string and some sample instructional text on how to use this file * @param string type the bean-type to export * @return string delimited string for export with some tutorial text */ function exportSample($type) { global $app_strings; //first grab the $_REQUEST['all'] = true; //retrieve the export content $content = export($type, null, false, true); // Add a new row and add details on removing the sample data // Our Importer will stop after he gets to the new row, ignoring the text below return $content . "\n" . $app_strings['LBL_IMPORT_SAMPLE_FILE_TEXT']; }
# # # # # # require "settings.php"; require "core-settings.php"; if (isset($_POST["key"])) { switch ($_POST["key"]) { case "view": require_lib("docman"); $OUTPUT = printPurch($_POST); break; case "export": $OUTPUT = export($_POST); break; default: $OUTPUT = slct(); break; } } else { # Display default output $OUTPUT = slct(); } require "template.php"; # Default view function slct() { db_conn(YR_DB); $sql = "SELECT * FROM info WHERE prdname !=''";
for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA $Id: listorgs.php,v 1.20 2006/02/20 02:55:17 mlutfy Exp $ */ include 'inc/inc.php'; include_lcm('inc_impex'); $find_org_string = ''; if (isset($_REQUEST['find_org_string'])) { $find_org_string = $_REQUEST['find_org_string']; } if (!empty($_REQUEST['export']) && $GLOBALS['author_session']['status'] == 'admin') { export('org', $_REQUEST['exp_format'], $find_org_string); exit; } lcm_page_start(_T('title_org_list'), '', '', 'clients_intro'); lcm_bubble('org_list'); show_find_box('org', $find_org_string, '', (string) ($GLOBALS['author_session']['status'] == 'admin')); // List all organisations in the system + search criterion if any $q = "SELECT id_org,name\n\t\tFROM lcm_org"; if (strlen($find_org_string) > 1) { $q .= " WHERE (name LIKE '%{$find_org_string}%')"; } // Sort orgs by ID $order_set = false; $order_id = ''; if (isset($_REQUEST['order_id'])) { if ($_REQUEST['order_id'] == 'ASC' || $_REQUEST['order_id'] == 'DESC') {
<?php // this page uses smarty template // this must be set before including main header.php $xoopsOption['template_main'] = 'list_garage.html'; include_once "header.php"; include "include/fonctions.php"; export(); include_once "footer.php";
use MwbExporter\Formatter\Propel1\Yaml\Formatter as P1Y; use MwbExporter\Formatter\Sencha\ExtJS3\Formatter as SE3; use MwbExporter\Formatter\Sencha\ExtJS4\Formatter as SE4; use MwbExporter\Formatter\Zend\DbTable\Formatter as ZD; use MwbExporter\Formatter\Zend\RestController\Formatter as ZR; // setup modes $mode = array('doctrine1.yaml' => 'doctrine1-yaml', 'doctrine2.annotation' => 'doctrine2-annotation', 'doctrine2.yaml' => 'doctrine2-yaml', 'doctrine2.zf2inputfilter' => 'doctrine2-zf2inputfilterannotation', 'propel.xml' => 'propel1-xml', 'propel.yaml' => 'propel1-yaml', 'sencha.extjs3' => 'sencha-extjs3', 'sencha.extjs4' => 'sencha-extjs4', 'zend.dbtable' => 'zend-dbtable', 'zend.restcontroller' => 'zend-restcontroller'); // IF POST if (isset($_POST['input']) && isset($_POST['output']) && isset($_POST['mode'])) { // set inputs $filename = $_POST['input']; $outDir = $_POST['output']; // formatter setup $setup = array('doctrine1.yaml' => array(D1Y::CFG_USE_LOGGED_STORAGE => true, D1Y::CFG_INDENTATION => 2, D1Y::CFG_FILENAME => '%entity%.%extension%', D1Y::CFG_EXTEND_TABLENAME_WITH_SCHEMA => false), 'doctrine2.annotation' => array(D2A::CFG_USE_LOGGED_STORAGE => true, D2A::CFG_INDENTATION => 4, D2A::CFG_FILENAME => '%entity%.%extension%', D2A::CFG_ANNOTATION_PREFIX => 'ORM\\', D2A::CFG_BUNDLE_NAMESPACE => 'AppBundle', D2A::CFG_ENTITY_NAMESPACE => 'Entity', D2A::CFG_REPOSITORY_NAMESPACE => '', D2A::CFG_AUTOMATIC_REPOSITORY => true, D2A::CFG_SKIP_GETTER_SETTER => false), 'doctrine2.yaml' => array(D2Y::CFG_USE_LOGGED_STORAGE => true, D2Y::CFG_INDENTATION => 4, D2Y::CFG_FILENAME => '%entity%.orm.%extension%', D2Y::CFG_BUNDLE_NAMESPACE => '', D2Y::CFG_ENTITY_NAMESPACE => '', D2Y::CFG_REPOSITORY_NAMESPACE => '', D2Y::CFG_EXTEND_TABLENAME_WITH_SCHEMA => false, D2Y::CFG_AUTOMATIC_REPOSITORY => true), 'doctrine2.zf2inputfilter' => array(D2Z::CFG_USE_LOGGED_STORAGE => true, D2Z::CFG_INDENTATION => 4, D2Z::CFG_BUNDLE_NAMESPACE => 'AppBundle', D2Z::CFG_ENTITY_NAMESPACE => 'Entity', D2Z::CFG_AUTOMATIC_REPOSITORY => true, D2Z::CFG_SKIP_GETTER_SETTER => false), 'propel.xml' => array(P1X::CFG_USE_LOGGED_STORAGE => true, P1X::CFG_INDENTATION => 4, P1X::CFG_ADD_VENDOR => false, P1X::CFG_NAMESPACE => 'Acme\\Namespace'), 'propel.yaml' => array(P1Y::CFG_USE_LOGGED_STORAGE => true, P1Y::CFG_INDENTATION => 2), 'sencha.extjs3' => array(SE3::CFG_USE_LOGGED_STORAGE => true, SE3::CFG_INDENTATION => 4, SE3::CFG_FILENAME => 'JS/%schema%/%entity%.%extension%', SE3::CFG_CLASS_PREFIX => 'SysX.App', SE3::CFG_PARENT_CLASS => 'SysX.Ui.App'), 'sencha.extjs4' => array(SE4::CFG_USE_LOGGED_STORAGE => true), 'zend.dbtable' => array(ZD::CFG_USE_LOGGED_STORAGE => true, ZD::CFG_INDENTATION => 4, ZD::CFG_FILENAME => 'DbTable/%schema%/%entity%.%extension%', ZD::CFG_TABLE_PREFIX => 'Application_Model_DbTable_', ZD::CFG_PARENT_TABLE => 'Zend_Db_Table_Abstract', ZD::CFG_GENERATE_DRI => false, ZD::CFG_GENERATE_GETTER_SETTER => false), 'zend.restcontroller' => array(ZR::CFG_USE_LOGGED_STORAGE => true, ZR::CFG_INDENTATION => 4, ZR::CFG_FILENAME => '%entity%.%extension%', ZR::CFG_TABLE_PREFIX => '', ZR::CFG_PARENT_TABLE => 'Zend_Rest_Controller')); // lets do it $html = export($mode[$_POST['mode']], $setup[$_POST['mode']], $filename, $outDir); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>MySQlWorkbench Exporter</title> <!-- Bootstrap --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
* Copyright (c) 2012-2014 Toha <*****@*****.**> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // show errors error_reporting(E_ALL); include 'util.php'; // enable autoloading of classes autoload(); use MwbExporter\Formatter\Propel1\Xml\Formatter; // formatter setup $setup = array(Formatter::CFG_USE_LOGGED_STORAGE => true, Formatter::CFG_INDENTATION => 4, Formatter::CFG_ADD_VENDOR => false, Formatter::CFG_NAMESPACE => 'Acme\\Namespace'); // lets do it export('propel1-xml', $setup);
global $locale; global $current_user; global $app_list_strings; $the_module = clean_string($_REQUEST['module']); if ($sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($the_module) && ACLAction::getUserAccessLevel($current_user->id, $the_module, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN_DEV))) { die($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']); } //check to see if this is a request for a sample or for a regular export if (!empty($_REQUEST['sample'])) { //call special method that will create dummy data for bean as well as insert standard help message. $content = exportSample(clean_string($_REQUEST['module'])); } else { if (!empty($_REQUEST['uid'])) { $content = export(clean_string($_REQUEST['module']), $_REQUEST['uid'], isset($_REQUEST['members']) ? $_REQUEST['members'] : false); } else { $content = export(clean_string($_REQUEST['module'])); } } $filename = $_REQUEST['module']; //use label if one is defined if (!empty($app_list_strings['moduleList'][$_REQUEST['module']])) { $filename = $app_list_strings['moduleList'][$_REQUEST['module']]; } //strip away any blank spaces $filename = str_replace(' ', '', $filename); $transContent = $GLOBALS['locale']->translateCharset($content, 'UTF-8', $GLOBALS['locale']->getExportCharset()); if ($_REQUEST['members'] == true) { $filename .= '_' . 'members'; } /////////////////////////////////////////////////////////////////////////////// //// BUILD THE EXPORT FILE