100+ results for 'php array_slice'

Not the results you expected?

reputation.php (https://gitlab.com/Ltaimao/wecenter) PHP · 403 lines

1 <?php

2 /*

3 +--------------------------------------------------------------------------

294 if ($user_topics = aasort($user_topics, 'count', 'DESC'))

295 {

296 $user_topics = array_slice($user_topics, 0, 20);

297 }

298

MockWrapper.php (https://github.com/georgeredinger/openinviter.git) PHP · 453 lines

1 <?php

2 /**

3 * Holds the classes needed to amend PHPUnit's awkward memory-hogging behaviour,

11 * like other mock objects are all around?

12 *

13 * PHP version: 5.2

14 *

15 * @category File

28

29 /**

30 * This class is used to wrap a PHPUnit_Framework_MockObject_InvocationMocker

31 * instance to provide a way to inject wrapped instances of

32 * PHPUnit_Framework_MockObject_Matcher_Invocation to it.

46 */

47 class InvocationMockerWrapper

48 implements PHPUnit_Framework_MockObject_Stub_MatcherCollection

49 {

50

Migrator.php (https://gitlab.com/oytunistrator/92five) PHP · 383 lines

1 <?php namespace Illuminate\Database\Migrations;

2

3 use Closure;

217 public function getMigrationFiles($path)

218 {

219 $files = $this->files->glob($path.'/*_*.php');

220

221 // Once we have the array of files in the directory we will just remove the

226 $files = array_map(function($file)

227 {

228 return str_replace('.php', '', basename($file));

229

230 }, $files);

246 public function requireFiles($path, array $files)

247 {

248 foreach ($files as $file) $this->files->requireOnce($path.'/'.$file.'.php');

249 }

250

Collection.php (https://gitlab.com/koodersmiikka/operaatio-terveys) PHP · 717 lines

1 <?php namespace Illuminate\Support;

2

3 use Closure;

396 public function slice($offset, $length = null, $preserveKeys = false)

397 {

398 return new static(array_slice($this->items, $offset, $length, $preserveKeys));

399 }

400

project.php (https://github.com/Exygy/CrowdFund.git) PHP · 293 lines

1 <?php

2

3 class Project extends AppModel {

209 $offset = ($page-1)*$limit;

210

211 return array_slice($result, $offset, $limit);

212 }

213

router.php (https://gitlab.com/Bartwillemsen/aurora-framework) PHP · 275 lines

1 <?php

2 namespace Aurora\Routing;

3

82 * Find a route by name.

83 *

84 * The returned array will be identical the array defined in the routes.php file.

85 *

86 * @param string $name

191 // off of the array of segments. Any remaining segments are the

192 // parameters that should be passed to the controller method.

193 $controller = implode('.', array_slice($segments, 0, $key));

194

195 $segments = array_slice($segments, $key);

218 // should be the deepest controller matched by the URI.

219 foreach (array_reverse($segments, true) as $key => $value) {

220 $controller = implode('/', array_slice($segments, 0, $key + 1)).EXT;

221

222 if (file_exists($path = $this->controllers.$controller)) {

dashboard.php (https://github.com/dsqmoore/buddypress-courseware.git) PHP · 280 lines

115 <div class="dp25">

116 <div id="user-progress">

117 <?php echo ( $assignments_count ? $assignments_count : 1 ) - $own_responses_count; ?>,<?php echo $own_responses_count; ?>

118 </div>

119 <div id="progress-title"><?php _e( 'Your progress so far:', 'bpsp' );?></div>

183 <?php foreach ( array_slice( $assignments, 0, $items_limit ) as $a ): ?>

184 <li>

185 <a href="<?php echo $a->permalink ?>"><?php echo get_the_title( $a->ID ); ?></a>

186 <span class="alignright meta">

187 <?php

214 <?php foreach ( array_slice( $schedules, 0, $items_limit ) as $s ): ?>

215 <li>

216 <a href="<?php echo $s->permalink ?>"><?php echo bp_create_excerpt( $s->post_content, 20 ); ?></a>

217 <span class="alignright meta">

218 <?php

ResourceRegistrar.php (https://gitlab.com/kimting254/wbms) PHP · 392 lines

1 <?php namespace Illuminate\Routing;

2

3 class ResourceRegistrar {

97 // a slash. This will generate a proper URI prefix for us. Then we take this

98 // last segment, which will be considered the final resources name we use.

99 $prefix = implode('/', array_slice($segments, 0, -1));

100

101 return array(end($segments), $prefix);

class-wp-walker.php (https://gitlab.com/ngochuynh1991/cuacuon) PHP · 425 lines

1 <?php

2 /**

3 * A class for displaying various tree-like structures.

189 */

190 public function walk( $elements, $max_depth ) {

191 $args = array_slice(func_get_args(), 2);

192 $output = '';

193

228 if ( empty($top_level_elements) ) {

229

230 $first = array_slice( $elements, 0, 1 );

231 $root = $first[0];

232

281 }

282

283 $args = array_slice( func_get_args(), 4 );

284 $output = '';

285

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

1 <?php

2

3 namespace Zend\Code\Scanner;

461 }

462 $m = new $returnScannerClass(

463 array_slice($this->tokens, $info['tokenStart'], $info['tokenEnd'] - $info['tokenStart'] + 1),

464 $this->namespace,

465 $this->uses

RestClient.php (https://github.com/kiranatama/sagalaya.git) PHP · 287 lines

1 <?php

2 /**

3 * Zend Framework

260 }

261 $this->data['rest'] = 1;

262 $data = array_slice($args, 1) + $this->data;

263 $response = $this->{'rest' . $method}($args[0], $data);

264 $this->data = array(); //Initializes for next Rest method.

Standings.php (https://github.com/chartjes/building-testable-applications.git) PHP · 356 lines

1 <?php

2 /**

3 * Model for generating standards

88 foreach ($regularStandings as $conference => $confTeams) {

89 foreach ($confTeams as $division => $teams) {

90 $leader = array_slice($teams, 0, 1);

91 $secondTeam = array_slice($teams, 1, 1);

103 // Add the teams that are not division leaders to

104 // the list of wild card teams

105 $chaseTeams = array_slice($teams, 1);

106

107 foreach ($chaseTeams as $team) {

Template.php (https://github.com/radicalsuz/amp.git) PHP · 294 lines

1 <?php

2

3 class AMP_Display_Template {

224 if ( !isset( $this->_helpers[ $helper_key ])) continue;

225

226 $helper_method = join( '_', array_slice( $helper_request, 2 ));

227 if ( !method_exists( $this->_helpers[ $helper_key ], $helper_method )) continue;

228

ResourceRegistrar.php (https://gitlab.com/rocs/Streaming-Safe-for-Kids) PHP · 421 lines

1 <?php

2

3 namespace Illuminate\Routing;

123 // a slash. This will generate a proper URI prefix for us. Then we take this

124 // last segment, which will be considered the final resources name we use.

125 $prefix = implode('/', array_slice($segments, 0, -1));

126

127 return [end($segments), $prefix];

ShowProcessor.php (https://gitlab.com/staging06/myproject) PHP · 166 lines

1 <?php

2 /**

3 * ShowProcessor.php

31 */

32

33 require_once(dirname(__FILE__) . '/../utils/PHPSQLParserConstants.php');

34 require_once(dirname(__FILE__) . '/../utils/ExpressionType.php');

35 require_once(dirname(__FILE__) . '/LimitProcessor.php');

36 require_once(dirname(__FILE__) . '/AbstractProcessor.php');

117 case 'LIMIT':

118 $limit = array_pop($resultList);

119 $limit['sub_tree'] = $this->limitProcessor->process(array_slice($tokens, $k));

120 $resultList[] = $limit;

121 break;

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

1 <?php

2 /**

3 * File containing the ezcDebug class.

99 protected function prepare( $stackTrace, $removeElements )

100 {

101 return array_slice(

102 $stackTrace,

103 $removeElements,

Ruleset.php (https://github.com/agar/less.php.git) PHP · 253 lines

1 <?php

2

3 namespace Less\Node;

34 $newRules = $ruleset->rules[$i]->compile($env);

35 $ruleset->rules = array_merge(

36 array_slice($ruleset->rules, 0, $i),

37 (array) $newRules,

38 array_slice($ruleset->rules, $i + 1)

55 $newRules = $ruleset->rules[$i]->compile($env);

56 $ruleset->rules = array_merge(

57 array_slice($ruleset->rules, 0, $i),

58 $newRules,

59 array_slice($ruleset->rules, $i + 1)

128

129 if (count($selector->elements) > count($ruleSelector->elements)) {

130 $rules = array_merge($rules, $rule->find( new \Less\Node\Selector(array_slice($selector->elements, 1)), $self, $env));

131 } else {

132 $rules[] = $rule;

Writer.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 311 lines

1 <?php namespace Illuminate\Log;

2

3 use Closure;

256 $level = head(func_get_args());

257

258 return call_user_func_array(array($this, $level), array_slice(func_get_args(), 1));

259 }

260

NamePrep.php (https://github.com/NavigateCMS/Navigate-CMS.git) PHP · 318 lines

1 <?php

2

3 namespace Algo26\IdnaConvert\NamePrep;

115 // Try to match

116 $sequenceLength = $outerIndex - $previousStarter;

117 $combined = $this->combine(array_slice($codePoints, $previousStarter, $sequenceLength));

118 // On match: Replace the last starter with the composed character and remove

119 // the now redundant non-starter(s)

AssetBuildTask.php (https://github.com/renan/asset_compress.git) PHP · 291 lines

1 <?php

2 App::uses('Shell', 'Console');

3 App::uses('Folder', 'Utility');

145 foreach ($this->_tokens as $call) {

146 $method = $call[2][1];

147 $args = array_slice($call, 3);

148

149 list($files, $build) = $this->_parseArgs($args);

File.php (https://bitbucket.org/kdms/sh-magento.git) PHP · 275 lines

1 <?php

2 /**

3 * Magento Enterprise Edition

136 }

137

138 $slice = array_slice($this->_data[$type], $offset, $count);

139 if (empty($slice)) {

140 return false;

elements_edit.php (https://gitlab.com/x33n/platform) PHP · 169 lines

1 <?php

2 if (!$request_parameters) {

3 AdminHelper::controllerRedirect('/');

89 }

90 arsort($tmp_locations_array); // sort temp array most to least

91 $tmp_locations_array = array_slice($tmp_locations_array, 0, 5); // trim temp array to no more than 5

92

93 $locations_array = array(); // let's rebuild the locations array

SubformState.php (https://gitlab.com/mohamed_hussein/prodt) PHP · 154 lines

1 <?php

2

3 namespace Drupal\Core\Form;

134 $limit_validation_errors = parent::getLimitValidationErrors();

135 if (is_array($limit_validation_errors)) {

136 return array_slice($limit_validation_errors, count($this->getParents('#parents')));

137

138 }

authentication.php (https://github.com/cgajardo/repositorium.git) PHP · 238 lines

1 <?php

2 /**

3 * Base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage WebTester

6 * @version $Id: authentication.php 1720 2008-04-07 02:32:43Z lastcraft $

7 */

8 /**

9 * include http class

10 */

11 require_once(dirname(__FILE__) . '/http.php');

12

13 /**

58 for ($i = 0; $i < min(count($first), count($second)); $i++) {

59 if ($first[$i] != $second[$i]) {

60 return implode('/', array_slice($first, 0, $i)) . '/';

61 }

62 }

ValidationRuleParser.php (https://gitlab.com/hoangduys4k5/laravelproject) PHP · 338 lines

1 <?php

2

3 namespace Illuminate\Validation;

243 protected static function parseArrayRule(array $rule)

244 {

245 return [Str::studly(trim(Arr::get($rule, 0, ''))), array_slice($rule, 1)];

246 }

247

authentication.php (https://github.com/h-kanjisan/swiftmailer.git) PHP · 237 lines

1 <?php

2 /**

3 * Base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage WebTester

6 * @version $Id: authentication.php 1784 2008-04-26 13:07:14Z pp11 $

7 */

8 /**

9 * include http class

10 */

11 require_once(dirname(__FILE__) . '/http.php');

12

13 /**

58 for ($i = 0; $i < min(count($first), count($second)); $i++) {

59 if ($first[$i] != $second[$i]) {

60 return implode('/', array_slice($first, 0, $i)) . '/';

61 }

62 }

Row.php (https://github.com/timglabisch/pimcore.git) PHP · 215 lines

1 <?php

2 /**

3 * Zend Framework

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

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

19 * @version $Id: Row.php 24593 2012-01-05 20:35:02Z matthew $

20 */

21

61 }

62

63 // require_once 'Zend/Text/Table/Column.php';

64

65 $column = new Zend_Text_Table_Column($content, $align, $colSpan, $encoding);

119 {

120 if ($this->_columnWidths === null) {

121 // require_once 'Zend/Text/Table/Exception.php';

122 throw new Zend_Text_Table_Exception('No columns were rendered yet');

123 }

Matrix.php (https://github.com/livinglab/openlab.git) PHP · 403 lines

1 <?php

2

3 /**

5 * Class for the management of Matrices

6 *

7 * @copyright Copyright (c) 2018 Mark Baker (https://github.com/MarkBaker/PHPMatrix)

8 * @license https://opensource.org/licenses/MIT MIT

9 */

165 }

166

167 return new static(array_slice($this->grid, $row - 1, $rowCount));

168 }

169

tiled-gallery-shape.php (https://gitlab.com/chernushov881/charity-fund) PHP · 209 lines

1 <?php

2 class Jetpack_Tiled_Gallery_Shape {

3 static $shapes_used = array();

9

10 public function sum_ratios( $number_of_images = 3 ) {

11 return array_sum( array_slice( wp_list_pluck( $this->images, 'ratio' ), 0, $number_of_images ) );

12 }

13

17

18 public function is_not_as_previous( $n = 1 ) {

19 return ! in_array( get_class( $this ), array_slice( self::$shapes_used, -$n ) );

20 }

21

package.module.nextgen_pagination.php (https://github.com/livinglab/openlab.git) PHP · 118 lines

1 <?php

2 /**

3 * Contains function(s) to generate a basic pagination widget

48 }

49 }

50 $after = $this->array_slice_from('current', $pages);

51 if (count($after) > 3) {

52 $after = array_merge($this->array_take_from_start(2, $after), ["<span class='ellipsis'>...</span>"], $this->array_take_from_end(1, $after));

53 }

54 $before = $this->array_slice_to('current', $pages);

55 if (count($before) > 3) {

56 $before = array_merge($this->array_take_from_start(1, $before), ["<span class='ellipsis'>...</span>"], $this->array_take_from_end(2, $before));

75 return $return;

76 }

77 function array_slice_from($find_key, $arr)

78 {

79 $retval = [];

Tlpicture.php (https://github.com/10layer/10Layer-CMS.git) PHP · 128 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2

3 /**

107 /*protected function _cachefilename() {

108 $segs=$this->uri->segment_array();

109 $params=array_slice($segs,3);

110 $cachefilename=$this->_cachedir.implode("_",$params).".jpg";

111 return $cachefilename;

sfFeed.class.php (https://github.com/malacon/rbwords.git) PHP · 345 lines

1 <?php

2

3 /*

165 if($count < count($this->items))

166 {

167 $this->items = array_slice($this->items, 0, $count);

168 }

169 return $this;

message.php (https://github.com/4260/OpenPNE2.git) PHP · 1044 lines

1 <?php

2 /**

3 * @copyright 2005-2008 OpenPNE Project

4 * @license http://www.php.net/license/3_01.txt PHP License 3.01

5 */

6

251 }

252 @array_multisort($c_message_id, SORT_DESC, $c_message_list);

253 $c_message_list = array_slice($c_message_list, $page_size * ($page - 1), $page_size);

254

255 $total_num = $c_message_num_from + $c_message_num_to;

888 " AND is_send = 1";

889

890 if ($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['phptype'] == 'pgsql') {

891 $sql = "SELECT c_member_id_from" .

892 " FROM" .

blog.php (https://github.com/losaposta/ubuntuism.git) PHP · 202 lines

47 <?php foreach ($this->lead_items as &$item) : ?>

48 <article class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">

49 <?php

76 <?php endif; ?>

77

78 <article class="item column-<?php echo $rowcount;?><?php echo $item->state == 0 ? ' system-unpublished"' : null; ?>">

79 <?php

141 <?php if ($this->params->get('show_description_image') && $this->category->image) : ?>

142 <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/' . $this->category->image; ?>" class="image_<?php echo $this->category->image_position; ?>" />

143 <?php endif; ?>

171 <?php for ($y = 0; $y < $rowcount && $i < $this->total; $y++) : ?>

172 <div class="items-row cols-<?php echo $colcount; ?> row-<?php echo $y; ?> clearfix">

173 <?php for ($z = 0; $z < $colcount && $ii < $introcount && $i < $this->total; $z++, $i++, $ii++) : ?>

184 <?php $numlinks = $this->params->def('num_links', 4);

185 if ($numlinks && $i < $this->total) : ?>

186 <?php $this->links = array_slice($this->items, $i - $this->pagination->limitstart, $i - $this->pagination->limitstart + $numlinks);

187 echo $this->loadTemplate('links'); ?>

188 <?php endif; ?>

converter_docbook_html_xsl_test.php (https://github.com/F5/zetacomponents.git) PHP · 148 lines

1 <?php

2 /**

3 * ezcDocumentConverterEzp3TpEzp4Tests

38 public static function suite()

39 {

40 return new PHPUnit_Framework_TestSuite( __CLASS__ );

41 }

42

59

60 return self::$testDocuments;

61 return array_slice( self::$testDocuments, -1, 1 );

62 }

63

Tasklist.php (https://github.com/finger2000/horde.git) PHP · 158 lines

1 <?php

2 /**

3 * The Horde_LoginTasks_Tasklist:: class is used to store the list of

109

110 if ($advance) {

111 $this->_tasks = array_slice($this->_tasks, count($tmp));

112 $this->_ptr = 0;

113 }

ConfigDependencies.php (https://gitlab.com/mohamed_hussein/prodt) PHP · 275 lines

1 <?php

2

3 namespace Drupal\rest\Entity;

81

82 case RestResourceConfigInterface::RESOURCE_GRANULARITY:

83 $methods = array_slice($rest_config->getMethods(), 0, 1);

84 break;

85

ArrayTools.php (https://github.com/GunioRobot/IconStore.git) PHP · 176 lines

1 <?php

2

3 /**

119 {

120 $offset = self::searchKey($arr, $key);

121 $arr = array_slice($arr, 0, $offset, TRUE) + $inserted + array_slice($arr, $offset, count($arr), TRUE);

122 }

123

135 $offset = self::searchKey($arr, $key);

136 $offset = $offset === FALSE ? count($arr) : $offset + 1;

137 $arr = array_slice($arr, 0, $offset, TRUE) + $inserted + array_slice($arr, $offset, count($arr), TRUE);

138 }

139

manager.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 135 lines

1 <?php

2 /**

3 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.

124 }

125

126 if (array_key_exists($key = implode('/', array_slice($path, 0, $i+1)), $tmp['children'])) {

127 $tmp = &$tmp['children'][$key];

128 }

DynamicModel.php (https://gitlab.com/Griffolion/Game-Embargo-Tracker) PHP · 202 lines

1 <?php

2 /**

3 * @link http://www.yiiframework.com/

15 * The typical usage of DynamicModel is as follows,

16 *

17 * ```php

18 * public function actionSearch($name, $email)

19 * {

40 * Alternatively, you may use the following more "classic" syntax to perform ad-hoc data validation:

41 *

42 * ```php

43 * $model = new DynamicModel(compact('name', 'email'));

44 * $model->addRule(['name', 'email'], 'string', ['max' => 128])

180 $validators->append($rule);

181 } elseif (is_array($rule) && isset($rule[0], $rule[1])) { // attributes, validator type

182 $validator = Validator::createValidator($rule[1], $model, (array) $rule[0], array_slice($rule, 2));

183 $validators->append($validator);

184 } else {

CommonModule.php (https://github.com/rasstroen/audio.git) PHP · 149 lines

1 <?php

2

3 // класс, генерирующий xml для вывода объектов,списков объектов,редактирования и создания объектов

117 function _idsToData($ids, $limit = 100) {

118 if ($limit) {

119 $ids = array_slice($ids, 0, $limit);

120 }

121 return $this->Collection->idsToData($ids);

TemplateTest.php (https://github.com/chartjes/building-testable-applications.git) PHP · 346 lines

1 <?php

2

3 /*

9 * file that was distributed with this source code.

10 */

11 class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase

12 {

13 /**

170

171 if (function_exists('twig_template_get_attributes')) {

172 foreach(array_slice($tests, 0) as $test) {

173 $test[] = true;

174 $tests[] = $test;

authentication.php (https://github.com/knevcher/korchasa_limb.git) PHP · 238 lines

1 <?php

2 /**

3 * Base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage WebTester

6 * @version $Id: authentication.php 7198 2008-11-01 11:57:17Z korchasa $

7 */

8 /**

9 * include http class

10 */

11 require_once(dirname(__FILE__) . '/http.php');

12

13 /**

58 for ($i = 0; $i < min(count($first), count($second)); $i++) {

59 if ($first[$i] != $second[$i]) {

60 return implode('/', array_slice($first, 0, $i)) . '/';

61 }

62 }

Ajax.php (https://github.com/intraweb-modules13/IWusers.git) PHP · 242 lines

1 <?php

2

3 class IWusers_Controller_Ajax extends Zikula_Controller_AbstractAjax {

13 $gi = UserUtil::getGroups('',$orderBy);

14 foreach ($gi as $key => $value) {

15 $groupInfo[] = array_slice($value,0,2);

16 }

17

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

1 <?php

2 /**

3 * Zend Framework

166

167 // Calculate the column width

168 $columnWidth = ($colSpan - 1 + array_sum(array_slice($columnWidths,

169 $colNum,

170 $colSpan)));

188 if ($colNum < count($columnWidths)) {

189 $remainingWidth = (count($columnWidths) - $colNum - 1) +

190 array_sum(array_slice($columnWidths,

191 $colNum));

192 $renderedColumns[] = array(str_repeat(' ', $remainingWidth));

Ruleset.php (https://github.com/Mordred/less.php.git) PHP · 269 lines

1 <?php

2

3 namespace Less\Node;

42 $newRules = $ruleset->rules[$i]->compile($env);

43 $ruleset->rules = array_merge(

44 array_slice($ruleset->rules, 0, $i),

45 is_array($newRules) ? $newRules : array($newRules),

46 array_slice($ruleset->rules, $i + 1)

63 $newRules = $ruleset->rules[$i]->compile($env);

64 $ruleset->rules = array_merge(

65 array_slice($ruleset->rules, 0, $i),

66 $newRules,

67 array_slice($ruleset->rules, $i + 1)

135

136 if (count($selector->elements) > count($ruleSelector->elements)) {

137 $rules = array_merge($rules, $rule->find( new \Less\Node\Selector(array_slice($selector->elements, 1)), $self, $env));

138 } else {

139 $rules[] = $rule;

FieldnameRelatedTest.php (https://github.com/1989gaurav/Propel.git) PHP · 394 lines

1 <?php

2

3 /**

28 * @package misc

29 */

30 class FieldnameRelatedTest extends PHPUnit_Framework_TestCase

31 {

32 protected function setUp()

34 parent::setUp();

35 set_include_path(get_include_path() . PATH_SEPARATOR . "fixtures/bookstore/build/classes");

36 require_once 'bookstore/map/BookTableMap.php';

37 require_once 'bookstore/BookPeer.php';

38 require_once 'bookstore/Book.php';

39 }

40

ArrayHelper.php (https://github.com/hanfer2/Talentos.git) PHP · 162 lines

1 <?php

2

3 if (!function_exists('array_combine')) {

76 function joins($glue, $pieces) {

77 $glue = str_replace("\n", '<br/>', $glue);

78 $arrays = array_slice(func_get_args(), 1);

79 $arrays = array_filter($arrays);

80 return implode($glue, $arrays);

100 $subarray = array();

101 if(func_num_args() > 2)

102 $keys = array_slice(func_get_args(), 1);

103 elseif(!is_array($keys))

104 $keys = explode(',', $keys);

sidebar_gallery.php (https://github.com/geekbuntu/Microweber.git) PHP · 87 lines

47 </a>

48 <div class="sidebar-list-side">

49 <h3><a href="<?php print $this->content_model->contentGetHrefForPostId($the_post['id']) ; ?>"><?php print (character_limiter($the_post['content_title'], 30, '...')); ?>

50

51 </a></h3>

54 <?php print (character_limiter($the_post['content_description'], 50, '...')); ?>

55 <?php else: ?>

56 <?php print character_limiter($the_post['content_body_nohtml'], 50, '...'); ?>

64 <?php else: ?>

65 <a href="<?php print site_url('userbase/action:gallery/username:'.$who['username']); ?>" class="btn right hmarg"><?php print $this->users_model->getPrintableName ( $who['id'], 'first' ); ?>'s galleries</a>

66 <?php endif; ?>

79 require (ACTIVE_TEMPLATE_DIR.'sidebar_products.php') ?>

80 <?php require (ACTIVE_TEMPLATE_DIR.'sidebar_trainings.php') ?>

81 <?php if(!empty( $author)): ?>

82 <?php require (ACTIVE_TEMPLATE_DIR.'sidebar_widgets.php') ?>

83 <?php endif; ?>

Collection.php (https://bitbucket.org/tschrock52/ethodeshare.git) PHP · 210 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 Varien_Data

23 * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)

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

25 */

26

141 $newOrderElements[] = $currElement;

142 $newOrderElements[] = $element;

143 $this->_elements = array_merge($newOrderElements, array_slice($this->_elements, $index + 1));

144 return $element;

145 }

DependencyTest.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 158 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

10 use Magento\Framework\Component\ComponentRegistrar;

11 use Magento\TestFramework\Integrity\Library\Injectable;

12 use Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory;

13 use Magento\TestFramework\Integrity\Library\PhpParser\Tokens;

18 *

19 */

20 class DependencyTest extends \PHPUnit_Framework_TestCase

21 {

22 /**

58 foreach ($dependencies as $dependency) {

59 $dependencyPaths = explode('/', $dependency);

60 $dependencyPaths = array_slice($dependencyPaths, 2);

61 $dependency = implode('\\', $dependencyPaths);

62 $libraryPaths = $componentRegistrar->getPaths(ComponentRegistrar::LIBRARY);

class-wp-walker.php (https://github.com/sharpmachine/wakeupmedia.com.git) PHP · 397 lines

1 <?php

2 /**

3 * A class for displaying various tree-like structures.

174 function walk( $elements, $max_depth) {

175

176 $args = array_slice(func_get_args(), 2);

177 $output = '';

178

215 if ( empty($top_level_elements) ) {

216

217 $first = array_slice( $elements, 0, 1 );

218 $root = $first[0];

219

264 return '';

265

266 $args = array_slice( func_get_args(), 4 );

267 $output = '';

268

Status.php (https://github.com/daevid/MWFork.git) PHP · 358 lines

1 <?php

2

3 /**

85 */

86 function warning( $message /*, parameters... */ ) {

87 $params = array_slice( func_get_args(), 1 );

88 $this->errors[] = array(

89 'type' => 'warning',

99 */

100 function error( $message /*, parameters... */ ) {

101 $params = array_slice( func_get_args(), 1 );

102 $this->errors[] = array(

103 'type' => 'error',

113 */

114 function fatal( $message /*, parameters... */ ) {

115 $params = array_slice( func_get_args(), 1 );

116 $this->errors[] = array(

117 'type' => 'error',

ft.multi_select.php (https://github.com/mondomon916/LYBC.git) PHP · 220 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2 /**

3 * ExpressionEngine - by EllisLab

82 if (count($data) > $limit)

83 {

84 $data = array_slice($data, 0, $limit);

85 }

86 }

217 // END Multi_select_ft class

218

219 /* End of file ft.multi_select.php */

220 /* Location: ./system/expressionengine/fieldtypes/ft.multi_select.php */

xhtml.php (https://github.com/oluwalataz/zetacomponents.git) PHP · 264 lines

1 <?php

2 /**

3 * File containing the ezcTreeVisitorXHTML class.

31 *

32 * <code>

33 * <?php

34 * $options = new ezcTreeVisitorXHTMLOptions;

35 * $options->xmlId = 'menu_tree';

156 if ( $this->options->selectedNodeLink )

157 {

158 $slice = array_slice( $path, -1 );

159 $path = htmlspecialchars( $this->options->basePath . '/' . array_pop( $slice ) );

160 }

StaticStringy.php (https://gitlab.com/dae.nuli/toko) PHP · 148 lines

1 <?php

2

3 namespace Stringy;

135

136 if ($numArgs === static::$methodArgs[$name]) {

137 $args = array_slice($arguments, 1, -1);

138 $encoding = $arguments[$numArgs - 1];

139 } else {

140 $args = array_slice($arguments, 1);

141 $encoding = null;

142 }

spell.php (https://github.com/meloncholy/video-gallery.git) PHP · 283 lines

1 <?php

2 /**

3 * Check spelling of searches

187 {

188 $pos = $pos_start;

189 $word = implode(array_slice($words, $pos, $len));

190

191 if ($len == 1 || $this->check($word))

227 {

228 $pos = $pos_start;

229 $word = implode(array_slice($letters, $pos, $len));

230

231 if ($pos + $len <= $count)

array.idl.php (https://github.com/diegoIta/hiphop-php.git) PHP · 376 lines

1 <?php

2

3 include_once 'base.php';

140 array('array' => VariantMap | Reference));

141

142 f('array_slice', Variant,

143 array('array' => Variant,

144 'offset' => Int32,

FieldnameRelatedTest.php (https://github.com/apinstein/Propel2.git) PHP · 394 lines

1 <?php

2

3 /**

28 * @package misc

29 */

30 class FieldnameRelatedTest extends \PHPUnit_Framework_TestCase

31 {

32 protected function setUp()

34 parent::setUp();

35 set_include_path(get_include_path() . PATH_SEPARATOR . "fixtures/bookstore/build/classes");

36 require_once 'bookstore/map/BookTableMap.php';

37 require_once 'bookstore/BookPeer.php';

38 require_once 'bookstore/Book.php';

39 }

40

FieldnameRelatedTest.php (https://github.com/esimionato/Propel2.git) PHP · 394 lines

1 <?php

2

3 /**

28 * @package misc

29 */

30 class FieldnameRelatedTest extends \PHPUnit_Framework_TestCase

31 {

32 protected function setUp()

34 parent::setUp();

35 set_include_path(get_include_path() . PATH_SEPARATOR . "fixtures/bookstore/build/classes");

36 require_once 'bookstore/map/BookTableMap.php';

37 require_once 'bookstore/BookPeer.php';

38 require_once 'bookstore/Book.php';

39 }

40

CompiledRouteCollection.php (https://gitlab.com/nmhieucoder/laravel_tintuc) PHP · 333 lines

1 <?php

2

3 namespace Illuminate\Routing;

291

292 $baseUri = trim(implode(

293 '/', array_slice(

294 explode('/', trim($attributes['uri'], '/')),

295 count($prefix !== '' ? explode('/', $prefix) : [])

not-gettexted.php (https://gitlab.com/CueFox/cf-utility-pro) PHP · 243 lines

1 <?php

2 /**

3 * Console application, which extracts or replaces strings for

18 require_once( "$pomo/po.php" );

19 require_once( "$pomo/mo.php" );

20

21 class NotGettexted {

218

219 public function usage() {

220 $this->stderr( 'php i18n-comments.php COMMAND OUTPUTFILE INPUTFILES' );

221 $this->stderr( 'Extracts and replaces strings, which cannot be gettexted' );

222 $this->stderr( 'Commands:' );

223 $this->stderr( ' extract POTFILE PHPFILES appends the strings to POTFILE' );

224 $this->stderr( ' replace MOFILE PHPFILES replaces strings in PHPFILES with translations from MOFILE' );

225 }

226

Repo.php (https://github.com/knpEdgar/knpbundles.git) PHP · 213 lines

1 <?php

2

3 namespace Knp\Bundle\KnpBundlesBundle\Github;

11 {

12 /**

13 * php-github-api instance used to request GitHub API

14 *

15 * @var \Github_Client

106 return false;

107 }

108 $repo->setLastCommits(array_slice($commits, 0, 30));

109

110 return $repo;

uiformconfiguration.php (https://gitlab.com/alexprowars/bitrix) PHP · 374 lines

1 <?php

2

3 namespace Bitrix\Catalog\Update;

293 else

294 {

295 $before = array_slice($formSettings[$column]['elements'][$list]['elements'], 0, $row);

296 $before[] = $field;

297 $after = array_slice($formSettings[$column]['elements'][$list]['elements'], $row);

313 else

314 {

315 $before = array_slice($formSettings[$column]['elements'][$list]['elements'], 0, $row + 1);

316 $before[] = $field;

317 $after = array_slice($formSettings[$column]['elements'][$list]['elements'], $row + 1);

meta.php (https://github.com/mitchellsimoens/Ext.ux.touch.grid.git) PHP · 53 lines

1 <?php

2

3 $records = array(

37 }

38

39 $page = array_slice($records, $_REQUEST['start'], $_REQUEST['limit']);

40

41 $columns = array(

Diff.php (https://github.com/akelos/v1.git) PHP · 371 lines

1 <?php

2 /**

3 * Text_Diff

6 * two sequences of strings.

7 *

8 * The PHP diff code used in this package was originally written by Geoffrey

9 * T. Dairiki and is used with his permission.

10 *

11 * $Horde: framework/Text_Diff/Diff.php,v 1.17 2006/02/06 00:16:09 jan Exp $

12 *

13 * @package Text_Diff

43 $engine = basename($engine);

44

45 require_once 'Text/Diff/Engine/' . $engine . '.php';

46 $class = 'Text_Diff_Engine_' . $engine;

47 $diff_engine = &new $class();

filters.php (https://gitlab.com/hop23typhu/bryepoxy) PHP · 180 lines

1 <?php

2

3 /**

43 protected function get_comments_queried_language( $query ) {

44 // Don't filter comments if comment ids or post ids are specified

45 $plucked = wp_array_slice_assoc( $query->query_vars, array( 'comment__in', 'parent', 'post_id', 'post__in', 'post_parent' ) );

46 $fields = array_filter( $plucked );

47 if ( ! empty( $fields ) ) {

TimeEfficientImplementationTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 175 lines

1 <?php

2 /*

3 * This file is part of the Diff package.

4 *

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

6 *

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

11 namespace SebastianBergmann\Diff\LCS;

12

13 use PHPUnit_Framework_TestCase;

14

15 /**

16 * Some of these tests are volontary stressfull, in order to give some approximative benchmark hints.

17 */

18 class TimeEfficientImplementationTest extends PHPUnit_Framework_TestCase

19 {

20 private $implementation;

Validator.php (https://bitbucket.org/jonbiard/nucleus.git) PHP · 249 lines

1 <?php

2 /**

3 * Class Validator

145 $validatorData->setErrorMessage($errorMessage);

146 $validatorData->setOptions($options);

147 $validatorData->setArgs(array_slice(func_get_args(), 4));

148

149 $this->validatorData[$key][] = $validatorData;

eztags.php (https://github.com/calhoun/eztags.git) PHP · 440 lines

1 <?php

2

3 /**

144 if ( $maxTags > 0 && count( $this->IDArray ) > $maxTags )

145 {

146 $this->IDArray = array_slice( $this->IDArray, 0, $maxTags );

147 $this->KeywordArray = array_slice( $this->KeywordArray, 0, $maxTags );

148 $this->ParentArray = array_slice( $this->ParentArray, 0, $maxTags );

149 }

150

lang.php (https://bitbucket.org/Maron1/taqman.git) PHP · 252 lines

1 <?php namespace Laravel;

2

3 class Lang {

167 if (count($segments) >= 2)

168 {

169 $line = implode('.', array_slice($segments, 1));

170

171 return array($bundle, $segments[0], $line);

Controller.php (https://gitlab.com/ElvisAns/tiki) PHP · 191 lines

1 <?php

2

3 // (c) Copyright by authors of the Tiki Wiki CMS Groupware Project

187 $shares = Secret::share($key, $data['shares'] + 1, 2);

188 $data['secret'] = $shares[0];

189 return array_slice($shares, 1, count($shares) - 1);

190 }

191 }

functions.php (https://gitlab.com/alexandresgv/siteentec) PHP · 226 lines

1 <?php

2 /**

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

4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

5 *

9 *

10 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

11 * @link http://cakephp.org CakePHP(tm) Project

12 * @since 3.0.0

13 * @license http://www.opensource.org/licenses/mit-license.php MIT License

96 * @param mixed $args Array with arguments or multiple arguments in function.

97 * @return string|null Plural form of translated string.

98 * @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dn

99 */

100 function __dn($domain, $singular, $plural, $count, $args = null)

Renderer.php (https://github.com/allinside/Yii-CMS.git) PHP · 237 lines

1 <?php

2 /**

3 * A class to render Diffs in different formats.

6 * this class be customized via inheritance, to obtain fancier outputs.

7 *

8 * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.10 2008/01/04 10:37:27 jan Exp $

9 *

10 * Copyright 2004-2008 The Horde Project (http://www.horde.org/)

11 *

12 * See the enclosed file COPYING for license information (LGPL). If you did

13 * not receive this file, see http://opensource.org/licenses/lgpl-license.php.

14 *

15 * @package Text_Diff

100 /* Create a new block with as many lines as we need

101 * for the trailing context. */

102 $context = array_slice($edit->orig, 0, $ntrail);

103 $block[] = new Text_Diff_Op_copy($context);

104 }

Object.php (https://gitlab.com/brownmestizo/design-sandbox) PHP · 255 lines

1 <?php

2

3 class Stripe_Object implements ArrayAccess

124

125 /**

126 * This unfortunately needs to be public to be used in Util.php

127 *

128 * @param Stripe_Object $class

217 }

218

219 // Pretend to have late static bindings, even in PHP 5.2

220 protected function _lsb($method)

221 {

222 $class = get_class($this);

223 $args = array_slice(func_get_args(), 1);

224 return call_user_func_array(array($class, $method), $args);

225 }

Method.php (https://github.com/MontmereLimited/ZendFramework-v1.git) PHP · 168 lines

28 * @see Zend_Reflection_Docblock

29 */

30 // // // // // // // // require_once 'Zend/Reflection/Docblock.php';

31

32 /**

33 * @see Zend_Reflection_Parameter

34 */

35 // // // // // // // // require_once 'Zend/Reflection/Parameter.php';

36

37 /**

95 throw new Zend_Reflection_Exception('Invalid reflection class provided; must extend Zend_Reflection_Class');

96 }

97 unset($phpReflection);

98 return $zendReflection;

99 }

109 $phpReflections = parent::getParameters();

110 $zendReflections = array();

111 while ($phpReflections && ($phpReflection = array_shift($phpReflections))) {

112 $instance = new $reflectionClass(array($this->getDeclaringClass()->getName(), $this->getName()), $phpReflection->getName());

TokenStream.php (https://gitlab.com/gideonmarked/PLCPortal) PHP · 192 lines

1 <?php

2

3 /*

53 public function injectTokens(array $tokens)

54 {

55 $this->tokens = array_merge(array_slice($this->tokens, 0, $this->current), $tokens, array_slice($this->tokens, $this->current));

56 }

57

Diff3.php (https://github.com/shafiqissani/ASTRA-College-Website.git) PHP · 262 lines

1 <?php

2

3 require_once 'Text/Diff.php';

6 * A class for computing three way diffs.

7 *

8 * $Horde: framework/Text_Diff/Diff3.php,v 1.4 2005/07/03 05:10:11 selsky Exp $

9 *

10 * @package Text_Diff

81 $ncopy = min($e1->norig(), $e2->norig());

82 assert($ncopy > 0);

83 $edits[] = &new Text_Diff3_Op_copy(array_slice($e1->orig, 0, $ncopy));

84

85 if ($e1->norig() > $ncopy) {

sunspotsex7.html (https://github.com/nephie/AZL-website.git) HTML · 112 lines

1 <div style="font-weight: bold;margin-left:15px;">sunspotsex7.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

55 55

56 56

57 </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">

58 </span><span class="hl-reserved">require_once</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">jpgraph/jpgraph.php</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</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">&quot;</span><span class="hl-string">jpgraph/jpgraph_line.php</span><span class="hl-quotes">&quot;</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">&quot;</span><span class="hl-string">jpgraph/jpgraph_bar.php</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;

77

78 </span><span class="hl-comment">//</span><span class="hl-comment"> Just keep the last 20 values in the arrays</span><span class="hl-comment"></span><span class="hl-code">

79 </span><span class="hl-var">$year</span><span class="hl-code"> = </span><span class="hl-identifier">array_slice</span><span class="hl-brackets">(</span><span class="hl-var">$year</span><span class="hl-code">, -</span><span class="hl-number">20</span><span class="hl-brackets">)</span><span class="hl-code">;

80 </span><span class="hl-var">$ydata</span><span class="hl-code"> = </span><span class="hl-identifier">array_slice</span><span class="hl-brackets">(</span><span class="hl-var">$ydata</span><span class="hl-code">, -</span><span class="hl-number">20</span><span class="hl-brackets">)</span><span class="hl-code">;

extension.php (https://github.com/rkern21/videoeditor.git) PHP · 132 lines

1 <?php

2 /**

3 * @version $Id: extension.php 47 2009-05-26 18:06:30Z happynoodleboy $

5 * @subpackage Menus

6 * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.

7 * @license GNU/GPL, see LICENSE.php

8 * Joomla! is free software. This version may have been modified pursuant to the

9 * GNU General Public License, and as distributed it includes or is derivative

10 * of works licensed under the GNU General Public License or other free or open

11 * source software licenses. See COPYRIGHT.php for copyright notices and

12 * details.

13 */

14

15 // Import library dependencies

16 require_once(dirname(__FILE__).DS.'extensions.php');

17

18 /**

PropertyPathBuilder.php (https://github.com/pulzarraider/symfony.git) PHP · 298 lines

1 <?php

2

3 /*

258

259 // All remaining elements should be removed

260 $this->elements = \array_slice($this->elements, 0, $i);

261 $this->isIndex = \array_slice($this->isIndex, 0, $i);

gradebook_data_generator.class.php (https://bitbucket.org/frchico/chamilo_openshift.git) PHP · 233 lines

1 <?php

2 /* For licensing terms, see /license.txt */

3 /**

85 }

86 // get selected items

87 $visibleitems = array_slice($allitems, $start, $count);

88 //status de user in course

89 $user_id = api_get_user_id();

sfFilterConfigHandler.class.php (https://github.com/bheneka/gitta.git) PHP · 207 lines

1 <?php

2

3 /*

119

120 // compile data

121 $retval = sprintf("<?php\n".

122 "// auto-generated by sfFilterConfigHandler\n".

123 "// date: %s\n%s\n%s\n\n", date('Y/m/d H:i:s'),

134 * @param array $parameters Filter default parameters

135 *

136 * @return string The PHP statement

137 */

138 protected function addFilter($category, $class, $parameters)

151 * @param array $parameters Filter default parameters

152 *

153 * @return string The PHP statement

154 */

155 protected function addSecurityFilter($category, $class, $parameters)

class-wp-customize-panel.php (https://gitlab.com/darmawan.fatria/df-skp-2014) PHP · 333 lines

213 */

214 public function json() {

215 $array = wp_array_slice_assoc( (array) $this, array( 'title', 'description', 'priority', 'type' ) );

216 $array['content'] = $this->get_content();

217 $array['active'] = $this->active();

296 $classes = 'accordion-section control-section control-panel control-panel-' . $this->type;

297 ?>

298 <li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">

299 <h3 class="accordion-section-title" tabindex="0">

300 <?php echo esc_html( $this->title ); ?>

305 </ul>

306 </li>

307 <?php

308 }

309

Object.php (https://gitlab.com/team_fsn/fsn-php) PHP · 399 lines

1 <?php

2 /**

3 * Yab Framework

342 public function slice($start, $offset) {

343

344 return new self(array_slice($this->toArray(), $start, $offset));

345

346 }

397 }

398

399 // Do not clause PHP tags unless it is really necessary

400

event.php (https://github.com/barkerja/EightPHP.git) PHP · 202 lines

1 <?php

2 /**

3 * Process queuing/execution class. Allows an unlimited number of callbacks

7 * @package System

8 * @subpackage Core

9 * @author EightPHP Development Team

10 * @copyright (c) 2009-2010 EightPHP

11 * @license http://license.eightphp.com

12 */

13 final class Event {

26 *

27 * @param string event name

28 * @param array http://php.net/callback

29 * @return boolean

30 */

SetConfig.php (https://gitlab.com/wuhang2003/core) PHP · 198 lines

1 <?php

2 /**

3 * @author Joas Schilling <nickvergessen@owncloud.com>

85

86 $newValue = $this->mergeArrayValue(

87 array_slice($configNames, 1), $existingValue, $configValue['value'], $updateOnly

88 );

89

Method.php (https://bitbucket.org/brunoMaurice/youfood.git) PHP · 168 lines

28 * @see Zend_Reflection_Docblock

29 */

30 require_once 'Zend/Reflection/Docblock.php';

31

32 /**

33 * @see Zend_Reflection_Parameter

34 */

35 require_once 'Zend/Reflection/Parameter.php';

36

37 /**

95 throw new Zend_Reflection_Exception('Invalid reflection class provided; must extend Zend_Reflection_Class');

96 }

97 unset($phpReflection);

98 return $zendReflection;

99 }

109 $phpReflections = parent::getParameters();

110 $zendReflections = array();

111 while ($phpReflections && ($phpReflection = array_shift($phpReflections))) {

112 $instance = new $reflectionClass(array($this->getDeclaringClass()->getName(), $this->getName()), $phpReflection->getName());

11.php (https://github.com/livinglab/openlab.git) PHP · 340 lines

1 <?php

2 /**

3 * PEAR_REST_11 - implement faster list-all/remote-list command

4 *

5 * PHP versions 4 and 5

6 *

7 * @category pear

8 * @package PEAR

9 * @author Greg Beaver <cellog@php.net>

10 * @copyright 1997-2009 The Authors

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

12 * @link http://pear.php.net/package/PEAR

13 * @since File available since Release 1.4.3

14 */

arr.php (https://github.com/mihalyf/gallery3-contrib.git) PHP · 275 lines

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

2 /**

3 * Array helper class.

4 *

5 * $Id: arr.php 4680 2009-11-10 01:57:00Z isaiah $

6 *

7 * @package Core

8 * @author Kohana Team

9 * @copyright (c) 2007-2009 Kohana Team

10 * @license http://kohanaphp.com/license

11 */

12 class arr_Core {

98 {

99 // Get the keys, removing the $search array

100 $keys = array_slice(func_get_args(), 1);

101

102 $found = array();

ProtoLexer.php (git://pkgs.fedoraproject.org/php-pear-CodeGen-PECL) PHP · 305 lines

1 <?php

2 class CodeGen_PECL_Tools_ProtoLexer

3 {

80 if ($tokenMap[$this->token]) {

81 // extract sub-patterns for passing to lex function

82 $yysubmatches = array_slice($yysubmatches, $this->token + 1,

83 $tokenMap[$this->token]);

84 } else {

138 if ($tokenMap[$this->token]) {

139 // extract sub-patterns for passing to lex function

140 $yysubmatches = array_slice($yysubmatches, $this->token + 1,

141 $tokenMap[$this->token]);

142 } else {

Collection.php (https://bitbucket.org/kdms/sh-magento.git) PHP · 210 lines

1 <?php

2 /**

3 * Magento Enterprise Edition

141 $newOrderElements[] = $currElement;

142 $newOrderElements[] = $element;

143 $this->_elements = array_merge($newOrderElements, array_slice($this->_elements, $index + 1));

144 return $element;

145 }

class.clean_url.php (https://github.com/raphaelbastide/berta.git) PHP · 156 lines

1 <?php

2

3 /* uzlabota: ernesto */

20 ** The scope of this class is to change the way writing URL Query String like this:

21 ** from

22 ** news.php?id=120&page=2

23 ** to

24 ** news/120/2

28 **

29 ** RewriteEngine on

30 ** RewriteRule ^news(\/.*)*$ /news.php

31 **

32 **

33 ** To create clean URL:

34 ** $clean->makeClean('news.php?id=120&page=2');

35 ** results 'news/120/2';

36 **

core.php (https://github.com/justus/kohana-formo.git) PHP · 453 lines

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

2

3 /**

323 public function orm($method)

324 {

325 $args = array_slice(func_get_args(), 1);

326 return call_user_func_array(array($this->field->orm_driver(), $method), $args);

327 }

SubPanelDefinitions.php (https://gitlab.com/tjaafar/SuiteCRM) PHP · 205 lines

1 <?php

2 /**

3 * SubPanelDefinitions.php

6 */

7

8 require_once('include/SubPanel/SubPanelDefinitions.php');

9

10 class CustomaSubPanel extends aSubPanel

111 {

112 //Try to insert the new field in an order that makes sense

113 $start = array_slice($display_fields, 0, $index);

114 $end = array_slice($display_fields, $index);

179 *

180 * @param BEAN $focus - this is the bean you want to get the data from

181 * @param STRING $layout_def_key - if you wish to use a layout_def defined in the default metadata/subpaneldefs.php that is not keyed off of $bean->module_dir pass in the key here

182 * @param ARRAY $layout_def_override - if you wish to override the default loaded layout defs you pass them in here.

183 * @return SubPanelDefinitions

ArrayDataProvider.php (https://gitlab.com/afzalpotenza/YII_salon) PHP · 136 lines

1 <?php

2 /**

3 * @link http://www.yiiframework.com/

28 * ArrayDataProvider may be used in the following way:

29 *

30 * ```php

31 * $query = new Query;

32 * $provider = new ArrayDataProvider([

83

84 if ($pagination->getPageSize() > 0) {

85 $models = array_slice($models, $pagination->getOffset(), $pagination->getLimit(), true);

86 }

87 }

DB_forge.php (https://github.com/mkhairul/Presta.git) PHP · 346 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2 /**

3 * Code Igniter

4 *

5 * An open source application development framework for PHP 4.3.2 or newer

6 *

7 * @package CodeIgniter

249 // add field info into field array, but we can only do one at a time

250 // so only grab the first field in the event there are more then one

251 $this->add_field(array_slice($field, 0, 1));

252

253 if (count($this->fields) == 0)

311 // add field info into field array, but we can only do one at a time

312 // so only grab the first field in the event there are more then one

313 $this->add_field(array_slice($field, 0, 1));

314

315 if (count($this->fields) == 0)

class-bp-walker-nav-menu.php (https://github.com/livinglab/openlab.git) PHP · 227 lines

1 <?php

2 /**

3 * Core component classes.

47 *

48 * @since 1.7.0

49 * @since 5.1.0 Method was renamed from `walk` to `do_walk` to ensure PHP 5.3 compatibility

50 *

51 * @see Walker::walk()

100 if ( empty( $top_level_elements ) ) {

101

102 $first = array_slice( $elements, 0, 1 );

103 $root = $first[0];

104 $top_level_elements = array();

Row.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 220 lines

1 <?php

2 /**

3 * Zend Framework

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

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

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

20 */

21

66 }

67

68 require_once 'Zend/Text/Table/Column.php';

69

70 $column = new Column($content, $align, $colSpan, $encoding);

124 {

125 if ($this->_columnWidths === null) {

126 require_once 'Zend/Text/Table/Exception.php';

127 throw new Exception('No columns were rendered yet');

128 }

Client.php (https://bitbucket.org/mercysam/zfs.git) PHP · 253 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Service_Abstract */

24 require_once 'Zend/Service/Abstract.php';

25

26 /** Zend_Rest_Client_Result */

27 require_once 'Zend/Rest/Client/Result.php';

28

29 /** Zend_Uri */

30 require_once 'Zend/Uri.php';

31

32 /**

Renderer.php (https://gitlab.com/ElvisAns/tiki) PHP · 208 lines

1 <?php

2

3 /**

7 * this class be customized via inheritance, to obtain fancier outputs.

8 *

9 * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5 2004/10/13 09:30:20 jan Exp $

10 *

11 * @package Text_Diff

67 } else {

68 if ($ntrail) {

69 $context = array_slice($edit->orig, 0, $ntrail);

70 $block[] = new Text_Diff_Op_copy($context);

71 }

83 } else {

84 if (! is_array($block)) {

85 $context = array_slice($context, count($context) - $nlead);

86 $x0 = $xi - count($context);

87 $y0 = $yi - count($context);

Migrator.php (https://gitlab.com/judielsm/Handora) PHP · 405 lines

1 <?php

2

3 namespace Illuminate\Database\Migrations;

237 public function getMigrationFiles($path)

238 {

239 $files = $this->files->glob($path.'/*_*.php');

240

241 // Once we have the array of files in the directory we will just remove the

247

248 $files = array_map(function ($file) {

249 return str_replace('.php', '', basename($file));

250

251 }, $files);

269 {

270 foreach ($files as $file) {

271 $this->files->requireOnce($path.'/'.$file.'.php');

272 }

273 }

Log.php (https://gitlab.com/yasminmostfa/thomas-site) PHP · 247 lines

1 <?php

2 /**

3 * Piwik - free/libre analytics platform

125 public static function error($message /* ... */)

126 {

127 self::logMessage(Logger::ERROR, $message, array_slice(func_get_args(), 1));

128 }

129

140 public static function warning($message /* ... */)

141 {

142 self::logMessage(Logger::WARNING, $message, array_slice(func_get_args(), 1));

143 }

144

155 public static function info($message /* ... */)

156 {

157 self::logMessage(Logger::INFO, $message, array_slice(func_get_args(), 1));

158 }

159

ActionError.php (https://github.com/bobpp/ethna.git) PHP · 224 lines

1 <?php

2 // vim: foldmethod=marker

3 /**

4 * ActionError.php

5 *

6 * @author Masaki Fujimoto <fujimoto@php.net>

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

8 * @package Ethna

9 * @version $Id: e08ceaf4594b9cf9dd5e38e3ba0997d5d1cc983b $

15 *

16 * @access public

17 * @author Masaki Fujimoto <fujimoto@php.net>

18 * @package Ethna

19 * @todo 配列フォームを扱えるようにする

Translation.php (https://gitlab.com/koodersmiikka/operaatio-terveys) PHP · 479 lines

1 <?php

2

3 namespace Gettext;

260 $this->pluralTranslation = $this->pluralTranslation + array_fill(0, $allowed, '');

261 } elseif ($current > $allowed) {

262 $this->pluralTranslation = array_slice($this->pluralTranslation, 0, $allowed);

263 }

264 } else {

ListAbstract.php (https://gitlab.com/mac_doggie/list) PHP · 361 lines

1 <?php

2 namespace Macdoggie\Component\Lists;

3

240 {

241 if ($clause[0] == '$or') {

242 $orClauses = array_slice($clause, 1);

243 $result = $this->orClause($orClauses, $item);

244 } elseif ($clause[0] == '$and') {

245 $andClauses = array_slice($clause, 1);

246 $result = $this->andClause($andClauses, $item);

247 } else {

document_rst_visitor_docbook_test.php (https://github.com/F5/zetacomponents.git) PHP · 159 lines

1 <?php

2 /**

3 * ezcDocumentRstParserTests

26 */

27

28 require_once 'helper/rst_dummy_directives.php';

29 require_once 'helper/rst_paragraph_directive.php';

41 public static function suite()

42 {

43 return new PHPUnit_Framework_TestSuite( __CLASS__ );

44 }

45

62

63 return self::$testDocuments;

64 return array_slice( self::$testDocuments, -2, 1 );

65 }

66

TBGEdition.class.php (https://github.com/disassembler/thebuggenie.git) PHP · 414 lines

1 <?php

2

3 /**

6 * @author Daniel Andre Eikeland <zegenie@zegeniestudios.net>

7 * @version 3.1

8 * @license http://www.opensource.org/licenses/mozilla1.1.php Mozilla Public License 1.1 (MPL 1.1)

9 * @package thebuggenie

10 * @subpackage main

275 }

276 }

277 return array_slice($this->_builds, 0, 1);

278 }

279 return 0;

300 {

301 $builds = usort($this->getBuilds(), array($this, '_sortBuildsByReleaseDate'));

302 return array_slice($builds, 0, 1);

303 }

304 return null;

cache.php (https://github.com/ot2sen/Molajo.git) PHP · 188 lines

1 <?php

2 /**

3 * @version $Id: cache.php 21518 2011-06-10 21:38:12Z chdemko $

89 // Apply custom pagination

90 if ($this->_total > $this->getState('list.limit') && $this->getState('list.limit')) {

91 $this->_data = array_slice($this->_data, $this->getState('list.start'), $this->getState('list.limit'));

92 }

93 }

Scope.php (https://gitlab.com/dae.nuli/toko) PHP · 423 lines

1 <?php

2

3 /*

154 {

155 if ($this->parentScopes) {

156 $scopeArray = array_slice($this->parentScopes, 1);

157 array_push($scopeArray, $this->scopeIdentifier, $checkScopeSegment);

158 } else {

182 {

183 if ($this->parentScopes) {

184 $scopeArray = array_slice($this->parentScopes, 1);

185 array_push($scopeArray, $this->scopeIdentifier, $checkScopeSegment);

186 } else {

class-wp-walker.php (https://gitlab.com/darmawan.fatria/df-skp-2014) PHP · 416 lines

1 <?php

2 /**

3 * A class for displaying various tree-like structures.

191 public function walk( $elements, $max_depth) {

192

193 $args = array_slice(func_get_args(), 2);

194 $output = '';

195

231 if ( empty($top_level_elements) ) {

232

233 $first = array_slice( $elements, 0, 1 );

234 $root = $first[0];

235

283 return '';

284

285 $args = array_slice( func_get_args(), 4 );

286 $output = '';

287

pusher.php (https://github.com/agallou/atoum.git) PHP · 380 lines

1 <?php

2

3 namespace mageekguy\atoum\scripts\git;

136 if (sizeof($remote) != 1)

137 {

138 throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $remote, $script->getName()));

139 }

140

149 if (sizeof($tagFile) != 1)

150 {

151 throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $argument, $script->getName()));

152 }

153

251 }

252

253 return implode('.', array_slice($matches, 1));

254 };

255 };

GeneratorCommand.php (https://gitlab.com/zan_zan/laravel_sample) PHP · 204 lines

1 <?php

2

3 namespace Illuminate\Console;

75 $name = str_replace($this->laravel->getNamespace(), '', $name);

76

77 return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';

78 }

79

164 protected function getNamespace($name)

165 {

166 return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\');

167 }

168

Migrator.php (https://gitlab.com/kimting254/wbms) PHP · 411 lines

1 <?php namespace Illuminate\Database\Migrations;

2

3 use Illuminate\Filesystem\Filesystem;

242 public function getMigrationFiles($path)

243 {

244 $files = $this->files->glob($path.'/*_*.php');

245

246 // Once we have the array of files in the directory we will just remove the

251 $files = array_map(function($file)

252 {

253 return str_replace('.php', '', basename($file));

254

255 }, $files);

272 public function requireFiles($path, array $files)

273 {

274 foreach ($files as $file) $this->files->requireOnce($path.'/'.$file.'.php');

275 }

276

EachValidator.php (https://gitlab.com/brucealdridge/yii2) PHP · 152 lines

1 <?php

2 /**

3 * @link http://www.yiiframework.com/

15 * EachValidator validates an array by checking each of its elements against an embedded validation rule.

16 *

17 * ~~~php

18 * class MyModel extends Model

19 * {

104 $model = new Model(); // mock up context model

105 }

106 return Validator::createValidator($rule[0], $model, $this->attributes, array_slice($rule, 1));

107 } else {

108 throw new InvalidConfigException('Invalid validation rule: a rule must be an array specifying validator type.');

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

This PHP script is a file service that handles HTTP requests for retrieving files and directories. It accepts query parameters to filter results, sort files, and paginate output. If a specific file path is provided, it returns the file’s metadata in JSON format. Otherwise, it returns a list of matching files with optional filtering and sorting.

1 <?php

2 //Define the root directory to use for this service.

3 //All file lookups are relative to this path.

4 $rootDir = "../..";

5

6 require_once("filestore_funcs.php");

7

8 //Extract the query, if any.

104 $start = 0;

105 }

106 $files = array_slice($files, $start);

107 }

108 if (array_key_exists("count", $_GET)) {

111 $count = $total;

112 }

113 $files = array_slice($files, 0, $count);

114 }

115