function last_query($die = 0) { $CI = get_instance(); pre_dump($CI->db->last_query()); if ($die) { die; } }
/** * Alter the DB schema to match the current expected one ({@link $schema_queries}). * * @todo if used by install only, then put it into the install folder!!! * * @param boolean Display what we've done? */ function install_make_db_schema_current($display = true) { global $schema_queries, $DB, $debug; // Go through all tables: foreach ($schema_queries as $table => $query_info) { // Look for differences between terrain & map: $items_need_update = db_delta($query_info[1], array('drop_column', 'drop_index'), false); if (empty($items_need_update)) { continue; } if (!$display) { // just execute queries foreach ($items_need_update as $table => $itemlist) { foreach ($itemlist as $item) { foreach ($item['queries'] as $query) { $DB->query($query); } } } } else { // execute & output foreach ($items_need_update as $table => $itemlist) { if (count($itemlist) == 1 && $itemlist[0]['type'] == 'create_table') { echo $itemlist[0]['note'] . "<br />\n"; evo_flush(); foreach ($itemlist[0]['queries'] as $query) { // should be just one, but just in case if ($debug >= 2) { pre_dump($query); } $DB->query($query); } } else { echo 'Altering table «' . $table . '»...'; echo '<ul>'; foreach ($itemlist as $item) { echo '<li>' . $item['note']; if ($debug) { pre_dump($item['queries']); } echo '</li>'; foreach ($item['queries'] as $query) { $DB->query($query); } } echo "</ul>"; } } } } }
<?php $User = new MangoPay\UserNatural(); $User->Email = "*****@*****.**"; $User->FirstName = "Bob"; $User->LastName = "Briant"; $User->Birthday = 121271; $User->Nationality = "FR"; $User->CountryOfResidence = "ZA"; $result = $mangoPayApi->Users->Create($User); //Display result pre_dump($result); $_SESSION["MangoPayDemo"]["UserNatural"] = $result->Id;
/** * Show every active filter that is not the same as the defaults */ function dump_active_filters() { foreach ($this->default_filters as $key => $value) { if (!isset($this->filters[$key])) { // SOme value has not been copied over from defaults to active or specifically set: if (!is_null($value)) { // A NON NULL value is missing pre_dump('no active value for default ' . $key); } } elseif ($value != $this->filters[$key]) { pre_dump('default ' . $key, $value); pre_dump('active ' . $key, $this->filters[$key]); } } }
/** * Alter the DB schema to match the current expected one ({@link $schema_queries}). * * @todo if used by install only, then put it into the install folde!!! * * @param boolean Display what we've done? */ function install_make_db_schema_current($display = true) { global $schema_queries, $DB, $debug; foreach ($schema_queries as $table => $query_info) { $items_need_update = db_delta($query_info[1], array('drop_column', 'drop_index')); if (empty($items_need_update)) { continue; } if (!$display) { // just execute queries foreach ($items_need_update as $table => $itemlist) { foreach ($itemlist as $item) { foreach ($item['queries'] as $query) { $DB->query($query); } } } } else { // the same, but with output foreach ($items_need_update as $table => $itemlist) { if (count($itemlist) == 1 && $itemlist[0]['type'] == 'create_table') { echo $itemlist[0]['note'] . '<br />'; foreach ($itemlist[0]['queries'] as $query) { // should be just one, but just in case $DB->query($query); } } else { echo 'Altering table «' . $table . '»...'; echo '<ul>'; foreach ($itemlist as $item) { echo '<li>' . $item['note']; if ($debug) { pre_dump($item['queries']); } echo '</li>'; foreach ($item['queries'] as $query) { $DB->query($query); } } echo "</ul>"; } } } } }
// ---------------------------------------------------------------------------------------------------- echo '<h2>blogger.getRecentPosts</h2>'; evo_flush(); $client->debug = false; $message = new xmlrpcmsg('blogger.getRecentPosts', array(new xmlrpcval($bloggerAPIappkey), new xmlrpcval(1), new xmlrpcval($test_user), new xmlrpcval($test_pass), new xmlrpcval(6, 'int'))); $result = $client->send($message); $ret = xmlrpc_displayresult($result); // pre_dump( $ret ); if (is_array($ret)) { foreach ($ret as $a) { echo '<li>' . htmlspecialchars($a['content']) . '</li>'; } } // Get latest message: $latest = $ret[0]; pre_dump($latest); echo '<p>Message ID: ' . $latest['postid']; if ($latest['postid'] == $msg_ID) { echo '- OK match'; } else { die('ERROR'); } echo '</p>'; echo '<p>Content: ' . htmlspecialchars($latest['content']); if (strpos($latest['content'], $post_text)) { echo ' - OK'; } else { die('ERROR'); } echo '</p>'; if (strpos($ret[3]['content'], 'XML-RPC post :')) {
<?php //create the doc $KycDocument = new \MangoPay\KycDocument(); $KycDocument->Type = "IDENTITY_PROOF"; $result = $mangoPayApi->Users->CreateKycDocument($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocument); $KycDocumentId = $result->Id; //add a page to this doc $result2 = $mangoPayApi->Users->CreateKycPageFromFile($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocumentId, "logo.png"); //submit the doc for validation $KycDocument = new MangoPay\KycDocument(); $KycDocument->Id = $KycDocumentId; $KycDocument->Status = "VALIDATION_ASKED"; $result3 = $mangoPayApi->Users->UpdateKycDocument($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocument); //Display result pre_dump($result3); $_SESSION["MangoPayDemo"]["KYC"] = $KycDocumentId;
function debug_dump($var, $title = '') { global $output_debug_dump; if ($output_debug_dump) { pre_dump($var, $title); } }
if (isset($_GET["files"])) { foreach (core::$c->get_folders() as $folder) { $path = FILES . $folder; // Open the folder $dir_handle = @opendir($path) or die("Unable to open {$path}"); // Loop through the files while ($file = readdir($dir_handle)) { if ($file == "." || $file == ".." || $file == "index.php" || $file == "style.css" || $file == "img") { continue; } $files[$folder] = $file; } // Close closedir($dir_handle); } pre_dump($files); } ?> <!DOCTYPE html> <html> <head> <title>Upload :: Eizio.net</title> </head> <body> <form action="" method="post" enctype="multipart/form-data"> <label for="file">File:</label> <input type="file" name="file" id="file" /><br /><br /> <label for="folder">Folder:</label> <select name="folder">
/** * db_delta(): Check if we get our current scheme right */ function test_db_delta_currentscheme() { global $schema_queries, $basepath; load_db_schema(); foreach ($schema_queries as $query_info) { $this->test_DB->query($query_info[1]); $r = $this->db_delta_wrapper($query_info[1]); if (!empty($r)) { pre_dump($query_info[1], $r); } $this->assertIdentical($r, array()); } }
<?php /** * Chars Tests * * b2evolution - {@link http://b2evolution.net/} * * Released under GNU GPL License - {@link http://b2evolution.net/about/gnu-gpl-license} * * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license} * * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/} * * @package tests */ require_once dirname(__FILE__) . '/../blogs/conf/_config.php'; require_once dirname(__FILE__) . '/../blogs/' . $core_subdir . '_main.inc.php'; $test = "<strong>Hé 'man\"!</strong> € <fake & &wrong é>"; echo '[', $test, "] => \n"; echo 'html: [', convert_chars($test, 'html'), "]\n"; echo 'xml: [', convert_chars($test, 'xml'), "]\n"; $php_trans = array_flip(get_html_translation_table(HTML_ENTITIES)); // pre_dump( $b2_htmltrans ); // Chech that we do at least all translations PHP would do foreach ($php_trans as $entity => $uref) { if (!isset($b2_htmltrans[$entity])) { echo 'Not set: ', $entity, '->', $uref, "<br />\n"; } } pre_dump($b2_htmltrans);
$i++; } mysql_free_result($res); // select the evolution db $db = mysql_select_db($evo_db, $con); if (!$db) { die('b2evolution database name is incorrect. Please check the name and try again.'); } foreach ($users as $a_user) { // Import the user $query = 'INSERT INTO ' . $b2 . 'users (user_ID, user_login, user_pass, user_firstname, user_nickname, user_email, user_url, dateYMDhour, user_validated, user_grp_ID) VALUES ("' . $a_user['id'] . '", "' . $a_user['login'] . '", "' . $a_user['password'] . '", "' . $a_user['firstname'] . '", "' . $a_user['nickname'] . '", "' . $a_user['email'] . '", "' . $a_user['url'] . '", "' . fix_date($a_user['date']) . '", "1", "4");'; $flag = mysql_query($query); if (!$flag) { pre_dump($query); die('User importing failed. Please check your b2evolution installation.'); } // Import the permissions for blog for the user $query = 'INSERT INTO ' . $b2 . 'blogusers (bloguser_blog_ID, bloguser_user_ID, bloguser_ismember) VALUES ("1", "' . $a_user['id'] . '", "1");'; $flag = mysql_query($query); if (!$flag) { die('User (permissions) importing failed. Please check you b2evolution installation.'); } } echo '<font color="#00CC00">Users imported successfully! <strong>NOTE:</strong> all users are set to basic users level by default. You should probably reconfigure user permissions in the admin control panel if you want to give them higher privileges.</font>'; // All done echo '<br><br>'; echo '<strong><font color="#00CC00">Everything imported correctly. Try out your new b2evolution blog!</font></strong>'; // close the connection to the MySQL server mysql_close($con);