100+ results for 'php preg_split'

Not the results you expected?

smarty_internal_config_file_compiler.php (https://gitlab.com/Shenglian/SmartyProject) PHP · 199 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Config File Compiler

146 // template header code

147 $template_header =

148 "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") .

149 "\n";

150 $template_header .= " compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";

151

152 $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .

153 var_export($this->config_data, true) . '); ?>';

154 return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code);

174 // $line--;

175 }

176 $match = preg_split("/\n/", $this->lex->data);

177 $error_text =

178 "Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' ";

table.php (https://bitbucket.org/flth/xtcm.git) PHP · 119 lines

1 <?php

2 /* -----------------------------------------------------------------------------------------

3 $Id: table.php 1002 2005-07-10 16:11:37Z mz $

10 based on:

11 (c) 2000-2001 The Exchange Project (earlier name of osCommerce)

12 (c) 2002-2003 osCommerce(table.php,v 1.27 2003/02/05); www.oscommerce.com

13 (c) 2003 nextcommerce (table.php,v 1.8 2003/08/24); www.nextcommerce.org

62 }

63

64 $table_cost = preg_split("/[:,]/" , MODULE_SHIPPING_TABLE_COST); // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3

65 $size = sizeof($table_cost);

66 for ($i=0, $n=$size; $i<$n; $i+=2) {

patch.class.php (https://github.com/saePixel/jcore.git) PHP · 242 lines

1 <?php

2 ## PhpPatcher class

9 # files will be created, updated and/or deleted

10

11 define('_PHPP_INVALID_INPUT', 'Invalid input');

12 define('_PHPP_UNEXPECTED_EOF', 'Unexpected end of file');

13 define('_PHPP_UNEXPECTED_ADD_LINE', 'Unexpected add line at line %d');

14 define('_PHPP_UNEXPECTED_REMOVE_LINE', 'Unexpected remove line at line %d');

15 define('_PHPP_INVALID_DIFF', 'Invalid unified diff block');

16 define('_PHPP_FAILED_VERIFY', 'Failed source verification of file %s at line %d');

49 // separate CR or CRLF lines

50 function &_linesplit(&$data) {

51 $lines = preg_split('/(\r\n)|(\r)|(\n)/', $data);

52 return $lines;

53 }

autocomplete.php (https://github.com/jpatokal/openflights.git) PHP · 199 lines

1 <?php

2 include 'helper.php';

3 include 'db_pdo.php';

4

5 // Trim anything after a hyphen, period or left paren

6 function trim_query($query) {

7 $chunks = preg_split("/[-.(]/", $query);

8 return trim($chunks[0]);

9 }

links_options.php (https://bitbucket.org/wiseintegration/wisetracker-wp.git) PHP · 184 lines

1 <?php

2 /**

3 * @package Adminimize

13 <div id="poststuff" class="ui-sortable meta-box-sortables">

14 <div class="postbox">

15 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>

16 <h3 class="hndle" id="links_options"><?php esc_attr_e( 'Links options', 'adminimize' ); ?></h3>

21 <table summary="config_edit_links" class="widefat">

22 <colgroup>

23 <?php

24 $col = 0;

25 foreach ( $user_roles_names as $role_name ) {

31 <thead>

32 <tr>

33 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>

34 <?php

Query.php (https://github.com/tmccormi/openemr.git) PHP · 195 lines

1 <?php

2 /**

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

51 }

52

53 if ($xpathPhpfunctions = $document->getXpathPhpFunctions()) {

54 $xpath->registerNamespace('php', 'http://php.net/xpath');

55 if ($xpathPhpfunctions === true) {

56 $xpath->registerPhpFunctions();

57 } else {

58 $xpath->registerPhpFunctions($xpathPhpfunctions);

59 }

60 }

block_frame_decorator.cls.php (https://bitbucket.org/netglue/dompdf.git) PHP · 235 lines

1 <?php

2 /**

3 * @package dompdf

156

157 if ( $frame->is_text_node() ) {

158 $current_line->wc += count(preg_split("/\s+/", trim($frame->get_text())));

159 }

160

ezfunctionhandler.php (https://bitbucket.org/crevillo/enetcall.git) PHP · 150 lines

1 <?php

2 /**

3 * File containing the eZFunctionHandler class.

10

11 /*!

12 \class eZFunctionHandler ezfunctionhandler.php

13 \brief The class eZFunctionHandler does

14

68 {

69 $constantParameterArray = $aliasSettings->variable( $aliasFunctionName, 'Constant' );

70 // prevent PHP warning in the loop below

71 if ( !is_array( $constantParameterArray ) )

72 $constantParameterArray = array();

89 I use \x5c instead of \\ here.

90 */

91 $constantParameter = preg_split( '/((?<=\x5c\x5c)|(?<!\x5c{1}));/',

92 $constantParameterArray[$constKey] );

93

Router.php (https://github.com/FranckErnewein/citron.git) PHP · 202 lines

1 <?php

2 /**

3 * Router Class

16 * Two main ways to use:

17 * 1. Manually Prepare and Set Routes. Best used when we have our routes in array, or from file.

18 * <?php

19 * $router = new Frapi_Router();

20 * $router->setPreparedRoutes(Frapi_Router::prepareRoutes($routes));

23 *

24 * 2. Let Frapi_Router load and prepare routes

25 * <?php

26 * $router = new Frapi_Router();

27 * $router->loadAndPrepareRoutes(); //Load prepared routes from APC, else load from DB and prepare.

117 {

118 $route = trim($route, ' /');

119 $exploded = preg_split('@[/]+@', $route);

120

121 return $exploded;

ImportLdi.class.php (https://bitbucket.org/subhan_12/mwi-panel.git) PHP · 187 lines

1 <?php

2 /* vim: set expandtab sw=4 ts=4 sts=4: */

3 /**

4 * CSV import plugin for phpMyAdmin using LOAD DATA

5 *

6 * @package PhpMyAdmin-Import

7 * @subpackage LDI

8 */

9 if (! defined('PHPMYADMIN')) {

10 exit;

11 }

12

13 /* Get the import interface */

14 require_once 'libraries/plugins/ImportPlugin.class.php';

15

16 // We need relations enabled and we work only on database

Driver.php (https://github.com/alexandresalome/PHP-Selenium.git) PHP · 231 lines

1 <?php

2 /*

3 * This file is part of PHP Selenium Library.

123 $string = $this->getString($command, $target, $value);

124

125 $results = preg_split('/(?<!\\\),/', $string);

126 foreach ($results as &$result) {

127 $result = str_replace('\,', ',', $result);

InterchangeBuilder.php (https://github.com/pez252/gallery3-contrib.git) PHP · 180 lines

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

2

3 class HTMLPurifier_ConfigSchema_InterchangeBuilder

113 if (isset($hash['ALIASES'])) {

114 $raw_aliases = trim($hash->offsetGet('ALIASES'));

115 $aliases = preg_split('/\s*,\s*/', $raw_aliases);

116 foreach ($aliases as $alias) {

117 $directive->aliases[] = $this->id($alias);

132

133 if (isset($hash['EXTERNAL'])) {

134 $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));

135 }

136

139

140 /**

141 * Evaluates an array PHP code string without array() wrapper

142 */

143 protected function evalArray($contents) {

Provider.php (https://github.com/cdfre/TypoGento.git) PHP · 206 lines

1 <?php

2

3 class Typogento_Replication_Model_Typo3_Frontend_User_Provider extends Typogento_Replication_Model_Provider_Abstract {

168 $country = Mage::getModel('directory/country');

169 $country->loadByCode($source->getData('static_info_country'));

170 $street = preg_split('/\n|\r|\r\n/', $source->getData('address'), 2, PREG_SPLIT_NO_EMPTY);

171 if (isset($street[1])) {

172 $street[1] = preg_replace('/\n|\r|\r\n/', '', $street[1]);

InterchangeBuilder.php (https://github.com/Dhaanu/Garden.git) PHP · 176 lines

1 <?php

2

3 class HTMLPurifier_ConfigSchema_InterchangeBuilder

109 if (isset($hash['ALIASES'])) {

110 $raw_aliases = trim($hash->offsetGet('ALIASES'));

111 $aliases = preg_split('/\s*,\s*/', $raw_aliases);

112 foreach ($aliases as $alias) {

113 $directive->aliases[] = $this->id($alias);

128

129 if (isset($hash['EXTERNAL'])) {

130 $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));

131 }

132

135

136 /**

137 * Evaluates an array PHP code string without array() wrapper

138 */

139 protected function evalArray($contents) {

ImageValidator.php (https://github.com/auaskwho/yii2.git) PHP · 197 lines

1 <?php

2 /**

3 * Image validator class file.

136 }

137 if (!is_array($this->mimeTypes)) {

138 $this->mimeTypes = preg_split('/[\s,]+/', strtolower($this->mimeTypes), -1, PREG_SPLIT_NO_EMPTY);

139 }

140 }

Exception.php (https://github.com/drslump/DrTal.git) PHP · 177 lines

1 <?php

2

3 namespace DrSlump\Tal\Parser\Xml;

74

75 // Convert the template to an array of lines

76 $lines = preg_split( '/\r\n|\n|\r/', $this->tplString );

77 $numLinesToShow = 5;

78

169 echo "<h3>" . $levels[$error->level] . " #{$error->code} at line {$error->line} column {$error->column}</h3>";

170 echo "<pre>";

171 echo htmlentities( rtrim($lines[$error->line-1]) . PHP_EOL );

172 echo str_repeat( '-', $error->column ) . '^';

173 echo "</pre>";

class-wp-customize-setting.php (https://gitlab.com/Gashler/dp) PHP · 439 lines

1 <?php

2 /**

3 * Customize Setting Class.

45

46 // Parse the ID for array keys.

47 $this->id_data[ 'keys' ] = preg_split( '/\[/', str_replace( ']', '', $this->id ) );

48 $this->id_data[ 'base' ] = array_shift( $this->id_data[ 'keys' ] );

49

Differ.php (https://gitlab.com/techniconline/kmc) PHP · 257 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

19 *

20 * @package Diff

21 * @author Sebastian Bergmann <sebastian@phpunit.de>

22 * @author Kore Nordmann <mail@kore-nordmann.de>

23 * @copyright Sebastian Bergmann <sebastian@phpunit.de>

136

137 if (is_string($from)) {

138 $from = preg_split('(\r\n|\r|\n)', $from);

139 }

140

class.pdf2txt.inc.php (https://bitbucket.org/xongie/rexsearch.git) PHP · 297 lines

91 $openBracketCount = 0;

92 $encodedStream = false;

93 foreach(preg_split('~(<<\s*/.*?>>\s*stream\s*)|(\s*endstream\s*)|(\()|(\))~ism', $this->data, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $k => $part)

94 {

95 if(preg_match('~<<\s*/(.*?)>>\s*stream\s*~ism', $part, $match))

158 $textObject = '';

159 $openBracketCount = 0;

160 foreach(preg_split('~(\s*BT\s+)|(\s+ET\s+)|(\()|(\))~ism', $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $k => $part)

161 {

162 $switch = trim($part);

207 $openBracketCount = 0;

208

209 foreach(preg_split('~(?:\s+(Td|TD|T\*|"|\')\s+)|(\()|(\))~ism', $textObject, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $k => $part)

210 {

211 switch($part)

diff.php (https://github.com/DArtagan/worldwidewilly.git) PHP · 243 lines

1 <?php

2 ## PhpPatcher class

9 # files will be created, updated and/or deleted

10

11 define('_PHPP_INVALID_INPUT', 'Invalid input');

12 define('_PHPP_UNEXPECTED_EOF', 'Unexpected end of file');

13 define('_PHPP_UNEXPECTED_ADD_LINE', 'Unexpected add line at line %d');

14 define('_PHPP_UNEXPECTED_REMOVE_LINE', 'Unexpected remove line at line %d');

15 define('_PHPP_INVALID_DIFF', 'Invalid unified diff block');

16 define('_PHPP_FAILED_VERIFY', 'Failed source verification of file %s at line %d');

17

18 class PhpPatcher {

19

20 var $root;

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

1 <?php

2 /**

3 * File containing the eZSOAPServer class.

10

11 /*!

12 \class eZSOAPServer ezsoapserver.php

13 \ingroup eZSOAP

14 \brief The class eZSOAPServer handles SOAP server requensts

152 }

153

154 list( $objectName, $objectFunctionName ) = preg_split('/::/', $functionName, 2, PREG_SPLIT_NO_EMPTY);

155 if ( !$objectFunctionName and in_array( $functionName, $this->FunctionList ) &&

156 function_exists( $functionName ) )

simplecrypt.php (https://github.com/katalystsol/joomla-platform.git) PHP · 289 lines

1 <?php

2 /**

3 * @package Joomla.Platform

270 protected function _xorCharString($s)

271 {

272 $ac = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY);

273 (string) $s1 = $this->_key;

274 (int) $i = strlen($s1);

Option.php (https://github.com/top-think/framework.git) PHP · 221 lines

1 <?php

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

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

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

5 // | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved.

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

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

84 $shortcut = implode('|', $shortcut);

85 }

86 $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-'));

87 $shortcuts = array_filter($shortcuts);

88 $shortcut = implode('|', $shortcuts);

Selectors.php (https://github.com/abuiles/bricker.git) PHP · 245 lines

1 <?php

2 /**

3 * CSS Compressor [VERSION]

190 */

191 private function strictid( $selector ) {

192 $parts = preg_split( $this->rcomma, $selector );

193 foreach ( $parts as &$s ) {

194 if ( preg_match( $this->rid, $s ) ) {

195 $p = preg_split( $this->rid, $s );

196 $s = '#' . array_pop( $p );

197 }

207 */

208 private function repeats( $selector ) {

209 $parts = preg_split( $this->rcomma, $selector );

210 $parts = array_flip( $parts );

211 $parts = array_flip( $parts );

Loader.php (https://github.com/0x20h/zf2.git) PHP · 202 lines

1 <?php

2 /**

3 * Zend Framework

33 {

34 /**

35 * Loads a PHP file. This is a wrapper for PHP's include() function.

36 *

37 * $filename must be the complete filename, including any

38 * extension such as ".php". Note that a security check is performed that

39 * does not permit extended characters in the filename. This method is

40 * intended for loading Zend Framework files.

92 /**

93 * Returns TRUE if the $filename is readable, or FALSE otherwise.

94 * This function uses the PHP include_path, where PHP's is_readable()

95 * does not.

96 *

Lexer.php (https://github.com/opulencephp/Opulence.git) PHP · 181 lines

1 <?php

2

3 /*

4 * Opulence

5 *

6 * @link https://www.opulencephp.com

7 * @copyright Copyright (C) 2017 David Young

8 * @license https://github.com/opulencephp/Opulence/blob/master/LICENSE.md

30 $inOpenTag = false;

31 $inCloseTag = false;

32 $charArray = preg_split('//u', $text, -1, PREG_SPLIT_NO_EMPTY);

33 $textLength = count($charArray);

34

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

1 <?php

2 /**

3 * DDAutoFilterSearchBehavior class file

347 break;

348 case 'BETWEEN':

349 list($valueStart, $valueEnd) = preg_split('/[\s]+AND|OR[\s]+/', $filter['value'], -1, PREG_SPLIT_NO_EMPTY);

350 $criteria->addBetweenCondition($attribute, $valueStart, $valueEnd, $join);

351 break;

DumperTest.php (https://bitbucket.org/AdriVanHoudt/school.git) PHP · 181 lines

1 <?php

2

3 /*

16 use Symfony\Component\Yaml\Dumper;

17

18 class DumperTest extends \PHPUnit_Framework_TestCase

19 {

20 protected $parser;

43

44 // split YAMLs documents

45 foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) {

46 if (!$yaml) {

47 continue;

54 // TODO

55 } else {

56 $expected = eval('return '.trim($test['php']).';');

57

58 $this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']);

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

1 <?php

2

3 namespace Concrete\Controller\SinglePage\Dashboard\System\Conversations;

95 Conversation::setDefaultSubscribedUsers($users);

96 if ($this->post('fileExtensions')) {

97 $types = preg_split('{,}', $this->post('fileExtensions'), null, PREG_SPLIT_NO_EMPTY);

98 $types = $helper_file->serializeUploadFileExtensions($types);

99 $config->save('conversations.files.allowed_types', $types);

Config.php (https://github.com/speedupmate/Magento-CE-Mirror.git) PHP · 151 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_Widget

23 * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)

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

25 */

26

146 {

147 $param = Mage::helper('core')->urlDecode($queryParam);

148 return preg_split('/\s*\,\s*/', $param, 0, PREG_SPLIT_NO_EMPTY);

149 }

150

WCTitleSegment.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 139 lines

1 <?php

2 /**

3 * Part of WikiCitation extension for Mediawiki.

79

80 # Check for final quotes at the end of the title:

81 $p = preg_split( '/(<\/q>+)$/uS', $title, 2, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );

82 if ( count( $p ) >= 2 ) {

83 $title = $p[0] . mb_substr( $endSeparator, 0, 1 ) . $p[1];

AuthorizeNetTypes.php (https://github.com/sharpmachine/whiteantelopestudio.com.git) PHP · 323 lines

1 <?php

2 /**

3 * Classes for the various AuthorizeNet data types.

299 $xml_clean = "";

300 // Remove any blank child elements

301 foreach (preg_split("/(\r?\n)/", $xml) as $key => $line) {

302 if (!preg_match('/><\//', $line)) {

303 $xml_clean .= $line . "\n";

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

1 <?php

2 /**

3 * File containing the ezcSearchQueryBuilder class.

115 );

116 $tokens = array();

117 $tokenArray = preg_split( '@(\s)|(["+():-])@', $searchQuery, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );

118 foreach ( $tokenArray as $token )

119 {

Corescan.php (https://github.com/expressdecor/Expressdecor.git) PHP · 185 lines

1 <?php

2 class Expressdecorcom_Commercebug_Helper_Corescan extends Mage_Core_Helper_Abstract

3 {

30 {

31 $diff->output = $helper_diff->diff(

32 preg_split('{[\r\n]}',$i['contents'],null,PREG_SPLIT_NO_EMPTY),

33 preg_split('{[\r\n]}',file_get_contents($path),null,PREG_SPLIT_NO_EMPTY)

Modifier.php (https://gitlab.com/matadorov/gravity_pph) PHP · 296 lines

1 <?php

2 /*

3 * This file is part of Fenom.

257 {

258 if(is_string($value)) {

259 return preg_split($pattern, $value);

260 } elseif(is_array($value)) {

261 return $value;

Parser.php (https://github.com/hyperf/hyperf.git) PHP · 156 lines

1 <?php

2

3 declare(strict_types=1);

132 private function parseDate(string $crontabString): array

133 {

134 $cron = preg_split('/[\\s]+/i', trim($crontabString));

135 if (count($cron) == 6) {

136 $date = [

ArrayRepository.php (https://github.com/ladybirdweb/agorainvoicing.git) PHP · 218 lines

1 <?php

2

3 /*

97 public function search($query, $mode = 0, $type = null)

98 {

99 $regex = '{(?:'.implode('|', preg_split('{\s+}', $query)).')}i';

100

101 $matches = array();

SanityCheckerProvider.php (https://bitbucket.org/eviweb/moodle-local_sanitychecker.git) PHP · 154 lines

1 <?php

2

3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

150

151 // splits lines

152 return preg_split('/[\n\r]+/', $content, null, PREG_SPLIT_NO_EMPTY);

153 }

154 }

AuthorizeNetTypes.php (https://github.com/ideahackdev/edgen.git) PHP · 323 lines

1 <?php

2 /**

3 * Classes for the various AuthorizeNet data types.

299 $xml_clean = "";

300 // Remove any blank child elements

301 foreach (preg_split("/(\r?\n)/", $xml) as $key => $line) {

302 if (!preg_match('/><\//', $line)) {

303 $xml_clean .= $line . "\n";;

TListControlValidator.php (http://prado3.googlecode.com/svn/trunk/) PHP · 226 lines ✨ Summary

This PHP class, TListControlValidator, validates a TListControl component to ensure that it meets certain criteria. It checks for minimum and maximum number of selections, as well as specific values that must be selected. The validation is performed using JavaScript and can be customized through its properties.

1 <?php

2 /**

3 * TListControlValidator class file

7 * @copyright Copyright &copy; 2005-2012 PradoSoft

8 * @license http://www.pradosoft.com/license/

9 * @version $Id: TListControlValidator.php 3187 2012-07-12 11:21:01Z ctrlaltca $

10 * @package System.Web.UI.WebControls

11 */

58 *

59 * @author Xiang Wei Zhuo <weizhuo[at]gmail.com>

60 * @version $Id: TListControlValidator.php 3187 2012-07-12 11:21:01Z ctrlaltca $

61 * @package System.Web.UI.WebControls

62 * @since 3.0

190 $string = $this->getRequiredSelections();

191 if(!empty($string))

192 $required = preg_split('/,\s*/', $string);

193 return $required;

194 }

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

66 </span><span class="hl-brackets">}</span><span class="hl-code">

67 </span><span class="hl-reserved">foreach</span><span class="hl-brackets">(</span><span class="hl-code"> </span><span class="hl-var">$lines</span><span class="hl-code"> </span><span class="hl-reserved">as</span><span class="hl-code"> </span><span class="hl-var">$line</span><span class="hl-code"> =&gt; </span><span class="hl-var">$datarow</span><span class="hl-code"> </span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">

68 </span><span class="hl-var">$split</span><span class="hl-code"> = </span><span class="hl-identifier">preg_split</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">/[\s]+/</span><span class="hl-quotes">'</span><span class="hl-code">,</span><span class="hl-var">$datarow</span><span class="hl-brackets">)</span><span class="hl-code">;

69 </span><span class="hl-var">$aYears</span><span class="hl-brackets">[</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-identifier">substr</span><span class="hl-brackets">(</span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-var">$split</span><span class="hl-brackets">[</span><span class="hl-number">0</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-code">,</span><span class="hl-number">0</span><span class="hl-code">,</span><span class="hl-number">4</span><span class="hl-brackets">)</span><span class="hl-code">;

70 </span><span class="hl-var">$aSunspots</span><span class="hl-brackets">[</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-var">$split</span><span class="hl-brackets">[</span><span class="hl-number">1</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-code">;

CommitRenderer.php (https://bitbucket.org/kayahr/gitten.git) PHP · 410 lines

1 <?php

2 /*

3 * Copyright (C) 2013 Klaus Reimer <k@ailis.de>

175 }

176 $modifications = $additions + $deletions;

177 include "parts/commit/files.php";

178 }

179

209 private function processRawLine($line)

210 {

211 $parts = preg_split('/\s+/', substr($line, 1));

212 $srcMode = $parts[0];

213 $destMode = $parts[1];

228 private function processNumStatLine($line)

229 {

230 $parts = preg_split('/\s+/', $line);

231 $additions = intval($parts[0]);

232 $deletions = intval($parts[1]);

jFormsDatasource.class.php (https://github.com/BorisMorel/havefnubb.git) PHP · 164 lines

1 <?php

2 /* comments & extra-whitespaces have been removed by jBuildTools*/

3 /**

64 $this->profile=$profile;

65 $this->method=$method;

66 $this->labelProperty=preg_split('/[\s,]+/',$label);

67 $this->labelSeparator=$labelSeparator;

68 if($criteria!==null)

69 $this->criteria=preg_split('/[\s,]+/',$criteria);

70 if($criteriaFrom!==null)

71 $this->criteriaFrom=preg_split('/[\s,]+/',$criteriaFrom);

Headers.php (https://github.com/GeeH/zf2-sandbox.git) PHP · 273 lines

1 <?php

2

3 namespace Zf2\Http;

233 $headers = array();

234 $type = false;

235 foreach (preg_split(self::PATTERN_HEADER_DELIM, $string) as $line) {

236 if (preg_match('/^' . self::PATTERN_TOKEN . ':' . self::PATTERN_FIELD_CONTENT . '$/', $line, $matches)) {

237 $type = $matches['token'];

Command.php (https://bitbucket.org/vladap/symfony.git) PHP · 296 lines

1 <?php

2

3 /*

253 } else {

254 $process = proc_open($this->join(), array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);

255 $output = preg_split('~(\r\n|\r|\n)~', stream_get_contents($pipes[1]), -1, PREG_SPLIT_NO_EMPTY);

256

257 if ($error = stream_get_contents($pipes[2])) {

smarty_internal_compile_private_special_variable.php (https://gitlab.com/fiesta-framework/Documentation) PHP · 114 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile Special Smarty Variable

28 public function compile($args, $compiler, $parameter)

29 {

30 $_index = preg_split("/\]\[/", substr($parameter, 1, strlen($parameter) - 2));

31 $compiled_ref = ' ';

32 $variable = trim($_index[0], "'");

sfCommandManager.class.php (https://github.com/yuya-takeyama/symfony-hackathon-20110924.git) PHP · 381 lines

1 <?php

2

3 /*

15 * @subpackage command

16 * @author Fabien Potencier <fabien.potencier@symfony-project.com>

17 * @version SVN: $Id: sfCommandManager.class.php 21908 2009-09-11 12:06:21Z fabien $

18 */

19 class sfCommandManager

110 // hack to split arguments with spaces : --test="with some spaces"

111 $arguments = preg_replace('/(\'|")(.+?)\\1/e', "str_replace(' ', '=PLACEHOLDER=', '\\2')", $arguments);

112 $arguments = preg_split('/\s+/', $arguments);

113 $arguments = str_replace('=PLACEHOLDER=', ' ', $arguments);

114 }

smarty_internal_extension_handler.php (https://gitlab.com/team_fsn/fsn-php) PHP · 157 lines

1 <?php

2

3 /**

75 // convert camel case to underscored name

76 $this->resolvedProperties[$prop] = $pn = strtolower(join('_',

77 preg_split('/([A-Z][^A-Z]*)/', $prop, - 1,

78 PREG_SPLIT_NO_EMPTY |

79 PREG_SPLIT_DELIM_CAPTURE)));

80 $this->_property_info[$prop] = property_exists($data, $pn) ? 1 :

81 ($data->_objType == 2 && property_exists($smarty, $pn) ? 2 : 0);

Server.php (https://bitbucket.org/larryg/powerhut.git) PHP · 237 lines

1 <?php namespace Basset;

2

3 use Basset\Collection;

34 public function collection($collection, $format = null)

35 {

36 list($collection, $extension) = preg_split('/\.(css|js)/', $collection, 2, PREG_SPLIT_DELIM_CAPTURE);

37

38 return $this->serve($collection, $extension == 'css' ? 'stylesheets' : 'javascripts', $format);

class-bp-activity-query.php (https://github.com/livinglab/openlab.git) PHP · 247 lines

1 <?php

2 /**

3 * BuddyPress Activity Classes

158 if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {

159 if ( ! is_array( $value ) ) {

160 $value = preg_split( '/[,\s]+/', $value );

161 }

162 }

AnnounceTest.php (https://gitlab.com/hwmack/LibtorrentPHP) PHP · 198 lines

1 <?php

2

3 namespace CWE\Libraries\LibtorrentPHP\Test\Blackbox;

4

5 use CWE\Libraries\LibtorrentPHP\Persistence\SqlPersistence;

6 use CWE\Libraries\LibtorrentPHP\Core;

7 use CWE\Libraries\Bencode;

8

9 class AnnounceTest extends \PHPUnit_Framework_TestCase

10 {

11 private $persistence;

143

144 $driver = new \PDO( 'sqlite::memory:' );

145 $statements = preg_split( '/;[ \t]*\n/', $table_definitions, -1, PREG_SPLIT_NO_EMPTY );

146

147 foreach ( $statements as $statement )

Selectors.php (https://github.com/burning-boots/third-party-tools.git) PHP · 245 lines

1 <?php

2 /**

3 * CSS Compressor 3.0

190 */

191 private function strictid( $selector ) {

192 $parts = preg_split( $this->rcomma, $selector );

193 foreach ( $parts as &$s ) {

194 if ( preg_match( $this->rid, $s ) ) {

195 $p = preg_split( $this->rid, $s );

196 $s = '#' . array_pop( $p );

197 }

207 */

208 private function repeats( $selector ) {

209 $parts = preg_split( $this->rcomma, $selector );

210 $parts = array_flip( $parts );

211 $parts = array_flip( $parts );

Error.php (https://gitlab.com/hunt9310/ras) PHP · 124 lines

1 <?php

2 namespace Braintree\Result;

3

52 public function valueForHtmlField($field)

53 {

54 $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY);

55 $params = $this->params;

56 foreach(array_slice($pieces, 0, -1) as $key) {

SMW_DV_Record.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 298 lines

1 <?php

2 /**

3 * @file

42 }

43

44 $values = preg_split( '/[\s]*;[\s]*/u', trim( $value ) );

45 $valueIndex = 0; // index in value array

46 $propertyIndex = 0; // index in property list

271 }

272 ++$i;

273 $propertyValues = $this->m_dataitem->getSemanticData()->getPropertyValues( $propertyDataItem ); // combining this with next line violates PHP strict standards

274 $dataItem = reset( $propertyValues );

275 if ( $dataItem !== false ) {

CssSplitter.php (https://gitlab.com/A.Julien/sendstockbymail-module-prestashop) PHP · 254 lines

1 <?php

2 /**

3 * PHP CSS Splitter

4 *

5 * Based on https://github.com/zweilove/css_splitter but written for PHP

6 *

7 * @homepage http://www.github.com/dlundgren/php-css-splitter

202 private function splitIntoRules($css)

203 {

204 $rules = preg_split('/}/', trim($this->stripComments($css)));

205

206 // complete any rules by append } to them

SafeFN.class.php (https://gitlab.com/michield/dokuwiki) PHP · 158 lines

1 <?php

2

3 /**

130

131 $unicode = array();

132 $split = preg_split('#(?=['.self::$post_indicator.self::$pre_indicator.'])#',$safe,-1,PREG_SPLIT_NO_EMPTY);

133

134 $converted = false;

function.fetch.php (https://gitlab.com/staging06/myproject) PHP · 221 lines

1 <?php

2 /**

3 * Smarty plugin

13 * Purpose: fetch file, web or ftp data and display results

14 *

15 * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch}

16 * (Smarty online manual)

17 * @author Monte Ohrt <monte at ohrt dot com>

43 if (isset($template->smarty->security_policy)) {

44 if ($protocol) {

45 // remote resource (or php stream, …)

46 if (!$template->smarty->security_policy->isTrustedUri($params['file'])) {

47 return;

194 }

195 fclose($fp);

196 $csplit = preg_split("!\r\n\r\n!", $content, 2);

197

198 $content = $csplit[1];

WikiRenderer.class.php (https://gitlab.com/JKANetwork/ZeusWiki) PHP · 221 lines

1 <?php

2 /**

3 * Wikirenderer is a wiki text parser. It can transform a wiki text into xhtml or other formats

74

75 if(is_string($config)){

76 $f = WIKIRENDERER_PATH.'rules/'.basename($config).'.php';

77 if(file_exists($f)){

78 require_once($f);

83 $this->config=$config;

84 }else{

85 require_once(WIKIRENDERER_PATH . 'rules/wr3_to_xhtml.php');

86 $this->config= new wr3_to_xhtml();

87 }

108 $text = $this->config->onStart($text);

109

110 $lignes=preg_split("/\015\012|\015|\012/",$text); // we split the text at all line feeds

111

112 $this->_newtext=array();

transformations.lib.php (https://github.com/BenBE/ispCP.git) PHP · 246 lines

1 <?php

2 /* vim: set expandtab sw=4 ts=4 sts=4: */

3 /**

4 * Set of functions used with the relation and pdf feature

5 *

6 * @package phpMyAdmin

7 */

8

20 * </code>

21 *

22 * @uses preg_split()

23 * @uses array_shift()

24 * @uses trim()

36

37 if (! strlen($option_string)

38 || ! $transform_options = preg_split('/,/', $option_string)) {

39 return $result;

40 }

RequestTest.php (https://github.com/shupp/openid.git) PHP · 269 lines

1 <?php

2 /**

3 * OpenID_Auth_RequestTest

4 *

5 * PHP Version 5.2.0+

6 *

7 * @uses PHPUnit_Framework_TestCase

10 * @author Bill Shupp <hostmaster@shupp.org>

11 * @copyright 2009 Bill Shupp

12 * @license http://www.opensource.org/licenses/bsd-license.php FreeBSD

13 * @link http://github.com/shupp/openid

14 */

15

16 require_once 'OpenID/Auth/Request.php';

17 require_once 'OpenID/Discover.php';

GeoLocation.php (https://github.com/dimension27/silverstripe-geolocator.git) PHP · 140 lines

1 <?php

2

3 class GeoLocation extends DataObject {

83 $geoLocations->removeAll();

84

85 $postcodes = preg_split('/[ ,]+/', $postcodes);

86 foreach ($postcodes as $postcode) {

87 if ($postcode = trim($postcode)) {

IniFile.php (https://github.com/orchestra-io/sample-openx.git) PHP · 169 lines

1 <?php

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

3 // | PHP Version 4 |

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

5 // | Copyright (c) 1997-2003 The PHP Group |

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

7 // | This source file is subject to version 2.0 of the PHP license, |

8 // | that is bundled with this package in the file LICENSE, and is |

9 // | available at through the world-wide-web at |

10 // | http://www.php.net/license/2_02.txt. |

11 // | If you did not receive a copy of the PHP license and are unable to |

12 // | obtain it through the world-wide-web, please send a note to |

13 // | license@php.net so we can mail you a copy immediately. |

14 // +----------------------------------------------------------------------+

15 // | Authors: Bertrand Mansion <bmansion@mamasam.com> |

class.ipmiutil.inc.php (https://github.com/gunet/openeclass.git) PHP · 265 lines

1 <?php

2 /**

3 * ipmiutil sensor class, getting information from ipmi-sensors

8 * @package PSI_Sensor

9 * @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>

10 * @copyright 2014 phpSysInfo

11 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

31 case 'command':

32 CommonFunctions::executeProgram('ipmiutil', 'sensor -stw', $lines);

33 $this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);

34 break;

35 case 'data':

36 if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmiutil.txt', $lines)) {

37 $this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);

38 }

39 break;

wp-rest-functions.php (https://gitlab.com/najomie/fit-hippie) PHP · 275 lines

1 <?php

2 /**

3 * @version 2.0-beta13.1

9

10 /**

11 * core-integration.php

12 */

13

23 function wp_parse_slug_list( $list ) {

24 if ( ! is_array( $list ) ) {

25 $list = preg_split( '/[\s,]+/', $list );

26 }

27

82

83 /**

84 * plugin.php

85 */

86

SetCookie.php (https://github.com/leerbag/zf2.git) PHP · 399 lines

1 <?php

2

3 namespace Zend\Http\Header;

74 $setCookieProcessor = function($headerLine) use ($setCookieClass) {

75 $header = new $setCookieClass;

76 $keyValuePairs = preg_split('#;\s*#', $headerLine);

77 foreach ($keyValuePairs as $keyValue) {

78 if (strpos($keyValue, '=')) {

79 list($headerKey, $headerValue) = preg_split('#=\s*#', $keyValue, 2);

80 } else {

81 $headerKey = $keyValue;

99 }

100

101 list($name, $value) = preg_split('#: #', $headerLine, 2);

102

103 // check to ensure proper header type for this factory

session.php (https://github.com/clyfe/DEXonline.git) PHP · 198 lines

1 <?php

2

3 function session_init() {

88 function session_user_prefers($pref) {

89 if (isset($_SESSION['user'])) {

90 return isset($_SESSION['user']->preferences) && in_array($pref, preg_split('/,/', $_SESSION['user']->preferences));

91 } else {

92 $prefs = session_getCookieSetting('anonymousPrefs');

93 return in_array($pref, preg_split('/,/', $prefs));

94 }

95 }

163

164 function session_setVariable($var, $value) {

165 // Lazy start of the session so we don't send a PHPSESSID cookie unless we have to

166 if (!isset($_SESSION)) {

167 session_start();

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

1 <?php

2 /***************************************************************************

3 * Associaspip, extension de SPIP pour gestion d'associations *

50 /* selection du format d'import du champ non */

51 if ($GLOBALS['association_metas']['import_nom_auteur'] == "prenom_nom") {

52 list($prenom, $nom) = preg_split('/\s+/', $nom, 2);

53 if (!$nom) {/* il n'y avait qu'une seule chaine -> on la met dans le nom et le prenom reste vide */

54 $nom = $prenom;

58 $prenom = '';

59 } else { // defaut: format nom prenom

60 list($nom, $prenom) = preg_split('/\s+/', $nom, 2); /* il faudrait aussi gerer le cas ou le nom de famille contient un espace */

61 }

62 }

Diff.php (https://bitbucket.org/hoardingsinc/wikitabbook.git) PHP · 386 lines

1 <?php

2

3 /*

4

5 class.Diff.php

6

7 A class containing a diff implementation

45 $end2 = strlen($string2) - 1;

46 }else{

47 $sequence1 = preg_split('/\R/', $string1);

48 $sequence2 = preg_split('/\R/', $string2);

date.php (https://github.com/livinglab/openlab.git) PHP · 401 lines

1 <?php

2 /**

3 * Date helper.

45

46 // Array with the output formats

47 $output = preg_split('/[^a-z]+/', $output);

48

49 // Convert the list of outputs to an associative array

DebugCommand.php (https://github.com/hhamon/symfony.git) PHP · 148 lines

1 <?php

2

3 /*

50 dispatched using the message buses:

51

52 <info>php %command.full_name%</info>

53

54 Or for a specific bus only:

55

56 <info>php %command.full_name% command_bus</info>

57

58 EOF

130

131 if ($docComment = $r->getDocComment()) {

132 $docComment = preg_split('#\n\s*\*\s*[\n@]#', substr($docComment, 3, -2), 2)[0];

133

134 return trim(preg_replace('#\s*\n\s*\*\s*#', ' ', $docComment));

transformations.lib.php (https://github.com/cabenitez/factuweb.git) PHP · 249 lines

1 <?php

2 /* vim: set expandtab sw=4 ts=4 sts=4: */

3 /**

4 * Set of functions used with the relation and pdf feature

5 *

6 * @version $Id: transformations.lib.php 11192 2008-04-09 00:22:06Z lem9 $

7 */

8

20 * </code>

21 *

22 * @uses preg_split()

23 * @uses array_shift()

24 * @uses trim()

36

37 if (! strlen($option_string)

38 || ! $transform_options = preg_split('/,/', $option_string)) {

39 return $result;

40 }

Plugin.php (https://gitlab.com/hoanghung.dev/aloads) PHP · 280 lines

1 <?php

2 /**

3 * Plugin.php

63 // @codeCoverageIgnoreEnd

64

65 $chunks = preg_split('/,/', $format, 0, PREG_SPLIT_NO_EMPTY);

66 $imageInfo = MOXMAN_Media_MediaInfo::getInfo($file);

67 $width = $imageInfo["width"];

205 // @codeCoverageIgnoreEnd

206

207 $chunks = preg_split('/,/', $format, 0, PREG_SPLIT_NO_EMPTY);

208 $imageInfo = MOXMAN_Media_MediaInfo::getInfo($file);

209 $width = $imageInfo["width"];

album.php (https://github.com/rninne/picManager.git) PHP · 125 lines

1 <?php

2 /*** Include configuration scripts and image scaler

3 */

4 include('php/SimpleImage.php');

5 include('php/iniProperties.php');

48 }

49 function addImageToDownloads(id){

50 $('downloads').insert('<div id="DL_'+ id +'" class="choice"><img src="<?php echo $dir ?>thumbs/small/'+ id +'.jpg" onmouseup="toggleImage(\''+ id +'\')" /><br />'+id+'</div>');

51 $('A_'+id).title = '<input id="CBL_'+ id +'" class="CBL" type="checkbox" checked="checked" onchange="toggleImage(\''+ id +'\')" /> Add to downloads';

52 imageList.push(id);

54 }

55 function updateURL(){

56 $('DLZIP').href = 'zipDownload.php?folder=<?php echo $folder ?>&files=' + imageList.toString();

57 }

58

lib.php (https://gitlab.com/MotoSport/morgue) PHP · 132 lines

1 <?php

2

3 #require_once('Persistence.php');

8

9 $terms = preg_replace_callback("/\"(.*?)\"/", function($m) {return Search::transform_term($m[1]);}, $terms);

10 $terms = preg_split("/\s+|,/", $terms);

11

12 $out = array();

AcceptHeaderItem.php (https://github.com/ivebeenlinuxed/Boiler.git) PHP · 226 lines

1 <?php

2

3 /*

62 public static function fromString($itemValue)

63 {

64 $bits = preg_split('/\s*(?:;*("[^"]+");*|;*(\'[^\']+\');*|;+)\s*/', $itemValue, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);

65 $value = array_shift($bits);

66 $attributes = array();

FSTools.php (https://gitlab.com/afzalpotenza/YII_salon) PHP · 164 lines

1 <?php

2

3 /**

34 * Recursively creates a directory

35 * @param string $folder Name of folder to create

36 * @note Adapted from the PHP manual comment 76612

37 */

38 public function mkdirr($folder)

39 {

40 $folders = preg_split("#[\\\\/]#", $folder);

41 $base = '';

42 for($i = 0, $c = count($folders); $i < $c; $i++) {

58 /**

59 * Copy a file, or recursively copy a folder and its contents; modified

60 * so that copied files, if PHP, have includes removed

61 * @note Adapted from http://aidanlister.com/repos/v/function.copyr.php

plural-comparison.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 204 lines

1 <?php

2 /**

3 * Script for comparing different plural implementations.

16 $dir = dirname( __FILE__ ); $IP = "$dir/../../..";

17 }

18 require_once( "$IP/maintenance/Maintenance.php" );

19

20 /// Script for comparing different plural implementations.

144 $gtData = file_get_contents( dirname( __FILE__ ) . '/../data/plural-gettext.txt' );

145 $gtLanguages = array();

146 foreach ( preg_split( '/\n|\r/', $gtData, -1, PREG_SPLIT_NO_EMPTY ) as $line ) {

147 list( $code, $rule ) = explode( "\t", $line );

148 $rule = preg_replace( '/^.*?plural=/', '', $rule );

Parser.class.php (https://github.com/macmade/WOOPS.git) PHP · 279 lines

1 <?php

2 ################################################################################

3 # #

22 {

23 /**

24 * The minimum version of PHP required to run this class (checked by the WOOPS class manager)

25 */

26 const PHP_COMPATIBLE = '5.2.0';

234 $handler = new $handlerClass();

235

236 $piParams = preg_split( '/="|" |"$/', $data );

237

238 array_pop( $piParams );

PlainContentEncoder.php (https://gitlab.com/x33n/platform) PHP · 159 lines

1 <?php

2

3 /*

126 $currentLine =& $lines[$lineCount++];

127

128 //$chunks = preg_split('/(?<=[\ \t,\.!\?\-&\+\/])/', $originalLine);

129 $chunks = preg_split('/(?<=\s)/', $originalLine);

smarty_internal_runtime_updatecache.php (https://github.com/usualoma/movabletype.git) PHP · 183 lines

70 $no_output_filter

71 ) {

72 $php_pattern = '/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/';

73 $content = ob_get_clean();

74 $hash_array = $cached->hashes;

95 // escape PHP tags in template content

96 $php_split = preg_split(

97 $php_pattern,

103 $php_parts

104 );

105 foreach ($php_split as $idx_php => $curr_php) {

106 $content .= $curr_php;

107 if (isset($php_parts[ 0 ][ $idx_php ])) {

108 $content .= "<?php echo '{$php_parts[ 1 ][ $idx_php ]}'; ?>\n";

109 }

110 }

Column.php (https://gitlab.com/ElvisAns/tiki) PHP · 270 lines

1 <?php

2

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

49 public function getRemoteFields()

50 {

51 return preg_split('/\s*,\s*/', $this->remoteField);

52 }

53

PhutilProseDifferenceEngine.php (git://github.com/facebook/phabricator.git) PHP · 275 lines

1 <?php

2

3 final class PhutilProseDifferenceEngine extends Phobject {

129 }

130

131 $pieces = preg_split($expr, $corpus, -1, PREG_SPLIT_DELIM_CAPTURE);

132 return $this->stitchPieces($pieces, $level);

133 }

Table.php (https://github.com/ggunlugu/ornekler.git) PHP · 220 lines

1 <?php

2 /**

3 *

27 * @package Solar_Markdown_Extra

28 *

29 * @author Michel Fortin <http://www.michelf.com/projects/php-markdown/>

30 *

31 * @author Paul M. Jones <pmjones@solarphp.com>

32 *

33 * @license http://opensource.org/licenses/bsd-license.php BSD

34 *

35 * @version $Id: Table.php 3153 2008-05-05 23:14:16Z pmjones $

166

167 // Reading alignment from header underline.

168 $separators = preg_split('/ *[|] */', $underline);

169 $attr = array();

170 foreach ($separators as $n => $s) {

ApplicationConfigFile.php (https://github.com/sidealice/zf2.git) PHP · 286 lines

1 <?php

2 /**

3 * Zend Framework

129 }

130

131 $contentLines = preg_split('#[\n\r]#', $this->getContents());

132

133 $newLines = array();

259 $contents = <<<'EOS'

260 [production]

261 phpSettings.display_startup_errors = 0

262 phpSettings.display_errors = 0

263 includePaths.library = APPLICATION_PATH "/../library"

264 bootstrap.path = APPLICATION_PATH "/Bootstrap.php"

265 bootstrap.class = "Bootstrap"

266 appnamespace = "Application"

sfImageTextGD.class.php (https://github.com/sanjeevan/codelovely.git) PHP · 288 lines

1 <?php

2 /*

3 * This file is part of the sfImageTransform package.

234

235

236 $lines = preg_split('/[\n\r]+/', $this->getText());

237 print $this->getMaximumLineLength($lines);

238 exit;

270 if(!is_array($lines))

271 {

272 $lines = preg_split('/[\n\r]+/', $lines);

273 }

274

Transport.php (https://github.com/FabienD/symfony.git) PHP · 199 lines

1 <?php

2

3 /*

147 public function fromString(string $dsn): TransportInterface

148 {

149 $dsns = preg_split('/\s++\|\|\s++/', $dsn);

150 if (\count($dsns) > 1) {

151 return new FailoverTransport($this->createFromDsns($dsns));

152 }

153

154 $dsns = preg_split('/\s++&&\s++/', $dsn);

155 if (\count($dsns) > 1) {

156 return new RoundRobinTransport($this->createFromDsns($dsns));

GameController.php (https://github.com/joshuaswarren/weatherhub.git) PHP · 222 lines

1 <?php

2 /**

3 * GameController class file.

14 *

15 * @author Qiang Xue <qiang.xue@gmail.com>

16 * @version $Id: CController.php 131 2008-11-02 01:32:57Z qiang.xue $

17 * @package demos.hangman

18 * @since 1.0

106 {

107 $wordFile=dirname(__FILE__).'/words.txt';

108 $words=preg_split("/[\s,]+/",file_get_contents($wordFile));

109 do

110 {

settings.php (https://github.com/duk3luk3/mibew.git) PHP · 107 lines

1 <?php

2 /*

3 * This file is part of Mibew Messenger project.

20 */

21

22 require_once('../libs/common.php');

23 require_once('../libs/operator.php');

24 require_once('../libs/settings.php');

25

26 $operator = check_login();

71

72 if($params['geolinkparams']) {

73 foreach(preg_split("/,/", $params['geolinkparams']) as $oneparam) {

74 if(!preg_match("/^\s*(toolbar|scrollbars|location|status|menubar|width|height|resizable)=\d{1,4}$/", $oneparam)) {

75 $errors[] = "Wrong link parameter: \"$oneparam\", should be one of 'toolbar, scrollbars, location, status, menubar, width, height or resizable'";

Util_File.php (https://gitlab.com/karlen/ayo_wp) PHP · 418 lines

1 <?php

2 namespace W3TC;

3

205 static public function get_open_basedirs() {

206 $open_basedir_ini = ini_get( 'open_basedir' );

207 $open_basedirs = ( W3TC_WIN ? preg_split( '~[;,]~', $open_basedir_ini ) : explode( ':', $open_basedir_ini ) );

208 $result = array();

209

349

350 /**

351 * Takes a W3TC settings array and formats it to a PHP String

352 *

353 * @param unknown $data

355 */

356 static public function format_data_as_settings_file( $data ) {

357 $config = "<?php\r\n\r\nreturn array(\r\n";

358 foreach ( $data as $key => $value )

359 $config .= Util_File::format_array_entry_as_settings_file_entry( 1, $key, $value );

setup.info.php (https://github.com/fuyumacha/evolution-jp.git) PHP · 207 lines

1 <?php

2 //:: MODx Installer Setup file

3 //:::::::::::::::::::::::::::::::::::::::::

4 require_once('../manager/includes/version.inc.php');

5

6 $moduleName = 'MODX';

46 $params['modx_category'],

47 $params['lock_template'],

48 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false

49 );

50 }

78 $params['modx_category'],

79 $params['lock_tv'], /* value should be 1 or 0 */

80 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false

81 );

82 }

Oracle.php (https://bitbucket.org/gencer/zf2.git) PHP · 189 lines

1 <?php

2 /**

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

162 return $identifier;

163 }

164 $parts = preg_split('#([\.\s\W])#', $identifier, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

165 if ($safeWords) {

166 $safeWords = array_flip($safeWords);

sfCommandManager.class.php (https://github.com/proyectoalba/alba.git) PHP · 381 lines

1 <?php

2

3 /*

15 * @subpackage command

16 * @author Fabien Potencier <fabien.potencier@symfony-project.com>

17 * @version SVN: $Id: sfCommandManager.class.php 17858 2009-05-01 21:22:50Z FabianLange $

18 */

19 class sfCommandManager

110 // hack to split arguments with spaces : --test="with some spaces"

111 $arguments = preg_replace('/(\'|")(.+?)\\1/e', "str_replace(' ', '=PLACEHOLDER=', '\\2')", $arguments);

112 $arguments = preg_split('/\s+/', $arguments);

113 $arguments = str_replace('=PLACEHOLDER=', ' ', $arguments);

114 }

shortcodes.php (https://bitbucket.org/rossberenson/michael-karas.git) PHP · 281 lines

1 <?php

2 /**

3 * Plugin Name: r+ Columns Shortcode

212 if ( !empty( $attr['class'] ) ) {

213 if ( !is_array( $attr['class'] ) )

214 $attr['class'] = preg_split( '#\s+#', $attr['class'] );

215 $column_classes = array_merge( $column_classes, $attr['class'] );

216 }

import.php (https://gitlab.com/Blueprint-Marketing/hhvm) PHP · 138 lines

8 $source_root = realpath($argv[1]);

9 $ext_name = $argv[2];

10 $systemlib_name = 'ext_'.$ext_name.'.php';

11 $dest_root = __DIR__.'/'.$ext_name;

12 $test_root = __DIR__.'/../../test';

68 ],

69 deps=[

70 '@/hphp/runtime:hphp_runtime',

71 '@/hphp/runtime/ext_zend_compat:ext_zend_compat_lib',

74 "-Ihphp/runtime/ext_zend_compat/php-src/main/",

75 "-Ihphp/runtime/ext_zend_compat/php-src/Zend/",

76 "-Ihphp/runtime/ext_zend_compat/php-src/TSRM/",

77 "-Ihphp/runtime/ext_zend_compat/php-src/",

78 ],

79 )

PathTokenizer.php (https://gitlab.com/Isaki/le331.fr) PHP · 165 lines

1 <?php

2 /**

3 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

18 */

19

20 include_once 'phing/util/StringHelper.php';

21

22 /**

36 {

37 /**

38 * A array of tokens, created by preg_split().

39 */

40 private $tokens = array();

67 // enough information to tokenize correctly.

68

69 $this->tokens = preg_split("/[;:]/", $path, -1, PREG_SPLIT_NO_EMPTY);

70

71 $this->dosStyleFilesystem = (PATH_SEPARATOR == ';');

ElementLiteral.php (https://gitlab.com/src-run/scrible) PHP · 310 lines

1 <?php

2

3 namespace Scribe\Jabiru\Component\Element;

231 *

232 * @param string $pattern The pattern to search for, as a string.

233 * @param int $flags [optional] PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_OFFSET_CAPTURE

234 *

235 * @return Text[]|Collection

236 */

237 public function split($pattern, $flags = PREG_SPLIT_DELIM_CAPTURE)

238 {

239 return new Collection(

240 array_map(function ($item) {

241 return new static($item);

242 }, preg_split($pattern, $this->text, -1, $flags))

243 );

244 }

Css2Xpath.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 141 lines

1 <?php

2 /**

3 * Zend Framework

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

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

28 * @version $Id: Css2Xpath.php 10020 2009-08-18 14:34:09Z j.fischer@metaways.de $

29 */

30 class Zend_Dom_Query_Css2Xpath

54

55 $paths = array('//');

56 $segments = preg_split('/\s+/', $path);

57 foreach ($segments as $key => $segment) {

58 $pathSegment = self::_tokenize($segment);

Timestamp.php (https://gitlab.com/IR31121994/quizbd-master) PHP · 198 lines

1 <?php

2

3 /**

183 $decimal = 0;

184

185 foreach (preg_split('`[^0-9.]+`', $numbers) as $chunk) {

186 [$integerPart, $decimalPart] = explode('.', "$chunk.");

187

syncInit.php (https://github.com/ciniki/core.git) PHP · 151 lines

1 <?php

2 //

3 // Description

20 // Load the config

21 //

22 require_once($ciniki_root . '/ciniki-mods/core/private/loadCinikiConfig.php');

23 if( ciniki_core_loadCinikiConfig($ciniki, $ciniki_root) == false ) {

24 return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.208', 'msg'=>'Internal configuration error'));

107 //

108 if( isset($_POST) && is_array($_POST) ) {

109 $encrypted_content = file_get_contents("php://input");

110

111 // unencrypt

112 // private_decrypt and encrypt can only be used for short strings

113 // if( !openssl_private_decrypt($encrypted_content, $decrypted_content, $local_private_key) ) {

114 $arsp = preg_split('/:::/', $encrypted_content);

115 if( count($arsp) != 2 || !isset($arsp[1]) ) {

116 return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.213', 'msg'=>'Invalid request'));

HeraldTranscript.php (https://github.com/dannysu/phabricator.git) PHP · 235 lines

1 <?php

2

3 final class HeraldTranscript extends HeraldDAO

65

66 private static function combineXHeraldRulesHeaders($u, $v) {

67 $u = preg_split('/[, ]+/', $u);

68 $v = preg_split('/[, ]+/', $v);

91 self::CONFIG_TIMESTAMPS => false,

92 self::CONFIG_SERIALIZATION => array(

93 'objectTranscript' => self::SERIALIZATION_PHP,

94 'ruleTranscripts' => self::SERIALIZATION_PHP,

95 'conditionTranscripts' => self::SERIALIZATION_PHP,

96 'applyTranscripts' => self::SERIALIZATION_PHP,

127 public function __construct() {

128 $this->time = time();

129 $this->host = php_uname('n');

130 }

131

peoplesearch.php (https://gitlab.com/BeS/io.schiessle.org) PHP · 142 lines

1 <?php

2 /**

3 * People search action class.

4 *

5 * PHP version 5

6 *

7 * @category Action

33 }

34

35 require_once INSTALLDIR.'/lib/searchaction.php';

36 require_once INSTALLDIR.'/lib/profilelist.php';

76 }

77 if ($cnt > 0) {

78 $terms = preg_split('/[\s,]+/', $q);

79 $results = new PeopleSearchResults($profile, $terms, $this);

80 $results->show();

Test.php (https://gitlab.com/virtualrealms/d7civicrm) PHP · 170 lines

1 <?php

2 namespace Civi;

3

28 public static function dsn($part = NULL) {

29 if (!isset(self::$singletons['dsn'])) {

30 require_once "DB.php";

31 self::$singletons['dsn'] = \DB::parseDSN(CIVICRM_DSN);

32 }

60 }

61 catch (PDOException $e) {

62 echo "Can't connect to MySQL server:" . PHP_EOL . $e->getMessage() . PHP_EOL;

63 exit(1);

64 }

150 $string = preg_replace("/^(--[^-]).*/m", "\n", $string);

151

152 $queries = preg_split('/;\s*$/m', $string);

153 foreach ($queries as $query) {

154 $query = trim($query);

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

1 <?php

2 /**

3 * CFormButtonElement class file.

32 *

33 * @author Qiang Xue <qiang.xue@gmail.com>

34 * @version $Id: CFormButtonElement.php 3001 2011-02-24 16:42:44Z alexander.makarow $

35 * @package system.web.form

36 * @since 1.1

86 public function setOn($value)

87 {

88 $this->_on=preg_split('/[\s,]+/',$value,-1,PREG_SPLIT_NO_EMPTY);

89 }

90

sqlite.php (https://github.com/leonardoweslei/CMDB.git) PHP · 158 lines

1 <?php

2 class database_sqlite extends PDO

3 {

47 $fields[$fname]['name'] = $data_f['name'];

48 $fields[$fname]['null'] = $data_f['notnull']!=1 && $data_f['pk']!="1"?true:false;

49 $data_type = preg_split("/[\(\) ]/", $data_f['type']);

50 if(isset($data_type[1]) && preg_replace("/[0-9]/","",$data_type[1])!="")

51 {

rotate.php (https://github.com/ciniki/images.git) PHP · 190 lines

1 <?php

2 //

3 // Description

151 if( $action['action'] == 1 ) {

152 // Crop

153 $params = preg_split('/,/', $action['params']);

154 $new_params = $params[1] . ',' . $params[0] . ',' . $params[3] . ',' . $params[2];

155 $strsql = "UPDATE ciniki_image_actions "

question.php (https://bitbucket.org/ngmares/moodle.git) PHP · 142 lines

1 <?php

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

3 //

85 public static function compare_string_with_wildcard($string, $pattern, $ignorecase) {

86 // Break the string on non-escaped asterisks.

87 $bits = preg_split('/(?<!\\\\)\*/', $pattern);

88 // Escape regexp special characters in the bits.

89 $excapedbits = array();

112 public function clean_response($answer) {

113 // Break the string on non-escaped asterisks.

114 $bits = preg_split('/(?<!\\\\)\*/', $answer);

115

116 // Unescape *s in the bits.

Table.php (https://github.com/pear2/Text_Markdown.git) PHP · 222 lines

1 <?php

2 /**

3 *

27 * @package Markdown_Extra

28 *

29 * @author Michel Fortin <http://www.michelf.com/projects/php-markdown/>

30 *

31 * @author Paul M. Jones <pmjones@solarphp.com>

32 *

33 * @license http://opensource.org/licenses/bsd-license.php BSD

34 *

35 * @version $Id: Table.php 3153 2008-05-05 23:14:16Z pmjones $

168

169 // Reading alignment from header underline.

170 $separators = preg_split('/ *[|] */', $underline);

171 $attr = array();

172 foreach ($separators as $n => $s) {

string.php (https://github.com/raeldc/nooku-server.git) PHP · 153 lines

1 <?php

2 /**

3 * @version $Id: select.php 1309 2011-05-17 16:47:27Z johanjanssens $

40 if($config->match != 'exact')

41 {

42 $words = preg_split('/\s+/u', $config->term);

43 $needle = $words[0];

44 }

82 $words = array($config->term);

83 } else {

84 $words = preg_split('/\s+/u', $config->term);

85 }

86

Feed.php (https://github.com/edmondscommerce/XAMPP-Magento-Demo-Site.git) PHP · 194 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_AdminNotification

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

166 return false;

167 }

168 $data = preg_split('/^\r?$/m', $data, 2);

169 $data = trim($data[1]);

170 $curl->close();

updateviewcount.php (https://github.com/GunioRobot/ezpublish.git) PHP · 237 lines

1 <?php

2 /**

3 * File containing the updateviewcount.php cronjob

74 if ( $startParse or !$hasStartLine )

75 {

76 $logPartArray = preg_split( "/[\"]+/", $line );

77 list( $ip, $timePart ) = explode( '[', $logPartArray[0] );

78 list( $time, $rest ) = explode( ' ', $timePart );

DumperTest.php (https://github.com/liuggio/symfony.git) PHP · 237 lines

1 <?php

2

3 /*

16 use Symfony\Component\Yaml\Dumper;

17

18 class DumperTest extends \PHPUnit_Framework_TestCase

19 {

20 protected $parser;

85

86 // split YAMLs documents

87 foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) {

88 if (!$yaml) {

89 continue;

96 // TODO

97 } else {

98 eval('$expected = '.trim($test['php']).';');

99 $this->assertSame($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']);

100 }

ParserTest.php (https://bitbucket.org/rybadour/todo_list_site.git) PHP · 193 lines

1 <?php

2

3 /*

16 use Symfony\Component\Yaml\Exception\ParseException;

17

18 class ParserTest extends \PHPUnit_Framework_TestCase

19 {

20 protected $parser;

55

56 // split YAMLs documents

57 foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) {

58 if (!$yaml) {

59 continue;

64 // TODO

65 } else {

66 $expected = var_export(eval('return '.trim($test['php']).';'), true);

67

68 $tests[] = array($file, $expected, $test['yaml'], $test['test']);

preg.h (https://gitlab.com/iranjith4/hhvm) C Header · 149 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

12 | obtain it through the world-wide-web, please send a note to |

13 | license@php.net so we can mail you a copy immediately. |

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

15 */