100+ results for 'php mt_rand'
Not the results you expected?
acl0005Test.php (https://github.com/gnomeontherun/joomla-cms.git) PHP · 428 lines
1 <?php
2 /**
3 * @package Joomla.SystemTest
6 * Tests admin login permissions per global configuration permission settings.
7 */
8 require_once 'SeleniumJoomlaTestCase.php';
10 class Acl0005Test extends SeleniumJoomlaTestCase
18 //Set random salt
19 $salt = mt_rand();
21 //Set message to be checked
49 try {
50 $this->assertTrue($this->isElementPresent("link=Log out"));
51 } catch (PHPUnit_Framework_AssertionFailedError $e){
52 array_push($this->verificationErrors, $this->getTraceFiles($e));
53 }
DirectoryResourceTest.php (https://gitlab.com/ViniciusP/project-games) PHP · 166 lines
1 <?php
3 /*
14 use Symfony\Component\Config\Resource\DirectoryResource;
16 class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
17 {
18 protected $directory;
69 $this->assertFalse($resource->isFresh(time() - 86400), '->isFresh() returns false if the resource has been updated');
71 $resource = new DirectoryResource('/____foo/foobar'.mt_rand(1, 999999));
72 $this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist');
73 }
LoginController.php (https://gitlab.com/yutdhidev_labs/webku) PHP · 165 lines
1 <?php
2 namespace App\Http\Controllers;
3 use Illuminate\Http\Request;
36 // $exp = explode(" ",str_replace("'","",$request->name));
37 // $characters = '0123456789';
38 // $pin = mt_rand(1, 999);
40 // if(count($exp) > 1){
126 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
127 $pin = mt_rand(1000000, 9999999).$characters[rand(0, strlen($characters) - 1)];
128 $string = str_shuffle($pin);
db.php (https://github.com/enygma/fuel.git) PHP · 260 lines
1 <?php
2 /**
3 * Fuel
4 *
5 * Fuel is a fast, lightweight, community driven PHP5 framework.
6 *
7 * @package Fuel
10 * @license MIT License
11 * @copyright 2010 Dan Horrigan
12 * @link http://fuelphp.com
13 */
157 // do some garbage collection
158 if (mt_rand(0,100) < $this->config['gc_probability'])
159 {
160 $expired = $this->time->get_timestamp() - $this->config['expiration_time'];
criterias_document.test.php (https://github.com/cgajardo/repositorium.git) PHP · 238 lines
1 <?php
2 /* CriteriasDocument Test cases generated on: 2011-08-06 19:00:58 : 1312671658*/
3 App::import('Model', 'CriteriasDocument');
59 function testGetRandomDocumentsValidated() {
60 $criteria_id = mt_rand(1,$this->criteria_qty);
61 $confirmado = true;
62 $preguntable = true;
81 function testGetRandomDocumentsNonValidated() {
82 $criteria_id = mt_rand(1,$this->criteria_qty);
83 $confirmado = false;
84 $preguntable = true;
NodeSaveTest.php (git://github.com/drupal/drupal.git) PHP · 183 lines
Hash.php (https://bitbucket.org/Ebozavrik/test-application.git) PHP · 271 lines
1 <?php
2 /**
3 * Zend Framework
22 /** Zend_Form_Element_Xhtml */
23 require_once 'Zend/Form/Element/Xhtml.php';
25 /**
31 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
32 * @license http://framework.zend.com/license/new-bsd New BSD License
33 * @version $Id: Hash.php 24593 2012-01-05 20:35:02Z matthew $
34 */
35 class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
109 {
110 if (null === $this->_session) {
111 require_once 'Zend/Session/Namespace.php';
112 $this->_session = new Zend_Session_Namespace( $this->getSessionName() );
113 }
CryptUtil.php (https://github.com/LamCiuLoeng/BookShare.git) PHP · 109 lines
simple.php (https://github.com/square-one/square-one-cms.git) PHP · 288 lines
log.php (https://github.com/koto/blog-kotowicz-net-examples.git) PHP · 95 lines
1 <?php
2 require_once 'Upload_Client.php';
63 case 'upload-file':
64 if (!empty($_FILES['contents']) && array_key_exists('fileid', $_POST) && $client->hasFile($_POST['fileid'])) { // process file upload
65 $uniq = "file-" . md5(mt_rand() . uniqid());
66 $match = array();
67 if (preg_match('#\/(jpe?g|gif|png|pdf)$#i', $_POST['type'], $match)) { // images and pdf are "safe" to serve
AdsConversionAction.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 177 lines
twitter.php (https://bitbucket.org/jonphipps/elefant-vocabhub.git) PHP · 111 lines
1 <?php
3 /**
15 ));
17 $here = tmhUtilities::php_self ();
18 if (strpos ($here, '?redirect=') === false) {
19 $here .= '?redirect=' . urlencode ($_GET['redirect']);
38 if ($u) {
39 // already have an account, log them in
40 $u->session_id = md5 (uniqid (mt_rand (), 1));
41 $u->expires = gmdate ('Y-m-d H:i:s', time () + 2592000);
42 $try = 0;
43 while (! $u->put ()) {
44 $u->session_id = md5 (uniqid (mt_rand (), 1));
45 $try++;
46 if ($try == 5) {
email.reservation.php (https://gitlab.com/Nightprince/Warcry-CMS) PHP · 235 lines
NodeSaveTest.php (https://bitbucket.org/diegoe87/challenge-dc.git) PHP · 182 lines
Upload.php (https://github.com/houdunwang/video.git) PHP · 230 lines
1 <?php
2 /** .-------------------------------------------------------------------
3 * | Software: [HDCMS framework]
8 * | Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
9 * '-------------------------------------------------------------------*/
10 namespace hdphp\upload;
12 class Upload {
93 */
94 private function save( $file ) {
95 $fileName = mt_rand( 1, 9999 ) . time() . "." . $file['ext'];
96 $filePath = $this->path . '/' . $fileName;
97 if ( ! move_uploaded_file( $file ['tmp_name'], $filePath ) && is_file( $filePath ) ) {
198 switch ( $error ) {
199 case UPLOAD_ERR_INI_SIZE :
200 $this->error = '上传文件超过PHP.INI配置文件允许的大小';
201 break;
202 case UPLOAD_ERR_FORM_SIZE :
string_helper.php (https://github.com/holsinger/openfloor.git) PHP · 154 lines
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
56 * except those found in http://
57 *
58 * http://www.some-site.com//index.php
59 *
60 * becomes:
61 *
62 * http://www.some-site.com/index.php
63 *
64 * @access public
Math.php (https://github.com/jaws-project/jaws.git) PHP · 125 lines
1 <?php
2 /**
3 * Math captcha
6 * @package Core
7 * @author Pablo Fischer <pablo@pablo.com.mx>
8 * @author Ali Fazelzadeh <afz@php.net>
9 * @copyright 2006-2022 Jaws Development Group
10 * @license http://www.gnu.org/copyleft/lesser.html
51 function randomEquation()
52 {
53 $fnum = mt_rand(1, 9);
54 $snum = mt_rand(1, 9);
55 $oprt = mt_rand(0, 2);
56 $utf8_offset = $this->app->registry->fetch('captcha_math_offset', 'Policy');
57 $operations = array(
function_happyhour.php (https://github.com/cybernet/CyBerFuN-CoDeX.git) PHP · 101 lines
1 <?php
2 if(!defined('PUBLIC_ACCESS')) die('Fuck off - You cant access scripts directly fool !');
3 //made by putyn @tbdev 06.11.2008
8 {
9 $nextDay = date("Y-m-d" , time()+86400 );
10 $nextHoura = mt_rand(0,2);
11 if ($nextHoura == 2)
12 $nextHourb = mt_rand(0,3);
13 else
14 $nextHourb = mt_rand(0,9);
15 $nextHour = $nextHoura.$nextHourb;
16 $nextMina = mt_rand(0,5);
17 $nextMinb = mt_rand(0,9);
18 $nextMin = $nextMina.$nextMinb;
19 $happyHour = $nextDay." ".$nextHour.":".$nextMin."";
Guid.php (https://github.com/WebTricks/WebTricks-CMS.git) PHP · 208 lines
acl0001Test.php (https://github.com/chdemko/joomla-cms.git) PHP · 288 lines
1 <?php
2 /**
3 * @version $Id$
7 * Creates test group and assigns priviledges with the ACL.
8 */
9 require_once 'SeleniumJoomlaTestCase.php';
11 class Acl0001Test extends SeleniumJoomlaTestCase
21 $this->assertTrue($this->isElementPresent("//ul[@id='menu-com-users-users']"), 'User manager should be visible');
22 }
23 catch (PHPUnit_Framework_AssertionFailedError $e)
24 {
25 array_push($this->verificationErrors, $this->getTraceFiles($e));
30 $this->assertTrue($this->isElementPresent("//ul[@id='menu-com-users-groups']"), 'Groups should be visible');
31 }
32 catch (PHPUnit_Framework_AssertionFailedError $e)
33 {
34 array_push($this->verificationErrors, $this->getTraceFiles($e));
OrderSearchControllerTest.php (https://github.com/ladybirdweb/agorainvoicing.git) PHP · 167 lines
1 <?php
3 namespace Tests\Unit\Admin\Order;
162 $product = Product::create(['name'=>'Helpdesk'.$version]);
163 $order = Order::create(['client'=> $this->user->id, 'order_status' => 'executed',
164 'product'=> $product->id, 'number'=> mt_rand(100000, 999999), ]);
165 Subscription::create(['order_id'=>$order->id, 'product_id'=> $product->id, 'version'=>$version]);
166 }
voucher.php (https://bitbucket.org/jojoluzifer/gold-light-project.git) PHP · 263 lines
1 <?php
2 class ControllerAccountVoucher extends Controller {
3 private $error = array();
14 if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
15 $this->session->data['vouchers'][mt_rand()] = array(
16 'description' => sprintf($this->language->get('text_for'), $this->currency->format($this->currency->convert($this->request->post['amount'], $this->currency->getCode(), $this->config->get('config_currency'))), $this->request->post['to_name']),
17 'to_name' => $this->request->post['to_name'],
class.wp-pass.php (https://bitbucket.org/Red54/dianjihun.git) PHP · 141 lines
1 <?php
2 // Last sync [WP10712] - Refactored into a class from wp-incldues/pluggable.php
10 *
11 * @since WP 2.5
12 * @global object $wp_hasher PHPass object
13 * @uses PasswordHash::HashPassword
14 *
21 if ( empty($wp_hasher) ) {
22 require_once( BACKPRESS_PATH . 'class.passwordhash.php');
23 // By default, use the portable hash from phpass
32 *
33 * Maintains compatibility between old version and the new cookie authentication
34 * protocol using PHPass library. The $hash parameter is the encrypted password
35 * and the function compares the plain text password when encypted similarly
36 * against the already encrypted password to see if they match.
doomcounter.php (https://github.com/Xkeeper0/jul.git) PHP · 163 lines
Profiler.php (https://gitlab.com/fabian.morales/marlon_becerra) PHP · 295 lines
1 <?php
3 /*
176 * @return array An array of tokens
177 *
178 * @see http://php.net/manual/en/datetime.formats.php for the supported date/time formats
179 */
180 public function find($ip, $url, $limit, $method, $start, $end)
198 }
200 $profile = new Profile(substr(hash('sha256', uniqid(mt_rand(), true)), 0, 6));
201 $profile->setTime(time());
202 $profile->setUrl($request->getUri());
DiscISAM.php (https://github.com/Borluse/ProjetOption.git) PHP · 143 lines
1 <?php
2 /**
3 * PHPExcel
4 *
5 * Copyright (c) 2006 - 2010 PHPExcel
22 * @package PHPExcel_CachedObjectStorage
23 * @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version 1.7.3c, 2010-06-01
32 * @category PHPExcel
33 * @package PHPExcel_CachedObjectStorage
34 * @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
35 */
36 class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
38 private $_fileName = null;
peering2.php (https://github.com/mbj/zguide.git) PHP · 202 lines
1 <?php
2 /*
3 * Broker peering simulation (part 2)
5 * @author Ian Barber <ian(dot)barber(at)gmail(dot)com>
6 */
7 include "zmsg.php";
9 define("NBR_CLIENTS", 10);
21 $client->send("HELLO");
22 $reply = $client->recv();
23 printf("I: client status: %s%s", $reply, PHP_EOL);
24 }
25 }
41 sleep(1);
42 $zmsg->body_fmt("OK - %04x", mt_rand(0, 0x10000));
43 $zmsg->send();
44 }
index.php (https://code.google.com/p/maxsite/) PHP · 148 lines
ProxmoxController.php (https://github.com/MercyCloudTeam/TomatoIDC.git) PHP · 212 lines
file.php (https://github.com/akutaktau/feedmalaya.git) PHP · 351 lines
1 <?php
2 /**
3 * Fuel
4 *
5 * Fuel is a fast, lightweight, community driven PHP5 framework.
6 *
7 * @package Fuel
10 * @license MIT License
11 * @copyright 2010 - 2011 Fuel Development Team
12 * @link http://fuelphp.com
13 */
167 // do some garbage collection
168 if (mt_rand(0,100) < $this->config['gc_probability'])
169 {
170 if ($handle = opendir($this->config['path']))
User.php (https://gitlab.com/gothcon/cthulhu) PHP · 217 lines
Request.php (https://github.com/friendica/friendica-addons.git) PHP · 289 lines
menu0002Test.php (https://github.com/mathc/joomla-cms.git) PHP · 227 lines
1 <?php
2 /**
3 * @version $Id$
7 * Creates test group and assigns priviledges with the ACL.
8 */
9 require_once 'SeleniumJoomlaTestCase.php';
11 class Menu0002 extends SeleniumJoomlaTestCase
138 $this->waitForPageToLoad("30000");
140 $saltGroup = mt_rand();
142 $this->type("jform_title", "Test Menu Item" . $saltGroup);
class-fs-user-lock.php (https://github.com/livinglab/openlab.git) PHP · 126 lines
Cache.php (https://github.com/imr/horde.git) PHP · 421 lines
1 <?php
2 /**
3 * A cache backend for Kolab storage list handlers.
4 *
5 * PHP version 5
6 *
7 * @category Kolab
9 * @author Gunnar Wrobel <wrobel@pardus.de>
10 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11 * @link http://pear.horde.org/index.php?package=Kolab_Storage
12 */
24 * @author Gunnar Wrobel <wrobel@pardus.de>
25 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26 * @link http://pear.horde.org/index.php?package=Kolab_Storage
27 */
28 class Horde_Kolab_Storage_List_Cache
Liquid.php (https://gitlab.com/Skull3x/ClearSky) PHP · 437 lines
PHP.php (https://gitlab.com/link233/bootmw) PHP · 241 lines
1 <?php
3 namespace Cdb\Writer;
9 /**
10 * This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
11 * appears in PHP 5.3. Changes are:
35 * CDB writer class
36 */
37 class PHP extends Writer {
38 protected $hplist;
47 public function __construct( $fileName ) {
48 $this->realFileName = $fileName;
49 $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff );
50 $this->handle = fopen( $this->tmpFileName, 'wb' );
51 if ( !$this->handle ) {
PrettyPrinterAbstract.php (https://gitlab.com/oytunistrator/92five) PHP · 262 lines
118 * Preprocesses the top-level nodes to initialize pretty printer state.
119 *
120 * @param PHPParser_Node[] $nodes Array of nodes
121 */
122 protected function preprocessNodes(array $nodes) {
133 * Pretty prints an array of nodes (statements) and indents them optionally.
134 *
135 * @param PHPParser_Node[] $nodes Array of nodes
136 * @param bool $indent Whether to indent the printed nodes
137 *
168 }
170 protected function pInfixOp($type, PHPParser_Node $leftNode, $operatorString, PHPParser_Node $rightNode) {
171 list($precedence, $associativity) = $this->precedenceMap[$type];
test.php (https://github.com/trueos/lumina.git) PHP · 224 lines
19 public function __construct()
20 {
21 $this->uniqId = '<php-mail-' . md5(microtime()) . mt_rand() . '@git.php.net>';
22 }
24 /**
25 * Return unique id of mail
26 * @return string unique Id of message in format: '<php-mail-...@git.php.net';
27 */
28 public function getId()
33 /**
34 * Add parent mail for this mail
35 * @param string $uniqId unique Id of message in format: '<php-mail-...@git.php.net';
36 */
37 public function addReplyTo($uniqId)
redirect.php (https://github.com/ot2sen/Molajo.git) PHP · 300 lines
1 <?php
2 /**
3 * @version controller.php
133 if (MolajoFactory::getApplication()->getName() == 'site') {
134 if ($this->id == 0) {
135 $this->redirectSuccess = 'index.php';
136 } else {
137 $this->redirectSuccess = 'index.php?option='.JRequest::getCmd('option').'&view='.JRequest::getCmd('DefaultView').'&id='.$this->id.$extension.$component_specific;
138 }
139 } else {
140 $this->redirectSuccess = 'index.php?option='.JRequest::getCmd('option').'&view='.JRequest::getCmd('DefaultView').'&id='.$this->id.$extension.$component_specific;
141 }
142 $this->redirectReturn = $this->redirectSuccess;
146 /** multiple controller tasks **/
147 if (JRequest::getCmd('controller') == JRequest::getCmd('DefaultView')) {
148 $this->redirectSuccess = 'index.php?option='.JRequest::getCmd('option').'&view='.JRequest::getCmd('DefaultView').$extension.$component_specific;
149 $this->redirectReturn = $this->redirectSuccess;
150 return;
SecureRandom.php (https://gitlab.com/TouirMohamedMarwen/Symfony2) PHP · 114 lines
1 <?php
3 /*
45 // determine whether to use OpenSSL
46 if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50304) {
47 $this->useOpenSsl = false;
48 } elseif (!function_exists('openssl_random_pseudo_bytes')) {
83 list($this->seed, $this->seedLastUpdatedAt) = $this->readSeed();
84 } else {
85 $this->seed = uniqid(mt_rand(), true);
86 $this->updateSeed();
87 }
91 while (strlen($bytes) < $nbBytes) {
92 static $incr = 1;
93 $bytes .= hash('sha512', $incr++.$this->seed.uniqid(mt_rand(), true).$nbBytes, true);
94 $this->seed = base64_encode(hash('sha512', $this->seed.$bytes.$nbBytes, true));
95 $this->updateSeed();
PaymentMethodConfigurationAccessControlHandlerTest.php (https://gitlab.com/Drulenium-bot/payment) PHP · 357 lines
1 <?php
3 namespace Drupal\Tests\payment\Unit\Entity\PaymentMethodConfiguration;
24 * The module handler.
25 *
26 * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
27 */
28 protected $moduleHandler;
82 * Gets a mock payment method configuration.
83 *
84 * @return \Drupal\payment\Entity\PaymentMethodConfiguration|\PHPUnit_Framework_MockObject_MockObject
85 */
86 protected function getMockPaymentMethodConfiguration() {
140 */
141 public function testCheckAccessWithOwnPermission() {
142 $owner_id = mt_rand();
143 $operation = $this->randomMachineName();
144 $account = $this->getMock(AccountInterface::class);
FileDownloaderTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 215 lines
1 <?php
3 /*
16 use Composer\Util\Filesystem;
18 class FileDownloaderTest extends \PHPUnit_Framework_TestCase
19 {
20 protected function getDownloader($io = null, $config = null, $eventDispatcher = null, $cache = null, $rfs = null, $filesystem = null)
105 do {
106 $path = sys_get_temp_dir().'/'.md5(time().mt_rand());
107 } while (file_exists($path));
190 do {
191 $path = sys_get_temp_dir().'/'.md5(time().mt_rand());
192 } while (file_exists($path));
dropdownAllItems.php (https://github.com/glpi-project/glpi.git) PHP · 96 lines
1 <?php
2 /**
3 * ---------------------------------------------------------------------
31 */
33 include ('../inc/includes.php');
35 header("Content-Type: text/html; charset=UTF-8");
41 if ($_POST["idtable"] && class_exists($_POST["idtable"])) {
42 // Link to user for search only > normal users
43 $link = "getDropdownValue.php";
45 if ($_POST["idtable"] == 'User') {
46 $link = "getDropdownUsers.php";
47 }
SalesTest.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 127 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
14 * @magentoAppArea adminhtml
15 */
16 class SalesTest extends \PHPUnit_Framework_TestCase
17 {
18 const MAIN_WEBSITE = 1;
54 )->createBlock(
55 \Magento\Customer\Block\Adminhtml\Edit\Tab\View\Sales::class,
56 'sales_' . mt_rand(),
57 ['coreRegistry' => $this->coreRegistry]
58 )->setTemplate(
Profiler.php (https://github.com/AJenbo/ubuntudanmark.dk.git) PHP · 287 lines
1 <?php
3 /*
168 * @return array An array of tokens
169 *
170 * @see http://php.net/manual/en/datetime.formats.php for the supported date/time formats
171 */
172 public function find($ip, $url, $limit, $method, $start, $end)
190 }
192 $profile = new Profile(substr(sha1(uniqid(mt_rand(), true)), 0, 6));
193 $profile->setTime(time());
194 $profile->setUrl($request->getUri());
generar_datos.php (https://bitbucket.org/clcena/mongodb.git) PHP · 84 lines
1 <?php
2 require('dbconnection.php');
33 {
34 $length = count($array);
35 $randomIndex = mt_rand(0, $length - 1);
37 return $array[$randomIndex];
40 function getRandomTimestamp()
41 {
42 $randomDigit = mt_rand(0, 6) * -1;
43 return strtotime($randomDigit . ' día');
44 }
67 $publishedAt = new MongoDate(getRandomTimestamp());
68 $rating = mt_rand(1, 10);
70 return array('titulo' => $titulo, 'autor' => $autor, 'categoria' => $categoria,
Main.php (https://gitlab.com/Skull3x/Pocketmine-MP-Plugins) PHP · 279 lines
1 <?php
2 /**
3 * RandomDropper Copyright (C) 2015 CDFalcon
161 $event->setCancelled();
163 switch(mt_rand(1, 10)){
164 case 1:
165 if(count($this->item) > 0){
166 $r = mt_rand(0, count($this->item)-1);
167 $item = $this->item[$r];
168 $player->getLevel()->dropItem($block, new Item($item["id"], $item["damage"], 1));
174 case 2:
175 if(count($this->item) > 0){
176 $r = mt_rand(0, count($this->item)-1);
177 $item = $this->item[$r];
178 $player->getLevel()->dropItem($block, new Item($item["id"], $item["damage"], 1));
Attribute.php (https://github.com/sunsetsystems/openemr.git) PHP · 370 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
256 return $password;
257 case self::PASSWORD_HASH_SSHA:
258 $salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
259 $rawHash = sha1($password . $salt, true) . $salt;
260 $method = '{SSHA}';
265 break;
266 case self::PASSWORD_HASH_SMD5:
267 $salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
268 $rawHash = md5($password . $salt, true) . $salt;
269 $method = '{SMD5}';
AbstractMessage.php (https://github.com/jtai/zf2.git) PHP · 96 lines
1 <?php
2 /**
3 * Zend Framework
84 return sprintf(
85 '%08X-%04X-%04X-%02X%02X-%012X',
86 mt_rand(),
87 mt_rand(0, 65535),
88 bindec(substr_replace(
89 sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4)
90 ),
91 bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5, 2)),
92 mt_rand(0, 255),
93 mt_rand()
Ground.php (https://bitbucket.org/Sett/evolution.git) PHP · 71 lines
stress_test.php (https://github.com/md-tech/openemr.git) PHP · 419 lines
53 for ( $i = 1; $i <= $items; $i++ )
54 {
55 $return[] = $keys[mt_rand (0, $max)];
56 }
61 // require gacl
62 require_once (dirname (__FILE__) . '/../admin/gacl_admin.inc.php');
64 /*
291 for ( $i = $start; $i <= $max; $i++ )
292 {
293 $rand_aco_key = array_mt_rand ($aco_list, mt_rand (2, 10));
294 $rand_aro_key = array_mt_rand ($aro_groups, mt_rand(2,10));
295 $rand_axo_key = array_mt_rand ($axo_groups, mt_rand(2,10));
297 $aco_array = array ();
rtdealer.php (https://github.com/zetaben/zguide.git) PHP · 77 lines
1 <?php
2 /*
3 * Custom routing Router to Dealer (XREP to XREQ)
19 $request = $worker->recv();
20 if($request == 'END') {
21 printf ("A received: %d%s", $total, PHP_EOL);
22 break;
23 }
37 $request = $worker->recv();
38 if($request == 'END') {
39 printf ("B received: %d%s", $total, PHP_EOL);
40 break;
41 }
59 for ($task_nbr = 0; $task_nbr != 10; $task_nbr++) {
60 // Send two message parts, first the address...
61 if(mt_rand(0, 2) > 0) {
62 $client->send("A", ZMQ::MODE_SNDMORE);
63 } else {
dropdownMassiveActionAddActor.php (https://github.com/ardowz/glpi-itams.git) PHP · 51 lines
1 <?php
2 /*
3 * @version $Id: dropdownMassiveActionAddActor.php 14684 2011-06-11 06:32:40Z remi $
36 $AJAX_INCLUDE = 1;
37 define('GLPI_ROOT','..');
38 include (GLPI_ROOT."/inc/includes.php");
40 header("Content-Type: text/html; charset=UTF-8");
45 if ($_POST["actortype"] > 0) {
46 $rand = mt_rand();
47 Ticket::showActorAddForm($_POST["actortype"], $rand, $_SESSION['glpiactive_entity'], false);
48 echo " <input type='submit' name='add_actor' class='submit' value=\"".$LANG['buttons'][2]."\">";
PhpdocToCommentFixerTest.php (git://github.com/fabpot/PHP-CS-Fixer.git) PHP · 533 lines
dropdownMassiveActionAddActor.php (https://github.com/ardowz/Thesis-SideB.git) PHP · 51 lines
1 <?php
2 /*
3 * @version $Id: dropdownMassiveActionAddActor.php 14815 2011-06-29 07:27:02Z remi $
36 $AJAX_INCLUDE = 1;
37 define('GLPI_ROOT','..');
38 include (GLPI_ROOT."/inc/includes.php");
40 header("Content-Type: text/html; charset=UTF-8");
45 if ($_POST["actortype"] > 0) {
46 $rand = mt_rand();
47 Ticket::showActorAddForm($_POST["actortype"], $rand, $_SESSION['glpiactive_entity'], false);
48 echo " <input type='submit' name='add_actor' class='submit' value=\"".$LANG['buttons'][2]."\">";
CustomOptions.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 386 lines
1 <?php
2 /**
3 * Magento
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
22 * @package Tests_Functional
23 * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
64 $preset = [];
65 if (isset($data['preset'])) {
66 $preset = $this->replaceData($this->getPreset($data['preset']), mt_rand());
67 unset($data['preset']);
68 }
Profiler.php (https://github.com/Shumkov/TimeRanger.git) PHP · 251 lines
1 <?php
3 class TimeRanger_Profiler
29 {
30 if (self::$_enabled) {
31 require_once 'TimeRanger/Exception.php';
32 throw new TimeRanger_Exception('Profiler already started');
33 }
35 if ($probability !== false && !is_integer($probability) && $probability <= 0) {
36 require_once 'TimeRanger/Exception.php';
37 throw new TimeRanger_Exception('Probability must be a positive integer or false');
38 }
40 if (!self::$_instance) {
41 if (!extension_loaded('xhprof')) {
42 require_once 'TimeRanger/Exception.php';
43 throw new TimeRanger_Exception("The xhprof extension is required: http://pecl.php.net/package/xhprof");
LibraryInstallerTest.php (git://github.com/composer/composer.git) PHP · 290 lines
function.ViMbAdmin_Messages.php (https://github.com/basilgohar/ViMbAdmin.git) PHP · 138 lines
functions.php (http://xrnx.googlecode.com/svn/trunk/) PHP · 124 lines
bar-002.php (https://github.com/goldoraf/OBM.git) PHP · 80 lines
1 <?php
2 /*
3 * This work is hereby released into the Public Domain.
8 */
10 require_once "../../BarPlot.class.php";
12 $graph = new Graph(280, 280);
50 for($i = 0; $i < 6; $i++) {
51 $x[] = (cos($i * M_PI / 100) / ($n + 1) * mt_rand(600, 900) / 1000 - 0.5) * (($n%2) ? -0.5 : 1) + (($n%2) ? -0.4 : 0);
52 }
Files.php (https://github.com/jaws-project/jaws.git) PHP · 282 lines
StartSession.php (https://gitlab.com/kimting254/wbms) PHP · 248 lines
1 <?php namespace Illuminate\Session\Middleware;
3 use Closure;
51 // If a session driver has been configured, we will need to start the session here
52 // so that the data is ready for an application. Note that the Laravel sessions
53 // do not make use of PHP "native" sessions in any way since they are crappy.
54 if ($this->sessionConfigured())
55 {
163 protected function configHitsLottery(array $config)
164 {
165 return mt_rand(1, $config['lottery'][1]) <= $config['lottery'][0];
166 }
openid.php (https://bitbucket.org/jonphipps/elefant-vocabhub.git) PHP · 85 lines
ChangelogTest.php (https://gitlab.com/svillegas/magento2) PHP · 277 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
6 namespace Magento\Framework\Mview\Test\Unit\View;
8 class ChangelogTest extends \PHPUnit_Framework_TestCase
9 {
10 /**
16 * Mysql PDO DB adapter mock
17 *
18 * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\DB\Adapter\Pdo\Mysql
19 */
20 protected $connectionMock;
236 $this->setExpectedException('Exception', "Table {$changelogTableName} does not exist");
237 $this->model->setViewId('viewIdtest');
238 $this->model->getList(mt_rand(1, 200), mt_rand(201, 400));
239 }
FormJSAddMoreTest.php (https://gitlab.com/andecode/theme-spark) PHP · 128 lines
Color.php (https://github.com/fzaninotto/Faker.git) PHP · 143 lines
1 <?php
3 namespace Faker\Provider;
48 public static function hexColor()
49 {
50 return '#' . str_pad(dechex(mt_rand(1, 16777215)), 6, '0', STR_PAD_LEFT);
51 }
56 public static function safeHexColor()
57 {
58 $color = str_pad(dechex(mt_rand(0, 255)), 3, '0', STR_PAD_LEFT);
60 return '#' . $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2];
security.test.php (https://github.com/GunioRobot/findTwitter.git) PHP · 163 lines
1 <?php
2 /* SVN FILE: $Id$ */
3 /**
8 * PHP versions 4 and 5
9 *
10 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
11 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
12 *
16 * @filesource
17 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
18 * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
19 * @package cake
20 * @subpackage cake.tests.cases.libs
21 * @since CakePHP(tm) v 1.2.0.5432
22 * @version $Revision$
23 * @modifiedby $LastChangedBy$
UpdateApiEntityDefinitionUpdateTest.php (https://gitlab.com/reasonat/test8) PHP · 209 lines
1 <?php
3 namespace Drupal\system\Tests\Entity\Update;
55 public function testSingleUpdates() {
56 // Create a test entity.
57 $user_ids = [mt_rand(), mt_rand()];
58 $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => $user_ids]);
59 $entity->save();
106 public function testMultipleUpdates() {
107 // Create a test entity.
108 $user_ids = [mt_rand(), mt_rand()];
109 $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => $user_ids]);
110 $entity->save();
137 function testStatusReport() {
138 // Create a test entity.
139 $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => mt_rand()]);
140 $entity->save();
acl0001Test.php (https://github.com/gnomeontherun/joomla-cms.git) PHP · 288 lines
1 <?php
2 /**
3 * @package Joomla.SystemTest
6 * Creates test group and assigns priviledges with the ACL.
7 */
8 require_once 'SeleniumJoomlaTestCase.php';
10 class Acl0001Test extends SeleniumJoomlaTestCase
20 $this->assertTrue($this->isElementPresent("//ul[@id='menu-com-users-users']"), 'User manager should be visible');
21 }
22 catch (PHPUnit_Framework_AssertionFailedError $e)
23 {
24 array_push($this->verificationErrors, $this->getTraceFiles($e));
29 $this->assertTrue($this->isElementPresent("//ul[@id='menu-com-users-groups']"), 'Groups should be visible');
30 }
31 catch (PHPUnit_Framework_AssertionFailedError $e)
32 {
33 array_push($this->verificationErrors, $this->getTraceFiles($e));
TestDirHelper.php (https://github.com/Weltraumschaf/ebnf.git) PHP · 83 lines
EntityPopulator.php (https://gitlab.com/sarelvdwalt/Faker) PHP · 197 lines
6vip.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 172 lines
1 <?php
2 /**
3 * @package JohnCMS
16 $textl = 'Tôm cua cá';
17 $rootpath = '../';
18 require_once ("../incfiles/core.php");
19 require_once ("../incfiles/head.php");
25 $rand = mt_rand(100, 999);
26 $balans_plus = "1800";
27 $balans_minus = "300";
39 echo '<a href="6vip.php?act=go&thimble=1&rand=' . $rand .
40 '"><img src="nai.gif" alt=""/></a>
41 <a href="6vip.php?act=go&thimble=2&rand=' . $rand .
CourseController.php (https://bitbucket.org/coderpick/bdtutorial.git) PHP · 183 lines
CounterBalance.php (https://bitbucket.org/maxpanzer/cred_katherine.git) PHP · 79 lines
FilesystemTestCase.php (git://github.com/symfony/symfony.git) PHP · 180 lines
1 <?php
3 /*
12 namespace Symfony\Component\Filesystem\Tests;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Filesystem\Filesystem;
74 $this->umask = umask(0);
75 $this->filesystem = new Filesystem();
76 $this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
77 mkdir($this->workspace, 0777, true);
78 $this->workspace = realpath($this->workspace);
159 }
161 // https://bugs.php.net/69473
162 if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === PHP_ZTS) {
store.php (https://github.com/brion/mediawiki-svn.git) PHP · 77 lines
1 <?php
3 /**
7 */
9 require( dirname( __FILE__ ) . '/WebStoreStart.php' );
11 class WebStoreStore extends WebStoreCommon {
17 echo <<<EOT
18 <html>
19 <head><title>store.php Test Interface</title></head>
20 <body>
21 <form method="post" action="store.php" enctype="multipart/form-data" >
54 // Pick a random temporary path
55 $destRel = $timestamp . '/' . md5( mt_rand() . mt_rand() . mt_rand() ) . $extension;
56 if ( !@move_uploaded_file( $srcFile, "{$this->tmpDir}/$destRel" ) ) {
57 $this->error( 400, 'webstore_move_uploaded', $srcFile, "{$this->tmpDir}/$destRel" );
ContentTranslationSyncUnitTest.php (https://gitlab.com/mohamed_hussein/prodt) PHP · 260 lines
1 <?php
3 namespace Drupal\Tests\content_translation\Kernel;
115 $unchanged_items = $this->unchangedFieldValues[$sync_langcode];
116 $field_values = $this->unchangedFieldValues;
117 $sync_delta = mt_rand(0, count($field_values[$sync_langcode]) - 1);
118 unset($field_values[$sync_langcode][$sync_delta]);
119 // Renumber deltas to start from 0.
functions.php (https://github.com/carlic578/airpic.git) PHP · 140 lines
1 <?php
3 function checkForSession()
59 {
60 mt_srand();
61 $number = mt_rand()+time();
62 $temp = hash("sha512",$number);
63 return substr($temp, 0, 40);
120 {
121 $host = $_SERVER["HTTP_HOST"];
122 $path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\");
123 $goto = sprintf("Location: http://%s%s/%s", $host, $path, $navigateTo);
124 header($goto);
jssdk.php (https://gitlab.com/0072016/0072016-wechat) PHP · 94 lines
winners.blade.php (https://gitlab.com/urbanjunglestudio/whambush-website) PHP · 126 lines
4 <script src="{{ asset('js/admin/jquery-ui.custom/jquery-ui.js') }}"></script>
5 <link rel="stylesheet" href="{{ asset('js/admin/jquery-ui.custom/jquery-ui.css') }}">
6 <script src=<?php echo asset('js/admin/winners.js'); echo "?rand=".mt_rand();?>></script>
7 @stop
34 <div id="_number_of_missions" class="styled-select">
35 {!! Form::label('_number_of_missions', 'Max number of missions to print out:') !!}
36 <?php
37 $thelist = array();
38 for ($i=1; $i < 100; $i++) {
43 <label> - </label>
44 {!! Form::label('_number_of_entries', 'Number of entries / mission:') !!}
45 <?php
46 $thelist = array('default' => 'default', 'all' => 'all');
47 for ($i=1; $i < 50; $i++) {
AggregateCache.class.php (https://github.com/pupkinV/onphp-framework.git) PHP · 130 lines
1 <?php
2 /****************************************************************************
3 * Copyright (C) 2005-2008 by Anton E. Lebedevich, Konstantin V. Arkhipov *
89 $selectedLabel =
90 $zeroDistances[mt_rand(0, count($zeroDistances) - 1)];
92 } else {
94 // weighted random level selection
95 $sum = mt_rand() * array_sum($weights) / mt_getrandmax();
96 $peerLevel = null;
97 foreach ($weights as $level => $weight) {
109 }
111 $selectedLabel = $selectedPeers[mt_rand(0, count($selectedPeers) - 1)];
112 }
cachebench.php (https://github.com/glpi-project/glpi.git) PHP · 173 lines
1 <?php
2 /**
3 * ---------------------------------------------------------------------
31 */
33 if (PHP_SAPI != 'cli') {
34 echo "This script must be run from command line";
35 exit();
39 define('COUNT', 1024);
41 require __DIR__ . '/../inc/includes.php';
43 // To bypass various right checks
44 $_SESSION['glpishowallentities'] = 1;
45 $_SESSION['glpicronuserrunning'] = "cron_phpunit";
46 $_SESSION['glpi_use_mode'] = Session::NORMAL_MODE;
47 $_SESSION['glpiactiveentities'] = [0];
MiradouAuth.php (https://github.com/cybfr/famille.miradou.com.git) PHP · 154 lines
SwimRenderingManagerTest.php (https://gitlab.com/src-run/teavee-scribble-down-bundle) PHP · 74 lines
Submission.php (https://github.com/Bumblebee-Project/acpi-www.git) PHP · 200 lines
1 <?php
2 /**
3 * @license http://www.gnu.org/licenses/gpl.html GPLv3
181 $db = Database::getInstance();
182 // generate a 160-bit random string. @Mathematicans, any errors here?
183 $claim_key = str_shuffle(sha1(time() . '-' . mt_rand()));
185 $stmt_gen_key = $db->prepare('INSERT INTO submission_claim SET
Wolf.php (https://github.com/TuranicTeam/Altay.git) PHP · 152 lines
test-deprecated.php (https://gitlab.com/aristath/maera) PHP · 55 lines
23 public function test_kirki_sanitize_hex() {
24 $random_color = str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);
25 $this->assertEquals( kirki_sanitize_hex( $random_color ), Kirki_Color::sanitize_hex( $random_color ) );
26 }
28 public function test_kirki_get_rgb() {
29 $random_color = str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);
30 $this->assertEquals( kirki_get_rgb( $random_color ), Kirki_Color::get_rgb( $random_color ) );
31 }
33 public function test_kirki_get_rgba() {
34 $random_color = str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT) . str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);
35 $this->assertEquals( kirki_get_rgba( $random_color ), Kirki_Color::get_rgba( $random_color ) );
36 }
LocaleScannerTest.php (https://github.com/FabienD/symfony.git) PHP · 90 lines
1 <?php
3 /*
12 namespace Symfony\Component\Intl\Tests\Data\Util;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Filesystem\Filesystem;
16 use Symfony\Component\Intl\Data\Util\LocaleScanner;
35 protected function setUp(): void
36 {
37 $this->directory = sys_get_temp_dir().'/LocaleScannerTest/'.mt_rand(1000, 9999);
38 $this->filesystem = new Filesystem();
39 $this->scanner = new LocaleScanner();
AdmingeneratorMenuBuilder.php (https://bitbucket.org/ajalovec/admingeneratorgeneratorbundle.git) PHP · 130 lines
PrettyPrinterAbstract.php (https://gitlab.com/x33n/PHP-Parser) PHP · 268 lines
1 <?php
3 namespace PhpParser;
5 use PhpParser\Node\Expr;
6 use PhpParser\Node\Stmt;
78 public function __construct() {
79 $this->noIndentToken = '_NO_INDENT_' . mt_rand();
80 }
106 /**
107 * Pretty prints a file of statements (includes the opening <?php tag if it is required).
108 *
109 * @param Node[] $stmts Array of statements
LockBackendAbstract.php (https://gitlab.com/geeta7/drupal) PHP · 79 lines
Request.php (https://github.com/sgtcarneiro/horde.git) PHP · 198 lines
1 <?php
2 /**
3 * Copyright 2008-2011 The Horde Project (http://www.horde.org/)
4 *
5 * @author Chuck Hagenbuch <chuck@horde.org>
6 * @license http://opensource.org/licenses/bsd-license.php BSD
7 * @category Horde
8 * @package Oauth
13 *
14 * @author Chuck Hagenbuch <chuck@horde.org>
15 * @license http://opensource.org/licenses/bsd-license.php BSD
16 * @category Horde
17 * @package Oauth
117 {
118 $mt = microtime();
119 $rand = mt_rand();
121 return hash('md5', microtime() . mt_rand());
geolib.php (https://gitlab.com/ElvisAns/tiki) PHP · 206 lines
crypt.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 238 lines
1 <?php
2 /**
3 * @package Joomla.Platform
121 /*
122 * if a secure randomness generator exists and we don't
123 * have a buggy PHP version use it.
124 */
125 if (function_exists('openssl_random_pseudo_bytes')
126 && (version_compare(PHP_VERSION, '5.3.4') >= 0 || IS_WIN))
127 {
128 $sslStr = openssl_random_pseudo_bytes($length, $strong);
147 $handle = null;
149 // This is PHP 5.3.3 and up
150 if (function_exists('stream_set_read_buffer') && @is_readable('/dev/urandom'))
151 {
Upgrade2_0_0_2.php (https://github.com/BranchesWebDesign/development.git) PHP · 191 lines
UserRepository.php (https://bitbucket.org/ghanu/chope.git) PHP · 362 lines
1 <?php
3 namespace App\Repositories\Backend\Auth;
109 'password' => Hash::make($data['password']),
110 'active' => isset($data['active']) && $data['active'] == '1' ? 1 : 0,
111 'confirmation_code' => md5(uniqid(mt_rand(), true)),
112 'confirmed' => isset($data['confirmed']) && $data['confirmed'] == '1' ? 1 : 0,
113 ]);
Template.php (https://gitlab.com/koodersmiikka/operaatio-terveys) PHP · 361 lines
FormLibrary.class.php (https://bitbucket.org/chamilo/chamilo-dev/) PHP · 200 lines
1 <?php
2 require_once Path :: get_plugin_path() . 'FormLibrary/Rules/Rule.class.php';
3 require_once Path :: get_plugin_path() . 'FormLibrary/ElementStorage/ElementStorage.class.php';
4 require_once Path :: get_plugin_path() . 'FormLibrary/Elements/Element.class.php';
5 require_once Path :: get_plugin_path() . 'FormLibrary/Containers/Container.class.php';
6 require_once Path :: get_plugin_path() . 'FormLibrary/Renderer/Render.class.php';
7 require_once Path :: get_plugin_path() . 'FormLibrary/Elements/CustomElements/form_library_html_editor.class.php';
8 /*
9 * Main class to create forms
31 //Set a unique name for the form
32 {
33 $a = "FormLibrary_" . mt_rand();
34 }
Generator.php (https://github.com/churchillyik/TRSimu.git) PHP · 202 lines
FileServ.php (https://bitbucket.org/jasechen/ea-alfa-api.git) PHP · 286 lines
variable.php (https://github.com/Yacodo/atoum.git) PHP · 219 lines
1 <?php
3 namespace mageekguy\atoum\asserters;
76 $this->fail(
77 ($failMessage !== null ? $failMessage : sprintf($this->getLocale()->_('%s is not equal to %s'), $this, $this->getTypeOf($value))) .
78 PHP_EOL .
79 $diff->setReference($value)->setData($this->value)
80 );
114 $this->fail(
115 ($failMessage !== null ? $failMessage : sprintf($this->getLocale()->_('%s is not identical to %s'), $this, $this->getTypeOf($value))) .
116 PHP_EOL .
117 $diff->setReference($value)->setData($this->value)
118 );
187 {
188 $tmp = $reference;
189 $reference = uniqid(mt_rand());
190 $isReference = ($this->value === $reference);
191 $reference = $tmp;
StoreTest.php (https://github.com/easybib/php-openid.git) PHP · 298 lines
1 <?php
2 /**
3 * Tests_Auth_OpenID_Store
4 */
5 require_once dirname(__FILE__) . '/../Store.php';
7 /**
14 function test_memstore()
15 {
16 require_once 'Tests/Auth/OpenID/MemStore.php';
17 $store = new Tests_Auth_OpenID_MemStore();
18 $this->_testStore($store);
23 function test_filestore()
24 {
25 require_once 'Auth/OpenID/Store/File.php';
27 $temp_dir = _Auth_OpenID_mkdtemp();
UserTableSeeder.php (https://gitlab.com/Ankit77/motiv8) PHP · 55 lines
1 <?php
3 use Carbon\Carbon as Carbon;
31 'email' => 'info@webdevelopmentpark.com',
32 'password' => bcrypt('123456'),
33 'confirmation_code' => md5(uniqid(mt_rand(), true)),
34 'confirmed' => true,
35 'created_at' => Carbon::now(),
40 'email' => 'aniljmk@gmail.com',
41 'password' => bcrypt('123456'),
42 'confirmation_code' => md5(uniqid(mt_rand(), true)),
43 'confirmed' => true,
44 'created_at' => Carbon::now(),
cls_session.php (https://github.com/xnsimon/dmk.git) PHP · 290 lines
1 <?php
3 /**
11 * ============================================================================
12 * $Author: liuhui $
13 * $Id: cls_session.php 17063 2010-03-25 06:35:46Z liuhui $
14 */
122 function gen_session_id()
123 {
124 $this->session_id = md5(uniqid(mt_rand(), true));
126 return $this->insert_session();
235 /* 随机对 sessions_data 的库进行删除操作 */
236 if (mt_rand(0, 2) == 2)
237 {
238 $this->db->query('DELETE FROM ' . $this->session_data_table . ' WHERE expiry < ' . ($this->_time - $this->max_life_time));