100+ results for 'php max'

Not the results you expected?

AssertionsTest.class.php (https://github.com/treuter/xp-framework.git) PHP · 617 lines

1 <?php

2 /* This class is part of the XP framework

3 *

119 * Test assertEquals() for integers

120 */

121 #[@test, @values(array(0, 1, -1, LONG_MAX, LONG_MIN))]

122 public function integersAreEqual($int) {

123 $this->assertEquals($int, $int);

Advertiser.php (https://bitbucket.org/valmy/openx.git) PHP · 371 lines

1 <?php

2

3 /*

34

35 // Required classes

36 require_once MAX_PATH . '/lib/OA/Dal/Statistics.php';

37

38 /**

content_actionhandler.php (https://github.com/SylvainGuittard/ezlightbox.git) PHP · 364 lines

1 <?php

2 //

3 // Created on: <2007-11-21 13:01:28 ab>

class-cp-user-relationships.php (https://gitlab.com/clusterpress/clusterpress) PHP · 543 lines

1 <?php

2 /**

3 * ClusterPress User Relationships.

FileValidatorTest.php (https://github.com/Exercise/symfony.git) PHP · 324 lines

1 <?php

2

3 /*

17 use Symfony\Component\HttpFoundation\File\UploadedFile;

18

19 abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase

20 {

21 protected $context;

93

94 $constraint = new File(array(

95 'maxSize' => 10,

96 'maxSizeMessage' => 'myMessage',

113

114 $constraint = new File(array(

115 'maxSize' => '1k',

116 'maxSizeMessage' => 'myMessage',

TSqlMapGateway.php (https://bitbucket.org/volatileeight/prado.git) PHP · 259 lines

1 <?php

2 /**

3 * TSqlMapGateway class file.

84 * pass in null if want to return a list instead.

85 * @param int The number of rows to skip over.

86 * @param int The maximum number of rows to return.

87 * @return TList A List of result objects.

88 */

89 public function queryForList($statementName, $parameter=null, $result=null, $skip=-1, $max=-1)

90 {

91 $statement = $this->getSqlMapManager()->getMappedStatement($statementName);

92 return $statement->executeQueryForList($this->getDbConnection(),$parameter, $result, $skip, $max);

93 }

94

SortedSet.php (https://github.com/netweaver/Rediska.git) PHP · 335 lines

65 *

66 * @param integer $min Min score

67 * @param integer $max Max score

68 * @return integer

69 */

77 *

78 * @param number $min Min score

79 * @param number $max Max score

80 * @param boolean $withScores Get with scores

81 * @param integer $limit Limit

92 *

93 * @param $min Min score

94 * @param $max Max score

95 * @return integer

96 */

style.php (https://github.com/shafiqissani/Jewelery-Ecommerce-.git) PHP · 262 lines

47 float: right;

48 position: relative;

49 <?php if($_GET['wrapper_border'] > 0) : ?>border: <?php echo $_GET['wrapper_border']; ?>px solid #e6e6e6;<?php endif; ?>

50 }

51

83 <?php endif; ?>

84 <?php if($_GET['text_block_position'] == 1) : ?>width: <?php echo $text_block_width; ?>px;<?php else : ?>width: <?php echo $_GET['slide_width'];?>px;<?php endif; ?>

85 <?php if($_GET['text_block_position'] == 1) : ?>height: <?php echo $_GET['slide_height']; ?>px;<?php else : ?>height: <?php echo $_GET['text_block_height']; ?>px;<?php endif; ?>

88 <?php if($_GET['text_block_position'] == 0) : ?>bottom: <?php echo $_GET['module_height']-$_GET['slide_height']-$_GET['image_y'];?>px;<?php endif; ?>

89 <?php if($_GET['text_block_position'] == 1) : ?>left: <?php echo $_GET['text_block_margin']; ?>px;<?php else : ?>left: <?php echo $_GET['image_x']; ?>px;<?php endif; ?>

90 background-color: <?php echo $text_overlay_bgcolor;?>;

97 <?php if($_GET['text_block_position'] == 1) : ?>width: <?php echo $text_block_width-10; ?>px;<?php else : ?>width: 90%;margin: 0 5%;<?php endif; ?>

98 <?php if($_GET['text_block_position'] == 1) : ?>height: <?php echo $text_block_height-10; ?>px;<?php else : ?>height: <?php echo $_GET['text_block_height']; ?>px;<?php endif; ?>

99 <?php if($_GET['text_block_position'] == 1) : ?>left: <?php echo $_GET['text_block_margin']; ?>px;<?php endif; ?>

100 position: absolute;

101 <?php if($_GET['text_block_position'] == 1) : ?>top: <?php echo $text_block_top; ?>px;<?php else : ?>bottom: 0;<?php endif; ?>

102 }

103

sale.php (https://github.com/sansanwawa/e-commerse.git) PHP · 307 lines

1 <?php

2 class ModelReportSale extends Model {

3 public function getOrders($data = array()) {

4 $sql = "SELECT MIN(tmp.date_added) AS date_start, MAX(tmp.date_added) AS date_end, COUNT(tmp.order_id) AS `orders`, SUM(tmp.products) AS products, SUM(tmp.tax) AS tax, SUM(tmp.total) AS total FROM (SELECT o.order_id, (SELECT SUM(op.quantity) FROM `" . DB_PREFIX . "order_product` op WHERE op.order_id = o.order_id GROUP BY op.order_id) AS products, (SELECT SUM(ot.value) FROM `" . DB_PREFIX . "order_total` ot WHERE ot.order_id = o.order_id AND ot.code = 'tax' GROUP BY ot.order_id) AS tax, o.total, o.date_added FROM `" . DB_PREFIX . "order` o";

5

6 if (isset($data['filter_order_status_id']) && $data['filter_order_status_id']) {

102

103 public function getTaxes($data = array()) {

104 $sql = "SELECT MIN(o.date_added) AS date_start, MAX(o.date_added) AS date_end, ot.title, SUM(ot.value) AS total, COUNT(o.order_id) AS `orders` FROM `" . DB_PREFIX . "order_total` ot LEFT JOIN `" . DB_PREFIX . "order` o ON (ot.order_id = o.order_id) WHERE ot.code = 'tax'";

105

106 if (isset($data['filter_order_status_id']) && $data['filter_order_status_id']) {

204

205 public function getShipping($data = array()) {

206 $sql = "SELECT MIN(o.date_added) AS date_start, MAX(o.date_added) AS date_end, ot.title, SUM(ot.value) AS total, COUNT(o.order_id) AS `orders` FROM `" . DB_PREFIX . "order_total` ot LEFT JOIN `" . DB_PREFIX . "order` o ON (ot.order_id = o.order_id) WHERE ot.code = 'shipping'";

207

208 if (isset($data['filter_order_status_id']) && $data['filter_order_status_id']) {

Clients.php (https://gitlab.com/my-application.bjoernbartels.earth/my-application) PHP · 322 lines

1 <?php

2 /**

3 * BB's Zend Framework 2 Components

93 'encoding' => 'UTF-8',

94 'min' => 1,

95 'max' => 255,

96 ),

97 ),

116 'encoding' => 'UTF-8',

117 'min' => 1,

118 'max' => 255,

119 ),

120 ),

139 'encoding' => 'UTF-8',

140 'min' => 1,

141 'max' => 255,

142 ),

143 ),

BannerServiceImpl.php (https://bitbucket.org/blackriver/openx.git) PHP · 344 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: BannerServiceImpl.php 81772 2012-09-11 00:07:29Z chris.nutting $

26 */

27

33

34 // Base class BaseLogonService

35 require_once MAX_PATH . '/www/api/v1/common/BaseServiceImpl.php';

36

37 // Banner Dll class

38 require_once MAX_PATH . '/lib/OA/Dll/Banner.php';

39

40 /**

voucher.php (https://bitbucket.org/elena_dyavolova/omf.git) PHP · 263 lines

1 <?php

2 class ControllerAccountVoucher extends Controller {

3 private $error = array();

58 $this->data['entry_theme'] = $this->language->get('entry_theme');

59 $this->data['entry_message'] = $this->language->get('entry_message');

60 $this->data['entry_amount'] = sprintf($this->language->get('entry_amount'), $this->currency->format($this->config->get('config_voucher_min')), $this->currency->format($this->config->get('config_voucher_max')));

61

62 $this->data['button_continue'] = $this->language->get('button_continue');

246 }

247

248 if (($this->currency->convert($this->request->post['amount'], $this->currency->getCode(), $this->config->get('config_currency')) < $this->config->get('config_voucher_min')) || ($this->currency->convert($this->request->post['amount'], $this->currency->getCode(), $this->config->get('config_currency')) > $this->config->get('config_voucher_max'))) {

249 $this->error['amount'] = sprintf($this->language->get('error_amount'), $this->currency->format($this->config->get('config_voucher_min')), $this->currency->format($this->config->get('config_voucher_max')) . ' ' . $this->currency->getCode());

PropertyPathBuilder.php (https://github.com/gimler/symfony.git) PHP · 299 lines

1 <?php

2

3 /*

249

250 // Shift elements to the left (left-to-right until the new end)

251 // Max allowed offset to be shifted is such that

252 // $offset + $diff < $length (otherwise invalid index access)

253 // i.e. $offset < $length - $diff = $newLength

277 // inserted elements. This needs to be done left-to-right in

278 // order to preserve an ascending array index order

279 // Since $i = max($length, $indexAfterInsertion) and $indexAfterInsertion >= $diff,

280 // $i >= $diff is guaranteed.

281 for ($i = max($length, $indexAfterInsertion); $i < $newLength; ++$i) {

MonitoredResourceDescriptor.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 262 lines

1 <?php

2 # Generated by the protocol buffer compiler. DO NOT EDIT!

3 # source: google/api/monitored_resource.proto

37 * Required. The monitored resource type. For example, the type

38 * `"cloudsql_database"` represents databases in Google Cloud SQL.

39 * The maximum length of this value is 256 characters.

40 *

41 * Generated from protobuf field <code>string type = 1;</code>

83 * Required. The monitored resource type. For example, the type

84 * `"cloudsql_database"` represents databases in Google Cloud SQL.

85 * The maximum length of this value is 256 characters.

86 * @type string $display_name

87 * Optional. A concise name for the monitored resource type that might be

142 * Required. The monitored resource type. For example, the type

143 * `"cloudsql_database"` represents databases in Google Cloud SQL.

144 * The maximum length of this value is 256 characters.

145 *

146 * Generated from protobuf field <code>string type = 1;</code>

shipping.php (https://gitlab.com/reclamare/mao) PHP · 268 lines

1 <?php

2 class ControllerApiShipping extends Controller {

3 public function address() {

136 $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']);

137 $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');

138 $this->response->addHeader('Access-Control-Max-Age: 1000');

139 $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');

140 }

206 $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']);

207 $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');

208 $this->response->addHeader('Access-Control-Max-Age: 1000');

209 $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');

210 }

259 $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']);

260 $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');

261 $this->response->addHeader('Access-Control-Max-Age: 1000');

262 $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');

263 }

errors.php (https://github.com/libersoft/fengoffice-ls.git) PHP · 194 lines

1 <?php

2

3 /**

44 // Avatar

45 'invalid upload type' => 'Invalid file type. Allowed types are {0}',

46 'invalid upload dimensions' => 'Invalid image dimensions. Max size is {0}x{1} pixels',

47 'invalid upload size' => 'Invalid image size. Max size is {0}',

91 // Add event

92 'event subject required' => 'Event subject is required',

93 'event description maxlength' => 'Description must be under 3000 characters',

94 'event subject maxlength' => 'Subject must be under 100 characters',

153 'user has contact' => 'There is a contact already assigned to this user',

154

155 'maximum number of users reached error' => 'The maximum number of users has been reached',

156 'maximum number of users exceeded error' => 'The maximum number of users has been exceeded. The application will not work anymore until this issue is resolved.',

BaseUserService.php (https://github.com/kervin/kyzstudio.git) PHP · 399 lines

1 <?php

2 /**

3 * Zend Framework

18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: BaseUserService.php 20166 2010-01-09 19:00:17Z bkarwin $

21 */

22

24 * @see Zend_Service_DeveloperGarden_Client_ClientAbstract

25 */

26 #require_once 'Zend/Service/DeveloperGarden/Client/ClientAbstract.php';

27

28 /**

29 * @see Zend_Service_DeveloperGarden_Response_BaseUserService_GetQuotaInformationResponse

30 */

31 #require_once 'Zend/Service/DeveloperGarden/Response/BaseUserService/GetQuotaInformationResponse.php';

32

33 /**

ValidatorTypeGuesser.php (https://github.com/Exercise/symfony.git) PHP · 273 lines

1 <?php

2

3 /*

57 * {@inheritDoc}

58 */

59 public function guessMaxLength($class, $property)

60 {

61 $guesser = $this;

62

63 return $this->guess($class, $property, function (Constraint $constraint) use ($guesser) {

64 return $guesser->guessMaxLengthForConstraint($constraint);

65 });

66 }

144 return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE);

145

146 case 'Symfony\Component\Validator\Constraints\MaxLength':

147 case 'Symfony\Component\Validator\Constraints\MinLength':

148 case 'Symfony\Component\Validator\Constraints\Regex':

ipn.php (https://github.com/steebo/CakePHP-Paypal-IPN-Plugin.git) PHP · 120 lines

1 <?php

2 class ipnSchema extends CakeSchema {

3 var $name = 'ipn';

ext_zlib.php (https://github.com/tstarling/hiphop-php.git) PHP · 376 lines

1 <?hh

2 // @generated by docskel.php

3

4 /**

18 * @param string $data - The data to compress.

19 * @param int $level - The level of compression. Can be given as 0 for no

20 * compression up to 9 for maximum compression. If -1 is used, the

21 * default compression of the zlib library is used which is 6.

22 *

30 *

31 * @param string $data - The data to decode, encoded by gzencode().

32 * @param int $length - The maximum length of data to decode.

33 *

34 * @return string - The decoded string, or FALSE if an error occurred.

43 * @param string $data - The data to deflate.

44 * @param int $level - The level of compression. Can be given as 0 for no

45 * compression up to 9 for maximum compression. If not given, the default

46 * compression level will be the default compression level of the zlib

47 * library.

advanced.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 143 lines

16 <table border="0" cellpadding="0" cellspacing="4">

17 <tr>

18 <td><label for="classlist" class="hastip" title="<?php echo WFText::_('WF_LABEL_CLASS_LIST_DESC'); ?>"><?php echo WFText::_('WF_LABEL_CLASS_LIST'); ?></label></td>

19 <td>

20 <select id="classlist" onchange="TableDialog.setClasses(this.value);">

24 </tr>

25 <tr>

26 <td><label for="title" class="hastip" title="<?php echo WFText::_('WF_LABEL_CLASSES_DESC'); ?>"><?php echo WFText::_('WF_LABEL_CLASSES'); ?></label></td>

27 <td><input id="classes" type="text" value="" /></td>

28 </tr>

85 <option value="hsides"><?php echo WFText::_('WF_TABLE_RULES_HSIDES'); ?></option>

86 <option value="lhs"><?php echo WFText::_('WF_TABLE_RULES_LHS'); ?></option>

87 <option value="rhs"><?php echo WFText::_('WF_TABLE_RULES_RHS'); ?></option>

88 <option value="vsides"><?php echo WFText::_('WF_TABLE_RULES_VSIDES'); ?></option>

89 <option value="box"><?php echo WFText::_('WF_TABLE_RULES_BOX'); ?></option>

BannerServiceImpl.php (https://github.com/skynet/OpenX-2.8.7.git) PHP · 344 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: BannerServiceImpl.php 62345 2010-09-14 21:16:38Z chris.nutting $

26 */

27

33

34 // Base class BaseLogonService

35 require_once MAX_PATH . '/www/api/v1/common/BaseServiceImpl.php';

36

37 // Banner Dll class

38 require_once MAX_PATH . '/lib/OA/Dll/Banner.php';

39

40 /**

sfValidatorDateTest.php (https://github.com/yuya-takeyama/symfony-hackathon-20110924.git) PHP · 246 lines

1 <?php

2

3 /*

9 */

10

11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php');

12

13 $t = new lime_test(52);

176 }

177

178 // max and min options

179 $t->diag('max and min options');

180 $v->setOption('min', strtotime('1 Jan 2005'));

181 $v->setOption('max', strtotime('31 Dec 2007'));

182 $t->is($v->clean('18 october 2005'), '2005-10-18', '->clean() can accept a max/min option');

Space.php (https://github.com/markn86/moodle.git) PHP · 259 lines

1 <?php

2

3 declare(strict_types=1);

4

5 namespace Phpml\Clustering\KMeans;

6

7 use InvalidArgumentException;

8 use LogicException;

9 use Phpml\Clustering\KMeans;

10 use SplObjectStorage;

11

96 }

97

98 if ($max[$n] === null || $max[$n] < $point[$n]) {

99 $max[$n] = $point[$n];

FindOneAndReplace.php (https://github.com/markn86/moodle.git) PHP · 168 lines

1 <?php

2 /*

3 * Copyright 2015-2017 MongoDB, Inc.

65 * exception at execution time if used.

66 *

67 * * maxTimeMS (integer): The maximum amount of time to allow the query to

68 * run.

69 *

editviewdefs.php (https://github.com/bkilgore/sugarcrm_dev.git) PHP · 402 lines

1 <?php

2 $viewdefs ['Opportunities'] =

3 array (

6 'templateMeta' =>

7 array (

8 'maxColumns' => '2',

9 'widths' =>

10 array (

MultishippingTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 271 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

6 namespace Magento\Multishipping\Test\Unit\Model\Checkout\Type;

7

8 class MultishippingTest extends \PHPUnit_Framework_TestCase

9 {

10 /**

14

15 /**

16 * @var \PHPUnit_Framework_MockObject_MockObject

17 */

18 protected $checkoutSessionMock;

19

20 /**

21 * @var \PHPUnit_Framework_MockObject_MockObject

22 */

23 protected $customerSessionMock;

InternalFrame.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 221 lines

5 * Copyright (C) 2003 sven_luzar

6 *

7 * 6/01/2006: I, Raphpael Valyi, changed back the header of this file to LGPL

8 * because nobody changed the file significantly since the last

9 * 3.0 version of GPGraphpad that was LGPL. By significantly, I mean:

111 * @param resizable

112 * @param closable

113 * @param maximizable

114 */

115 public InternalFrame(

117 boolean resizable,

118 boolean closable,

119 boolean maximizable) {

120 super(title, resizable, closable, maximizable);

129 * @param resizable

130 * @param closable

131 * @param maximizable

132 * @param iconifiable

133 */

share.php (https://gitlab.com/AaronDeb/cloudbox) PHP · 190 lines

1 <?PHP

2 include 'init.php';

modules-defaults.php (https://gitlab.com/Magi1053/Extra) PHP · 250 lines

1 <?php

2 // Prevent file from being loaded directly

3 if ( ! defined( 'ABSPATH' ) ) {

migration_tables_core_538.php (https://bitbucket.org/blackriver/openx.git) PHP · 318 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: migration_tables_core_538.php 81772 2012-09-11 00:07:29Z chris.nutting $

26 */

27

28 require_once(MAX_PATH.'/lib/OA/Upgrade/Migration.php');

29

30 class Migration_538 extends Migration

297 function migrateDayHour($table)

298 {

299 $prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];

300 $tableName = $this->oDBH->quoteIdentifier($prefix.$table, true);

301

dbndir.php (https://github.com/robertleeplummerjr/bluebox.git) PHP · 134 lines

1 <?php defined('SYSPATH') or die('No direct access allowed.');

2

3 class FreeSwitch_dbndir_Driver extends FreeSwitch_Base_Driver

16 $xml->setXmlRoot($root);

17

18 if (isset($dbnData->dbn_max_menu_attempts) && !empty($dbnData->dbn_max_menu_attempts) && $dbnData->dbn_max_menu_attempts != '')

19 $updatestr = '/param[@name="max-menu-attempts"]{@value="' . $dbnData->dbn_max_menu_attempts . '"}';

20 else

21 $updatestr = '/param[@name="max-menu-attempts"]{@value="3"}';

22

23 Kohana::log('debug', $updatestr);

43 $xml->update($updatestr);

44

45 if (isset($dbnData->dbn_max_result) && !empty($dbnData->dbn_max_result) && $dbnData->dbn_max_result != '')

46 $updatestr = '/param[@name="max-result"]{@value="' . $dbnData->dbn_max_result . '"}';

SqlServerGrammar.php (https://gitlab.com/vincetang/mtweb) PHP · 551 lines

1 <?php

2

3 namespace Illuminate\Database\Schema\Grammars;

263 protected function typeText(Fluent $column)

264 {

265 return 'nvarchar(max)';

266 }

267

274 protected function typeMediumText(Fluent $column)

275 {

276 return 'nvarchar(max)';

277 }

278

285 protected function typeLongText(Fluent $column)

286 {

287 return 'nvarchar(max)';

288 }

289

DictionaryLoader.php (https://github.com/gmimano/newd.git) PHP · 265 lines

1 <?php

2 /**

3 * Zend Framework

59 if ($tiVersion != (int)0xFFFFFFFE /* pre-2.1 format */ &&

60 $tiVersion != (int)0xFFFFFFFD /* 2.1+ format */) {

61 require_once 'Zend/Search/Lucene/Exception.php';

62 throw new Zend_Search_Lucene_Exception('Wrong TermInfoIndexFile file format');

63 }

64

65 // $indexTermCount = $tiiFile->readLong();

66 if (PHP_INT_SIZE > 4) {

67 $indexTermCount = ord($data[$pos]) << 56 |

68 ord($data[$pos+1]) << 48 |

79 (ord($data[$pos+3]) != 0) ||

80 ((ord($data[$pos+4]) & 0x80) != 0)) {

81 require_once 'Zend/Search/Lucene/Exception.php';

82 throw new Zend_Search_Lucene_Exception('Largest supported segment size (for 32-bit mode) is 2Gb');

83 }

profile.php (https://github.com/jaden54/GATE.git) PHP · 303 lines

1 <?php

2 session_start();

3

4 if (!isset($_SESSION['user'])) {

5

6 header ('Location: index.php');

7

8 exit();

133 style="vertical-align: middle; width: 160px; height: 60px; background-color: rgb(213, 209, 225); text-align: center;"><big

134 style="color: rgb(77, 67, 102);">'.$user.'</big><br>

135 <a href="deconnexion.php"><small>D�connexion</small></a></td>

136 </tr>

137 </tbody>

151 <td

152 style="vertical-align: middle; width: 120px; text-align: center; background-color: rgb(255, 214, 254);"><a

153 href="accueil.php"><span style="text-decoration: underline;">Accueil</span></a><br>

154 </td>

155 </tr>

PaginatedList.php (https://github.com/sminnee/silverstripe-framework.git) PHP · 420 lines

1 <?php

2 /**

3 * A decorator that wraps around a data list in order to provide pagination.

193 * basic pagination.

194 *

195 * By default it returns links to every page, but if you pass the $max

196 * parameter the number of pages will be limited to that number, centered

197 * around the current page.

198 *

199 * @param int $max

200 * @return SS_List

201 */

214 if ($end > $this->TotalPages()) {

215 $end = $this->TotalPages();

216 $start = max(0, $end - $max);

217 }

218 } else {

TestCommon.php (https://github.com/apinstein/jqjobs.git) PHP · 204 lines

1 <?php

2

3 require_once dirname(__FILE__) . '/../src/JQJobs/JQJobs.php';

4 const JQJOB_ID_DOES_NOT_EXIST = 999999;

5

6 $composerAutoloader = dirname(__FILE__) . '/../vendor/autoload.php';

7 if (file_exists($composerAutoloader))

8 {

13 {

14 ini_set('include_path',

15 dirname(__FILE__) . "/../externals/pear/php"

16 . ":" . dirname(__FILE__) . "/../lib/propel"

17 );

18 require_once 'propel/Propel.php';

19 }

20

PartnersSubscriptions.php (https://gitlab.com/Japang-Jawara/jawara-penilaian) PHP · 183 lines

1 <?php

2 /*

3 * Copyright 2014 Google Inc.

70 * @opt_param string subscriptionId Required. Identifies the subscription

71 * resource on the Partner side. The value is restricted to 63 ASCII characters

72 * at the maximum. If a subscription was previously created with the same

73 * subscription_id, we will directly return that one.

74 * @return GoogleCloudPaymentsResellerSubscriptionV1Subscription

149 * @opt_param string subscriptionId Required. Identifies the subscription

150 * resource on the Partner side. The value is restricted to 63 ASCII characters

151 * at the maximum. If a subscription was previously created with the same

152 * subscription_id, we will directly return that one.

153 * @return GoogleCloudPaymentsResellerSubscriptionV1Subscription

node_conditional_branch.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 201 lines

1 <?php

2 /**

3 * File containing the ezcWorkflowNodeConditionalBranch class.

37

38 /**

39 * Constraint: The maximum number of conditional outgoing nodes this node

40 * may activate. Set to false to disable this constraint.

41 *

42 * @var integer

43 */

44 protected $maxActivatedConditionalOutNodes = false;

45

46 /**

145 if ( $this->maxActivatedConditionalOutNodes !== false )

146 {

147 $maxActivatedConditionalOutNodes = $this->maxActivatedConditionalOutNodes;

148 }

149 else

SortableBehaviorObjectBuilderModifierTest.php (https://github.com/DoghouseMedia/Airtime.git) PHP · 279 lines

1 <?php

2

3 /*

4 * $Id: SortableBehaviorTest.php 1356 2009-12-11 16:36:55Z francois $

5 * This file is part of the Propel package.

6 * For the full copyright and license information, please view the LICENSE

41 public function testPreDelete()

42 {

43 $max = Table11Peer::getMaxRank();

44 $t3 = Table11Peer::retrieveByRank(3);

45 $t3->delete();

46 $this->assertEquals($max - 1, Table11Peer::getMaxRank(), 'Sortable rearrange subsequent rows on delete');

47 $c = new Criteria();

48 $c->add(Table11Peer::TITLE, 'row4');

BaseCcBackupQuery.php (https://github.com/DoghouseMedia/Airtime.git) PHP · 292 lines

216 *

217 * @param string|array $fromtime The value to use as filter.

218 * Accepts an associative array('min' => $minValue, 'max' => $maxValue)

219 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL

220 *

233 $useMinMax = true;

234 }

235 if ($useMinMax) {

236 return $this;

237 }

247 *

248 * @param string|array $totime The value to use as filter.

249 * Accepts an associative array('min' => $minValue, 'max' => $maxValue)

250 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL

251 *

TrackerXmlRpcService.php (https://bitbucket.org/blackriver/openx.git) PHP · 174 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: TrackerXmlRpcService.php 81772 2012-09-11 00:07:29Z chris.nutting $

26 */

27

28 require_once '../../../../init.php';

29 require_once MAX_PATH . '/lib/pear/XML/RPC/Server.php';

30 require_once MAX_PATH . '/www/api/v2/common/BaseTrackerService.php';

31 require_once MAX_PATH . '/www/api/v2/common/XmlRpcUtils.php';

32 require_once MAX_PATH . '/lib/OA/Dll/Tracker.php';

Audit.php (https://bitbucket.org/blackriver/openx.git) PHP · 138 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: Audit.php 81772 2012-09-11 00:07:29Z chris.nutting $

26 */

27

34 define('OA_AUDIT_ACTION_DELETE',3);

35

36 require_once 'DB_DataObjectCommon.php';

37

38 class DataObjects_Audit extends DB_DataObjectCommon

93 $key = $this->getFirstPrimaryKey();

94 if (empty($this->$key)) {

95 MAX::raiseError('Key on object is not set, table: '.$this->getTableWithoutPrefix());

96 return null;

97 }

BlockAccessControlHandler.php (https://gitlab.com/reasonat/test8) PHP · 171 lines

1 <?php

2

3 namespace Drupal\block;

116 // condition will have a missing context on any non-node route like the

117 // frontpage.

118 // @todo Avoid setting max-age 0 for some or all cases, for example by

119 // treating available contexts without value differently in

120 // https://www.drupal.org/node/2521956.

121 $access = AccessResult::forbidden()->setCacheMaxAge(0);

122 }

123 elseif ($this->resolveConditions($conditions, 'and') !== FALSE) {

164 $access->addCacheTags($condition->getCacheTags());

165 $access->addCacheContexts($condition->getCacheContexts());

166 $access->setCacheMaxAge(Cache::mergeMaxAges($access->getCacheMaxAge(), $condition->getCacheMaxAge()));

167 }

168 }

CanvasTransform.java (https://github.com/CyanogenMod/android_sdk.git) Java · 215 lines

6 * You may obtain a copy of the License at

7 *

8 * http://www.eclipse.org/org/documents/epl-v10.php

9 *

10 * Unless required by applicable law or agreed to in writing, software

178 int selection = mScrollbar.getSelection();

179 int thumb = cx;

180 int maximum = sx;

181

182 if (selection + thumb > maximum) {

183 selection = maximum - thumb;

184 if (selection < 0) {

185 selection = 0;

187 }

188

189 mScrollbar.setValues(selection, mScrollbar.getMinimum(), maximum, thumb, mScrollbar

190 .getIncrement(), mScrollbar.getPageIncrement());

191

Getargs_getValuesTest.php (https://github.com/CloCkWeRX/Console_Getargs.git) PHP · 297 lines

28 require_once 'Console/Getargs.php';

29 require_once 'PHPUnit/Framework/TestCase.php';

30

31 /**

38 * @copyright 1997-2005 The PHP Group

39 * @license http://www.php.net/license/3_0.txt PHP License 3.0

40 * @version Release: @package_version@

41 * @link http://pear.php.net/package/Console_Getargs

267 );

268

269 $args = array('-n', 'arg1', '-e', 'schst@php.net', 'wenz@php.net');

270 $message = implode(' ', $args);

271 $obj =& Console_Getargs::factory($config, $args);

278 }

279

280 $args = array('--name', 'arg1', '--email', 'schst@php.net', 'wenz@php.net');

281 $message = implode(' ', $args);

282 $obj =& Console_Getargs::factory($config, $args);

regions5.js.php (https://github.com/cools/Minecraft-Overviewer-Addons.git) PHP · 132 lines

33 $maxy = $region["max"]["y"];

34 $maxz = $region["max"]["z"];

35

36 //determine if drawing a cube is worth our time, 2 extra polygons for cube rendering.

47 $output .= " {\"x\": {$minx}, \"y\": {$maxy}, \"z\": {$maxz}},\n";

48 $output .= " {\"x\": {$maxx}, \"y\": {$maxy}, \"z\": {$maxz}},\n";

49 $output .= " {\"x\": {$maxx}, \"y\": {$maxy}, \"z\": {$minz}}\n";

62 $output .= " //{$label}:isometric projection-right\n";

63 $output .= " {\"label\": \"{$label}-isoright\", \"color\": \"{$color}\", \"opacity\": 0.5, \"closed\": true, \"path\": [\n";

64 $output .= " {\"x\": {$maxx}, \"y\": {$maxy}, \"z\": {$maxz}},\n";

65 $output .= " {\"x\": {$minx}, \"y\": {$maxy}, \"z\": {$maxz}},\n";

66 $output .= " {\"x\": {$minx}, \"y\": {$miny}, \"z\": {$maxz}},\n";

67 $output .= " {\"x\": {$maxx}, \"y\": {$miny}, \"z\": {$maxz}}\n";

68 $output .= " ]},\n";

69 }

policy.inc.php (https://github.com/hansek/revolution.git) PHP · 81 lines

1 <?php

2 /**

3 * Access Policy English lexicon topic

TbBaseMenu.php (https://github.com/LosYear/FluentCMS.git) PHP · 189 lines

1 <?php

2 /**

3 * TbBaseMenu class file.

4 * @author Christoffer Niska <ChristofferNiska@gmail.com>

5 * @copyright Copyright &copy; Christoffer Niska 2012-

6 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License

7 * @package bootstrap.widgets

8 */

mysql4-install-0.1.0.php (https://bitbucket.org/acidel/buykoala.git) PHP · 128 lines

1 <?php

2 $installer = $this;

3

24 `minimum_qty` int(11) NOT NULL,

25 `sold_qty` int(11) NOT NULL,

26 `maximum_qty` int(11) NOT NULL,

27 `coupon_barcode` text NOT NULL default '',

28 `coupon_merchant_address` int(11) NOT NULL,

migration_tables_core_538.php (https://github.com/skynet/OpenX-2.8.7.git) PHP · 318 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: migration_tables_core_538.php 62345 2010-09-14 21:16:38Z chris.nutting $

26 */

27

28 require_once(MAX_PATH.'/lib/OA/Upgrade/Migration.php');

29

30 class Migration_538 extends Migration

297 function migrateDayHour($table)

298 {

299 $prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];

300 $tableName = $this->oDBH->quoteIdentifier($prefix.$table, true);

301

subpaneldefs.php (https://github.com/jacknicole/sugarcrm_dev.git) PHP · 175 lines

1 <?php

2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

3 /*********************************************************************************

banner.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 252 lines

1 <?php

2 namespace Wpmet\Libs;

3

comment_php.ml (https://github.com/repos-ocaml/pfff.git) OCaml · 188 lines

36 (*

37 * We sometimes need to analyze comments and modify them, but it can be

38 * painful as PHP support different form of PHP comments, and people use

39 * different style in it. We want any modification to be harmonious with

40 * the rest of the comment, hence the need to better parsing of comments.

180

181 let comments_of_file file =

182 let toks = Parse_php.tokens file in

183 toks +> Common.map_filter (function

184 | Parser_php.T_COMMENT info

185 | Parser_php.T_DOC_COMMENT info

186 -> Some info

187 | _ -> None

main_scheck_heavy.ml (https://github.com/repos-ocaml/pfff.git) OCaml · 211 lines

61 let main_action xs =

62

63 let files = Lib_parsing_php.find_php_files_of_dir_or_files xs in

64 let errors = ref [] in

65

67 Flag_parsing_php.verbose_lexing := false;

68

69 Database_php.with_db ~metapath:!metapath (fun db ->

70

71 let find_entity = Some (Database_php_build.build_entity_finder db) in

100 let root = Common.common_prefix_of_files_or_dirs xs in

101

102 Layer_checker_php.gen_layer ~root ~output:file !Error_php._errors

103

104 );

class-wp-sitemaps-posts.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 228 lines

171 * @since 5.5.0

172 *

173 * @param int|null $max_num_pages The maximum number of pages. Default null.

174 * @param string $post_type Post type name.

175 */

176 $max_num_pages = apply_filters( 'wp_sitemaps_posts_pre_max_num_pages', null, $post_type );

177

178 if ( null !== $max_num_pages ) {

187

188 $min_num_pages = ( 'page' === $post_type && 'posts' === get_option( 'show_on_front' ) ) ? 1 : 0;

189 return isset( $query->max_num_pages ) ? max( $min_num_pages, $query->max_num_pages ) : 1;

190 }

191

Row.php (https://github.com/snippet/zf2.git) PHP · 217 lines

1 <?php

2 /**

3 * Zend Framework

152 }

153

154 // First we have to render all columns, to get the maximum height

155 $renderedColumns = array();

156 $maxHeight = 0;

178 // Store the rendered column and calculate the new max height

179 $renderedColumns[] = $result;

180 $maxHeight = max($maxHeight, count($result));

181

182 // Set up the internal column number

197 // Add each single column line to the result

198 $result = '';

199 for ($line = 0; $line < $maxHeight; $line++) {

200 $result .= $decorator->getVertical();

201

com_kb.php (https://bitbucket.org/dreamriks/gift.git) PHP · 156 lines

1 <?php

2 /**

3 * @author Guillermo Vargas, http://joomla.vargas.co.cr

4 * @email guille@vargas.co.cr

5 * @version $Id: com_kb.php 52 2009-10-24 22:35:11Z guilleva $

6 * @package Xmap

7 * @license GNU/GPL

63 $params['limit'] = '';

64 $params['days'] = '';

65 $limit = JArrayHelper::getValue($params,'max_articles','','');

66

67 if ( intval($limit) )

68 $params['limit'] = ' LIMIT '.$limit;

69

70 $days = JArrayHelper::getValue($params,'max_age','','');

71 if ( intval($days) )

72 $params['days'] = ' AND a.`created` >= \''.date('Y-m-d H:m:s', ($xmap->now - ($days*86400)) ) ."' ";

Photos.php (https://gitlab.com/efabian/maya) PHP · 139 lines

1 <?php

2 /*

3 * Copyright 2014 Google Inc.

122 * @opt_param string pageToken The nextPageToken value returned from a previous

123 * ListPhotos request, if any.

124 * @opt_param int pageSize The maximum number of photos to return. `pageSize`

125 * must be non-negative. If `pageSize` is zero or is not provided, the default

126 * page size of 100 is used. The number of photos returned in the response may

details.php (https://github.com/livinglab/openlab.git) PHP · 180 lines

78 <dt> <?php esc_html_e( 'Start:', 'the-events-calendar' ); ?> </dt>

79 <dd>

80 <abbr class="tribe-events-abbr tribe-events-start-datetime published dtstart" title="<?php echo esc_attr( $start_ts ); ?>"> <?php echo esc_html( $start_date ); ?> </abbr>

81

82 </dd>

104 <dt> <?php esc_html_e( 'Start:', 'the-events-calendar' ); ?> </dt>

105 <dd>

106 <abbr class="tribe-events-abbr updated published dtstart" title="<?php echo esc_attr( $start_ts ); ?>"> <?php echo esc_html( $start_datetime ); ?> </abbr>

107 <?php if ( $show_time_zone ) : ?>

112 <dt> <?php esc_html_e( 'End:', 'the-events-calendar' ); ?> </dt>

113 <dd>

114 <abbr class="tribe-events-abbr dtend" title="<?php echo esc_attr( $end_ts ); ?>"> <?php echo esc_html( $end_datetime ); ?> </abbr>

115 <?php if ( $show_time_zone ) : ?>

125 <dt> <?php esc_html_e( 'Date:', 'the-events-calendar' ); ?> </dt>

126 <dd>

127 <abbr class="tribe-events-abbr tribe-events-start-date published dtstart" title="<?php echo esc_attr( $start_ts ); ?>"> <?php echo esc_html( $start_date ); ?> </abbr>

128 </dd>

129

2016.05.php (https://github.com/mekhall/Das-Rebussystem.git) PHP · 199 lines

1 <?php

2

3 require_once 'slide.php';

169 );

170

171 $maxPoints =

172 array(

173 'P ORAL' => 19,

kml_infos.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 187 lines

1 <?php

2 /**

3 * Plugin GIS

140 if(preg_match(',^bounds ,',$meta)){

141 $meta = '<'.$meta.'>';

142 $maxlat = extraire_attribut($meta,'maxlat');

143 $minlat = extraire_attribut($meta,'minlat');

144 $maxlon = extraire_attribut($meta,'maxlon');

145 $minlon = extraire_attribut($meta,'minlon');

146 if($maxlat && $minlat)

147 $infos['latitude'] = (($maxlat+$minlat)/2);

148 if($maxlon && $minlon)

149 $infos['longitude'] = (($maxlon+$minlon)/2);

split_page_results.php (https://github.com/yama/zencart1302-ja-yama.git) PHP · 158 lines

107 if ($this->current_page_number % $max_page_links) $cur_window_num++;

108

109 $max_window_num = intval($this->number_of_pages / $max_page_links);

110 if ($this->number_of_pages % $max_page_links) $max_window_num++;

111

112 // previous window of pages

113 if ($cur_window_num > 1) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';

114

115 // page nn button

116 for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {

117 if ($jump_to_page == $this->current_page_number) {

118 $display_links_string .= '&nbsp;<strong class="current">' . $jump_to_page . '</strong>&nbsp;';

123

124 // next window of pages

125 if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>&nbsp;';

126

127 // next button

category_widget.php (https://github.com/Matmon/WP-e-Commerce.git) PHP · 180 lines

140

141 <p>

142 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('grid'); ?>" name="<?php echo $this->get_field_name('grid'); ?>"<?php checked( $grid ); ?> />

143 <label for="<?php echo $this->get_field_id('grid'); ?>"><?php _e('Use Category Grid View', 'wpsc'); ?></label><br />

149 <p>

150

151 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_name'); ?>" name="<?php echo $this->get_field_name('show_name'); ?>"<?php checked( $show_name ); ?> /><label for="<?php echo $this->get_field_id('show_name'); ?>"><?php _e(' Show N/A when No Image Available', 'wpsc'); ?></label>

152 </p>

153 <p>

156 <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:', 'wpsc'); ?></label>

157 <input type="text" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" value="<?php echo $height ; ?>" size="3" />

158 </p>

159 </div>

174 $checked = ''; ?>

175

176 <input type="checkbox" class="checkbox" id="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>" name="<?php echo $fieldconfig['name']; ?>[<?php echo $category->term_id; ?>]" <?php echo $checked; ?>></input> <label for="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>"><?php echo htmlentities($category->name, ENT_QUOTES, 'UTF-8' ); ?></label><br />

177

178 <?php

TransportHandlingUnitType.php (https://github.com/moyarada/XSD-to-PHP.git) PHP · 317 lines

1 <?php

2 namespace oasis\names\specification\ubl\schema\xsd\CommonAggregateComponents_2;

3

29 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2

30 * @xmlMinOccurs 0

31 * @xmlMaxOccurs 1

32 * @xmlName ID

33 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\ID

46 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2

47 * @xmlMinOccurs 0

48 * @xmlMaxOccurs 1

49 * @xmlName TransportHandlingUnitTypeCode

50 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\TransportHandlingUnitTypeCode

64 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2

65 * @xmlMinOccurs 0

66 * @xmlMaxOccurs 1

67 * @xmlName HandlingCode

68 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\HandlingCode

Message.php (https://gitlab.com/wuhang2003/typecho) PHP · 167 lines

1 <?php

2 /*

3 IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002

4 Version 1.61 - Simon Willison, 11th July 2003 (htmlentities -> htmlspecialchars)

5 Site: http://scripts.incutio.com/xmlrpc/

6 Manual: http://scripts.incutio.com/xmlrpc/manual.php

7 Made available under the Artistic License: http://www.opensource.org/licenses/artistic-license.php

db_structure.php (https://github.com/Indomian/KS-CMS.git) PHP · 344 lines

1 <?php

2 /**

3 * @file db_structure.php

Data.php (https://github.com/arush/desparation-deprecated.git) PHP · 309 lines

1 <?php

2 class Evogue_Customer_Helper_Data extends Mage_Core_Helper_Abstract {

3

55 'validate_types' => array(

56 'min_text_length',

57 'max_text_length',

58 ),

59 'validate_filters' => array(

76 'validate_types' => array(

77 'min_text_length',

78 'max_text_length',

79 ),

80 'validate_filters' => array(),

91 'validate_types' => array(

92 'min_text_length',

93 'max_text_length',

94 ),

95 'validate_filters' => array(

admin_selectTable.php (https://github.com/loboda/cs411.git) PHP · 571 lines

244 ?>

245 <td>

246 <button type="editButton" onclick="showEdit('group', '<?php print($row['GroupName'])?>', '<?php print($row['AssnID'])?>', '0' )">Edit</button>

247 </td>

248

337 ?>

338 <td>

339 <button type="editButton" onclick="showEdit('memberof', '<?php print($row['GroupName']); ?>', '<?php print($row['StudentID']); ?>', '<?php print($row['AssnID']); ?>' )">Edit</button>

340 </td>

341

342 <td>

343 <button type="deleteButton" onclick="showDelete('memberof', '<?php print($row['GroupName']); ?>', '<?php print($row['StudentID']); ?>', '<?php print($row['AssnID']); ?>' )">Delete</button>

344 </td>

345 <?php

BCGean8.barcode.php (https://gitlab.com/talueses/SIPVE) PHP · 244 lines

1 <?php

2 /**

3 *--------------------------------------------------------------------

14 *--------------------------------------------------------------------

15 * Copyright (C) Jean-Sebastien Goupil

16 * http://www.barcodephp.com

17 */

18 include_once('BCGBarcode1D.php');

85

86 /**

87 * Returns the maximal size of a barcode.

88 *

89 * @param int $w

TrackerXmlRpcService.php (https://github.com/skynet/OpenX-2.8.7.git) PHP · 174 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: TrackerXmlRpcService.php 62345 2010-09-14 21:16:38Z chris.nutting $

26 */

27

28 require_once '../../../../init.php';

29 require_once MAX_PATH . '/lib/pear/XML/RPC/Server.php';

30 require_once MAX_PATH . '/www/api/v2/common/BaseTrackerService.php';

31 require_once MAX_PATH . '/www/api/v2/common/XmlRpcUtils.php';

32 require_once MAX_PATH . '/lib/OA/Dll/Tracker.php';

Audit.php (https://github.com/skynet/OpenX-2.8.7.git) PHP · 138 lines

1 <?php

2

3 /*

23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |

24 +---------------------------------------------------------------------------+

25 $Id: Audit.php 62345 2010-09-14 21:16:38Z chris.nutting $

26 */

27

34 define('OA_AUDIT_ACTION_DELETE',3);

35

36 require_once 'DB_DataObjectCommon.php';

37

38 class DataObjects_Audit extends DB_DataObjectCommon

93 $key = $this->getFirstPrimaryKey();

94 if (empty($this->$key)) {

95 MAX::raiseError('Key on object is not set, table: '.$this->getTableWithoutPrefix());

96 return null;

97 }

BUILD.sh (https://swig.svn.sourceforge.net/svnroot/swig) Shell · 5 lines

1 #! /bin/sh -e

2

3 ${SWIG:=swig} -php4 -phpfull -c++ -noproxy -withcxx example.cxx example.i

4 phpize && ./configure && make clean && make

WInZipAesKeyStrength.cs (https://bitbucket.org/jens13/cleanzip.git) C# · 14 lines

2 // Distributed under the New BSD License.

3 // (See accompanying file notice.txt or at

4 // http://www.opensource.org/licenses/bsd-license.php)

5 // Source: https://bitbucket.org/jens13/cleanzip

6

el-070604.php (https://bitbucket.org/shuangxinyu/emacspack.git) PHP · 12 lines

5 <head>

6 <title>Dummy</title>

7 <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet();?>"/>

8 </head>

9 <body>

question44504-folding.html (https://bitbucket.org/shuangxinyu/emacspack.git) HTML · 29 lines

6 <tr>

7 <td width='50' colspan='1' class='men-met'>

8 <input type='button' value=' < ' onClick='goLastMonth(<?php echo date("t", strtotime("$year1-$month1-$day1")).", ".$month . ", " . $year.", ".date("w", strtotime("$year-$month-$day1")); ?>)' />

9 </td>

10 <td width='250' colspan='5' class='men-met'>

11 <span class='title'><?php echo $men . " " . $year; ?></span><br />

12 </td>

13 <td width='50' colspan='1' align='right' class='men-met'>

14 <input type='button' value=' > ' onClick='goNextMonth(1, <?php echo $month . ", " . $year.", ".date("w", strtotime("$year2-$month2-$day1")); ?>)' />

15 </td>

16 </tr>

jedit.1 (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 163 lines

157

158 .SH BUGS

159 See http://www.jEdit.org/index.php?page=feedback for bug reporting information.

160

161 .SH WEB

htaccess.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 564 lines

282 <KEYWORD2>CacheIgnoreNoLastMod</KEYWORD2>

283 <KEYWORD2>CacheLastModifiedFactor</KEYWORD2>

284 <KEYWORD2>CacheMaxExpire</KEYWORD2>

285 <KEYWORD2>CacheMaxFileSize</KEYWORD2>

374 <KEYWORD2>LogFormat</KEYWORD2>

375 <KEYWORD2>LogLevel</KEYWORD2>

376 <KEYWORD2>MCacheMaxObjectCount</KEYWORD2>

377 <KEYWORD2>MCacheMaxObjectSize</KEYWORD2>

378 <KEYWORD2>MCacheMaxStreamingBuffer</KEYWORD2>

379 <KEYWORD2>MCacheMinObjectSize</KEYWORD2>

380 <KEYWORD2>MCacheRemovalAlgorithm</KEYWORD2>

381 <KEYWORD2>MCacheSize</KEYWORD2>

382 <KEYWORD2>MMapFile</KEYWORD2>

383 <KEYWORD2>MaxClients</KEYWORD2>

384 <KEYWORD2>MaxKeepAliveRequests</KEYWORD2>

UnixFileSystem.php (git://github.com/alexgorbatchev/SyntaxHighlighter.git) text · 0 lines

1 <?php

2 /*

3 * $Id: UnixFileSystem.php 258 2007-10-21 00:46:45Z hans $

20 */

21

22 include_once 'phing/system/io/FileSystem.php';

23

24 /**

25 * UnixFileSystem class. This class encapsulates the basic file system functions

26 * for platforms using the unix (posix)-stylish filesystem. It wraps php native

27 * functions suppressing normal PHP error reporting and instead uses Exception

29 *

30 * This class is part of a oop based filesystem abstraction and targeted to run

31 * on all supported php platforms.

32 *

33 * Note: For debugging turn track_errors on in the php.ini. The error messages

frame_9.svg (https://bitbucket.org/atchariya/nokia.git) SVG · 3078 lines

105 cd7plK/3PXdF+HEX/lky5nnif+4DX+sDazEOvCqdHJitNqFrnCMxLgR+t+/Z9co1L7ySCp9x45mS

106 Ghyceb0EXo0Lvh6cb6mywREpiMEfdJHjnPhicQwjuIMpOSZyXCAC62nHy75i1y3AnHU7gy9VSOog

107 9d+LVSXtwgrBUv2eR0wqpyMuCEpSp58mohQj6Yx7qEoqNcgFD5GxGFsH7wLPhp5rrqQ8MZeCSGDd

108 r1mlpspSw01AAyaKiSGe+bIbbxfhonOGUsfIYxKvEVnlwkeufHeh3BVl17D0ocFJjkMOTRUizEq9

109 MUV4EDp+RZVRhS9NueK/JaEaySaIGtGVqcxYKKzCkpwzOzNcCrigqrVj9qqeQpUsRpR6LCRrr0GE

262 T4tSOxOpqqOnevsAvJwjn8M4TjOf4Pwfg3A/RNScTirEIW607T6IOE4ieGxB3okR4Q808uYy8nfn

263 zGsl4V55gG+IsLMdX7FAXq745jzxgRiHKG+Kcm0p/MhYc3M6d6JncuNk+uwQ4qebDlOpLs6o7QFR

264 Z2EjV2dlNay5rxOTJwarphpXIZvSDT1y+ybTlUOOvv09oDq283CALdYV700TW9vxSdkxW2alwtaF

265 Dc5PhTX/2Aa2+ZTvCdCtebVbsO+ZL6RMCZF/s+i4s+j5QYQuFWLJf6PJWRlnwvkW3VuxXHbkxRrW

266 E2F7Ua9jCOTYkYe6C0JjoFusWHRdk2smbmYDCSxjxZ77YuzMWMTInb7nqlQMus/VEPoaMKtyzYRy

556 d1ozopWgoIVYLcSK5IR4SdlkUWx3D65cIx4ecen4hHz7fbI5lralOVIDU2m5QuJlG/g68EPJvBYa

557 vpgj/4X17IjwHs7faFr+JAd8zuBJ2nI2DKzHnicSGGoX+nNhwlwCpVNOWbqxIfPQRh7iRIl8Tju+

558 4WtUI/+6TPhpn/PusOZv64YvascfzsrcjNRpCT57QxxLeLWftNxXY7ldMfNarVylT3UnLBO2XOBj

559 wadsY8vBMJClxBMepBX5HPZnM5pYYJxNdm5N9rigkdPtkseeuS/CrheTy8oyUZVJrkSIWrUwTcKr

560 lOdkquV5QoxszqBK0oBX2vW1pmHtzn1PtWtIyChDKGReCYFrlST9Xq3PGCSQRWuGysGNA0JdvyMx

SimpleListModel.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 106 lines ✨ Summary

This Java class, SimpleListModel, extends AbstractListModel and provides a custom list model for displaying PHP items. It filters items based on a search string and mode settings, allowing users to narrow down results by type and name. The class uses a TreeSet to store the filtered items and updates the list when the filter or mode changes.

37 this.list.clear();

38 for (int i = 0; i < list.size(); i++) {

39 PHPItem phpItem = (PHPItem) list.get(i);

40 if (accept(phpItem, searchString)) {

53 Iterator iterator = list.iterator();

54 while (iterator.hasNext()) {

55 PHPItem phpItem = (PHPItem) iterator.next();

56 if (!accept(phpItem, searchString)) {

74 private boolean accept(PHPItem phpItem, String searchText) {

75 return (mode & phpItem.getItemType()) == phpItem.getItemType() && phpItem.getNameLowerCase().indexOf(searchText) != -1;

76 }

77

88 private static class SimpleComparator implements Comparator {

89 public int compare(Object o1, Object o2) {

90 PHPItem item1 = (PHPItem) o1;

91 PHPItem item2 = (PHPItem) o2;

IfStatement.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 184 lines ✨ Summary

This Java class represents an if statement in a PHP program, including its condition, statements to execute, and optional elseifs and else clauses. It provides methods for converting the if statement to a string, getting variables used by the statement, analyzing code, and retrieving expressions at specific locations. The class extends another Statement class and uses other classes like Expression, ElseIf, and VariableUsage.

1 package net.sourceforge.phpdt.internal.compiler.ast;

2

3 import gatchan.phpparser.parser.PHPParser;

4 import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage;

127

128 @Override

129 public void analyzeCode(PHPParser parser)

130 {

131 condition.analyzeCode(parser);

ConditionalExpression.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 70 lines ✨ Summary

This Java class represents a ConditionalExpression, which is an operator expression that evaluates to true if a condition is met and false otherwise. It has three main components: a boolean condition, a value to return if true, and a value to return if false. The class provides methods for getting variables used in the expression, modified by it, and outside of it.

1 package net.sourceforge.phpdt.internal.compiler.ast;

2

3 import java.util.List;

upload.php (http://rorptm.googlecode.com/svn/trunk/) PHP · 107 lines ✨ Summary

This PHP script is a file uploader for FCKeditor, a text editor for internet. It checks if the uploaded file meets certain criteria (e.g., valid type, allowed extension) and renames the file if another one with the same name already exists in the target directory. If successful, it sends a JavaScript notification to the parent window with the upload results.

1 <?php

2 /*

3 * FCKeditor - The text editor for internet

5 *

6 * Licensed under the terms of the GNU Lesser General Public License:

7 * http://www.opensource.org/licenses/lgpl-license.php

8 *

9 * For further information visit:

12 * "Support Open Source software. What about a donation today?"

13 *

14 * File Name: upload.php

15 * This is the "File Uploader" for PHP.

33 // Check if this uploader has been enabled.

34 if ( !$Config['Enabled'] )

35 SendResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/upload/php/config.php" file' ) ;

36

37 // Check if the file has been correctly uploaded.

ChunkCache.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 919 lines ✨ Summary

This Java code appears to be part of a text editor’s line management system, responsible for calculating and storing information about each line in a document. It handles soft wrapping (line breaks) and hard wrapping (physical line changes), updating line data accordingly. The code provides methods for retrieving line information, checking if a full repaint is needed, and handling backwards compatibility with older versions of the text editor.

427 fontRenderContext,str);

428 width = (float)text.getLogicalBounds().getWidth();

429 positions = text.getGlyphPositions(0,length,null);

430 }

431

441 } //}}}

442

443 //{{{ getMaxHorizontalScrollWidth() method

444 int getMaxHorizontalScrollWidth()

445 {

446 int max = 0;

447 for(int i = 0; i < lineInfo.length; i++)

448 {

449 LineInfo info = lineInfo[i];

450 if(info.chunksValid && info.width > max)

451 max = info.width;

editor_plugin.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 1 lines ✨ Summary

This JavaScript code creates a TinyMCE plugin called “Save” that adds two buttons to the editor: “save” and “cancel”. When clicked, these buttons trigger saving the content of the editor. The plugin also allows for custom callbacks to be executed before and after saving. It integrates with TinyMCE’s existing features, such as undo/redo management and form submission handling.

1 (function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.getLang('save.save_desc'),'mceSave');},getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})();

PHPSideKickCompletion.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 173 lines ✨ Summary

This Java class, PHPSideKickCompletion, extends SideKickCompletion and provides completion functionality for PHP syntax highlighting. It analyzes the current word in a text area and suggests possible completions based on PHP classes, methods, and keywords. The class handles keystrokes, inserting suggested completions, and updating the text area’s caret position accordingly.

1 /*

2 * PHPSideKickCompletion.java - The PHP Parser

3 * :tabSize=8:indentSize=8:noTabs=false:

4 * :folding=explicit:collapseFolds=1:

21 package gatchan.phpparser.sidekick;

22

23 import gatchan.phpparser.project.itemfinder.PHPItemCellRenderer;

24 import net.sourceforge.phpdt.internal.compiler.ast.ClassDeclaration;

25 import net.sourceforge.phpdt.internal.compiler.ast.ClassHeader;

26 import net.sourceforge.phpdt.internal.compiler.ast.MethodDeclaration;

27 import net.sourceforge.phpdt.internal.compiler.ast.MethodHeader;

28 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;

37 * @author Matthieu Casanova

38 */

39 public class PHPSideKickCompletion extends SideKickCompletion

40 {

41 private final String lastWord;

CHANGES.txt (https://jedit.svn.sourceforge.net/svnroot/jedit) Plain Text · 2241 lines

87 - Updated BibTeX and LaTeX syntax highlighting (Thomas Alspaugh).

88

89 - PHP mode now recognizes <script language="PHP">...</script>.

90

91 - Updated Omnimark syntax highlighting (Lionel Fiol).

892 modes.

893

894 - SCRIPT tags in HTML files no longer recognize <?php ... ?>.

895

896 }}}

htmlsidekick.html (https://jedit.svn.sourceforge.net/svnroot/jedit) HTML · 138 lines ✨ Summary

This HTML code generates a help page for an HTML editor plugin, providing information on its features, settings, and future plans. It includes sections on completion, validation, tag attributes, and history, with detailed explanations of each feature. The page also mentions compatibility requirements and previous versions.

41

42 <p>

43 While designed specifically for HTML and JSP files, this plugin does a pretty good job of displaying ASP, ColdFusion, VRML, PHP, SGML, and Velocity files. Needless to say, it works with XML files too. You can elect to use this plugin for those edit modes by going to Plugins -&gt; Plugin Options... -&gt; SideKick -&gt; Parsers, then selecting "<tt>html</tt>" for those edit modes. </p>

44

45 <h3>Completion</h3>

jsonRpc10.php (http://enginey.googlecode.com/svn/trunk/) PHP · 48 lines ✨ Summary

This PHP script processes a JSON-RPC request from a client, determines the requested method and its parameters, and returns a response in JSON format. If the requested method is found, it returns the parameter as the result; otherwise, it returns an error message indicating that the method was not found. The response includes an ID matching the original request’s ID.

1 <?php

2 require_once("./JSON.php");

6 // Commenting out.the require and the new File() call.

7

8 // NOTE: File.php is installed via Pear using:

9 // %> sudo pear install File

10 // Your server will also need the Pear library directory included in PHP's

11 // include_path configuration directive

12 // require_once('File.php');

13

14 // ensure that we don't try to send "html" down to the client

21 $results['error'] = null;

22

23 $jsonRequest = file_get_contents('php://input');

24 //$jsonRequest = '{"params":["Blah"],"method":"myecho","id":86}';

25

error.ctp (https://bitbucket.org/floresj/notetime.git) Unknown · 62 lines

4 * PHP 5

5 *

6 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

7 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)

8 *

17 */

18

19 $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');

20 ?>

21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

40 <div id="container">

41 <div id="header">

42 <h1><?php echo $this->Html->link($cakeDescription, 'http://cakephp.org'); ?></h1>

43 </div>

44 <div id="content">

bp-core-options.php (https://bitbucket.org/simplemediacode/bptrunk.git) PHP · 538 lines

1 <?php

2

3 /**

30

31 // Legacy bbPress config location

32 'bb-config-location' => ABSPATH . 'bb-config.php',

33

34 /** XProfile **********************************************************/

303 'sitewide_tags_blog' => '',

304 'registration' => '0',

305 'fileupload_maxk' => '1500'

306 ) );

307

490 * @param bool $default Optional. Default value 0

491 *

492 * @uses bp_get_option() To get the maximum title length

493 * @return int Is anonymous posting allowed?

494 */

ezhttptool_regression.php (git://github.com/ezsystems/ezpublish.git) PHP · 49 lines ✨ Summary

This PHP code defines a test class eZHTTPToolRegression that tests the functionality of the ezpTestCase class and two functions from the eZHTTPTool class: sendHTTPRequest() and createRedirectUrl(). The tests verify that these functions behave correctly in different scenarios, including handling URLs with dashes and SSL reverse proxies.

1 <?php

2 /**

3 * File containing the eZHTTPToolRegression class

21 {

22 self::markTestSkipped( "Test disabled pending update." );

23 $url = 'http://php-og.mgdm.net/';

24

25 $this->assertInternalType(

26 PHPUnit_Framework_Constraint_IsType::TYPE_STRING,

27 eZHTTPTool::sendHTTPRequest( $url, 80, false, 'eZ Publish', false )

28 );

en-GB.plg_finder_weblinks.ini (https://bitbucket.org/kraymitchell/fcd.git) Unknown · 11 lines

1 ; Joomla! Project

2 ; Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.

3 ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php

4 ; Note : All ini files need to be saved as UTF-8

5

populate (git://github.com/openmelody/melody.git) Perl · 798 lines ✨ Summary

This Perl script, populate, generates pseudorandom weblog data for a specified number of blogs, authors, entries, categories, and years. It creates user records, blog posts, categories, and tags with random data, including dates, URLs, IPs, and words. The script can be run multiple times to generate different data sets.

55 cool tech blogging politics interesting video

56 perl python ruby web2.0 sixapart reference link audio

57 php javascript voip news

58 );

59

118 field(

119 'file_extension',

120 [ '', '', 'html', 'asp', 'jsp', 'php' ]

121 ),

122 field( 'email_new_comments', RAND_BOOL ),

controller.php (https://bitbucket.org/kraymitchell/fcd.git) PHP · 84 lines

1 <?php

2 /**

3 * @package Joomla.Site

63 $app = JFactory::getApplication();

64 $menu = $app->getMenu();

65 $items = $menu->getItems('link', 'index.php?option=com_search&view=search');

66

67 if(isset($items[0])) {

79

80

81 $this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false));

82 }

83 }

Empty.php (http://sewebar-cms.googlecode.com/svn/trunk/) PHP · 139 lines ✨ Summary

This PHP class, Zend_Search_Lucene_Search_Query_Empty, represents an empty search query for a Lucene index. It provides methods to rewrite and optimize the query, create a weight implementation, execute the query, retrieve matched document IDs, score documents, and highlight matches. The class is designed to be used as a placeholder or default query when no actual query terms are provided.

1 <?php

2 /**

3 * Zend Framework

18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: Empty.php 20096 2010-01-06 02:05:09Z bkarwin $

21 */

22

23

24 /** Zend_Search_Lucene_Search_Query */

25 require_once 'Zend/Search/Lucene/Search/Query.php';

26

27

66 public function createWeight(Zend_Search_Lucene_Interface $reader)

67 {

68 require_once 'Zend/Search/Lucene/Search/Weight/Empty.php';

69 return new Zend_Search_Lucene_Search_Weight_Empty();

70 }

TwitterAlikeExample.html (http://redis.googlecode.com/svn/trunk/) HTML · 253 lines ✨ Summary

This HTML code outputs a blog post about Redis, a popular in-memory data store. The content explains how to implement a Twitter-like clone using Redis, including setting up followers and posting messages. It also discusses horizontal scaling of the system, including hashing keys, distributing user data across servers, and handling special cases like incrementing IDs and retrieving timeline data.

17 <div class="index">

18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->

19 <b>TwitterAlikeExample: Contents</b><br>&nbsp;&nbsp;<a href="#A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a><br>&nbsp;&nbsp;<a href="#Key-value stores basics">Key-value stores basics</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Atomic operations">Atomic operations</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Beyond key-value stores">Beyond key-value stores</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#The set data type">The set data type</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Prerequisites">Prerequisites</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Data layout">Data layout</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Following, followers and updates">Following, followers and updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Authentication">Authentication</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Updates">Updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Paginating updates">Paginating updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Following users">Following users</a><br>&nbsp;&nbsp;<a href="#Making it horizontally scalable">Making it horizontally scalable</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Hashing the key">Hashing the key</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Special keys">Special keys</a>

20 </div>

21

27

28 <div class="narrow">

29 <h1><a name="A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a></h1>In this article I'll explain the design and the implementation of a <a href="http://retwis.antirez.com" target="_blank">simple clone of Twitter</a> written using PHP and <a href="http://code.google.com/p/redis/" target="_blank">Redis</a> as only database. The programming community uses to look at key-value stores like special databases that can't be used as drop in replacement for a relational database for the development of web applications. This article will try to prove the contrary.<br/><br/>Our Twitter clone, <a href="http://retwis.antirez.com" target="_blank">called Retwis</a>, is structurally simple, has very good performances, and can be distributed among N web servers and M Redis servers with very little efforts. You can find the source code <a href="http://code.google.com/p/redis/downloads/list" target="_blank">here</a>.<br/><br/>We use PHP for the example since it can be read by everybody. The same (or... much better) results can be obtained using Ruby, Python, Erlang, and so on.

30 <h1><a name="Key-value stores basics">Key-value stores basics</a></h1>

31 The essence of a key-value store is the ability to store some data, called <i>value</i>, inside a key. This data can later be retrieved only if we know the exact key used to store it. There is no way to search something by value. So for example I can use the command SET to store the value <b>bar</b> at key <b>foo</b>:<br/><br/><pre class="codeblock python" name="code">

79 </pre>Ok I think we are ready to start coding!

80 <h2><a name="Prerequisites">Prerequisites</a></h2>

81 If you didn't download it already please <a href="http://code.google.com/p/redis/wiki/README" target="_blank">grab the source code of Retwis</a>. It's a simple tar.gz file with a few of .php files inside. The implementation is very simple. You will find the PHP library client inside (redis.php) that is used to talk with the Redis server from PHP. This library was written by <a href="http://qix.it" target="_blank">Ludovico Magnocavallo</a> and you are free to reuse this in your own projects, but for updated version of the library please download the Redis distribution.<br/><br/>Another thing you probably want is a working Redis server. Just get the source, compile with make, and run with ./redis-server and you are done. No configuration is required at all in order to play with it or to run Retwis in your computer.

82 <h2><a name="Data layout">Data layout</a></h2>

83 Working with a relational database this is the stage were the database layout should be produced in form of tables, indexes, and so on. We don't have tables, so what should be designed? We need to identify what keys are needed to represent our objects and what kind of values this keys need to hold.<br/><br/>Let's start from Users. We need to represent this users of course, with the username, userid, password, followers and following users, and so on. The first question is, what should identify an user inside our system? The username can be a good idea since it is unique, but it is also too big, and we want to stay low on memory. So like if our DB was a relational one we can associate an unique ID to every user. Every other reference to this user will be done by id. That's very simple to do, because we have our atomic INCR operation! When we create a new user we can do something like this, assuming the user is callled &quot;antirez&quot;:<br/><br/><pre class="codeblock python python python python python python python python python python python python" name="code">

masterlist.txt (http://better-oblivion-sorting-software.googlecode.com/svn/) Plain Text · 5744 lines

610 TOTTPointLookoutEdition.esp

611 YearlingsGlasses.esp

612 MaxLevelWorkaround-BS.esp

613 Max Level 99 V2.esp

614 MaxLevel100.esp

615 NoLockTopic.esp

616 LockMan.esp