echo config('database.connections.mysql.host') . '<br>'; var_dump(Valid::int()->notEmpty()->validate('1')); //xplog('hello'); }); Route::get('/get/hostname', function () { $hostname = strtolower(trim(gethostname())); //echo $hostname; echo bcrypt('abc123456'); }); Route::get('/sessions', function () { _pr(session()->all()); }); Route::get('/email', function () { die('turned off'); var_dump(Mail::send('emails.signup_confirmation', ['user' => 'test'], function ($m) { $m->to('*****@*****.**', 'Raffy')->subject('CLEVERBONS TEST EMAIL'); $m->from('*****@*****.**', 'Laravel'); })); }); Route::get('/testing', function () { //echo App\Cb\RealTime::foo(); //abort(404); _pr(App\Cb\Users::getDetailsById(1)); }); Route::get('/base64upload', function () { $data = '/9j/4AAQSkZJRgABAQAAAQABAAD/4QA2RXhpZgAASUkqAAgAAAABADIBAgAUAAAAGgAAAAAAAAAyMDExOjEwOjEyIDE1OjAzOjA0AP/bAEMABgQFBgUEBgYFBgcHBggKEAoKCQkKFA4PDBAXFBgYFxQWFhodJR8aGyMcFhYgLCAjJicpKikZHy0wLSgwJSgpKP/bAEMBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/CABEIAU0A7AMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYDBAcBAv/EABkBAQADAQEAAAAAAAAAAAAAAAACAwQBBf/aAAwDAQACEAMQAAABoIvwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADLxiffwB0AAAAAAAAAAAAt1X6xgnRo7penks5vr3mH1xraUjtUPgWxAAAAAAAAAAsN+rti8W0M3QIXnVtqXsVhriAAAAAAAAA98louhZ0f4F0g19jh57ByUbVPfpDoAAAAAAAABcqb07HKRp1j1cN0JJ45OXZHn955TZV8j1KwAAAAAAAAANvqlHvHk2VuQiJid0VaKzZssKrSpGO9akL+AAAAAAAAADJxf93crnh3feXJGbLJ34k6PlqrA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ST+kn9JP6SC+kkhRoFUWd9f8AYv/aAAwDAQACAAMAAAAQ8888888888888888888888888888888888888888888888888888888888888888888889/8888888888888rJhy88888888888W/wD3fPPPPPPPPPPWdbPfPPPPPPPPPP7ytvPPPPPPPPPPOWJ//PPPPPPPPPO9d5fPPPPPPPPPPLTRlvPPPPPPPPPPKiit/PPPPPPPPPPEfG/PPPPPPPPPPPGAV/PPPPPPPPPPPFlfPPPPPPPPLyzjuvPPPPPPPPPLzzz/AHzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz//xAAgEQEBAQACAgEFAAAAAAAAAAABEQAhMDFBEFBgcbHB/9oACAEDAQE/EPsUF4Miee7hzlHyZTxm8+wz5WZ1hWYPhYXLes1uF3HPidhhjDOudew+s8GkXsFxhrGfM7Dw5ByQuWt7BA10vy7Ya9b3HeM7TDTUuoRhyIH9fzRoyAnWM169eVfP1X//xAAnEQEAAgAEBQQDAQAAAAAAAAABABEhMDFBUWFxkfCBobHhEFDRYP/aAAgBAgEBPxD/AAotqiAFmcuonGO8OkZwW/ZmGGZysYeev5TevhlgzsXKQ6rETBjgbsIhoZeBd33LTGAm8tTbA6+fOZVnZ7vhKcSYVwlu66vVy1otime7cZbKsdNXz2zLtu4d4uVxl9OMsFv8H38ZhFeqOpKeUugrggbZiF8VBoKW/wBg+bpmoXWsRxTFGuabQvGCisrVYg41Ofac/wB2c/3YrZaNXLcBYxC7e/1OY9z+Qbbb6yndH7X/xAApEAEAAQMDBAEFAAMBAAAAAAABEQAhMUFRgUBhcZGhECCxwfBwgNHx/9oACAEBAAE/EP8ASHNKRCxNO8xFvfWy0tCAHEDtGSj1hdH5z91Osdy2r4R2saZ5hLdSELGY0lhfU0OcALYCD4+kumX/AKRnmhSHYEfD/lGvblPyfur15zilLIgXXp74yJf0ZXH3E557ViUZvfjqLNzkeN8/cw/CI3WPqXnpxClgN1sViD8whd9z9pakkaASvqperoPhHAHT3zG8V59BrJIousEmdKIOwsByv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xf/9k='; _pr(App\Upload::saveBase64($data, ['destination' => public_path('uploads'), 'extension' => 'jpg', 'wasabiii.jpg'])); //return 'aaaaa'; //App\Xplog::write('asdfasdf'); //return App\Upload::foo(); });
<?php require 'src/LucidFrame/Console/ConsoleTable.php'; use LucidFrame\Console\ConsoleTable; function _pr($string) { if (PHP_SAPI == 'cli') { echo "\n"; echo '### ' . $string . ' ###'; echo "\n\n"; } else { echo '<h2>' . $string . '</h2>'; } } _pr('Bordered Table (Default)'); $table = new ConsoleTable(); $table->addHeader('Language')->addHeader('Year')->addRow()->addColumn('PHP')->addColumn(1994)->addRow()->addColumn('C++')->addColumn(1983)->addRow()->addColumn('C')->addColumn(1970)->display(); _pr('Bordered Table with Padding Width 2'); $table = new ConsoleTable(); $table->setHeaders(array('Language', 'Year'))->addRow(array('PHP', 1994))->addRow(array('C++', 1983))->addRow(array('C', 1970))->setPadding(2)->display(); _pr('Bordered Table with Left Margin Width 4'); $table = new ConsoleTable(); $table->setHeaders(array('Language', 'Year'))->addRow(array('PHP', 1994))->addRow(array('C++', 1983))->addRow(array('C', 1970))->setIndent(4)->display(); _pr('Non-bordered Table with Header'); $table = new ConsoleTable(); $table->setHeaders(array('Language', 'Year'))->addRow(array('PHP', 1994))->addRow(array('C++', 1983))->addRow(array('C', 1970))->hideBorder()->display(); _pr('Non-bordered Table without Header'); $table = new ConsoleTable(); $table->addRow(array('PHP', 1994))->addRow(array('C++', 1983))->addRow(array('C', 1970))->hideBorder()->display();
/** * _pr(debug_backtrace()) somente se $HL_DEBUG estiver definida como true * @param mixed $var * @param boolean $die executa um die; no final */ function _bt() { global $HL_DEBUG; if (_indev()) { _pr(debug_backtrace()); } }
<?php global $vendo_perfil; _pr('ESTE É O TNBRANCH ESTATÍSTICAS'); ?> <header id="main-header" class="<?php if ($vendo_perfil) { ?> perfil-publico<?php } else { ?> geral<?php } ?> grid_16 clearfix"> <nav id="institutional"> <ul> <li> <h1><a href="<?php bloginfo('url'); ?> " title="<?php bloginfo('name'); ?> ">Toque no Brasil</a></h1> <?php wp_nav_menu(array("theme_location" => "institutional")); ?> </li> </ul> </nav>
function pr() { $varList = func_get_args(); $backTrace = debug_backtrace(); _pr($varList, "#0F0", "#000", $backTrace); }
function _bt() { global $HL_DEBUG; _pr(debug_backtrace()); }
echo 'iniciando script<hr/>'; } /* */ if (!get_option('script-recuperacao-perfil')) { update_option('script-recuperacao-perfil', date()); $users = $wpdb->get_results("\n \tSELECT\n \t\tDISTINCT {$wpdb->usermeta}.user_id,\n \t\t{$wpdb->users}.user_login\n \tFROM\n \t\t{$wpdb->usermeta},\n \t\t{$wpdb->users}\n \tWHERE\n \t\t({$wpdb->usermeta}.meta_key = '_widget_container_right' OR {$wpdb->usermeta}.meta_key = '_widget_container_left') AND\n \t\t{$wpdb->usermeta}.meta_value LIKE '%[object Object]%' AND\n \t\t{$wpdb->users}.ID = {$wpdb->usermeta}.user_id\n "); foreach ($users as $user) { $user_id = $user->user_id; $widgets = $wpdb->get_col("\n \tSELECT\n \t\tmeta_key\n \tFROM\n \t\t{$wpdb->usermeta}\n \tWHERE\n \t\tmeta_key LIKE '_widget_Widget_%' AND\n \t\tuser_id = '{$user_id}'\n "); $container_left = array(); $container_right = array(); for ($i = 0; $i < count($widgets); $i++) { if ($i < count($widgets) / 2) { $container_left[] = $widgets[$i]; } else { $container_right[] = $widgets[$i]; } } $left = addslashes(serialize($container_left)); $right = addslashes(serialize($container_right)); $result['login'] = $user->user_login; $result['left'] = $container_left; $result['right'] = $container_right; $result['left_value'] = $left; $result['right_value'] = $right; _pr($result); $wpdb->query("\n \tUPDATE \n {$wpdb->usermeta} \n SET\n \tmeta_value = '{$left}'\n WHERE\n \tmeta_key = '_widget_container_left' AND\n \tuser_id = '{$user_id}'"); $wpdb->query("\n \tUPDATE \n {$wpdb->usermeta} \n SET\n \tmeta_value = '{$right}'\n WHERE\n \tmeta_key = '_widget_container_right' AND\n \tuser_id = '{$user_id}'"); /* */ } }
echo 'app_path() => ' . app_path('asdfasd') . '<br>'; echo 'base_path() => ' . base_path() . '<br>'; //App\Helpers::load('app_helpers.php'); echo ENV_PREFIX . 'LOCAL_DB_HOST' . '<br>'; echo env(ENV_PREFIX . 'DB_HOST') . '<br>'; echo config('database.connections.mysql.host') . '<br>'; var_dump(Valid::int()->notEmpty()->validate('1')); //xplog('hello'); }); Route::get('/get/hostname', function () { $hostname = strtolower(trim(gethostname())); //echo $hostname; echo bcrypt('abc123456'); }); Route::get('/sessions', function () { _pr(session()->all()); }); Route::get('/testing', function () { $data = '/9j/4AAQSkZJRgABAQAAAQABAAD/4QA2RXhpZgAASUkqAAgAAAABADIBAgAUAAAAGgAAAAAAAAAy MDExOjEwOjEyIDE1OjAzOjA0AP/bAEMABgQFBgUEBgYFBgcHBggKEAoKCQkKFA4PDBAXFBgYFxQW FhodJR8aGyMcFhYgLCAjJicpKikZHy0wLSgwJSgpKP/bAEMBBwcHCggKEwoKEygaFhooKCgoKCgo KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/CABEIAU0A7AMBIgAC EQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYDBAcBAv/EABkBAQADAQEAAAAAAAAAAAAAAAAC AwQBBf/aAAwDAQACEAMQAAABoIvwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAADLxiffwB0AAAAAAAAAAAAt1X6xgnRo7penks5vr3mH1xraUjtUPgWxAA AAAAAAAAsN+rti8W0M3QIXnVtqXsVhriAAAAAAAAA98louhZ0f4F0g19jh57ByUbVPfpDoAAAAAA AABcqb07HKRp1j1cN0JJ45OXZHn955TZV8j1KwAAAAAAAAANvqlHvHk2VuQiJid0VaKzZssKrSpG O9akL+AAAAAAAAADJxf93crnh3feXJGbLJ34k6PlqrA9uoAAAAAAAAABOwV4z9s9Us1T8u6316vX W2W5ym8UHRSG+AAAAAAAAAACairBjt3ZeM18E7XmpGaPIqG989qgJgAAAAAAAAAN231u7+VdXvJJ VLTrNiqmqGMehUAAAAAAAAAABZZqg9yz38sz9Q53RKFhs2HTQF0QAAAAAAAAAAJDtPB7DXbuVHPg nWHeAAAAAAAAJCPudPZX2f1vL0RKWVQiUsNKp3bmOqOiPVrAAAAAAAAAbuki6F9c7ZZdEc7cdE16
<?php require_once '../../../../wp-load.php'; $user = get_user_by('id', 28); if (method_exists($user, 'add_cap')) { _pr($user); }
/** * _pr(debug_backtrace()) somente se $HL_DEBUG estiver definida como true * @param mixed $var * @param boolean $die executa um die; no final */ function _bt() { global $HL_DEBUG; if (isset($HL_DEBUG) && $HL_DEBUG === true) { _pr(debug_backtrace()); } }
} if (!get_option('tnb_sql_27')) { update_option('tnb_sql_27', 1); global $wpdb; $sql = "\nCREATE TABLE IF NOT EXISTS `pagseguro_transacoes` (\n `insert_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `TransacaoID` varchar(255) NOT NULL,\n `StatusTransacao` varchar(255) NOT NULL,\n `DataTransacao` varchar(255) NOT NULL,\n `TipoPagamento` varchar(255) NOT NULL,\n `Referencia` varchar(255) NOT NULL,\n `ProdID` varchar(255) NOT NULL,\n `ProdValor` varchar(255) NOT NULL,\n `ProdDescricao` varchar(255) NOT NULL,\n `CliNome` varchar(255) NOT NULL,\n `CliEmail` varchar(255) NOT NULL,\n `CliTelefone` varchar(255) NOT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; $wpdb->query($sql); } if (!get_option('tnb_sql_31')) { update_option('tnb_sql_31', 1); global $wpdb; $sql = "\nCREATE TABLE IF NOT EXISTS `{$wpdb->prefix}tnb_users_stats` (\n\t`id` INT NOT NULL AUTO_INCREMENT ,\n\t`data` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,\n\t`reg_type` VARCHAR( 10 ) NOT NULL ,\n\t`user_id` INT NOT NULL ,\n\t`login` VARCHAR( 255 ) NOT NULL ,\n\t`capability` VARCHAR( 25 ) NOT NULL ,\n\t`pais` VARCHAR( 50 ) NOT NULL ,\n\t`estado` VARCHAR( 50 ) NOT NULL ,\n\t`cidade` VARCHAR( 50 ) NOT NULL ,\n\tPRIMARY KEY (`id`),\n\tUNIQUE KEY `id` (`id`),\n\tKEY `user_id` (`user_id`)\n)"; _pr($sql); $wpdb->query($sql); $query = "\nSELECT \n\t{$wpdb->users}.ID,\n\t{$wpdb->users}.user_login,\n\t{$wpdb->users}.user_registered,\n\t(INSTR(wp_usermeta.meta_value,'artista') > 0) AS is_artista\nFROM\n\t{$wpdb->users},\n\t{$wpdb->usermeta}\nWHERE\n\t{$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND\n\t{$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities' AND\n\t({$wpdb->usermeta}.meta_value LIKE '%artista%' OR\n\t {$wpdb->usermeta}.meta_value LIKE '%produtor%') AND\n\t{$wpdb->users}.ID NOT IN (SELECT user_id FROM {$wpdb->prefix}tnb_users_stats)"; $users = $wpdb->get_results($query); _pr($query); foreach ($users as $user) { $capability = $user->is_artista ? 'artista' : 'produtor'; if ($capability == 'artista') { $pais = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'banda_pais' AND user_id = {$user->ID}"); $estado = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'banda_estado' AND user_id = {$user->ID}"); $cidade = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'banda_cidade' AND user_id = {$user->ID}"); } else { $pais = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'origem_pais' AND user_id = {$user->ID}"); $estado = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'origem_estado' AND user_id = {$user->ID}"); $cidade = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'origem_cidade' AND user_id = {$user->ID}"); } $q = "\nINSERT INTO {$wpdb->prefix}tnb_users_stats(\n\t`data`,\n\t`reg_type`,\n\t`user_id`,\n\t`login`,\n\t`capability`,\n\t`pais`,\n\t`estado`,\n\t`cidade`\n)VALUES(\n\t'{$user->user_registered}',\n\t'insert',\n\t'{$user->ID}',\n\t'{$user->user_login}',\n\t'{$capability}',\n\t'{$pais}',\n\t'{$estado}',\n\t'{$cidade}'\n)"; $wpdb->query($q); } }
break; case 'finalizar_contrato_inscricao': //_pr('contrato finalizado'); update_contrato_inscricao($_POST['evento_id'], $_POST['valor'], $_POST['porcentagem'], $_POST['contrato']); // altera o post_status do evento para "pay_pending_ok" $wpdb->query("UPDATE {$wpdb->posts} SET post_status = 'pay_pending_ok' WHERE ID = '{$evento_id}'"); // envia o email... (esta funcção está em "includes/email_messages.php") do_action('tnb_editor_revisou_evento_cobranca', $_POST['evento_id']); break; case 'marcar_pagamento_como_efetuado': add_post_meta($_POST['evento_id'], 'inscricao_pagamento_efetuado', true); do_action('tnb_editor_efetuou_pagamento_inscricoes', $_POST['evento_id']); break; case 'save-emails-pagamento': echo "AQUI"; _pr($_POST); if (!get_option('emails_pagamento')) { add_option('emails_pagamento', $_POST['pagamentos_emails']); } else { update_option('emails_pagamento', $_POST['pagamentos_emails']); } break; } } elseif ($_POST['pagamento_action'] == 'save-emails-pagamento') { if (!get_option('emails_pagamento')) { add_option('emails_pagamento', $_POST['pagamentos_emails']); } else { update_option('emails_pagamento', $_POST['pagamentos_emails']); } } }