100+ results for 'php sprintf'

Not the results you expected?

weight_class.php (https://bitbucket.org/deringer/opencart.git) PHP · 412 lines

1 <?php

2 class ControllerLocalisationWeightClass extends Controller {

3 private $error = array();

399

400 if ($product_total) {

401 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

402 }

403 }

tax_class.php (https://bitbucket.org/mjalajel/opencart.git) PHP · 413 lines

1 <?php

2 class ControllerLocalisationTaxClass extends Controller {

3 private $error = array();

244 $this->data['pagination'] = $pagination->render();

245

246 $this->data['results'] = sprintf($this->language->get('text_pagination'), ($tax_class_total) ? (($page - 1) * $this->config->get('config_admin_limit')) + 1 : 0, ((($page - 1) * $this->config->get('config_admin_limit')) > ($tax_class_total - $this->config->get('config_admin_limit'))) ? $tax_class_total : ((($page - 1) * $this->config->get('config_admin_limit')) + $this->config->get('config_admin_limit')), $tax_class_total, ceil($tax_class_total / $this->config->get('config_admin_limit')));

247

248 $this->data['sort'] = $sort;

400

401 if ($product_total) {

402 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

403 }

404 }

length_class.php (https://bitbucket.org/sandeepbhaskar/inspiredliving.git) PHP · 412 lines

1 <?php

2 class ControllerLocalisationLengthClass extends Controller {

3 private $error = array();

399

400 if ($product_total) {

401 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

402 }

403 }

zone.php (https://bitbucket.org/sandeepbhaskar/inspiredliving.git) PHP · 441 lines

1 <?php

2 class ControllerLocalisationZone extends Controller {

3 private $error = array();

410

411 if ($store_total) {

412 $this->error['warning'] = sprintf($this->language->get('error_store'), $store_total);

413 }

414

416

417 if ($address_total) {

418 $this->error['warning'] = sprintf($this->language->get('error_address'), $address_total);

419 }

420

422

423 if ($affiliate_total) {

424 $this->error['warning'] = sprintf($this->language->get('error_affiliate'), $affiliate_total);

425 }

426

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

1 <?php

2 /**

3 * ClusterPress User Relationships.

400

401 $sql = array(

402 'select' => sprintf( 'SELECT %s FROM %s', esc_sql( $column ), $this->table ),

403 'where' => array(),

404 );

465

466 $sql = array(

467 'select' => sprintf( 'SELECT count( %s ) FROM %s', esc_sql( $column ), $this->table ),

468 'where' => array(),

469 );

476

477 if ( $group_by && in_array( $group_by, array( 'user_id', 'primary_id', 'secondary_id' ) ) ) {

478 $sql['select'] = sprintf( 'SELECT DISTINCT %s, count( %s ) as count FROM %s', esc_sql( $group_by ), esc_sql( $column ), $this->table );

479 $sql['groupby'] = sprintf( 'GROUP BY %s', esc_sql( $group_by ) );

Config.cpp (https://gitlab.com/DELTA_37/Config) C++ · 746 lines

466 char *result;

467 dop = new char[(int)(floor(log10(Ints[k])) + 4)];

468 sprintf(dop, "(%d)", Ints[k]);

469 insert(dop, i, j, str);

470 delete[] dop;

481 char *dop;

482 dop = new char[(int)(floor(log10(Doubles[k])) + 10)];

483 sprintf(dop, "(%.5lf)", Doubles[k]);

484 insert(dop, i, j, str);

485 delete[] dop;

builtin-sprintf-warn-10.c (https://gitlab.com/4144/gcc) C · 274 lines

15 /* Macro to test either width or precision specified by the asterisk

16 (but not both). */

17 #define T1(fmt, a) sink (__builtin_sprintf (dst + 1, fmt, a, x), dst)

18

19 /* Macro to test both width and precision specified by the asterisk. */

20 #define T2(fmt, w, p) sink (__builtin_sprintf (dst + 1, fmt, w, p, x), dst)

21

22 /* Macro to test vsprintf with both width and precision specified by

23 the asterisk. */

24 #define T(fmt) sink (__builtin_vsprintf (dst + 1, fmt, va), dst)

25

26 /* Exercise %a. */

tax_class.php (https://gitlab.com/shapcy/opencart) PHP · 402 lines

1 <?php

2 class ControllerLocalisationTaxClass extends Controller {

3 private $error = array();

245 $data['pagination'] = $pagination->render();

246

247 $data['results'] = sprintf($this->language->get('text_pagination'), ($tax_class_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($tax_class_total - $this->config->get('config_limit_admin'))) ? $tax_class_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $tax_class_total, ceil($tax_class_total / $this->config->get('config_limit_admin')));

248

249 $data['sort'] = $sort;

394

395 if ($product_total) {

396 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

397 }

398 }

PU_test_dcp_role.php (https://github.com/CircleCode/dynacase-core.git) PHP · 432 lines

1 <?php

2 /*

3 * @author Anakeen

13 */

14

15 require_once 'PU_testcase_dcp_commonfamily.php';

16

17 class TestRole extends TestCaseDcpCommonFamily

58

59 foreach ($expectedRoles as $roleLogin) {

60 $this->assertTrue(in_array($roleLogin, $uRoleLogins) , sprintf("role %s must be present", $roleLogin));

61 }

62 foreach ($uRoleLogins as $roleLogin) {

63 $this->assertTrue(in_array($roleLogin, $expectedRoles) , sprintf("role %s must not be present", $roleLogin));

64 }

65 }

DefaultOptions.php (https://github.com/Exercise/symfony.git) PHP · 320 lines

1 <?php

2

3 /*

18 * Helper for specifying and resolving inter-dependent options.

19 *

20 * Options are a common pattern for initializing classes in PHP. Avoiding the

21 * problems related to this approach is however a non-trivial task. Usually,

22 * both classes and subclasses should be able to set default option values.

293

294 if (count($diff) > 1) {

295 throw new InvalidOptionException(sprintf('The options "%s" do not exist. Known options are: "%s"', implode('", "', $diff), implode('", "', $knownOptions)));

296 }

297

298 if (count($diff) > 0) {

299 throw new InvalidOptionException(sprintf('The option "%s" does not exist. Known options are: "%s"', current($diff), implode('", "', $knownOptions)));

300 }

301 }

ClassScanner.php (https://github.com/MarcelloDuarte/zf2.git) PHP · 494 lines

1 <?php

2

3 namespace Zend\Code\Scanner;

434 && !is_subclass_of($returnScannerClass, $baseScannerClass)

435 ) {

436 throw new Exception\RuntimeException(sprintf(

437 'Class must be or extend "%s"', $baseScannerClass

438 ));

DDAutoFilterSearchBehavior.php (https://bitbucket.org/jwerner/yii-ddautofilter.git) PHP · 360 lines

1 <?php

2 /**

3 * DDAutoFilterSearchBehavior class file

85 $fromTo = DDDateHelper::WeekRelative(null,-1);

86 $criteria->addCondition(

87 sprintf(

88 "t.%s BETWEEN '%s' AND '%s'",

89 $attribute,

98 $fromTo = DDDateHelper::WeekThis();

99 $criteria->addCondition(

100 sprintf(

101 "t.%s BETWEEN '%s' AND '%s'",

102 $attribute,

111 $fromTo = DDDateHelper::WeekRelative(null,1);

112 $criteria->addCondition(

113 sprintf(

114 "t.%s BETWEEN '%s' AND '%s'",

115 $attribute,

PgCacheFlush.php (https://github.com/elleeott/WPOC-boilerplate.git) PHP · 440 lines

1 <?php

2

3 /**

5 */

6

7 require_once W3TC_LIB_W3_DIR . '/PgCache.php';

8

9 /**

12 class W3_PgCacheFlush extends W3_PgCache {

13 /**

14 * PHP5 Constructor

15 */

16 function __construct() {

19

20 /**

21 * PHP4 Constructor

22 */

23 function W3_PgCacheFlush() {

ConstructorAnnotationsInspectorTest.php (https://gitlab.com/nstwf.pro/json-mapper) PHP · 413 lines

1 <?php

2

3

26 use Nstwf\JsonMapper\Unit\Implementation\UnionEnumObject;

27 use Nstwf\JsonMapper\Unit\Implementation\UnionScalarTypesObject;

28 use PHPUnit\Framework\TestCase;

29 use Psr\SimpleCache\CacheInterface;

30

377 $cache = $this->createMock(CacheInterface::class);

378 $cache->method('has')

379 ->with(sprintf('%s-%s', ConstructorAnnotationsInspector::class, NoTypeObject::class))

380 ->willReturn(false);

381 $cache->expects($this->once())

382 ->method('set')

383 ->with(sprintf('%s-%s', ConstructorAnnotationsInspector::class, NoTypeObject::class));

384

385 $reflection = new ReflectionWrapper(NoTypeObject::class);

Definition.php (https://github.com/nattaphat/hgis.git) PHP · 659 lines

1 <?php

2

3 /*

249 {

250 if ($index < 0 || $index > count($this->arguments) - 1) {

251 throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1));

252 }

253

283 {

284 if ($index < 0 || $index > count($this->arguments) - 1) {

285 throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1));

286 }

287

323 {

324 if (empty($method)) {

325 throw new InvalidArgumentException(sprintf('Method name cannot be empty.'));

326 }

327 $this->calls[] = array($method, $arguments);

Module.php (https://bitbucket.org/alessandro-aglietti/itis-leonardo-da-vinci.git) PHP · 372 lines

1 <?php

2

3 /*

31

32 /**

33 * Compiles the node to PHP.

34 *

35 * @param Twig_Compiler A Twig_Compiler instance

47 {

48 if (!$this->getAttribute('index')) {

49 $compiler->write('<?php');

50 }

51

124 $compiler

125 ->write("\n\n")

126 // if the filename contains */, add a blank to avoid a PHP parse error

127 ->write("/* ".str_replace('*/', '* /', $this->getAttribute('filename'))." */\n")

128 ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename'), $this->getAttribute('index')))

Service.php (https://bitbucket.org/resourcemode/smodels.git) PHP · 439 lines

1 <?php

2 /**

3 * Smodels

250 $attrValue = new ProductAttributeValue(array('uid'=>$attrValueUid)); //$this->getByUid($attrValueUid);

251 // if(!$attrValue) {

252 // $this->messages[] = sprintf('Unable to load attribute value: %s', $attrValue);

253 // }

254 $prodAttrValColl->append($attrValue);

casttypepb_test.go (https://gitlab.com/unofficial-mirrors/openshift-origin) Go · 513 lines

398 p := NewPopulatedCastaway(popr, false)

399 s1 := p.GoString()

400 s2 := fmt.Sprintf("%#v", p)

401 if s1 != s2 {

402 t.Fatalf("GoString want %v got %v", s1, s2)

411 p := NewPopulatedWilson(popr, false)

412 s1 := p.GoString()

413 s2 := fmt.Sprintf("%#v", p)

414 if s1 != s2 {

415 t.Fatalf("GoString want %v got %v", s1, s2)

496 p := NewPopulatedCastaway(popr, false)

497 s1 := p.String()

498 s2 := fmt.Sprintf("%v", p)

499 if s1 != s2 {

500 t.Fatalf("String want %v got %v", s1, s2)

Create.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 374 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

358 public function saveCreditCard($paymentMethod, $creditCardSave)

359 {

360 $saveCard = sprintf($this->vaultCheckbox, $paymentMethod);

361 $this->_rootElement->find($saveCard, Locator::SELECTOR_CSS, 'checkbox')->setValue($creditCardSave);

362 }

TraitUsageGenerator.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 353 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

317 // validation check

318 if ($this->classGenerator->hasMethod($alias['alias'])) {

319 throw new Exception\RuntimeException(sprintf(

320 'Generation Error: Aliased method %s already exists on this class',

321 $alias['alias']

ListenerOptions.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 396 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

89 if (!is_array($modulePaths) && !$modulePaths instanceof Traversable) {

90 throw new Exception\InvalidArgumentException(

91 sprintf(

92 'Argument passed to %s::%s() must be an array, '

93 . 'implement the Traversable interface, or be an '

135 if (!is_array($configGlobPaths) && !$configGlobPaths instanceof Traversable) {

136 throw new Exception\InvalidArgumentException(

137 sprintf(

138 'Argument passed to %s::%s() must be an array, '

139 . 'implement the Traversable interface, or be an '

161 if (!is_array($configStaticPaths) && !$configStaticPaths instanceof Traversable) {

162 throw new Exception\InvalidArgumentException(

163 sprintf(

164 'Argument passed to %s::%s() must be an array, '

165 . 'implement the Traversable interface, or be an '

voucher.php (https://bitbucket.org/elena_dyavolova/omf.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'],

18 'to_email' => $this->request->post['to_email'],

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');

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());

250 }

251

Binary.php (https://gitlab.com/wesleyvanneck/ImagicalMine) PHP · 596 lines

1 <?php

2 /**

3 * src/pocketmine/utils/Binary.php

261

262 if ($signed) {

263 if (PHP_INT_SIZE === 8) {

264 return $b << 56 >> 56;

265 } else {

307 public static function readSignedShort($str)

308 {

309 if (PHP_INT_SIZE === 8) {

310 return unpack("n", $str)[1] << 48 >> 48;

311 } else {

350 public static function readSignedLShort($str)

351 {

352 if (PHP_INT_SIZE === 8) {

353 return unpack("v", $str)[1] << 48 >> 48;

354 } else {

order_status.php (https://gitlab.com/shapcy/opencart) PHP · 380 lines

1 <?php

2 class ControllerLocalisationOrderStatus extends Controller {

3 private $error = array();

245 $data['pagination'] = $pagination->render();

246

247 $data['results'] = sprintf($this->language->get('text_pagination'), ($order_status_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($order_status_total - $this->config->get('config_limit_admin'))) ? $order_status_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $order_status_total, ceil($order_status_total / $this->config->get('config_limit_admin')));

248

249 $data['sort'] = $sort;

366

367 if ($store_total) {

368 $this->error['warning'] = sprintf($this->language->get('error_store'), $store_total);

369 }

370

372

373 if ($order_total) {

374 $this->error['warning'] = sprintf($this->language->get('error_order'), $order_total);

375 }

376 }

return_status.php (https://gitlab.com/reclamare/mao) PHP · 375 lines

1 <?php

2 class ControllerLocalisationReturnStatus extends Controller {

3 private $error = array();

245 $data['pagination'] = $pagination->render();

246

247 $data['results'] = sprintf($this->language->get('text_pagination'), ($return_status_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($return_status_total - $this->config->get('config_limit_admin'))) ? $return_status_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $return_status_total, ceil($return_status_total / $this->config->get('config_limit_admin')));

248

249 $data['sort'] = $sort;

361

362 if ($return_total) {

363 $this->error['warning'] = sprintf($this->language->get('error_return'), $return_total);

364 }

365

367

368 if ($return_total) {

369 $this->error['warning'] = sprintf($this->language->get('error_return'), $return_total);

370 }

371 }

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

1 <?php

2 class ControllerApiShipping extends Controller {

3 public function address() {

73 foreach ($custom_fields as $custom_field) {

74 if (($custom_field['location'] == 'address') && $custom_field['required'] && empty($this->request->post['custom_field'][$custom_field['custom_field_id']])) {

75 $json['error']['custom_field' . $custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field'), $custom_field['name']);

76 }

77 }

Image.php (https://gitlab.com/tunisiano187/PhpNuget) PHP · 465 lines

1 <?php

2 /*

3 * This file is part of forxer\Gravatar.

213 }

214

215 $message = sprintf(

216 'The default image "%s" is not a recognized gravatar "default" and is not a valid URL, default gravatar can be: %s',

217 $sDefaultImage,

357

358 if (!in_array($sRating, $this->aValidRatings)) {

359 $message = sprintf(

360 'Invalid rating "%s" specified, only allowed to be used are: %s',

361 $sRating,

421

422 if (!in_array($sExtension, $this->aValidExtensions)) {

423 $message = sprintf(

424 'The extension "%s" is not a valid one, extension image for Gravatar can be: %s',

425 $sExtension,

class-wpb-map.php (https://gitlab.com/haque.mdmanzurul/barongbarong) PHP · 439 lines

1 <?php

2 /**

3 * WPBakery Visual Composer Main manager.

10 *

11 * This class maps shortcodes settings to VC editors. You can manage add new shortcodes or manage default shortcodes

12 * mapped in config/map.php. For developers it is possible to use API functions to add update settings attributes.

13 *

14 * @see config/map.php

15 * @see include/helpers/helpers_api.php

16 * @since 3.1

17 *

83 * This method maps shortcode to VC.

84 * You need to shortcode's tag and settings to map correctly.

85 * Default shortcodes are mapped in config/map.php file.

86 * The best way is to call this method with "init" action callback function of WP.

87 *

Grammar.php (https://github.com/sergiosgc/Structures_Grammar.git) PHP · 407 lines

1 <?php

2 /* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */

3 namespace sergiosgc;

165 public function addRule($value)

166 {

167 if ($this->isRegular() && !$value->isRegular()) throw new Structures_Grammar_RestrictionException(sprintf(

168 'Trying to add non regular rule to regular grammar (%s)', (string) $value));

169 if ($this->isContextFree() && !$value->isContextFree()) throw new Structures_Grammar_RestrictionException(sprintf(

314 public function setRegular($value)

315 {

316 if ($value && !$this->testRegular()) foreach ($this->rules as $rule) if (!$rule->isRegular()) throw new Structures_Grammar_RestrictionException(sprintf('Grammar is not regular. Unable to introduce restriction. Rule \'%s\' is not regular', (string) $rule));

317 $this->regular = $value;

318 if ($value) $this->setContextFree(true);

388 {

389 $result = '';

390 foreach ($this->rules as $index => $value) $result .= sprintf("[%d] %s\n", $index, (string) $value);

391

392 return $result;

Text.php (https://gitlab.com/madwanz64/laravel) PHP · 341 lines

1 <?php declare(strict_types=1);

2 /*

3 * This file is part of phpunit/php-code-coverage.

4 *

5 * (c) Sebastian Bergmann <sebastian@phpunit.de>

86 $hasBranchCoverage = !empty($coverage->getData(true)->functionCoverage());

87

88 $output = PHP_EOL . PHP_EOL;

89 $report = $coverage->getReport();

90

286 }

287

288 $output .= PHP_EOL . $fullQualifiedPath . PHP_EOL

289 . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ';

290

html-bulk-edit-product.php (https://gitlab.com/webkod3r/tripolis) PHP · 319 lines

62 </label>

63 <label class="change-input">

64 <input type="text" name="_sale_price" class="text sale_price" placeholder="<?php echo sprintf( __( 'Enter sale price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />

65 </label>

66 </div>

131 </label>

132 <label class="change-input">

133 <input type="text" name="_weight" class="text weight" placeholder="<?php echo sprintf( __( '%s (%s)', 'woocommerce' ), wc_format_localized_decimal( 0 ), get_option( 'woocommerce_weight_unit' ) ); ?>" value="">

134 </label>

135 </div>

155 </label>

156 <label class="change-input">

157 <input type="text" name="_length" class="text length" placeholder="<?php echo sprintf( __( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">

158 <input type="text" name="_width" class="text width" placeholder="<?php echo sprintf( __( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">

159 <input type="text" name="_height" class="text height" placeholder="<?php echo sprintf( __( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">

160 </label>

161 </div>

ezcurrencydata.php (https://bitbucket.org/ericsagnes/ezpublish-multisite.git) PHP · 323 lines

1 <?php

2 /**

3 * File containing the eZCurrencyData class.

162 $rateValue = $this->attribute( 'auto_rate_value' );

163 $rateValue = $rateValue * $this->attribute( 'rate_factor' );

164 $rateValue = sprintf( "%7.5f", $rateValue );

165 }

166 */

175 $rateValue = $rateValue * $this->attribute( 'rate_factor' );

176

177 $rateValue = sprintf( "%7.5f", $rateValue );

178

179 $this->RateValue = $rateValue;

YPFHasManyRelation.php (https://github.com/yonpols/ypframework.git) PHP · 351 lines

1 <?php

2 class YPFHasManyRelation extends YPFModelBaseRelation implements IYPFModelQuery, Iterator {

3

103 $this->setCache($relatorModel, $list);

104 } else

105 throw new ErrorDataModel($this->relatorModelName, sprintf('Can\'t assign values to has_many relation: %s', $this->relationName));

106 }

107

118 {

119 if (is_numeric($index))

120 $whereConditions[sprintf('`%s`.`%s`', $aliasPrefix, $key)] = $relatorModel->__get($this->relatorModelParams->keyFields[$index]);

121 else

122 $whereConditions[sprintf('`%s`.`%s`', $aliasPrefix, $key)] = $relatorModel->{$index};

133 public function includeInQuery(YPFModelQuery $query) {

134 if ($this->tableAlias) {

135 $joinedTableName = sprintf('`%s` AS `%s`', $this->relatedModelParams->tableName, $this->tableAlias);

136 $joinedAliasPrefix = $this->tableAlias;

137 } elseif ($this->relatedModelParams->tableAlias) {

BlockCipher.php (https://github.com/cgmartin/zf2.git) PHP · 444 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

119 if (is_string($plugins)) {

120 if (!class_exists($plugins)) {

121 throw new Exception\InvalidArgumentException(sprintf(

122 'Unable to locate symmetric cipher plugins using class "%s"; class does not exist',

123 $plugins

127 }

128 if (!$plugins instanceof SymmetricPluginManager) {

129 throw new Exception\InvalidArgumentException(sprintf(

130 'Expected an instance or extension of %s\SymmetricPluginManager; received "%s"',

131 __NAMESPACE__,

Part.php (https://github.com/sunsetsystems/openemr.git) PHP · 494 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

40 {

41 if (! is_string($content) && ! is_resource($content)) {

42 throw new Exception\InvalidArgumentException(sprintf(

43 "'%s' must be string or resource",

44 $content

Item.php (https://bitbucket.org/dnejedly/eaparts.git) PHP · 335 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 Mage_Sales

23 * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

198 * Check qty availability

199 */

200 $qtyToInvoice = sprintf("%F", $this->getOrderItem()->getQtyToInvoice());

201 $qty = sprintf("%F", $qty);

banner.php (https://gitlab.com/dadangnh/sb1-bon) PHP · 430 lines

1 <?php

2 class ControllerDesignBanner extends Controller {

3 private $error = array();

248 $data['pagination'] = $pagination->render();

249

250 $data['results'] = sprintf($this->language->get('text_pagination'), ($banner_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($banner_total - $this->config->get('config_limit_admin'))) ? $banner_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $banner_total, ceil($banner_total / $this->config->get('config_limit_admin')));

251

252 $data['sort'] = $sort;

tabs_helper.php (https://github.com/rickogden/joind.in.git) PHP · 337 lines

1 <?php

2 /**

3 * Helpers for creating Accessible Tabs.

4 *

5 * PHP version 5

6 *

7 * @category Joind.in

145 }

146 ?>

147 <div id="<?php echo $this->_containerName; ?>-tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">

148 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">

149 <?php

160 ?>

161 </ul>

162 <?php foreach($contentList as $hash=>$tabContent):

163 echo $tabContent;

164 endforeach; ?>

class-wp-customize-theme-control.php (https://github.com/livinglab/openlab.git) PHP · 271 lines

81 <# } #>

82

83 <span class="more-details theme-details" id="{{ data.section }}-{{ data.theme.id }}-action" aria-label="<?php echo esc_attr( $details_label ); ?>"><?php _e( 'Theme Details' ); ?></span>

84

85 <div class="theme-author">

238 </h3>

239 <div class="theme-actions">

240 <button type="button" class="button button-primary customize-theme" aria-label="<?php echo esc_attr( $customize_label ); ?>"><?php _e( 'Customize' ); ?></button>

241 </div>

242 </div>

248 <# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>

249 <button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></button>

250 <# } else { #>

251 <button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $preview_label ); ?>"><?php _e( 'Live Preview' ); ?></button>

260 <# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>

261 <button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install &amp; Preview' ); ?></button>

262 <# } else { #>

263 <button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $install_label ); ?>" disabled><?php _e( 'Install &amp; Preview' ); ?></button>

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

1 <?php

2

3 /*

95 {

96 if (!isset($this->elements[$offset])) {

97 throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));

98 }

99

150 {

151 if (!isset($this->elements[$offset])) {

152 throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));

153 }

154

171 {

172 if (!isset($this->elements[$offset])) {

173 throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));

174 }

175

move.php (https://github.com/MarxGames/E-Hobused.git) PHP · 328 lines

1 <?php

2 include_once 'models/game.php';

57 // Don forget call parent::save($game)!

58 public function save(Game $game) {

59 $q = sprintf("UPDATE game SET checksum = checksum + 1 WHERE id = %d;", $game->values['id']);

60 $game->values['checksum'] += 1;

61 query($q);

77 parent::save($game);

78

79 $query_string = sprintf("INSERT INTO move(game_id, type, object, param1) ".

80 "VALUES (%d, 'add_horse', %d, %d);",

81 $game->values['id'],

109 parent::save($game);

110

111 $query_string = sprintf("INSERT INTO move(game_id, type, subject, object, round, param1, param2, param3) ".

112 "VALUES (%d, 'place_horse', %d, %d, %d, %d, %d, %d);",

113 $game->values['id'],

phpClass.php (https://github.com/Calak/atoum.git) PHP · 375 lines

1 <?php

2

3 namespace mageekguy\atoum\tests\units\asserters;

9 ;

10

11 require_once(__DIR__ . '/../../runner.php');

12

13 class phpClass extends atoum\test

30 public function test__construct()

31 {

32 $asserter = new asserters\phpClass($generator = new asserter\generator($this));

33

34 $this->assert

41 public function testGetClass()

42 {

43 $asserter = new asserters\phpClass(new asserter\generator($this));

44

45 $this->assert

filespec.c (https://bitbucket.org/olioengr/dmd.git) C · 424 lines

153 cwd = (char *)mem_calloc(strlen(cwd_t) + 1 + strlen(p) + 1);

154 #if SUN || M_UNIX || M_XENIX || linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun&&__SVR4

155 sprintf(cwd, "%s/%s", cwd_t, p); /* add relative directory */

156 #endif

157 #if MSDOS || __OS2__ || __NT__ || _WIN32

158 sprintf(cwd, "%s\\%s", cwd_t, p); /* add relative directory */

159 #endif

160 mem_free(cwd_t);

174 cwd = (char *)mem_calloc(strlen(cwd_t) + 1 + strlen(p) + 1);

175 #if SUN || M_UNIX || M_XENIX || linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun&&__SVR4

176 sprintf(cwd, "%s/%s", cwd_t, p); /* add relative directory */

177 #endif

178 #if MSDOS || __OS2__ || __NT__ || _WIN32

function.html_select_time.php (https://github.com/cabenitez/factuweb.git) PHP · 364 lines

1 <?php

2 /**

3 * Smarty plugin

10 * @ignore

11 */

12 require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');

13 /**

14 * @ignore

15 */

16 require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');

17

18 /**

23 * Purpose: Prints the dropdowns for time selection

24 *

25 * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}

26 * (Smarty online manual)

27 * @author Roberto Berto <roberto@berto.net>

weight_class.php (https://gitlab.com/dadangnh/sb1-bon) PHP · 401 lines

1 <?php

2 class ControllerLocalisationWeightClass extends Controller {

3 private $error = array();

251 $data['pagination'] = $pagination->render();

252

253 $data['results'] = sprintf($this->language->get('text_pagination'), ($weight_class_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($weight_class_total - $this->config->get('config_limit_admin'))) ? $weight_class_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $weight_class_total, ceil($weight_class_total / $this->config->get('config_limit_admin')));

254

255 $data['sort'] = $sort;

393

394 if ($product_total) {

395 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

396 }

397 }

Collection.php (https://bitbucket.org/dnejedly/eaparts.git) PHP · 333 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 Mage_Catalog

23 * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

297 foreach ($attributes as $attribute) {

298 $table = $this->getLinkModel()->getAttributeTypeTable($attribute['type']);

299 $alias = sprintf('link_attribute_%s_%s', $attribute['code'], $attribute['type']);

300

301 $joinCondiotion = array(

Form.php (https://github.com/flubbers/cloudFutbol.git) PHP · 390 lines

1 <?php

2

3 /*

123

124 /**

125 * Gets the field values as PHP.

126 *

127 * This method converts fields with th array notation

128 * (like foo[bar] to arrays) like PHP does.

129 *

130 * @return array An array of field values.

132 * @api

133 */

134 public function getPhpValues()

135 {

136 $qs = http_build_query($this->getValues());

Query.php (https://github.com/brikou/mandango.git) PHP · 606 lines

1 <?php

2

3 /*

51 $hash = $this->repository->getDocumentClass();

52

53 if (version_compare(PHP_VERSION, '5.3.6', '=>')) {

54 $debugBacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);

55 } else {

220 {

221 if (null !== $references && !is_array($references)) {

222 throw new \InvalidArgumentException(sprintf('The references "%s" are not valid.', $references));

223 }

224

254 {

255 if (null !== $sort && !is_array($sort)) {

256 throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));

257 }

258

errors.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 288 lines

163 if ($expectation = $this->_extractExpectation()) {

164 list($expected, $message) = $expectation;

165 $this->_test->assert($expected, $content, sprintf(

166 $message,

167 "%s -> PHP error [$content] severity [" .

177 * @return mixed False if none, or a list of error

178 * information. Elements are: severity

179 * as the PHP error code, the error message,

180 * the file with the error, the line number

181 * and a list of PHP super global arrays.

224 $expected,

225 $content,

226 sprintf($message, "Expected PHP error [$content] severity [$severity] in [$file] line [$line]"));

227 }

228

voucher_theme.php (https://gitlab.com/shapcy/opencart) PHP · 402 lines

1 <?php

2 class ControllerSaleVoucherTheme extends Controller {

3 private $error = array();

245 $data['pagination'] = $pagination->render();

246

247 $data['results'] = sprintf($this->language->get('text_pagination'), ($voucher_theme_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($voucher_theme_total - $this->config->get('config_limit_admin'))) ? $voucher_theme_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $voucher_theme_total, ceil($voucher_theme_total / $this->config->get('config_limit_admin')));

248

249 $data['sort'] = $sort;

394

395 if ($voucher_total) {

396 $this->error['warning'] = sprintf($this->language->get('error_voucher'), $voucher_total);

397 }

398 }

ResponseHeader.php (https://github.com/Shreef/zf2.git) PHP · 395 lines

1 <?php

2 /**

3 * Zend Framework

15 * @category Zend

16 * @package Zend_Test

17 * @subpackage PHPUnit

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

23 * @namespace

24 */

25 namespace Zend\Test\PHPUnit\Constraint;

26 use Zend\Controller\Response;

27

28 /**

29 * Response header PHPUnit Constraint

30 *

31 * @uses PHPUnit_Framework_Constraint

Workflow.php (https://github.com/deviantintegral/symfony.git) PHP · 322 lines

1 <?php

2

3 /*

47

48 if (!$marking instanceof Marking) {

49 throw new LogicException(sprintf('The value returned by the MarkingStore is not an instance of "%s" for workflow "%s".', Marking::class, $this->name));

50 }

51

53 if (!$marking->getPlaces()) {

54 if (!$this->definition->getInitialPlace()) {

55 throw new LogicException(sprintf('The Marking is empty and there is no initial place for workflow "%s".', $this->name));

56 }

57 $marking->mark($this->definition->getInitialPlace());

65 foreach ($marking->getPlaces() as $placeName => $nbToken) {

66 if (!isset($places[$placeName])) {

67 $message = sprintf('Place "%s" is not valid for workflow "%s".', $placeName, $this->name);

68 if (!$places) {

69 $message .= ' It seems you forgot to add places to the current workflow.';

passlistrpt.php (https://bitbucket.org/anneivycat/california-tour.git) PHP · 226 lines

174 foreach($a_value AS $sb_key => $sb_value) {

175 if(++$count <= 5) {

176 echo "<tr><td>" . $a_key . "</td><td>" . $sb_value['LAST_NAME'] . " " . $sb_value['FIRST_NAME'] . "</td><td>" . $sb_value['GENDER'] . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALCHARGE']) . "</td><td>" . sprintf("%5.2f",$sb_value['WEBDISCOUNT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYTODLT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYTOAGENT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYCC']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALBALANCE']) . "</td></tr>\n";

177 }

178 else {

179 echo "<tr><td colspan='9'>&nbsp;</td></tr>\n";

180 echo "<tr><td>" . $a_key . "</td><td>" . $sb_value['LAST_NAME'] . " " . $sb_value['FIRST_NAME'] . "</td><td>" . $sb_value['GENDER'] . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALCHARGE']) . "</td><td>" . sprintf("%5.2f",$sb_value['WEBDISCOUNT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYTODLT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYTOAGENT']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALPAYCC']) . "</td><td>" . sprintf("%5.2f",$sb_value['TOTALBALANCE']) . "</td></tr>\n";

181 $count = 1;

182 }

198 }

199 }

200 echo "<tr><td>Total:</td><td></td><td>" . $pu_people_count . "</td><td>" . sprintf("%5.2f",$pu_total_charge) . "</td><td>" . sprintf("%5.2f",$pu_web_discount) . "</td><td>" . sprintf("%5.2f",$pu_pay_to_dlt) . "</td><td>" . sprintf("%5.2f",$pu_pay_to_agent) . "</td><td>" . sprintf("%5.2f",$pu_pay_to_cc) . "</td><td>" . sprintf("%5.2f",$pu_balance) . "</td></tr>";

201 }

202 echo "<tr><td><b>Total:</b></td><td></td><td><b>" . $tour_people_count . "</b></td><td><b>" . sprintf("%5.2f",$tour_total_charge) . "</b></td><td><b>" . sprintf("%5.2f",$tour_web_discount) . "</b></td><td><b>" . sprintf("%5.2f",$tour_pay_to_dlt) . "</b></td><td><b>" . sprintf("%5.2f",$tour_pay_to_agent) . "</b></td><td><b>" . sprintf("%5.2f",$tour_pay_to_cc) . "</b></td><td><b>" . sprintf("%5.2f",$tour_balance) . "</b></td></tr>";

Label.class.php (https://bitbucket.org/jstechnologies/cats.git) PHP · 679 lines

1 <?php

2 /*

3 * This work is hereby released into the Public Domain.

238 $function = 'label'.time().'_'.(microtime() * 1000000);

239 eval('function '.$function.'($value) {

240 return sprintf("'.addcslashes($format, '"').'", $value);

241 }');

242 $this->setCallbackFunction($function);

TraceableEventDispatcher.php (https://github.com/deviantintegral/symfony.git) PHP · 335 lines

1 <?php

2

3 /*

131

132 if (null !== $this->logger && $event->isPropagationStopped()) {

133 $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));

134 }

135

Factory.php (https://github.com/shevron/zf2.git) PHP · 297 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

99 {

100 if (!is_array($inputSpecification) && !$inputSpecification instanceof Traversable) {

101 throw new Exception\InvalidArgumentException(sprintf(

102 '%s expects an array or Traversable; received "%s"',

103 __METHOD__,

113 $class = $inputSpecification['type'];

114 if (!class_exists($class)) {

115 throw new Exception\RuntimeException(sprintf(

116 'Input factory expects the "type" to be a valid class; received "%s"',

117 $class

126

127 if (!$input instanceof InputInterface) {

128 throw new Exception\RuntimeException(sprintf(

129 'Input factory expects the "type" to be a class implementing %s; received "%s"',

130 'Zend\InputFilter\InputInterface',

S3.php (https://github.com/EthanBlast/Glam-Star-Life.git) PHP · 452 lines

1 <?php

2

3 /**

4 * Amazon S3 CDN engine

5 */

6 require_once W3TC_LIB_W3_DIR . '/Cdn/Base.php';

7

8 if (!class_exists('S3')) {

9 require_once W3TC_LIB_DIR . '/S3.php';

10 }

11

252

253 if (!$buckets) {

254 $error = sprintf('Unable to list buckets (%s).', $this->get_last_error());

255

256 $this->restore_error_handler();

SubscriptionDAO.inc.php (https://github.com/mcrider/pkpUpgradeTestSuite.git) PHP · 474 lines

1 <?php

2

3 /**

4 * SubscriptionDAO.inc.php

5 *

6 * Copyright (c) 2003-2004 The Public Knowledge Project

12 * Operations for retrieving and modifying Subscription objects.

13 *

14 * $Id: SubscriptionDAO.inc.php,v 1.6 2005/05/03 17:45:25 alec Exp $

15 */

16

383 } else {

384 $matchFound = false;

385 $IP = sprintf('%u', ip2long($IP));

386

387 while (!$result->EOF) {

Rscf.php (https://github.com/sharpmachine/wakeupmedia.com.git) PHP · 359 lines

1 <?php

2

3 /**

8 }

9

10 require_once W3TC_LIB_W3_DIR . '/Cdn/Base.php';

11 require_once W3TC_LIB_CF_DIR . '/cloudfiles.php';

37

38 /**

39 * PHP5 Constructor

40 *

41 * @param array $config

54

55 /**

56 * PHP4 Constructor

57 *

58 * @param array $config

Route.php (https://bitbucket.org/laborautonomo/laborautonomo-site.git) PHP · 594 lines

1 <?php

2

3 /*

568 {

569 if (!is_string($regex)) {

570 throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" must be a string.', $key));

571 }

572

580

581 if ('' === $regex) {

582 throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" cannot be empty.', $key));

583 }

584

layout.php (https://bitbucket.org/deringer/opencart.git) PHP · 419 lines

1 <?php

2 class ControllerDesignLayout extends Controller {

3 private $error = array();

388

389 if ($store_total) {

390 $this->error['warning'] = sprintf($this->language->get('error_store'), $store_total);

391 }

392

394

395 if ($product_total) {

396 $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total);

397 }

398

400

401 if ($category_total) {

402 $this->error['warning'] = sprintf($this->language->get('error_category'), $category_total);

403 }

404

NumberHelper.php (https://github.com/sonata-project/SonataIntlBundle.git) PHP · 367 lines

1 <?php

2

3 declare(strict_types=1);

342

343 if (!\defined($constantName)) {

344 throw new \InvalidArgumentException(sprintf('NumberFormatter has no constant "%s".', $attribute));

345 }

346

NameContext.php (https://gitlab.com/madwanz64/laravel) PHP · 285 lines

1 <?php declare(strict_types=1);

2

3 namespace PhpParser;

4

5 use PhpParser\Node\Name;

6 use PhpParser\Node\Name\FullyQualified;

7 use PhpParser\Node\Stmt;

8

9 class NameContext

70

71 $this->errorHandler->handleError(new Error(

72 sprintf(

73 'Cannot use %s%s as %s because the name is already in use',

74 $typeStringMap[$type], $name, $aliasName

Cache_File.php (https://gitlab.com/karlen/ayo_wp) PHP · 455 lines

1 <?php

2 namespace W3TC;

3

116 $expires_at = time() + $expire;

117 @fputs( $fp, pack( 'L', $expires_at ) );

118 @fputs( $fp, '<?php exit; ?>' );

119 @fputs( $fp, @serialize( $var ) );

120 @fclose( $fp );

314 $hash = md5( $key );

315

316 $path = sprintf( '%s/%s/%s.php', substr( $hash, 0, 3 ), substr( $hash, 3, 3 ), $hash );

317

318 return $path;

408

409 @fputs( $fp, pack( 'L', $expires_at ) );

410 @fputs( $fp, '<?php exit; ?>' );

411 @fputs( $fp, (int)$value );

412 @fclose( $fp );

example16.6.html (https://gitlab.com/GLORIA04/conception-site-web) HTML · 114 lines

1 <div style="font-weight: bold;margin-left:15px;">example16.6.php</div><link rel="stylesheet" href="../phphl.css" type="text/css"><div class="hl-main"><table class="hl-table" width="100%"><tr><td class="hl-gutter" align="right" valign="top"><pre>1

2 2

3 3

56 56

57 57

58 </pre></td><td class="hl-main" valign="top"><pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code"> </span><span class="hl-comment">//</span><span class="hl-comment"> content=&quot;text/plain; charset=utf-8&quot;</span><span class="hl-comment"></span><span class="hl-code">

59 </span><span class="hl-reserved">require_once</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">jpgraph/jpgraph.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;

60 </span><span class="hl-reserved">require_once</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">jpgraph/jpgraph_scatter.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;

61 </span><span class="hl-reserved">require_once</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">jpgraph/jpgraph_line.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;

84 </span><span class="hl-var">$graph</span><span class="hl-code">-&gt;</span><span class="hl-identifier">title</span><span class="hl-code">-&gt;</span><span class="hl-identifier">SetFont</span><span class="hl-brackets">(</span><span class="hl-identifier">FF_ARIAL</span><span class="hl-code">,</span><span class="hl-identifier">FS_BOLD</span><span class="hl-code">,</span><span class="hl-number">14</span><span class="hl-brackets">)</span><span class="hl-code">;

85

86 </span><span class="hl-var">$graph</span><span class="hl-code">-&gt;</span><span class="hl-identifier">subtitle</span><span class="hl-code">-&gt;</span><span class="hl-identifier">Set</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">(stderr=</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-identifier">sprintf</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">%.2f</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-var">$stderr</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">, corr=</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-identifier">sprintf</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">%.2f</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-var">$corr</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">)</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;

87 </span><span class="hl-var">$graph</span><span class="hl-code">-&gt;</span><span class="hl-identifier">subtitle</span><span class="hl-code">-&gt;</span><span class="hl-identifier">SetFont</span><span class="hl-brackets">(</span><span class="hl-identifier">FF_ARIAL</span><span class="hl-code">,</span><span class="hl-identifier">FS_NORMAL</span><span class="hl-code">,</span><span class="hl-number">12</span><span class="hl-brackets">)</span><span class="hl-code">;

88

Message.php (https://github.com/schmittjoh/JMSTranslationBundle.git) PHP · 409 lines

1 <?php

2

3 declare(strict_types=1);

293 {

294 if ($this->id !== $message->getId()) {

295 throw new RuntimeException(sprintf('You can only merge messages with the same id. Expected id "%s", but got "%s".', $this->id, $message->getId()));

296 }

297

328 {

329 if ($this->id !== $message->getId()) {

330 throw new RuntimeException(sprintf('You can only merge messages with the same id. Expected id "%s", but got "%s".', $this->id, $message->getId()));

331 }

332

361 {

362 if ($this->id !== $message->getId()) {

363 throw new RuntimeException(sprintf('You can only merge messages with the same id. Expected id "%s", but got "%s".', $this->id, $message->getId()));

364 }

365

DelegatingValidator.php (https://github.com/xbojer/gfw.git) PHP · 259 lines

1 <?php

2

3 /*

250 if (is_string($form)) {

251 if (!isset($forms[$form])) {

252 throw new FormException(sprintf('The child form with path "%s" does not exist', $form));

253 }

254

Module.php (https://bitbucket.org/gerg711/asdfchan.git) PHP · 302 lines

1 <?php

2

3 /*

25

26 /**

27 * Compiles the node to PHP.

28 *

29 * @param Twig_Compiler A Twig_Compiler instance

103 {

104 $compiler

105 ->write("<?php\n\n")

106 // if the filename contains */, add a blank to avoid a PHP parse error

107 ->write("/* ".str_replace('*/', '* /', $this->getAttribute('filename'))." */\n")

108 ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename')))

109 ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass()))

110 ->write("{\n")

111 ->indent()

ViewModel.php (https://github.com/Thinkscape/zf2.git) PHP · 492 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

184

185 if (!is_array($options)) {

186 throw new Exception\InvalidArgumentException(sprintf(

187 '%s: expects an array, or Traversable argument; received "%s"',

188 __METHOD__,

259 {

260 if (!is_array($variables) && !$variables instanceof Traversable) {

261 throw new Exception\InvalidArgumentException(sprintf(

262 '%s: expects an array, or Traversable argument; received "%s"',

263 __METHOD__,

class-yoast-plugin-conflict.php (https://gitlab.com/najomie/fit-hippie) PHP · 333 lines

1 <?php

2 /**

3 * @package WPSEO\Admin

116 public function get_conflicting_plugins_as_string( $plugin_section ) {

117 if ( ! function_exists( 'get_plugin_data' ) ) {

118 require_once( ABSPATH . '/wp-admin/includes/plugin.php' );

119 }

120

196 $error_message = '';

197 /* translators: %1$s: 'Facebook & Open Graph' plugin name(s) of possibly conflicting plugin(s), %2$s to Yoast SEO */

198 $error_message .= '<p>' . sprintf( __( 'The %1$s plugin might cause issues when used in conjunction with %2$s.', 'wordpress-seo' ), '<em>' . $plugin_name . '</em>', 'Yoast SEO' ) . '</p>';

199 $error_message .= '<p>' . sprintf( $readable_plugin_section, 'Yoast SEO', $plugin_name ) . '</p>';

200

201 /* translators: %s: 'Facebook' plugin name of possibly conflicting plugin */

202 $error_message .= '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=all', 'deactivate-plugin_' . $plugin_file ) . '">' . sprintf( __( 'Deactivate %s', 'wordpress-seo' ), WPSEO_Utils::get_plugin_name( $plugin_file ) ) . '</a> ';

203

204 $identifier = $this->get_notification_identifier( $plugin_file );

PgCache.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 348 lines

1 <?php

2

3 /**

8 }

9

10 w3_require_once(W3TC_LIB_W3_DIR . '/Plugin.php');

11

12 /**

201 'w3_pgcache_cleanup' => array(

202 'interval' => $gc_interval,

203 'display' => sprintf('[W3TC] Page Cache file GC (every %d seconds)', $gc_interval)

204 ),

205 'w3_pgcache_prime' => array(

206 'interval' => $prime_interval,

207 'display' => sprintf('[W3TC] Page Cache prime (every %d seconds)', $prime_interval)

208 )

209 ));

Router.php (https://gitlab.com/milton2913/myBlog) PHP · 388 lines

1 <?php

2

3 /*

132 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator',

133 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator',

134 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper',

135 'generator_cache_class' => 'ProjectUrlGenerator',

136 'matcher_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher',

137 'matcher_base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher',

138 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper',

139 'matcher_cache_class' => 'ProjectUrlMatcher',

140 'resource_type' => null,

153

154 if ($invalid) {

155 throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('", "', $invalid)));

156 }

157 }

listings.php (https://gitlab.com/sihabudinahmad/asppi) PHP · 423 lines

119 if ( $archive ) {

120 ?>

121 <a href="<?php echo esc_attr( get_post_type_archive_link( $post_type ) ); ?>"><?php esc_html_e( 'View frontend archive', 'custom-post-type-ui' ); ?></a>

122 <?php } ?>

168 <p><strong><?php esc_html_e( 'Archives file name examples.', 'custom-post-type-ui' ); ?></strong><br/>

169 archive-<?php echo esc_html( $post_type ); ?>.php<br/>

170 archive.php<br/>

175 single-<?php echo esc_html( $post_type ); ?>-post_slug.php (WP 4.4+) *<br/>

176 single-<?php echo esc_html( $post_type ); ?>.php<br/>

177 single.php<br/>

193 </tr>

194

195 <?php

196 $counter++;

197 }

335 taxonomy-<?php echo esc_html( $taxonomy ); ?>-term_slug.php *<br />

336 taxonomy-<?php echo esc_html( $taxonomy ); ?>.php<br />

337 taxonomy.php<br />

voucher.php (https://github.com/smadi/arabian-land.git) PHP · 259 lines

1 <?php

2 class ControllerCheckoutVoucher extends Controller {

3 private $error = array();

16 if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {

17 $this->session->data['vouchers'][rand()] = array(

18 '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']),

19 'to_name' => $this->request->post['to_name'],

20 'to_email' => $this->request->post['to_email'],

53 $this->data['entry_from_email'] = $this->language->get('entry_from_email');

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

55 $this->data['entry_amount'] = sprintf($this->language->get('entry_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1));

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

57

239

240 if (($this->request->post['amount'] < 1) || ($this->request->post['amount'] > 1000)) {

241 $this->error['amount'] = sprintf($this->language->get('error_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1) . ' ' . $this->currency->getCode());

242 }

243

background_test.php (https://github.com/proyectoalba/alba.git) PHP · 346 lines

1 <?php

2 /**

3 * ezcGraphBackgroundTest

10 */

11

12 require_once dirname( __FILE__ ) . '/test_case.php';

13

14 /**

28 public static function suite()

29 {

30 return new PHPUnit_Framework_TestSuite( "ezcGraphBackgroundTest" );

31 }

32

35 static $i = 0;

36

37 $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/';

38 $this->basePath = dirname( __FILE__ ) . '/data/';

39 }

DataSeriesValues.php (https://github.com/sbourget/moodle.git) PHP · 397 lines

1 <?php

2

3 namespace PhpOffice\PhpSpreadsheet\Chart;

4

5 use PhpOffice\PhpSpreadsheet\Calculation\Calculation;

6 use PhpOffice\PhpSpreadsheet\Calculation\Functions;

7 use PhpOffice\PhpSpreadsheet\Cell\Coordinate;

8 use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

9

10 class DataSeriesValues

251 {

252 if (!preg_match('/^[a-f0-9]{6}$/i', $color)) {

253 throw new Exception(sprintf('Invalid hex color for chart series (color: "%s")', $color));

254 }

255

home.php (https://gitlab.com/Etern4l/BitcoinDice) PHP · 84 lines

21 <tr class="vypis_table_obsah">

22 <td>Total profit:</td>

23 <td><b><?php $settings['t_player_profit']=(0-$settings['t_player_profit']); echo ($settings['t_player_profit']>=0)?'<span style="color: green;">+'.sprintf("%.8f",$settings['t_player_profit']).'</span>':'<span style="color: #d10000;">'.sprintf("%.8f",$settings['t_player_profit']).'</span>'; ?></b> <?php echo $settings['currency_sign']; ?></td>

24 </tr>

25 <tr class="vypis_table_obsah">

66 <td><?php $this_q=mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN (0-((`bet_amount`*`multiplier`)-`bet_amount`)) ELSE `bet_amount` END) AS `total_profit`,SUM(`bet_amount`) AS `total_wager` FROM `bets` WHERE `time`>NOW()-INTERVAL 30 DAY"); $h_e_=mysql_fetch_array($this_q); $h_e_['h_e']=($h_e_['total_wager']!=0)?(($h_e_['total_profit']/$h_e_['total_wager'])*100):0; echo ($h_e_['h_e']>=0)?'<span style="color: green;">+'.sprintf("%.5f",$h_e_['h_e']).'%</span>':'<span style="color: #d10000;">'.sprintf("%.5f",$h_e_['h_e']).'%</span>'; ?></td>

67 <td><?php $profit_=mysql_fetch_array(mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN ((`bet_amount`*`multiplier`)-`bet_amount`) ELSE (0-`bet_amount`) END) AS `profit` FROM `bets` WHERE `time`>NOW()-INTERVAL 30 DAY")); echo ((0-$profit_['profit'])>=0)?'<span style="color: green;">+'.sprintf("%.8f",0-$profit_['profit']).'</span>':'<span style="color: #d10000;">'.sprintf("%.8f",0-$profit_['profit']).'</span>'; ?></td>

68 </tr>

69 <tr>

71 <td><?php $this_q=mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN (0-((`bet_amount`*`multiplier`)-`bet_amount`)) ELSE `bet_amount` END) AS `total_profit`,SUM(`bet_amount`) AS `total_wager` FROM `bets` WHERE `time`>NOW()-INTERVAL 6 MONTH"); $h_e_=mysql_fetch_array($this_q); $h_e_['h_e']=($h_e_['total_wager']!=0)?(($h_e_['total_profit']/$h_e_['total_wager'])*100):0; echo ($h_e_['h_e']>=0)?'<span style="color: green;">+'.sprintf("%.5f",$h_e_['h_e']).'%</span>':'<span style="color: #d10000;">'.sprintf("%.5f",$h_e_['h_e']).'%</span>'; ?></td>

72 <td><?php $profit_=mysql_fetch_array(mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN ((`bet_amount`*`multiplier`)-`bet_amount`) ELSE (0-`bet_amount`) END) AS `profit` FROM `bets` WHERE `time`>NOW()-INTERVAL 6 MONTH")); echo ((0-$profit_['profit'])>=0)?'<span style="color: green;">+'.sprintf("%.8f",0-$profit_['profit']).'</span>':'<span style="color: #d10000;">'.sprintf("%.8f",0-$profit_['profit']).'</span>'; ?></td>

73 </tr>

74 <tr>

81 <td><?php $this_q=mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN (0-((`bet_amount`*`multiplier`)-`bet_amount`)) ELSE `bet_amount` END) AS `total_profit`,SUM(`bet_amount`) AS `total_wager` FROM `bets`"); $h_e_=mysql_fetch_array($this_q); $h_e_['h_e']=($h_e_['total_wager']!=0)?(($h_e_['total_profit']/$h_e_['total_wager'])*100):0; echo ($h_e_['h_e']>=0)?'<span style="color: green;">+'.sprintf("%.5f",$h_e_['h_e']).'%</span>':'<span style="color: #d10000;">'.sprintf("%.5f",$h_e_['h_e']).'%</span>'; ?></td>

82 <td><?php $profit_=mysql_fetch_array(mysql_query("SELECT SUM(CASE WHEN `win_lose`=1 THEN ((`bet_amount`*`multiplier`)-`bet_amount`) ELSE (0-`bet_amount`) END) AS `profit` FROM `bets`")); echo ((0-$profit_['profit'])>=0)?'<span style="color: green;">+'.sprintf("%.8f",0-$profit_['profit']).'</span>':'<span style="color: #d10000;">'.sprintf("%.8f",0-$profit_['profit']).'</span>'; ?></td>

83 </tr>

84 </table>

MultiselectgrouplistElement.php (https://gitlab.com/axeltizon/magento-demopoweraccess) PHP · 327 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

129 protected function selectOption($option)

130 {

131 $optionElement = $this->find(sprintf($this->uiOptionText, $option), Locator::SELECTOR_XPATH);

132 if ($optionElement->isVisible()) {

133 if (!$optionElement->isSelected()) {

144 foreach ($values as $value) {

145 $optionIndent = $isOptgroup ? $this->indent : '';

146 $optionElement = $context->find(sprintf($this->option, $optionIndent . $value), Locator::SELECTOR_XPATH);

147 if ($optionElement->isVisible()) {

148 if (!$optionElement->isSelected()) {

174 protected function getOptgroup($value, ElementInterface $context)

175 {

176 $optgroup = $context->find(sprintf($this->optgroupByLabel, $value), Locator::SELECTOR_XPATH);

177 if (!$optgroup->isVisible()) {

178 throw new \Exception("Can't find group \"{$value}\".");

Folder.php (https://github.com/ewandor/horde.git) PHP · 247 lines

1 <?php

2 /**

3 * The Horde_Kolab_Cli_Module_Folder:: class handles single folders.

4 *

5 * PHP version 5

6 *

7 * @category Horde

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_Cli

12 */

13

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_Cli

27 */

28 class Horde_Kolab_Cli_Module_Folder

return_status.php (https://bitbucket.org/mjalajel/opencart.git) PHP · 385 lines

1 <?php

2 class ControllerLocalisationReturnStatus extends Controller {

3 private $error = array();

244 $this->data['pagination'] = $pagination->render();

245

246 $this->data['results'] = sprintf($this->language->get('text_pagination'), ($return_status_total) ? (($page - 1) * $this->config->get('config_admin_limit')) + 1 : 0, ((($page - 1) * $this->config->get('config_admin_limit')) > ($return_status_total - $this->config->get('config_admin_limit'))) ? $return_status_total : ((($page - 1) * $this->config->get('config_admin_limit')) + $this->config->get('config_admin_limit')), $return_status_total, ceil($return_status_total / $this->config->get('config_admin_limit')));

247

248 $this->data['sort'] = $sort;

366

367 if ($return_total) {

368 $this->error['warning'] = sprintf($this->language->get('error_return'), $return_total);

369 }

370

372

373 if ($return_total) {

374 $this->error['warning'] = sprintf($this->language->get('error_return'), $return_total);

375 }

376 }

BuilderConfiguration.php (https://github.com/ad2joe/php-framework-benchmarks.git) PHP · 396 lines

1 <?php

2

3 namespace Symfony\Components\DependencyInjection;

193 {

194 if (!$this->hasParameter($name)) {

195 throw new \InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));

196 }

197

281 {

282 if (!$this->hasAlias($alias)) {

283 throw new \InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $alias));

284 }

285

369 {

370 if (!$this->hasDefinition($id)) {

371 throw new \InvalidArgumentException(sprintf('The service definition "%s" does not exist.', $id));

372 }

373

rsslinks-widget.php (https://gitlab.com/thisishayat/itv-2016) PHP · 221 lines

1 <?php

2 /**

3 * Module Name: RSS Links Widget

16 parent::__construct(

17 'rss_links',

18 /** This filter is documented in modules/widgets/facebook-likebox.php */

19 apply_filters( 'jetpack_widget_name', __( 'RSS Links', 'jetpack' ) ),

20 $widget_ops

27 extract( $args );

28

29 /** This filter is documented in core/src/wp-includes/default-widgets.php */

30 $title = apply_filters( 'widget_title', $instance['title'] );

31 echo $before_widget;

163 }

164

165 $subscribe_to = sprintf( __( 'Subscribe to %s', 'jetpack' ), $type_text );

166

167 $link_item = '';

FlashMessenger.php (https://github.com/tmccormi/openemr.git) PHP · 353 lines

1 <?php

2 /**

3 * @link http://github.com/zendframework/zend-view for the canonical source repository

190

191 // Generate markup

192 $markup = sprintf($this->getMessageOpenFormat(), ' class="' . implode(' ', $classes) . '"');

193 $markup .= implode(

194 sprintf($this->getMessageSeparatorString(), ' class="' . implode(' ', $classes) . '"'),

299 && ! $pluginFlashMessenger instanceof PluginFlashMessenger

300 ) {

301 throw new InvalidArgumentException(sprintf(

302 '%s expects either a %s or %s instance; received %s',

303 __METHOD__,

View.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 323 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

14 * View block on order's view page

15 *

16 * @SuppressWarnings(PHPMD.TooManyFields)

17 */

18 class View extends Block

140 public function getItemBlock($id = null)

141 {

142 $selector = ($id === null) ? $this->content : sprintf($this->itemBlock, $id) . $this->content;

143 return $this->blockFactory->create(

144 \Magento\Sales\Test\Block\Order\Items::class,

155 public function openLinkByName($name)

156 {

157 $this->_rootElement->find(sprintf($this->link, $name), Locator::SELECTOR_XPATH)->click();

158 sleep(3); // TODO: remove after resolving an issue with ajax on Frontend.

159 }

TableMapper.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 251 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

19

20 /**

21 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)

22 */

23 class TableMapper

113 $table = $this->resource->getTableName('catalog_product_index_eav');

114 $alias = $field . RequestGenerator::FILTER_SUFFIX;

115 $mapOn = sprintf(

116 'search_index.entity_id = %1$s.entity_id AND %1$s.attribute_id = %2$d AND %1$s.store_id = %3$d',

117 $alias,

ExtensionSet.php (https://gitlab.com/arthur_quiroga/dystawork) PHP · 471 lines

1 <?php

2

3 /*

80

81 if (!isset($this->extensions[$class])) {

82 throw new Twig_Error_Runtime(sprintf('The "%s" extension is not enabled.', $class));

83 }

84

144

145 if ($this->initialized) {

146 throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $class));

147 }

148

149 if (isset($this->extensions[$class])) {

150 throw new LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $class));

151 }

152

lavaPages.php (https://github.com/volcanicpixels/Privacy-Plugin.git) PHP · 360 lines

1 <?php

2 /**

3 * The lavaPages class

173 {

174 $this ->addPage( $slug, "About" )

175 ->setTitle( sprintf( __( "About %s", $this->_framework() ), $this->_name() ) );

176 return $this;

177 }

Netdna.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 282 lines

1 <?php

2

3 /**

8 }

9

10 w3_require_once(W3TC_LIB_W3_DIR . '/Cdn/Mirror.php');

11

12 define('W3TC_CDN_NETDNA_URL', 'netdna-cdn.com');

17 class W3_Cdn_Mirror_Netdna extends W3_Cdn_Mirror {

18 /**

19 * PHP5 Constructor

20 *

21 * @param array $config

57

58 if (!class_exists('NetDNA')) {

59 w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');

60 }

61

PlainTextHandlerTest.php (https://gitlab.com/lighty/whoops) PHP · 354 lines

1 <?php

2 /**

3 * Whoops - php errors for cool kids

204 // Check that the trace is NOT returned:

205 $this->assertEquals(

206 sprintf(

207 "%s: %s in file %s on line %d\n",

208 get_class($this->getException()),

235 // Check that the trace is returned:

236 $this->assertContains(

237 sprintf(

238 '%3d. %s->%s() %s:%d',

239 2,

274 // Check that the trace is returned:

275 $this->assertContains(

276 sprintf(

277 '%3d. %s->%s() %s:%d',

278 2,

Recurrence.php (https://github.com/ewandor/horde.git) PHP · 241 lines

1 <?php

2 /**

3 * Handles recurrence data.

4 *

5 * PHP version 5

6 *

7 * @category Kolab

83 if ($recurrence['interval'] < 0) {

84 throw new Horde_Kolab_Format_Exception_ParseError(

85 sprintf(

86 'Recurrence: interval cannot be below zero [Value: %s]!',

87 $recurrence['interval']

120 if ($daynumber < 0) {

121 throw new Horde_Kolab_Format_Exception_ParseError(

122 sprintf(

123 'Recurrence: daynumber cannot be below zero ["%s"]!',

124 $daynumber

example.cxx (https://swig.svn.sourceforge.net/svnroot/swig) C++ · 47 lines ✨ Summary

This C++ code defines a Vector class and a VectorArray class, which is an array of Vectors. The Vector class has methods for adding two vectors together and printing its contents. The VectorArray class provides an array-like interface to access individual vectors in the array, with bounds checking and size retrieval functionality.

20 char *Vector::print() {

21 static char temp[512];

22 sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z);

23 return temp;

24 }

cache.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 416 lines ✨ Summary

This C code implements a caching system for file systems, known as FS-Cache. It allows multiple file systems to share cached data and reduces I/O operations by storing frequently accessed files in memory. The code provides functions to add, remove, and manage caches, as well as handle errors and withdraw caches from service.

173 * @ops: The cache operations to be installed in that record

174 * @idfmt: Format string to define identifier

175 * @...: sprintf-style arguments

176 *

177 * Initialise a record of a cache and fill in the name.

main.cc (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ · 627 lines ✨ Summary

This C++ code creates a graphical user interface (GUI) application called “vflow” that displays multiple documents in a multi-document interface (MDI). It initializes the GUI, sets up event handling for segmentation faults, and starts the main loop to display the GUI. The application can be run with or without specifying a document path, and it loads the specified document if provided.

31 //fname = (char *)doc->getName().c_str();

32 //msg = (char *)g_malloc(strlen(fname) + 52);

33 //sprintf(msg, _(" '%s' has been modified. Do you wish to save it?"), fname);

34 string msg = " '" + doc->getName() + "' has been modified. Do you wish to save it?";

35 if (mdi->active_view) {

awk.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 116 lines

78 <KEYWORD2>sin</KEYWORD2>

79 <KEYWORD2>split</KEYWORD2>

80 <KEYWORD2>sprintf</KEYWORD2>

81 <KEYWORD2>sqrt</KEYWORD2>

82 <KEYWORD2>srand</KEYWORD2>

runme.pike (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 34 lines

2 {

3 // Call some templated functions

4 write(sprintf("%d\n", .example.maxint(3, 7)));

5 write(sprintf("%f\n", .example.maxdouble(3.14, 2.18)));

22 }

23

24 write(sprintf("%d\n", isum));

25

26 float fsum = 0.0;

28 fsum += dv->getitem(i);

29 }

30 write(sprintf("%f\n", fsum));

31

32 return 0;

example.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 92 lines ✨ Summary

The provided C code defines a set of global variables and functions to demonstrate their usage. It prints out the values of these variables, including integers, shorts, longs, floats, doubles, characters, and pointers to strings and structures. The output displays the memory addresses and values of each variable, showcasing their data types and storage locations.

80 static char buffer[256];

81 if (p) {

82 sprintf(buffer,"(%d,%d)", p->x,p->y);

83 } else {

84 sprintf(buffer,"null");

octave.cxx (https://swig.svn.sourceforge.net/svnroot/swig) C++ · 1418 lines ✨ Summary

This C++ code is a part of the SWIG (Simplified Interface Generator) framework, which generates interface code for wrapping C/C++ libraries in multiple programming languages, including Octave. It defines a class OCTAVE that inherits from Language, and implements methods to generate Octave-specific code for creating a director method, handling runtime code, and defining external runtime filenames.

487 }

488

489 sprintf(source, "args(%d)", j);

490 Setattr(p, "emit:input", source);

491

mixer_oss.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1402 lines ✨ Summary

This C code implements a Linux kernel module for the ALSA (Advanced Linux Sound Architecture) sound system, specifically for OSS (Open Sound System) devices. It registers and manages OSS mixer devices, allowing users to interact with them through ioctl calls. The module initializes and exits when loaded/unloaded, and provides a way to notify handlers of changes to the mixer devices.

953 if (err)

954 return err;

955 sprintf(str, "%s Switch", ptr->name);

956 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,

957 SNDRV_MIXER_OSS_ITEM_GSWITCH);

958 if (err)

959 return err;

960 sprintf(str, "%s Route", ptr->name);

961 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,

962 SNDRV_MIXER_OSS_ITEM_GROUTE);

963 if (err)

964 return err;

965 sprintf(str, "%s Volume", ptr->name);

966 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,

967 SNDRV_MIXER_OSS_ITEM_GVOLUME);

home.ctp (https://bitbucket.org/floresj/notetime.git) Unknown · 189 lines

159 <h3><?php echo __d('cake_dev', 'More about Cake'); ?></h3>

160 <p>

161 <?php echo __d('cake_dev', 'CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>

162 </p>

163 <p>

169 <ul><li><?php echo __d('cake_dev', 'Promoting development related to CakePHP'); ?></li></ul></li>

170 <li><a href="http://www.cakephp.org"><?php echo __d('cake_dev', 'CakePHP'); ?> </a>

171 <ul><li><?php echo __d('cake_dev', 'The Rapid Development Framework'); ?></li></ul></li>

173 <ul><li><?php echo __d('cake_dev', 'Your Rapid Development Cookbook'); ?></li></ul></li>

174 <li><a href="http://api20.cakephp.org"><?php echo __d('cake_dev', 'CakePHP API'); ?> </a>

175 <ul><li><?php echo __d('cake_dev', 'Quick Reference'); ?></li></ul></li>

179 <ul><li><?php echo __d('cake_dev', 'The Show is a live and archived internet radio broadcast CakePHP-related topics and answer questions live via IRC, Skype, and telephone.'); ?></li></ul></li>

180 <li><a href="http://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>

181 <ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>

185 <ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>

186 <li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>

187 <ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>

class.bp-sql-schema-parser.php (https://bitbucket.org/simplemediacode/bptrunk.git) PHP · 615 lines

1 <?php

2 /**

3 * Parses SQL schema statements for comparison to real table structures

414 $alterations[$_dbhname][$_new_table_name][] = array(

415 'action' => 'add_column',

416 'message' => sprintf( __( 'Adding column: %s' ), $_new_column_name ),

417 'column' => $_new_column_name,

418 'query' => 'ALTER TABLE `' . $_new_table_name . '` ADD COLUMN ' . BP_SQL_Schema_Parser::get_column_definition( $_new_column_data ) . ';'

432 $alterations[$_dbhname][$_new_table_name][] = array(

433 'action' => 'set_default',

434 'message' => sprintf( __( 'Setting default on column: %s' ), $_new_column_name ),

435 'column' => $_new_column_name,

436 'query' => 'ALTER TABLE `' . $_new_table_name . '` ALTER COLUMN `' . $_new_column_name . '` SET DEFAULT \'' . $_new_column_data['Default'] . '\';'

447 $alterations[$_dbhname][$_new_table_name][] = array(

448 'action' => 'change_column',

449 'message' => sprintf( __( 'Changing column: %s' ), $_new_column_name ),

450 'column' => $_new_column_name,

451 'query' => 'ALTER TABLE `' . $_new_table_name . '` CHANGE COLUMN `' . $_new_column_name . '` ' . BP_SQL_Schema_Parser::get_column_definition( $_new_column_data ) . ';'

perlkw.swg (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 252 lines

25 PERLBN(reverse);

26 PERLBN(rindex);

27 PERLBN(sprintf);

28 PERLBN(substr);

29 PERLBN(uc);

tsql.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 1020 lines

839 <KEYWORD3>xp_revokelogin</KEYWORD3>

840 <KEYWORD3>xp_sendmail</KEYWORD3>

841 <KEYWORD3>xp_sprintf</KEYWORD3>

842 <KEYWORD3>xp_sqlinventory</KEYWORD3>

843 <KEYWORD3>xp_sqlmaint</KEYWORD3>

ChangeLog-9899 (https://bitbucket.org/freebsd/freebsd-head/) Unknown · 1670 lines

214 * dis-buf.c (buffer_read_memory): Rewrite expression to avoid

215 overflow at end of address space.

216 (generic_print_address): Use sprintf_vma.

217

218 1999-08-08 Ian Lance Taylor <ian@zembu.com>

664

665 * dis-buf.c (generic_strcat_address): reformat to GNU coding

666 conventions. change sprintf call to an sprintf_vma call.

667

668 Tue Dec 8 13:12:44 1998 Dave Brolley <brolley@cygnus.com>

dhd_common.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1733 lines ✨ Summary

This C code snippet appears to be part of a wireless networking driver, specifically related to Wi-Fi scanning and management. It provides functions for requesting Wi-Fi scans, deleting BSS (Basic Service Set) entries, and retrieving partial scan results. The code also handles various error conditions and manages internal data structures, such as the iscan_chain buffer.

7 * agreement governing use of this software, this software is licensed to you

8 * under the terms of the GNU General Public License version 2 (the "GPL"),

9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the

10 * following added to such license:

11 *

588 datalen = ntoh32(event->datalen);

589 /* debug dump of event messages */

590 sprintf(eabuf, "%02x:%02x:%02x:%02x:%02x:%02x",

591 (uchar)event->addr.octet[0]&0xff,

592 (uchar)event->addr.octet[1]&0xff,

672 auth_str = "Shared Key";

673 else {

674 sprintf(err_msg, "AUTH unknown: %d", (int)auth_type);

675 auth_str = err_msg;

676 }

parse-events.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 847 lines ✨ Summary

This C code parses command-line options and prints a list of pre-defined events that can be used with the perf command. It also provides help text for event symbols, including hardware cache events and raw hardware event descriptors. The output is printed to standard error, allowing users to pipe it into other commands or use it as input for further processing.

259

260 if (cache_result) {

261 sprintf(name, "%s-%s-%s", hw_cache[cache_type][0],

262 hw_cache_op[cache_op][0],

263 hw_cache_result[cache_result][0]);

264 } else {

265 sprintf(name, "%s-%s", hw_cache[cache_type][0],

266 hw_cache_op[cache_op][1]);

267 }

283

284 if (type == PERF_TYPE_RAW) {

285 sprintf(buf, "raw 0x%llx", config);

286 return buf;

287 }

trait.rjmcmc.09162010.R (git://github.com/eastman/auteur.git) R · 496 lines ✨ Summary

This R code appears to be part of a Bayesian model comparison and MCMC simulation framework. It generates log files, summarizes run results, and tracks convergence metrics such as likelihood ratio (lnR) values, parameter estimates, and convergence statistics for multiple models. The output provides insight into the performance of different models and helps identify potential issues with the simulations or model selection process.

193

194 if(i==1) cat(paste("gen", "cur.lnL", "new.lnL", "lnR", sQuote(decision), sep="\t\t"),"\n")

195 cat(paste(i, sprintf("%.2f", mod.cur$lnL), sprintf("%.2f", mod.new$lnL), sprintf("%.2f", lnR), sQuote(decision), sep="\t\t"),"\n")

196

197 if(r$error) generate.error.message(i, mod.cur, mod.new, lnR, errorLog)

465 msg<-paste(res$gen, sQuote(cur.model), sprintf("%.3f", res$mrate), res$cats, sprintf("%.3f", res$root), sprintf("%.3f", res$lnL),sep="\t")

466 } else {

467 msg<-paste(res$gen, sQuote(cur.model), sprintf("%.3f", res$mrate), res$cats, sprintf("%.4f", res$alpha), res$reg, sprintf("%.3f", res$theta), sprintf("%.3f", res$lnL),sep="\t")

468 }

469 }

475 initmsg = write(paste("gen", "curr.lnL", "new.lnL", "lnR", sep="\t"), file=errorLog)

476 } else {

477 write(paste(i, sprintf("%.3f", mod.cur$lnL), sprintf("%.3f", mod.new$lnL), sprintf("%.3f", lnR), sep="\t"), file=errorLog)

478 }

479 }

acpi.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 264 lines ✨ Summary

This C code is part of the Linux kernel’s PCI (Peripheral Component Interconnect) subsystem, specifically for ACPI (Advanced Configuration and Power Interface) based systems. It scans for PCI devices on a system, allocates resources for each device, and sets up IRQ routing using ACPI. The code initializes the PCI subsystem to use ACPI for IRQ routing and scanning of PCI devices.

140 if (!info.name)

141 goto name_alloc_fail;

142 sprintf(info.name, "PCI Bus %04x:%02x", domain, busnum);

143

144 info.res_num = 0;