100+ results for 'php array_search'

Not the results you expected?

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

1 <?php

2

3 namespace Tonic;

202 {

203 if (count($this->request->accept) == 0) return 0;

204 $pos = array_search($mimetype, $this->request->accept);

205 if ($pos === FALSE) {

206 if (in_array('*/*', $this->request->accept)) {

225 protected function lang($language)

226 {

227 $pos = array_search($language, $this->request->acceptLanguage);

228 if ($pos === FALSE)

229 throw new NotAcceptableException('No matching method for response type "'.join(', ', $this->request->acceptLanguage).'"');

Boolean.php (https://gitlab.com/luisrepo/ClienteWS) PHP · 375 lines

23 * @see Zend_Filter_Interface

24 */

25 require_once 'Zend/Filter/Interface.php';

26

27 /**

53 self::EMPTY_ARRAY => 'array',

54 self::NULL => 'null',

55 self::PHP => 'php',

56 self::FALSE_STRING => 'false',

57 self::YES => 'yes',

145 $detected += $value;

146 } elseif (in_array($value, $this->_constants)) {

147 $detected += array_search($value, $this->_constants);

148 }

149 }

Boolean.php (https://github.com/mattclegg/magento-mirror.git) PHP · 375 lines

23 * @see Zend_Filter_Interface

24 */

25 #require_once 'Zend/Filter/Interface.php';

26

27 /**

53 self::EMPTY_ARRAY => 'array',

54 self::NULL => 'null',

55 self::PHP => 'php',

56 self::FALSE_STRING => 'false',

57 self::YES => 'yes',

145 $detected += $value;

146 } elseif (in_array($value, $this->_constants)) {

147 $detected += array_search($value, $this->_constants);

148 }

149 }

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

23 * @see Zend_Filter_Interface

24 */

25 // // // // // // // // // // require_once 'Zend/Filter/Interface.php';

26

27 /**

53 self::EMPTY_ARRAY => 'array',

54 self::NULL => 'null',

55 self::PHP => 'php',

56 self::FALSE_STRING => 'false',

57 self::YES => 'yes',

145 $detected += $value;

146 } elseif (in_array($value, $this->_constants)) {

147 $detected += array_search($value, $this->_constants);

148 }

149 }

class.base_collection.php (https://github.com/Canuckaholic/Pop-Digital.git) PHP · 369 lines

1 <?php

2

3 /**

126 //Check for item in collection

127 if ( $this->has($item) ) {

128 $ret = array_search($item, $this->items);

129 } elseif ( !!$this->key_prop && ( is_object($item) || is_array($item) ) ) {

130 if ( !!$this->key_call ) {

ListEntry.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 208 lines

1 <?php

2

3 /**

25 * @see Zend_Gdata_Entry

26 */

27 // require_once 'Zend/Gdata/Entry.php';

28

29 /**

30 * @see Zend_Gdata_Spreadsheets_Extension_Custom

31 */

32 // require_once 'Zend/Gdata/Spreadsheets/Extension/Custom.php';

33

34 /**

173 $this->_custom = array_values($this->_custom);

174 // Be sure to delete form both arrays!

175 $key = array_search($element, $this->_customByName);

176 unset($this->_customByName[$key]);

177 } else {

PluginLoader.php (https://github.com/jorgenils/zend-framework.git) PHP · 337 lines

1 <?php

2 /**

3 * Zend Framework

21

22 /** Zend_Loader_PluginLoader_Interface */

23 require_once 'Zend/Loader/PluginLoader/Interface.php';

24

25 /** Zend_Loader */

26 require_once 'Zend/Loader.php';

27

28 /**

112 {

113 if (!is_string($prefix) || !is_string($path)) {

114 require_once 'Zend/Loader/PluginLoader/Exception.php';

115 throw new Zend_Loader_PluginLoader_Exception('Zend_Loader_PluginLoader::addPrefixPath() method only takes strings for prefix and path.');

116 }

wc-page-functions.php (https://github.com/crowdfavorite/woocommerce.git) PHP · 239 lines

1 <?php

2 /**

3 * WooCommerce Page Functions

81 if ( get_option( 'permalink_structure' ) ) {

82 if ( strstr( $permalink, '?' ) ) {

83 $query_string = '?' . parse_url( $permalink, PHP_URL_QUERY );

84 $permalink = current( explode( '?', $permalink ) );

85 } else {

188

189 if ( in_array( 'current_page_parent', $classes ) ) {

190 unset( $classes[ array_search('current_page_parent', $classes) ] );

191 }

192

193 if ( in_array( 'current-menu-item', $classes ) ) {

194 unset( $classes[ array_search('current-menu-item', $classes) ] );

195 }

196

Collection.php (https://github.com/vohnicky/treeview.git) PHP · 384 lines

1 <?php

2

3 /**

5 *

6 * @copyright Copyright (c) 2004, 2010 David Grudl

7 * @license http://nettephp.com/license Nette license

8 * @link http://nettephp.com

23 abstract class Collection extends ArrayObject implements ICollection

24 {

25 /** @var string type (class, interface, PHP type) */

26 private $itemType;

27

97 protected function search($item)

98 {

99 return array_search($item, $this->getArrayCopy(), TRUE);

100 }

101

Editor.php (https://github.com/lazenge/zf2.git) PHP · 601 lines

1 <?php

2 /**

3 * Zend Framework

126 $event = (string) $event;

127 $captureEvents = $this->getCaptureEvents();

128 if (false === ($index = array_search($event, $captureEvents))) {

129 return $this;

130 }

224 {

225 $events = $this->getEvents();

226 if (false === ($index = array_search($event, $events))) {

227 return $this;

228 }

322 {

323 $plugins = $this->getPlugins();

324 if (false === ($index = array_search($plugin, $plugins))) {

325 return $this;

326 }

result.php (https://github.com/vietvh/Finder.git) PHP · 398 lines

1 <?php

2 /**

3 * @package Joomla.Administrator

10 defined('_JEXEC') or die;

11

12 JLoader::register('FinderIndexer', dirname(__FILE__) . '/indexer.php');

13

14 /**

337 {

338 // Search for the property in the group.

339 $key = array_search($property, $this->instructions[$group]);

340

341 // If the property was found, remove it.

modregister.class.php (https://gitlab.com/haque.mdmanzurul/modx-improve-carolyn) PHP · 223 lines

1 <?php

2 /*

3 * MODX Revolution

72 *

73 * @param modX &$modx A reference to a modX instance.

74 * @param string $key A valid PHP variable which will be set on the modRegistry instance.

75 * @param array $options Optional array of registry options.

76 */

149 public function unsubscribe($topic) {

150 $success = false;

151 $topicIdx = array_search($topic, $this->subscriptions);

152 if ($topicIdx !== false && $topicIdx !== null) {

153 unset($this->subscriptions[$topicIdx]);

198 if ($topic[0] != '/') $topic = $this->_currentTopic . $topic;

199 if ($topic[strlen($topic) - 1] != '/') $topic .= '/';

200 $topicIdx = array_search($topic, $this->subscriptions);

201 if ($topicIdx !== false && $topicIdx !== null) {

202 $this->_currentTopic = $topic;

HelperPriorityStack.php (https://github.com/bruisedlee/zf2.git) PHP · 280 lines

1 <?php

2 /**

3 * Zend Framework

183 $helperName = $priorityOrHelperName;

184 $helper = $this->_helpersByNameRef[$helperName];

185 $priority = array_search($helper, $this->_helpersByPriority, true);

186 } else {

187 $priority = $priorityOrHelperName;

avaliacoes.inc.php (https://gitlab.com/papers-php/papers-php) PHP · 269 lines

228 $proposta -- codigo da proposta procurada

229

230 Eh uma pena, mas o PHP naum tem um array_search decente. Que

231 saudades do Ruby...

232 */

ClassExistenceResource.php (https://github.com/FabienD/symfony.git) PHP · 231 lines

1 <?php

2

3 /*

188 $callerFrame = $trace[1];

189 $i = 2;

190 } elseif (false !== $i = array_search($autoloadFrame, $trace, true)) {

191 $callerFrame = $trace[++$i];

192 } else {

Parser.php (https://gitlab.com/jafari/resana) PHP · 299 lines

1 <?php

2 /**

3 * @link http://www.noghteh.ir/

191

192 foreach ([$text, $this->update->baseMessage->text] as $pattern) {

193 $commandIndex = array_search($pattern, $patterns, false);

194 if ($commandIndex !== false) {

195 $command = $this->getCommands()[$commandIndex];

213 $path = Yii::getAlias('@common/components/telegram/commands');

214 $namespace = '\common\components\telegram\commands';

215 $files = glob($path.'/*.php');

216 $commands = [];

217

218 foreach ($files as $file) {

219 if (preg_match('/.*\/([\w]+Command).php/', $file, $matches)) {

220 $className = $namespace . '\\' . $matches[1];

221 $commands[] = new $className(['bot' => $this->bot, 'update' => $this->update]);

PredisCluster.php (https://gitlab.com/webbroteam/satisfaction-mvc) PHP · 237 lines

1 <?php

2

3 /*

100 public function remove(NodeConnectionInterface $connection)

101 {

102 if (($id = array_search($connection, $this->pool, true)) !== false) {

103 unset($this->pool[$id]);

104 $this->distributor->remove($connection);

MPSUM_Admin_Plugins.php (https://gitlab.com/memuller.web/wp_site) PHP · 275 lines

1 <?php

2 /**

3 * Controls the plugins tab

129 public function plugin_action_links( $settings, $plugin ) {

130 $plugin_options = MPSUM_Updates_Manager::get_options( 'plugins' );

131 if ( false !== $key = array_search( $plugin, $plugin_options ) ) {

132 $enable_url = add_query_arg( array( 'action' => 'allow-update-selected', '_mpsum' => wp_create_nonce( 'mpsum_plugin_update' ), 'checked' => array( $plugin ) ) );

133 $settings[] = sprintf( '<a href="%s">%s</a>', esc_url( $enable_url ), esc_html__( 'Allow Updates', 'stops-core-theme-and-plugin-updates' ) );

178 foreach( $plugins as $plugin ) {

179 $plugin_options[] = $plugin;

180 if ( ( $key = array_search( $plugin, $plugin_automatic_options ) ) !== false ) {

181 unset( $plugin_automatic_options[ $key ] );

182 }

186 case 'allow-update-selected':

187 foreach( $plugins as $plugin ) {

188 if ( ( $key = array_search( $plugin, $plugin_options ) ) !== false ) {

189 unset( $plugin_options[ $key ] );

190 }

meta-box-saves.inc.php (https://gitlab.com/Gashler/dp) PHP · 148 lines

1 <?php

2 /**

3 * Meta box saves.

64

65 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)

66 if (($i = array_search ($page_id, $pages[$n])) !== false)

67 unset($pages[$n][$i]);

68

90

91 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)

92 if (($i = array_search ($post_id, $posts[$n])) !== false)

93 unset($posts[$n][$i]);

94

EventDispatcher.php (https://gitlab.com/x33n/respond) PHP · 185 lines

1 <?php

2

3 /*

107

108 foreach ($this->listeners[$eventName] as $priority => $listeners) {

109 if (false !== ($key = array_search($listener, $listeners, true))) {

110 unset($this->listeners[$eventName][$priority][$key], $this->sorted[$eventName]);

111 }

Serializer.php (https://github.com/fernanDOTdo/symfony.git) PHP · 199 lines

1 <?php

2

3 namespace Symfony\Component\Serializer;

154 public function removeNormalizer(NormalizerInterface $normalizer)

155 {

156 unset($this->normalizers[array_search($normalizer, $this->normalizers, true)]);

157 }

158

compare.php (https://gitlab.com/shapcy/opencart) PHP · 195 lines

1 <?php

2 class ControllerProductCompare extends Controller {

3 public function index() {

13

14 if (isset($this->request->get['remove'])) {

15 $key = array_search($this->request->get['remove'], $this->session->data['compare']);

16

17 if ($key !== false) {

grid.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 470 lines

1 <?php

2 /**

3 * JGrid class to dynamically generate HTML tables

154 public function deleteColumn($name)

155 {

156 $index = array_search($name, $this->columns);

157 if ($index !== false)

158 {

363 if (in_array($id, $this->specialRows['header']))

364 {

365 unset($this->specialRows['header'][array_search($id, $this->specialRows['header'])]);

366 }

367

368 if (in_array($id, $this->specialRows['footer']))

369 {

370 unset($this->specialRows['footer'][array_search($id, $this->specialRows['footer'])]);

371 }

372

Broker.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Controller_Plugin_Abstract */

24 #require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 #require_once 'Zend/Controller/Exception.php';

60 if ($stackIndex) {

61 if (isset($this->_plugins[$stackIndex])) {

62 #require_once 'Zend/Controller/Exception.php';

63 throw new Zend_Controller_Exception('Plugin with stackIndex "' . $stackIndex . '" already registered');

64 }

Broker.php (https://github.com/vadimonus/moodle.git) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Controller_Plugin_Abstract */

24 require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 require_once 'Zend/Controller/Exception.php';

60 if ($stackIndex) {

61 if (isset($this->_plugins[$stackIndex])) {

62 require_once 'Zend/Controller/Exception.php';

63 throw new Zend_Controller_Exception('Plugin with stackIndex "' . $stackIndex . '" already registered');

64 }

OutputFormatterStyle.php (https://github.com/kiranatama/sagalaya.git) PHP · 217 lines

1 <?php

2

3 /*

144 }

145

146 if (false === array_search(static::$availableOptions[$option], $this->options)) {

147 $this->options[] = static::$availableOptions[$option];

148 }

164 }

165

166 $pos = array_search(static::$availableOptions[$option], $this->options);

167 if (false !== $pos) {

168 unset($this->options[$pos]);

ContainerInfoController.php (https://gitlab.com/guillaumev/alkarama) PHP · 274 lines

1 <?php

2

3 namespace Drupal\devel\Controller;

86 ];

87 $row['alias'] = [

88 'data' => array_search($service_id, $container['aliases']) ?: '',

89 'class' => 'table-filter-text-source',

90 ];

166

167 // If the service has an alias add it to the definition.

168 if ($alias = array_search($service_id, $cached_definitions['aliases'])) {

169 $definition['alias'] = $alias;

170 }

filter.php (https://github.com/markn86/moodle.git) PHP · 268 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

184 */

185 public function set_join_type(int $jointype): self {

186 if (array_search($jointype, $this->jointypes) === false) {

187 throw new InvalidArgumentException('Invalid join type specified');

188 }

219 }

220

221 if (array_search($value, $this->filtervalues) !== false) {

222 // Remove duplicates.

223 return $this;

PhpValue.php (https://github.com/Exercise/zf2.git) PHP · 340 lines

26 namespace Zend\CodeGenerator\Php;

27

28 class PhpValue extends AbstractPhp

29 {

30 /**#@+

132 *

133 * @param mixed $value

134 * @return \Zend\CodeGenerator\Php\PhpPropertyValue

135 */

136 public function setValue($value)

154 *

155 * @param string $type

156 * @return \Zend\CodeGenerator\Php\PhpPropertyValue

157 */

158 public function setType($type)

RequestActionTrait.php (https://gitlab.com/vannh/portal_training) PHP · 157 lines

1 <?php

2 /**

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

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

5 *

8 *

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

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

11 * @since 3.0.0

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

91 * ```

92 *

93 * @param string|array $url String or array-based url. Unlike other url arrays in CakePHP, this

94 * url will not automatically handle passed arguments in the $url parameter.

95 * @param array $extra if array includes the key "return" it sets the autoRender to true. Can

ViewModel.class.php (https://github.com/dzx0315/509.git) PHP · 285 lines

1 <?php

2 // +----------------------------------------------------------------------

3 // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]

4 // +----------------------------------------------------------------------

5 // | Copyright (c) 2010 http://thinkphp.cn All rights reserved.

6 // +----------------------------------------------------------------------

7 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )

13 /**

14 +------------------------------------------------------------------------------

15 * ThinkPHP 视图模型类

16 +------------------------------------------------------------------------------

17 * @category Think

107 */

108 private function _checkFields($name,$fields) {

109 if(false !== $pos = array_search('*',$fields)) {// 定义所有字段

110 $fields = array_merge($fields,M($name)->getDbFields());

111 unset($fields[$pos]);

User.class.php (https://github.com/gwu-libraries/srrs-mobile.git) PHP · 385 lines

1 <?php

2 /**

3 * This file contains the User class for viewing

5 * @author Nick Korbel <lqqkout13@users.sourceforge.net>

6 * @version 01-28-07

7 * @package phpScheduleIt

8 *

9 * Copyright (C) 2003 - 2007 phpScheduleIt

13 $basedir = dirname(__FILE__) . '/..';

14

15 include_once($basedir . '/lib/db/UserDB.class.php');

16

17 class User {

297 }

298 for ($i = 0; $i < count($groupids); $i++) {

299 if ( array_search($groupids[$i], $admin_groups) !== false ) {

300 return true; // Admin of at least one of the groups

301 }

panier.php (https://gitlab.com/thoussem/Tunisie-Shop) PHP · 315 lines

1

2 <?php

3

4

287 $present = false;

288 /* On vérifie les numéros de références des articles et on compare avec l'article à vérifier */

289 if( count($_SESSION['panier']['id_article']) > 0 && array_search($ref_article,$_SESSION['panier']['id_article']) !== false)

290 {

291 $present = true;

Editor.php (https://github.com/eschabell/openshift-zendframework.git) PHP · 599 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Editor.php 23921 2011-05-02 19:11:31Z matthew $

21 */

22

23 /** Zend_Dojo_Form_Element_Dijit */

24 require_once 'Zend/Dojo/Form/Element/Dijit.php';

25

26 /**

122 $event = (string) $event;

123 $captureEvents = $this->getCaptureEvents();

124 if (false === ($index = array_search($event, $captureEvents))) {

125 return $this;

126 }

index.php (https://github.com/einars/tiny-php-gallery.git) PHP · 229 lines

1 <?php

2

3 /*

4

5 A very tiny PHP gallery intended to be dropped into a web-facing folder full of images.

6

7 See the gallery in action: http://spicausis.lv/gallery-demo/ .

111

112 global $images;

113 $index = array_search($image, $images);

114

115 print_html_crap();

amazon_product.php (https://gitlab.com/reclamare/mao) PHP · 129 lines

1 <?php

2 class ModelOpenbayAmazonProduct extends Model {

3 public function setStatus($insertion_id, $status_string) {

119 $marketplaces = $this->config->get('openbay_amazon_processing_listing_reports');

120

121 if ($marketplaces && ($key = array_search($marketplace, $marketplaces)) !== false) {

122 unset($marketplaces[$key]);

123

Processes.php (https://github.com/livinglab/openlab.git) PHP · 278 lines

1 <?php

2

3 /**

92 }

93

94 $array_search = array_search( $action, $this->handler_actions, true );

95

96 if ( false === $handler_class = $array_search ) {

132 }

133

134 $array_search = array_search( $action, $all_queues_actions, true );

135

136 if ( false === $queue_class = $array_search ) {

backend.php (https://gitlab.com/wuhang2003/core) PHP · 159 lines

1 <?php

2 /**

3 * @author Arthur Schiwon <blizzz@owncloud.com>

69 $count = count($this->backend->getGroups()) - $startCount;

70 $this->assertEquals(1, $count);

71 $this->assertTrue((array_search($name1, $this->backend->getGroups()) !== false));

72 $this->assertFalse((array_search($name2, $this->backend->getGroups()) !== false));

74 $count = count($this->backend->getGroups()) - $startCount;

75 $this->assertEquals(2, $count);

76 $this->assertTrue((array_search($name1, $this->backend->getGroups()) !== false));

77 $this->assertTrue((array_search($name2, $this->backend->getGroups()) !== false));

80 $count = count($this->backend->getGroups()) - $startCount;

81 $this->assertEquals(1, $count);

82 $this->assertTrue((array_search($name1, $this->backend->getGroups()) !== false));

83 $this->assertFalse((array_search($name2, $this->backend->getGroups()) !== false));

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

3 * PHPExcel

4 *

5 * Copyright (c) 2006 - 2011 PHPExcel

6 *

7 * This library is free software; you can redistribute it and/or

22 * @package PHPExcel

23 * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)

24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL

25 * @version 1.7.6, 2011-02-27

33 * @package PHPExcel

34 * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)

35 */

36 class PHPExcel_HashTable

67 * Add HashTable items from source

68 *

69 * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from

70 * @throws Exception

71 */

Broker.php (https://gitlab.com/fabiorf/curso-zend1-aula1) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

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

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

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

21 */

22

23 /** Zend_Controller_Plugin_Abstract */

24 require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 require_once 'Zend/Controller/Exception.php';

Broker.php (https://github.com/necrogami/zf2.git) PHP · 376 lines

1 <?php

2 /**

3 * Zend Framework

54 public function registerPlugin(AbstractPlugin $plugin, $stackIndex = null)

55 {

56 if (false !== array_search($plugin, $this->_plugins, true)) {

57 throw new Controller\Exception('Plugin already registered');

58 }

97 if ($plugin instanceof AbstractPlugin) {

98 // Given a plugin object, find it in the array

99 $key = array_search($plugin, $this->_plugins, true);

100 if (false === $key) {

101 throw new Controller\Exception('Plugin never registered.');

utils.php (https://gitlab.com/Rad1calDreamer/honey) PHP · 225 lines

5 {

6 $arServices = Array();

7 include($servicePath.".services.php");

8

9 if (empty($arServices))

90 $number = 1;

91 $currentItemPath = $itemPath;

92 while (array_search($currentItemPath, $arServices[$itemID]) !== false)

93 $currentItemPath = $itemPath.$number++;

94

115

116 $arTemplate = Array();

117 if (is_file($themePath."/".$file."/description.php"))

118 @include($themePath."/".$file."/description.php");

167

168 $PERM = Array();

169 if(file_exists($documentRoot.$pathDir."/.access.php"))

170 @include($documentRoot.$pathDir."/.access.php");

module.php (https://github.com/ismanramadhan/Panada.git) PHP · 309 lines

1 <?php defined('THISPATH') or die('Can\'t access directly!');

2 /**

3 * Module class parent.

33 foreach($components as $component){

34

35 $key = array_search($component, $file_name);

36

37 if( $key !== false ){

49 return false;

50

51 $file = GEAR . 'module/'. $module_name . '/' . $component . '/' . $class_name .'.php';

52

53 include_once $file;

116

117 $prefix = $arr[2];

118 $file_path = GEAR . $file_path.'.php';

119

120 if( ! file_exists( $file_path ) )

Mock.php (https://github.com/ewandor/horde.git) PHP · 254 lines

1 <?php

2 /**

3 * This class provides a mock driver for the Horde group system.

226 throw new Horde_Exception_NotFound('Group ' . $gid . ' not found');

227 }

228 $key = array_search($user, $this->_groups[$gid]['users']);

229 if ($key !== false) {

230 unset($this->_groups[$gid]['users'][$key]);

grid.php (https://bitbucket.org/ke2083/transfans.co.uk-website.git) PHP · 480 lines

1 <?php

2 /**

3 * @package Joomla.Platform

152 public function deleteColumn($name)

153 {

154 $index = array_search($name, $this->columns);

155

156 if ($index !== false)

365 if (in_array($id, $this->specialRows['header']))

366 {

367 unset($this->specialRows['header'][array_search($id, $this->specialRows['header'])]);

368 }

369

370 if (in_array($id, $this->specialRows['footer']))

371 {

372 unset($this->specialRows['footer'][array_search($id, $this->specialRows['footer'])]);

373 }

374

system-users.php (https://gitlab.com/Anas7232/Layout-Changes) PHP · 177 lines

25 <div class="card-body row">

26

27 <?php

28 if (isset($fetched_data[0]['id'])) { ?>

29 <input type='hidden' name='edit_system_user' value="<?= $fetched_data[0]['id'] ?>">

30 <?php }

31 ?>

32

54 <div class="form-group">

55 <label for="password" class="control-label">Password <span class='text-danger text-sm'>*</span></label>

56 <?php if (isset($fetched_data[0]['id'])) { ?>

57 <span class='text-danger'>*Leave blank if there is no change</span>

58 <?php } ?>

acf-input-functions.php (https://gitlab.com/suporte.spturis/carnaval2015.spturis.com.br) PHP · 497 lines

1 <?php

2

3 /**

407

408 // If is selected.

409 $pos = array_search( esc_attr( $value ), $values );

410 if ( $pos !== false ) {

411 $attrs['selected'] = 'selected';

class.wp-dependencies.php (https://gitlab.com/webkod3r/tripolis) PHP · 509 lines

1 <?php

2 /**

3 * Dependencies API: WP_Dependencies base class

319 foreach ( (array) $handles as $handle ) {

320 $handle = explode('?', $handle);

321 $key = array_search($handle[0], $this->queue);

322 if ( false !== $key ) {

323 unset($this->queue[$key]);

class-ai1wm-extractor.php (https://gitlab.com/haque.mdmanzurul/neophix) PHP · 296 lines

1 <?php

2

3 /**

171

172 // let's unset the file from the files array

173 $key = array_search( $data['filename'], $files );

174 unset( $files[$key] );

175 } else {

Broker.php (https://bitbucket.org/haichau59/manga.git) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Broker.php 24594 2012-01-05 21:27:01Z matthew $

21 */

22

23 /** Zend_Controller_Plugin_Abstract */

24 //require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 //require_once 'Zend/Controller/Exception.php';

build_acl.php (https://github.com/JeremyPlease/acl_tutorial.git) PHP · 219 lines

1 <?php

2 class BuildAclComponent extends Object {

3

28 App::import('Core', 'File');

29 $Controllers = Configure::listObjects('controller');

30 $appIndex = array_search('App', $Controllers);

31 if ($appIndex !== false ) {

32 unset($Controllers[$appIndex]);

191 $didCD = $folder->cd(APP . 'plugins'. DS . $pluginName . DS . 'controllers');

192 // Get a list of the files that have a file name that ends

193 // with controller.php

194 $files = $folder->findRecursive('.*_controller\.php');

200

201 // Get the controller name

202 $file = Inflector::camelize(substr($file, 0, strlen($file)-strlen('_controller.php')));

203 if (!preg_match('/^'. Inflector::humanize($pluginName). 'App/', $file)) {

204 if (!App::import('Controller', $pluginName.'.'.$file)) {

Range.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 170 lines

1 <?php

2 /*

3 * $Id: Range.php 48519 2012-02-03 23:18:52Z btowles $

26 * @package Doctrine

27 * @subpackage Pager

28 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL

29 * @version $Revision$

30 * @link www.doctrine-project.org

145 public function isInRange($page)

146 {

147 return (array_search($page, $this->rangeAroundPage()) !== false);

148 }

149

Metaboxes.php (https://github.com/livinglab/openlab.git) PHP · 94 lines

13 <?php _e( 'Status','dw-question-answer' ) ?><br>&nbsp;

14 <select name="dwqa-question-status" id="dwqa-question-status" class="widefat">

15 <option <?php selected( $meta, 'open' ); ?> value="open"><?php _e( 'Open','dw-question-answer' ) ?></option>

16 <option <?php selected( $meta, 'pending' ); ?> value="pending"><?php _e( 'Pending','dw-question-answer' ) ?></option>

17 <option <?php selected( $meta, 'resolved' ); ?> value="resolved"><?php _e( 'Resolved','dw-question-answer' ) ?></option>

18 <option <?php selected( $meta, 're-open' ); ?> value="re-open"><?php _e( 'Re-Open','dw-question-answer' ) ?></option>

19 <option <?php selected( $meta, 'closed' ); ?> value="closed"><?php _e( 'Closed','dw-question-answer' ) ?></option>

20 </select>

21 </label>

27 $sticky_questions = get_option( 'dwqa_sticky_questions', array() );

28 ?>

29 <input <?php checked( true, in_array( $post->ID, $sticky_questions ), true ); ?> type="checkbox" name="dwqa-question-sticky" id="dwqa-question-sticky" value="1" ><span class="description"><?php _e( 'Pin question to top of archive page.','dw-question-answer' ); ?></span>

30 </label>

31 </p>

Editor.php (https://bitbucket.org/ksekar/campus.git) PHP · 599 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Editor.php 24594 2012-01-05 21:27:01Z matthew $

21 */

22

23 /** Zend_Dojo_Form_Element_Dijit */

24 require_once 'Zend/Dojo/Form/Element/Dijit.php';

25

26 /**

122 $event = (string) $event;

123 $captureEvents = $this->getCaptureEvents();

124 if (false === ($index = array_search($event, $captureEvents))) {

125 return $this;

126 }

ListEntry.php (https://bitbucket.org/kudutest/moodlegit.git) PHP · 208 lines

1 <?php

2

3 /**

25 * @see Zend_Gdata_Entry

26 */

27 require_once 'Zend/Gdata/Entry.php';

28

29 /**

30 * @see Zend_Gdata_Spreadsheets_Extension_Custom

31 */

32 require_once 'Zend/Gdata/Spreadsheets/Extension/Custom.php';

33

34 /**

173 $this->_custom = array_values($this->_custom);

174 // Be sure to delete form both arrays!

175 $key = array_search($element, $this->_customByName);

176 unset($this->_customByName[$key]);

177 } else {

Broker.php (https://bitbucket.org/hmancvs/farmis.git) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Broker.php,v 1.1 2011/11/03 08:29:58 smusoke Exp $

21 */

22

23 /** Zend_Controller_Plugin_Abstract */

24 require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 require_once 'Zend/Controller/Exception.php';

search.php (https://github.com/chalosalvador/GDS.git) PHP · 214 lines

1 <?php

2 /**

3 * @version $Id: search.php 21504 2011-06-10 06:21:35Z infograf768 $

send.php (https://gitlab.com/ptisky/API_prestashop) PHP · 276 lines

1 <?php

2 include_once(dirname(__FILE__).'/../../config/config.inc.php');

3 include_once(dirname(__FILE__).'/../../init.php');

4

5 if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || Tools::strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest'){

23 $settings = Tools::unserialize(Configuration::get('GOMAKOIL_ALL_UPDATE_SETTINGS', '' ,Tools::getValue('shopGroupId'), Tools::getValue('id_shop')));

24 if(in_array($id, $settings)){

25 $key = array_search($id, $settings);

26 unset ($settings[$key]);

27 $settings =serialize($settings);

44 $settings = Tools::unserialize(Configuration::get('GOMAKOIL_ALL_SETTINGS', '' ,Tools::getValue('shopGroupId'), Tools::getValue('id_shop')));

45 if(in_array($id, $settings)){

46 $key = array_search($id, $settings);

47 unset ($settings[$key]);

48 $settings =serialize($settings);

Watcher.php (https://gitlab.com/wuhang2003/core) PHP · 142 lines

1 <?php

2 /**

3 * @author Morris Jobke <hey@morrisjobke.de>

120 */

121 public function needsUpdate($path, $cachedData) {

122 if ($this->watchPolicy === self::CHECK_ALWAYS or ($this->watchPolicy === self::CHECK_ONCE and array_search($path, $this->checkedPaths) === false)) {

123 $this->checkedPaths[] = $path;

124 return $this->storage->hasUpdated($path, $cachedData['storage_mtime']);

qbehaviour.php (https://github.com/markn86/moodle.git) PHP · 139 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

111 $disabledbehaviours = array();

112 }

113 if (($key = array_search($this->name, $disabledbehaviours)) !== false) {

114 unset($disabledbehaviours[$key]);

115 set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');

122 $behaviourorder = array();

123 }

124 if (($key = array_search($this->name, $behaviourorder)) !== false) {

125 unset($behaviourorder[$key]);

126 set_config('behavioursortorder', implode(',', $behaviourorder), 'question');

135 */

136 public static function get_manage_url() {

137 return new moodle_url('/admin/qbehaviours.php');

138 }

139 }

NotEmpty.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 279 lines

1 <?php

2 /**

3 * Zend Framework

23 * @see Zend_Validate_Abstract

24 */

25 // require_once 'Zend/Validate/Abstract.php';

26

27 /**

40 const EMPTY_ARRAY = 32;

41 const NULL = 64;

42 const PHP = 127;

43 const SPACE = 128;

44 const OBJECT = 256;

58 self::EMPTY_ARRAY => 'array',

59 self::NULL => 'null',

60 self::PHP => 'php',

61 self::SPACE => 'space',

62 self::OBJECT => 'object',

Broker.php (https://gitlab.com/grayhamster/open-social-media-monitoring) PHP · 365 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Broker.php 24594 2012-01-05 21:27:01Z matthew $

21 */

22

23 /** Zend_Controller_Plugin_Abstract */

24 require_once 'Zend/Controller/Plugin/Abstract.php';

25

26 /**

51 public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)

52 {

53 if (false !== array_search($plugin, $this->_plugins, true)) {

54 require_once 'Zend/Controller/Exception.php';

result.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 429 lines

1 <?php

2 /**

3 * @package Joomla.Administrator

10 defined('_JEXEC') or die;

11

12 JLoader::register('FinderIndexer', __DIR__ . '/indexer.php');

13

14 /**

353 {

354 // Search for the property in the group.

355 $key = array_search($property, $this->instructions[$group]);

356

357 // If the property was found, remove it.

mf_install.php (https://github.com/leocaseiro/Magic-Fields-2.git) PHP · 212 lines

1 <?php

2 /**

3 * This file content the routines for install/activate uninstall/deactivate Magic Fields

8 global $wpdb;

9

10 require_once(ABSPATH.'wp-admin/includes/upgrade.php');

11

12 // Get collation info

202

203 $current = get_option('active_plugins');

204 $plugin = plugin_basename(MF_PATH.'/main.php');

205 array_splice($current, array_search( $plugin, $current), 1 );

207 update_option('active_plugins', $current);

208

209 wp_redirect('options-general.php');

210 }

211

class.wp-dependencies.php (https://github.com/livinglab/openlab.git) PHP · 452 lines

1 <?php

2 /**

3 * Dependencies API: WP_Dependencies base class

342 foreach ( (array) $handles as $handle ) {

343 $handle = explode( '?', $handle );

344 $key = array_search( $handle[0], $this->queue, true );

345

346 if ( false !== $key ) {

NotEmpty.php (https://gitlab.com/Ltaimao/wecenter) PHP · 279 lines

1 <?php

2 /**

3 * Zend Framework

23 * @see Zend_Validate_Abstract

24 */

25 //require_once 'Zend/Validate/Abstract.php';

26

27 /**

40 const EMPTY_ARRAY = 32;

41 const NULL = 64;

42 const PHP = 127;

43 const SPACE = 128;

44 const OBJECT = 256;

58 self::EMPTY_ARRAY => 'array',

59 self::NULL => 'null',

60 self::PHP => 'php',

61 self::SPACE => 'space',

62 self::OBJECT => 'object',

CategoryNode.php (https://github.com/joomla/joomla-cms.git) PHP · 496 lines

1 <?php

2

3 /**

310 {

311 if (!\is_null($this->_parent)) {

312 $key = array_search($this, $this->_parent->_children);

313 unset($this->_parent->_children[$key]);

314 }

Kohana_Config.php (https://github.com/bouthors/gallery3-contrib.git) PHP · 331 lines

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

2 /**

3 * Provides a driver-based interface for setting and getting

4 * configuration options for the Kohana environment

5 *

6 * $Id: Kohana_Config.php 4679 2009-11-10 01:45:52Z isaiah $

7 *

8 * @package KohanaConfig

9 * @author Kohana Team

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

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

12 */

13 class Kohana_Config_Core implements ArrayAccess {

77 //remove array if it's found in config

78 if (in_array('array', $drivers))

79 unset($drivers[array_search('array', $drivers)]);

80

81 //add array at the very end

translated-object.php (https://gitlab.com/hop23typhu/bryepoxy) PHP · 272 lines

1 <?php

2

3 /**

153 if ( ! empty( $term ) ) {

154 $d = unserialize( $term->description );

155 $slug = array_search( $id, $this->get_translations( $id ) ); // in case some plugin stores the same value with different key

156 unset( $d[ $slug ] );

157

NotEmpty.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 279 lines

1 <?php

2 /**

3 * Zend Framework

23 * @see Zend_Validate_Abstract

24 */

25 require_once 'Zend/Validate/Abstract.php';

26

27 /**

40 const EMPTY_ARRAY = 32;

41 const NULL = 64;

42 const PHP = 127;

43 const SPACE = 128;

44 const OBJECT = 256;

58 self::EMPTY_ARRAY => 'array',

59 self::NULL => 'null',

60 self::PHP => 'php',

61 self::SPACE => 'space',

62 self::OBJECT => 'object',

NotEmpty.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 279 lines

1 <?php

2 /**

3 * Zend Framework

23 * @see Zend_Validate_Abstract

24 */

25 #require_once 'Zend/Validate/Abstract.php';

26

27 /**

40 const EMPTY_ARRAY = 32;

41 const NULL = 64;

42 const PHP = 127;

43 const SPACE = 128;

44 const OBJECT = 256;

58 self::EMPTY_ARRAY => 'array',

59 self::NULL => 'null',

60 self::PHP => 'php',

61 self::SPACE => 'space',

62 self::OBJECT => 'object',

ListEntry.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 208 lines

1 <?php

2

3 /**

25 * @see Zend_Gdata_Entry

26 */

27 #require_once 'Zend/Gdata/Entry.php';

28

29 /**

30 * @see Zend_Gdata_Spreadsheets_Extension_Custom

31 */

32 #require_once 'Zend/Gdata/Spreadsheets/Extension/Custom.php';

33

34 /**

173 $this->_custom = array_values($this->_custom);

174 // Be sure to delete form both arrays!

175 $key = array_search($element, $this->_customByName);

176 unset($this->_customByName[$key]);

177 } else {

Layout.php (https://bitbucket.org/dnejedly/eaparts.git) PHP · 126 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_Page

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

110 $currentHandle = array_pop($appliedHandles);

111

112 $layoutCode = array_search($currentHandle, $pageLayoutHandles, true);

113

114 return $this->_getConfig()->getPageLayout($layoutCode);

EntityReferenceSelectionReferenceableTest.php (https://gitlab.com/reasonat/test8) PHP · 200 lines

1 <?php

2

3 namespace Drupal\Tests\system\Kernel\Entity;

120 // @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::getReferenceableEntities()

121 $item = is_string($item) ? Html::escape($item) : $item;

122 $this->assertTrue(array_search($item, $referenceables[$this->bundle]) !== FALSE);

123 }

124

Container.php (https://github.com/nuxwin/i-PMS.git) PHP · 373 lines

1 <?php

2 /**

3 * i-PMS - internet Project Management System

69 $this->addWidgets($widgets);

70 } elseif (null !== $widgets) {

71 require_once 'iPMS/Widgets/Exception.php';

72 throw new iPMS_Widgets_Exception(

73 'Invalid argument: $Widgets must be an array, an instance of Zend_Config, or null'

129 {

130 if (is_array($widget) || $widget instanceof Zend_Config) {

131 require_once 'iPMS/Widget.php';

132 $widget = iPMS_Widget::factory($widget);

133 } elseif (!$widget instanceof iPMS_Widget) {

134 require_once 'iPMS/Widgets/Exception.php';

135 throw new iPMS_Widgets_Exception(

136 'Invalid argument: $widget must be an instance of iPMS_Widget or Zend_Config, or an array'

Base.php (https://github.com/ewandor/horde.git) PHP · 315 lines

1 <?php

2 /**

3 * Base file class.

165 {

166 $this->_ensureInitialized();

167 $key = array_search($rev, $this->_revs);

168 return (($key !== false) && isset($this->_revs[$key + 1]))

169 ? $this->_revs[$key + 1]

HashTable.php (https://gitlab.com/devtoannh/cafe) PHP · 202 lines

3 * PHPExcel

4 *

5 * Copyright (c) 2006 - 2012 PHPExcel

6 *

7 * This library is free software; you can redistribute it and/or

22 * @package PHPExcel

23 * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL

25 * @version 1.7.8, 2012-10-12

33 * @package PHPExcel

34 * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

35 */

36 class PHPExcel_HashTable

67 * Add HashTable items from source

68 *

69 * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from

70 * @throws Exception

71 */

interactiveMapDrawExtension.js (https://github.com/Sleepcap/vDiplomacy.git) JavaScript · 99 lines

26 // Add 2nd destroyed-icon for the underworld gateways:

27 //if (in_array($this->territoryNames[$terrID].' (Underworld)' ,$this->territoryNames))

28 //parent::drawDestroyedUnit(array_search($this->territoryNames[$terrID].' (Underworld)',$this->territoryNames));

29 if(Territories.any(function(terr){return terr[1].name === Territories.get(fromTerrID).name+' (2)';}))

30 drawFunction(Territories.find(function(terr){return terr[1].name === Territories.get(fromTerrID).name+' (2)';})[1].id);

49 }

50

51 //documentation in drawMap.php

52 function adjustArrows(fromID, toID, terrID){

53 terrID = (typeof terrID == 'undefined')?0:terrID;

Collect.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 313 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

273 $moduleChanges[] = $this->getNewModuleChanges($moduleName, $active, $module['setup_version'], $state);

274 } else {

275 $dbModule = $dbModuleArray[array_search($moduleName, $nameValues)];

276 $changeTest = $dbModule->getData();

277 $changes = array_diff($module, $changeTest);

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

1 <?php

2

3 /**

104 {

105 $foo = array($key => NULL);

106 return array_search(key($foo), array_keys($arr), TRUE);

107 }

108

translate_show_php.php (https://gitlab.com/Rad1calDreamer/honey) PHP · 116 lines

30

31 $APPLICATION->SetTitle(GetMessage("TRANS_TITLE"));

32 require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");

33

34 if($strError == "")

59 if ($i==1)

60 {

61 $chain .= "<a href=\"translate_list.php?lang=".LANGUAGE_ID."&path=/"."&".bitrix_sessid_get()."\" title=\"".GetMessage("TRANS_CHAIN_FOLDER_ROOT")."\">..</a> / ";

62 }

63 else

95 $aMenu[] = Array(

96 "TEXT" => GetMessage("TR_FILE_EDIT"),

97 "LINK" => "/bitrix/admin/translate_edit_php.php?lang=".LANGUAGE_ID."&file=$file&".bitrix_sessid_get(),

98 "TITLE" => GetMessage("TR_FILE_EDIT_TITLE"),

99 "ICON" => ""

NotaRecuperacaoTest.php (https://github.com/gtinfo/ieducar.git) PHP · 250 lines

1 <?php

2

3 /**

30 */

31

32 require_once 'Avaliacao/_tests/Service/TestCommon.php';

33

34 /**

159

160 foreach ($notasSalvas as $notaSalva) {

161 $key = array_search($notaSalva->etapa, $etapas, FALSE);

162 $this->assertTrue($key !== FALSE);

163 unset($etapas[$key]);

243

244 foreach ($notasSalvas as $notaSalva) {

245 $key = array_search($notaSalva->etapa, $etapas, FALSE);

246 $this->assertTrue($key !== FALSE);

247 unset($etapas[$key]);

BCGcode39extended.barcode.php (https://github.com/wildanm/Jibas.git) PHP · 208 lines

1 <?php

2 /**

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

7 *--------------------------------------------------------------------

8 * Copyright (C) Jean-Sebastien Goupil

9 * http://www.barcodephp.com

10 */

11 include_once('BCGParseException.php');

12 include_once('BCGcode39.barcode.php');

13

14 class BCGcode39extended extends BCGcode39 {

46 $c = strlen($this->text);

47 for ($i = 0; $i < $c; $i++) {

48 $pos = array_search($this->text[$i], $this->keys);

49 if ($pos === false) {

50 // Search in extended?

TypeLoader.php (https://github.com/MarcelloDuarte/zf2.git) PHP · 197 lines

1 <?php

2 /**

3 * Zend Framework

30 * Loads a local class and executes the instantiation of that class.

31 *

32 * @todo PHP 5.3 can drastically change this class w/ namespace and the new call_user_func w/ namespace

33 * @uses Zend\Amf\Exception

34 * @uses Zend\Amf\Value\Messaging\AcknowledgeMessage

105 public static function getMappedClassName($className)

106 {

107 $mappedName = array_search($className, self::$classMap);

108

109 if ($mappedName) {

111 }

112

113 $mappedName = array_search($className, array_flip(self::$classMap));

114

115 if ($mappedName) {

VerifierManager.php (https://github.com/JeCat/framework.git) PHP · 139 lines

1 <?php

2 ////////////////////////////////////////////////////////////////////////////////////////////////////////////

3 // 这个文件是 JeCat PHP框架的一部分,该项目和此文件 均遵循 GNU 自由软件协议

6 //

7 //

8 // JeCat PHP框架 的正式全名是:Jellicle Cat PHP Framework。

9 // “Jellicle Cat”出自 Andrew Lloyd Webber的音乐剧《猫》(《Prologue:Jellicle Songs for Jellicle Cats》)。

10 // JeCat 是一个开源项目,它像音乐剧中的猫一样自由,你可以毫无顾忌地使用JCAT PHP框架。JCAT 由中国团队开发维护。

45 $this->arrVerifiers[] = $aVerifier ;

46

47 $nIdx = array_search($aVerifier, $this->arrVerifiers) ;

48 $this->arrVerifierOthers[$nIdx] = array(

49 $sExceptionWords, $callback, $arrCallbackArgvs

65 public function remove(IVerifier $aVerifier)

66 {

67 $nIdx = array_search($aVerifier, $this->arrVerifiers) ;

68 if( $nIdx===false )

69 {

Insert.php (https://github.com/kiranatama/sagalaya.git) PHP · 273 lines

1 <?php

2 /**

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

235 public function __unset($name)

236 {

237 if (($position = array_search($name, $this->columns)) === false) {

238 throw new \InvalidArgumentException('The key ' . $name . ' was not found in this objects column list');

239 }

266 public function __get($name)

267 {

268 if (($position = array_search($name, $this->columns)) === false) {

269 throw new \InvalidArgumentException('The key ' . $name . ' was not found in this objects column list');

270 }

DeliveryMethodsValidator.php (https://gitlab.com/mallgroup/mpapi-client) PHP · 274 lines

1 <?php

2 namespace Marketplace\Validators;

3

103 $methodCurrentPosition = implode('/', [

104 self::DELIVERY_METHODS,

105 array_search($delivery_method, $validationData[self::DELIVERY_METHODS])

106 ]);

107 $this->validateStructure($delivery_method, $this->sourceStructure, $methodCurrentPosition);

195 $setupCurrentPosition = implode('/', [

196 self::DELIVERY_SETUPS,

197 array_search($delivery_setup, $validationData[self::DELIVERY_SETUPS])

198 ]);

199 $this->validateStructure(

217 $setupCurrentPosition,

218 'pricing',

219 array_search($pricing, $delivery_setup['pricing'])

220 ]);

221 $this->validateStructure($pricing, $this->pricingSourceStructure, $pricingCurrentPosition);

Collection.php (https://github.com/grandison/budo16.git) PHP · 309 lines

1 <?php

2 /**

3 * SocialEngine

7 * @copyright Copyright 2006-2010 Webligo Developments

8 * @license http://www.socialengine.net/license/

9 * @version $Id: Collection.php 7244 2010-09-01 01:49:53Z john $

10 * @author Sami

11 */

276 foreach( $table->fetchAll($select) as $collectible )

277 {

278 $order = array_search($collectible->getIdentity(), $ids);

279 if( !$order )

280 {

299 foreach( $collectibles as $collectible )

300 {

301 $index = array_search($collectible->getIdentity(), $ids);

302 $collectible->order = $orderIndex[$index];

303 $collectible->save();

Kernel.php (https://gitlab.com/zan_zan/laravel_sample) PHP · 294 lines

1 <?php

2

3 namespace Illuminate\Foundation\Http;

191 public function prependMiddleware($middleware)

192 {

193 if (array_search($middleware, $this->middleware) === false) {

194 array_unshift($this->middleware, $middleware);

195 }

206 public function pushMiddleware($middleware)

207 {

208 if (array_search($middleware, $this->middleware) === false) {

209 $this->middleware[] = $middleware;

210 }

Collection.php (https://gitlab.com/asun89/socianovation-web) PHP · 549 lines

1 <?php

2 namespace Grav\Common\Page;

3

252 public function currentPosition($path)

253 {

254 return array_search($path, array_keys($this->items));

255 }

256

259 * an arbitrary datetime page field where end date is optional

260 * Dates can be passed in as text that strtotime() can process

261 * http://php.net/manual/en/function.strtotime.php

262 *

263 * @param $startDate

Legend.php (https://gitlab.com/techniconline/kmc) PHP · 178 lines

1 <?php

2 /**

3 * PHPExcel

4 *

5 * Copyright (c) 2006 - 2014 PHPExcel

22 * @package PHPExcel_Chart

23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL

25 * @version ##VERSION##, ##DATE##

28

29 /**

30 * PHPExcel_Chart_Legend

31 *

32 * @category PHPExcel

33 * @package PHPExcel_Chart

34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

35 */

36 class PHPExcel_Chart_Legend

class-Shoestrap_Color.php (https://gitlab.com/aristath/shoestrap-3) PHP · 481 lines

1 <?php

2

3

283

284 if ( $context == 'key' ) {

285 return array_search( $brightest, $colors );

286 } elseif ( $context == 'value' ) {

287 return $brightest;

314

315 if ( $context == 'key' ) {

316 return array_search( $most_saturated, $colors );

317 } elseif ( $context == 'value' ) {

318 return $most_saturated;

345

346 if ( $context == 'key' ) {

347 return array_search( $most_intense, $colors );

348 } elseif ( $context == 'value' ) {

349 return $most_intense;

functions.inc.php (https://github.com/martijnvermaat/quick-hacks.git) PHP · 160 lines

1 <?php

2 // UTF-8 functions

3 require_once(dirname(__FILE__) .'/includes/utf8.php');

4

5 // Translation

6 require_once(dirname(__FILE__) .'/includes/php-gettext/gettext.inc');

7 $domain = 'messages';

8 T_setlocale(LC_MESSAGES, $locale);

61 }

62

63 function multi_array_search($needle, $haystack) {

64 if (is_array($haystack)) {

65 foreach(array_keys($haystack) as $key) {

66 $value =& $haystack[$key];

67 $result = multi_array_search($needle, $value);

68 if (is_array($result)) {

69 $return = $result;

OfertaActividad.php (https://gitlab.com/bluedrayco/Portafolio) PHP · 568 lines

1 <?php

2

3 namespace ControlEscolar\CalendarioBundle\Entity;

503 //Evakya su existe el elemento en el array de control de acceso de

504 //acuerdo al tipo dado, lo elimina si existe

505 if (false !== $key = array_search(strtoupper($acceso), $this->control_acceso[$tipo], true)) {

506 $controlAuxiliar = $this->control_acceso[$tipo];

507 unset($controlAuxiliar[$key]);

acl_generate.php (https://github.com/makies/croogo.git) PHP · 120 lines

1 <?php

2 /**

3 * AclGenerate Component

4 *

5 * PHP version 5

6 *

7 * @category Component

9 * @version 1.0

10 * @author Fahad Ibnay Heylaal <contact@fahad19.com>

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

12 * @link http://www.croogo.org

13 */

36 $controllers = $this->folder->read();

37 foreach ($controllers['1'] AS $c) {

38 if (substr($c, strlen($c) - 4, 4) == '.php') {

39 $cName = Inflector::camelize(str_replace('_controller.php', '', $c));

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

1 <?php

2 /**

3 * Zend Framework

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

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

19 * @version $Id: NotEmpty.php 23775 2011-03-01 17:25:24Z ralph $

20 */

21

23 * @see Zend_Validate_Abstract

24 */

25 // // // // // // // // // // require_once 'Zend/Validate/Abstract.php';

26

27 /**

58 self::EMPTY_ARRAY => 'array',

59 self::NULL => 'null',

60 self::PHP => 'php',

61 self::SPACE => 'space',

62 self::OBJECT => 'object',

Ldap.php (https://github.com/testruby/Tine-2.0-Open-Source-Groupware-and-CRM.git) PHP · 204 lines

1 <?php

2 /**

3 * Tine 2.0

100 }

101

102 $keyMapping = array_search($key, $this->_propertyMapping);

103

104 if ($keyMapping !== FALSE) {

Array.php (https://github.com/ksecor/civicrm.git) PHP · 347 lines

1 <?php

2 /*

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

98 static function key( $value, &$list ) {

99 if ( is_array( $list ) ) {

100 $key = array_search( $value, $list );

101

102 // array_search returns key if found, false otherwise

231 /**

232 * Array splice function that preserves associative keys

233 * defauly php array_splice function doesnot preserve keys

234 * So specify start and end of the array that you want to remove

235 *

GitBitbucketDriver.php (https://github.com/ecoleman/composer.git) PHP · 162 lines

1 <?php

2

3 /*

66 public function getSource($identifier)

67 {

68 $label = array_search($identifier, $this->getTags()) ?: $identifier;

69

70 return array('type' => 'git', 'url' => $this->getUrl(), 'reference' => $label);

76 public function getDist($identifier)

77 {

78 $label = array_search($identifier, $this->getTags()) ?: $identifier;

79 $url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$label.'.zip';

80

152 if (!extension_loaded('openssl')) {

153 if ($io->isVerbose()) {

154 $io->write('Skipping Bitbucket git driver for '.$url.' because the OpenSSL PHP extension is missing.');

155 }

156

Container.php (https://gitlab.com/SFMSP/Hagape) PHP · 314 lines

1 <?php

2

3 namespace Application\Container;

73

74

75 if (array_search('agencia', $dadosUser['filtros']) !== false) {

76 $agencias = $sm->get('Admin\Repository\AgenciaRepository')->findInArrayLabel($dadosUser['agencias']);

77 $agencias[''] = 'Selecione uma Agência';

81 }

82

83 if (array_search('cemiterio', $dadosUser['filtros']) !== false) {

84 $cemiterios = $sm->get('Admin\Repository\CemiterioRepository')->findInArrayLabel($dadosUser['cemiterios']);

85 $cemiterios[''] = 'Selecione um Cemitério';

89 }

90

91 if (array_search('estoque', $dadosUser['filtros']) !== false) {

92 $estoques = $sm->get('Admin\Repository\EstoqueRepository')->findInArrayLabel($dadosUser['estoques']);

93 $estoques[''] = 'Selecione um Estoque';

class-yoast-plugin-conflict.php (https://gitlab.com/gabdark/aceit) 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

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

314 private function remove_deactivated_plugin() {

315 $deactivated_plugin = filter_input( INPUT_GET, 'plugin' );

316 $key_to_remove = array_search( $deactivated_plugin, $this->all_active_plugins );

317

318 if ( $key_to_remove !== false ) {

tree.class.php (https://github.com/massiveart-webservices/ZOOLU.git) PHP · 299 lines

1 <?php

2 /**

3 * ZOOLU - Content Management System

28 * @copyright Copyright (c) 2008-2012 HID GmbH (http://www.hid.ag)

29 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, Version 3

30 * @version $Id: version.php

31 */

32 /**

43 */

44

45 require_once(dirname(__FILE__) . '/item.class.php');

46

47 class NavigationTree extends NavigationItem implements Iterator, Countable

155 if ($intOrder === null) {

156 if (($intOrder = $this->{$strKey}->getOrder()) === null) {

157 while (array_search($intIndex, $this->arrOrder, true)) {

158 $intIndex++;

159 }

AdminObjectAclData.php (https://gitlab.com/cuza/Clinic_Recods) PHP · 319 lines

1 <?php

2

3 /*

279 if (!$this->isOwner()) {

280 foreach (self::$ownerPermissions as $permission) {

281 $key = array_search($permission, $permissions);

282 if ($key !== false) {

283 unset($permissions[$key]);

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

1 <?php

2 /**

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

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

15 * Copyright (C) Jean-Sebastien Goupil

16 * http://www.barcodephp.com

17 */

18 include_once('BCGBarcode1D.php');

146 // Checking if all chars are allowed

147 for ($i = 0; $i < $c; $i++) {

148 if (array_search($this->text[$i], $this->keys) === false) {

149 throw new BCGParseException('ean8', 'The character \'' . $this->text[$i] . '\' is not allowed.');

150 }

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

1 <?php

2 class YPFHasManyRelation extends YPFModelBaseRelation implements IYPFModelQuery, Iterator {

3

64 public function has($instance) {

65 if (is_array($this->iterationQuery))

66 return array_search ($instance, $this->iterationQuery);

67 else

68 return ($this->tiedModelQuery->where($instance->getSqlIdConditions($this->tiedModelQuery->getTableAlias()))->count() > 0);

NotEmpty.php (https://github.com/Exercise/zf2.git) PHP · 281 lines

1 <?php

2 /**

3 * Zend Framework

42 const EMPTY_ARRAY = 32;

43 const NULL = 64;

44 const PHP = 127;

45 const SPACE = 128;

46 const OBJECT = 256;

60 self::EMPTY_ARRAY => 'array',

61 self::NULL => 'null',

62 self::PHP => 'php',

63 self::SPACE => 'space',

64 self::OBJECT => 'object',

132 $detected += $value;

133 } else if (in_array($value, $this->_constants)) {

134 $detected += array_search($value, $this->_constants);

135 }

136 }

TaskStatus.php (https://github.com/timstephenson/NatureBridge.git) PHP · 191 lines

1 <?php

2

3 /*

40

41

42 require_once 'CRM/Project/DAO/TaskStatus.php';

43

44 class CRM_Project_BAO_TaskStatus {

56 if ( ! $taskStatusID ) {

57 // cache the status

58 require_once 'CRM/Core/OptionGroup.php';

59 $status =& CRM_Core_OptionGroup::values( 'task_status', true );

60

61 // get the task status object, if not there create one

62 require_once 'CRM/Project/DAO/TaskStatus.php';

63 $dao = new CRM_Project_DAO_TaskStatus( );

64 $dao->responsible_entity_table = $ret;

Server.php (https://github.com/GulDmitry/php-websocket-server.git) PHP · 254 lines

1 <?php

2

3 namespace WebSocket;

119 public function log($message, $type = 'info')

120 {

121 echo date('Y-m-d H:i:s') . ' [' . ($type ? $type : 'error') . '] ' . $message . PHP_EOL;

122 }

123

143 public function broadcast($excludeConnection, $message)

144 {

145 $clientKey = array_search($excludeConnection, $this->_clients);

146

147 foreach ($this->_clients as $k => $v) {

162 public function socketDisconnect($connect)

163 {

164 $socketKey = array_search($connect, $this->_clients);

165

166 $sKey = array_search($socketKey, $this->_allsockets);

AbstractHelper.php (https://bitbucket.org/dominicwatson/dlutwbootstrap-active.git) PHP · 320 lines

1 <?php

2 namespace DluTwBootstrap\View\Helper\Navigation;

3

258 if($activeIconInverse && $item->isActive(true)) {

259 $classes = explode(' ', $iClass);

260 $iconWhiteClassKey = array_search('icon-white', $classes);

261 if($iconWhiteClassKey === false) {

262 //icon-white class not found