100+ results for 'php substr_count'
Not the results you expected?
ClassCommentSniff.php (https://github.com/amumu/modev.git) PHP · 233 lines
46 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
47 * @version Release: 1.2.0a1
48 * @link http://pear.php.net/package/PHP_CodeSniffer
49 */
50 class PEAR_Sniffs_Commenting_ClassCommentSniff extends PEAR_Sniffs_Commenting_FileCommentSniff
174 if (empty($long) === false) {
175 $between = $comment->getWhiteSpaceBetween();
176 $newlineBetween = substr_count($between, $phpcsFile->eolChar);
177 if ($newlineBetween !== 2) {
178 $error = "There must be exactly one blank line between descriptions in $type comments";
190 $error = "There must be exactly one blank line before the tags in $type comments";
191 if ($long !== '') {
192 $newlineCount += (substr_count($long, $phpcsFile->eolChar) - $newlineSpan + 1);
193 }
RetrieveFXSQLData.class.php (git://github.com/yodarunamok/fxphp.git) PHP · 204 lines
1 <?php
3 require_once('RetrieveFXData.class.php');
5 #### Part of FX.php #####################################################
6 # #
7 # License: Artistic License (included with release) #
31 }
32 $currentOrderBy .= "{$field}";
33 if (substr_count(strtolower($sortOrder), 'desc') > 0) {
34 $currentOrderBy .= ' DESC';
35 }
url_tools.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 173 lines
1 <?php
2 /**
3 * File containing the ezcUrlTools class.
14 *
15 * Static methods contained in this class:
16 * - parseQueryString() - It implements the functionality of the PHP function
17 * parse_str(), but without converting dots to underscores in parameter names.
18 * - getCurrentUrl() - Returns the current URL as a string from the provided
27 * Parses the provided string and returns an associative array structure.
28 *
29 * It implements the functionality of the PHP function parse_str(), but
30 * without converting dots to underscores in parameter names.
31 *
75 }
77 if ( substr_count( $parts[0], '[' ) === 0 )
78 {
79 $key = $parts[0];
InstanceTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 139 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
6 namespace Magento\Widget\Model\Widget;
8 class InstanceTest extends \PHPUnit_Framework_TestCase
9 {
10 /**
128 $this->assertContains('<body><referenceContainer name="content">', $result);
129 $this->assertContains('<block class="' . $model->getType() . '"', $result);
130 $this->assertEquals(count($params), substr_count($result, '<action method="setData">'));
131 $this->assertContains('<argument name="name" xsi:type="string">display_mode</argument>', $result);
132 $this->assertContains('<argument name="value" xsi:type="string">fixed</argument>', $result);
LexerNeedle.php (https://github.com/bshaffer/ChartDown.git) PHP · 238 lines
RouteBuilderTest.php (https://gitlab.com/reasonat/test8) PHP · 325 lines
1 <?php
3 /**
33 * The mocked matcher dumper.
34 *
35 * @var \Drupal\Core\Routing\MatcherDumperInterface|\PHPUnit_Framework_MockObject_MockObject
36 */
37 protected $dumper;
40 * The mocked lock backend.
41 *
42 * @var \Drupal\Core\Lock\LockBackendInterface|\PHPUnit_Framework_MockObject_MockObject
43 */
44 protected $lock;
47 * The mocked event dispatcher.
48 *
49 * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject
50 */
51 protected $dispatcher;
InstanceTest.php (https://gitlab.com/daigiangaitu91/magento) PHP · 139 lines
1 <?php
2 /**
3 * Copyright © 2015 Magento. All rights reserved.
6 namespace Magento\Widget\Model\Widget;
8 class InstanceTest extends \PHPUnit_Framework_TestCase
9 {
10 /**
128 $this->assertContains('<body><referenceContainer name="content">', $result);
129 $this->assertContains('<block class="' . $model->getType() . '"', $result);
130 $this->assertEquals(count($params), substr_count($result, '<action method="setData">'));
131 $this->assertContains('<argument name="name" xsi:type="string">display_mode</argument>', $result);
132 $this->assertContains('<argument name="value" xsi:type="string">fixed</argument>', $result);
DocBlockScanner.php (https://github.com/leerbag/zf2.git) PHP · 375 lines
ProfilePicture.php (https://gitlab.com/Afsana/Afsana_148423_B35_Session_31) PHP · 308 lines
1 <?php
3 namespace App\ProfilePicture;
61 Message::message("Failed! Data Has Not Been Inserted Successfully :(");
63 Utility::redirect('create.php'); // redirect korte hobe create.php te tai utility.php use korechi //
65 }//end of store method
72 $fetchMode = strtoupper($fetchMode);
73 if(substr_count($fetchMode,'OBJ') > 0)
74 $STH->setFetchMode(PDO::FETCH_OBJ);
75 else
89 $fetchMode = strtoupper($fetchMode);
90 if(substr_count($fetchMode,'OBJ') > 0)
91 $STH->setFetchMode(PDO::FETCH_OBJ);
92 else
DocBlockReflection.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 296 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
100 // determine line numbers
101 $lineCount = substr_count($this->docComment, "\n");
102 $this->startLine = $this->reflector->getStartLine() - $lineCount - 1;
103 $this->endLine = $this->reflector->getStartLine() - 1;
270 public function toString()
271 {
272 $str = "DocBlock [ /* DocBlock */ ] {" . PHP_EOL . PHP_EOL;
273 $str .= " - Tags [" . count($this->tags) . "] {" . PHP_EOL;
277 }
279 $str .= " }" . PHP_EOL;
280 $str .= "}" . PHP_EOL;
Model.php (https://github.com/GeekZooTeam/Geek-Zoo-PHP-Library.git) PHP · 402 lines
1 <?php
3 /*
5 *
6 * @copyright (c) 2010 Geek-Zoo Projects More info http://www.geek-zoo.com
7 * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License
8 * @author xuanyan <xuanyan@geek-zoo.com>
9 *
148 list($set, $where) = explode('WHERE', $sql);
149 $select = "SELECT * FROM `$table` WHERE $where";
150 $c = substr_count($select, '?');
151 $select_param = array();
152 while ($c) {
MethodScanner.php (https://bitbucket.org/alexandretaz/maniac_divers.git) PHP · 537 lines
Birthday.php (https://gitlab.com/Mishu_ctg69/Princy_143467_B37_Atomic_project) PHP · 399 lines
1 <?php
2 namespace App\BITM\SEIP143467\Birthday;
3 use App\BITM\SEIP143467\Message\Message;
23 $sth=$DBH->prepare("select * from birthday Where is_deleted='0'");
24 $sth->execute();
25 if(substr_count($fetchMode,'OBJ') > 0)
26 $sth->setFetchMode(PDO::FETCH_OBJ);
27 else
70 else
71 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Updated !</h3></div>");
72 Utility::redirect('index.php');
86 else
87 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
88 Utility::redirect('index.php');
Gender.php (https://gitlab.com/Princy008/Princy_143467_B37_Atomic_project) PHP · 405 lines
1 <?php
2 namespace App\BITM\SEIP143467\Gender;
3 use App\BITM\SEIP143467\Message\Message;
22 $sth=$DBH->prepare("select * from Gender where is_deleted='0'");
23 $sth->execute();
24 if(substr_count($fetchMode,'OBJ') > 0)
25 $sth->setFetchMode(PDO::FETCH_OBJ);
26 else
80 Utility::redirect('create.php');
107 else
108 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Updated !</h3></div>");
109 Utility::redirect('index.php');
Birthday.php (https://gitlab.com/Soikot/AtomicProject_AmirulIslam_152207) PHP · 400 lines
1 <?php
2 namespace App\BITM\SEIP152207\Birthday;
3 use App\BITM\SEIP152207\Message\Message;
23 $sth=$DBH->prepare("select * from birthday Where is_deleted='0'");
24 $sth->execute();
25 if(substr_count($fetchMode,'OBJ') > 0)
26 $sth->setFetchMode(PDO::FETCH_OBJ);
27 else
70 else
71 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Updated !</h3></div>");
72 Utility::redirect('index.php');
86 else
87 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
88 Utility::redirect('index.php');
bootstrap.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 244 lines
FormSelectTest.php (https://github.com/Exercise/zf2.git) PHP · 302 lines
1 <?php
2 /**
3 * Zend Framework
37 * @group Zend_View_Helper
38 */
39 class FormSelectTest extends \PHPUnit_Framework_TestCase
40 {
79 $this->assertRegExp('#<option[^>]+value="foo".*?>Foobar</option>#', $html);
80 $this->assertRegExp('#<option[^>]+value="baz".*?>Bazbat</option>#', $html);
81 $this->assertEquals(2, substr_count($html, '<option'));
82 }
Profile_Picture.php (https://gitlab.com/rahad777/atomic_project_Rahad_143368_B36) PHP · 273 lines
1 <?php
2 namespace App\Profile_Picture;
3 use App\Message\Message;
45 else
46 Message::message("Failed! DATA HAS not BEEN INSERTED SUCCESSFULLY");
47 Utility::redirect('create.php');
48 }
49 public function index($fetchMode="ASSOC"){
54 $fetchMode = strtoupper($fetchMode);
55 if(substr_count($fetchMode, "OBJ")>0)
56 $STH->setFetchMode(PDO::FETCH_OBJ);
57 else
68 $fetchMode = strtoupper($fetchMode);
69 if(substr_count($fetchMode, "OBJ")>0)
70 $STH->setFetchMode(PDO::FETCH_OBJ);
71 else
edit.php (https://github.com/laanlabs/snackfeed.com.git) PHP · 192 lines
112 <td>
113 <? for ( $i = 0; $i <= 6; $i ++) { ?>
114 <input type="checkbox" name="_show_process_days[]" <? if (substr_count($_show_process_days, $i) > 0) echo 'CHECKED' ?> value="<?= $i ?>" ><?= $days[$i] ?>
115 <? } ?>
116 </td>
170 <td>
171 <select name="_status" >
172 <option value="1" <?php if ($_status==1) {echo 'SELECTED';} ?> >Active</option>
173 <option value="2" <?php if ($_status==2) {echo 'SELECTED';} ?>>Pending</option>
174 <option value="0" <?php if ($_status==0) {echo 'SELECTED';} ?>>Inactive</option>
175 </select>
176 </td>
smarty_internal_compile_include.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 168 lines
1 <?php
3 /**
34 if ($compiler->smarty->merge_compiled_includes || isset($_attr['inline'])) {
35 // check if compiled code can be merged (contains no variable part)
36 if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) {
37 $tmp = null;
38 eval("\$tmp = $include_file;");
53 $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']);
54 // merge filedependency by evaluating header code
55 preg_match_all("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", $compiled_tpl, $result);
56 $saved_has_nocache_code = $compiler->template->has_nocache_code;
57 $saved_nocache_hash = $compiler->template->properties['nocache_hash'];
61 $compiler->template->has_nocache_code = $saved_has_nocache_code;
62 // remove header code
63 $compiled_tpl = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_tpl);
64 if ($tpl->has_nocache_code) {
65 // replace nocache_hash
Docblock.php (https://github.com/Unplagged/unplagged.git) PHP · 294 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: Docblock.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
Docblock.php (https://bitbucket.org/tschrock52/ethodeshare.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 20096 2010-01-06 02:05:09Z bkarwin $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 #require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
Cookie.php (https://bitbucket.org/cesarmedrano/cesarmedrano.git) PHP · 525 lines
1 <?php
3 namespace Guzzle\Plugin\Cookie;
440 // Root domains don't match except for .local.
441 if (!substr_count($realDomain, '.') && strcasecmp($realDomain, 'local')) {
442 return false;
443 }
446 // Match exact or 1 deep subdomain.
447 return !strcasecmp($domain, $realDomain) ||
448 substr_count(substr($domain, 0, -strlen($realDomain)), '.') === 1;
449 }
450 }
BaseChunk.php (https://gitlab.com/kamata4649/genisys) PHP · 267 lines
Compiler.php (https://gitlab.com/ShizuoLamperouge/Dashboard) PHP · 277 lines
1 <?php
3 /*
13 /**
14 * Compiles a node to PHP code.
15 *
16 * @author Fabien Potencier <fabien@symfony.com>
54 /**
55 * Gets the current PHP code after compilation.
56 *
57 * @return string The PHP code
213 // when mbstring.func_overload is set to 2
214 // mb_substr_count() replaces substr_count()
215 // but they have different signatures!
216 if (((int) ini_get('mbstring.func_overload')) & 2) {
AbstractDocElement.php (https://github.com/hatone/moodle.git) PHP · 327 lines
61 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
62 * @version Release: 1.1.0
63 * @link http://pear.php.net/package/PHP_CodeSniffer
64 */
65 abstract class PHP_CodeSniffer_CommentParser_AbstractDocElement implements PHP_CodeSniffer_CommentParser_DocElement
135 }
137 $this->phpcsFile = $phpcsFile;
139 $this->previousElement = $previousElement;
293 $previousLine = $this->previousElement->getLine();
295 return ($previousLine + substr_count($previousContent, $this->phpcsFile->eolChar));
296 }
Suites.php (https://github.com/antonioribeiro/ci.git) PHP · 186 lines
Birthday.php (https://gitlab.com/Afsana/Afsana_148423_B35_Session_31) PHP · 282 lines
1 <?php
3 namespace App\Birthday;
55 Message::message("Failed! Data Has Not Been Inserted Successfully :(");
57 Utility::redirect('create.php'); // redirect korte hobe create.php te tai utility.php use korechi //
59 }//end of store method
65 $fetchMode = strtoupper($fetchMode);
66 if(substr_count($fetchMode,'OBJ') > 0)
67 $STH->setFetchMode(PDO::FETCH_OBJ);
68 else
81 $fetchMode = strtoupper($fetchMode);
82 if(substr_count($fetchMode,'OBJ') > 0)
83 $STH->setFetchMode(PDO::FETCH_OBJ);
84 else
Docblock.php (https://bitbucket.org/sauron07/friend_social.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 24594 2012-01-05 21:27:01Z matthew $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 //require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
CSV.class.php (https://github.com/lievenjanssen/The-DataTank.git) PHP · 131 lines
1 <?php
2 /**
3 * This class handles a CSV file
8 * @author Jan Vansteenlandt
9 */
10 include_once ("model/resources/strategies/ATabularData.class.php");
11 class CSV extends ATabularData {
60 try {
61 // find the delimiter
62 $commas = substr_count($csv, ",", 0, strlen($csv)>127?127:strlen($csv));
63 $semicolons = substr_count($csv, ";", 0, strlen($csv)>127?127:strlen($csv));
BookTitle.php (https://gitlab.com/Princy008/Princy_143467_B37_Atomic_project) PHP · 395 lines
1 <?php
2 namespace App\BITM\SEIP143467\BookTitle;
3 use App\BITM\SEIP143467\Message\Message;
23 $sth=$DBH->prepare("select * from book_title WHERE is_deleted='0'");
24 $sth->execute();
25 if(substr_count($fetchMode,'OBJ') > 0)
26 $sth->setFetchMode(PDO::FETCH_OBJ);
27 else
73 else
74 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
75 Utility::redirect('index.php');
96 else
97 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
98 Utility::redirect('index.php');
IpUtils.php (https://gitlab.com/judielsm/Handora) PHP · 128 lines
1 <?php
3 /*
40 }
42 $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';
44 foreach ($ips as $ip) {
84 * In case a subnet is given, it checks if it contains the request IP.
85 *
86 * @author David Soria Parra <dsp at php dot net>
87 *
88 * @see https://github.com/dsp/v6tools
98 {
99 if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) {
100 throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
101 }
BookTitle.php (https://gitlab.com/muhammadhasan/Hasan_143132_B35_Session29_Pagination) PHP · 294 lines
1 <?php
2 namespace App\BookTitle;
3 use App\Message\Message;
50 Utility::redirect('create.php');
61 $fetchMode = strtoupper($fetchMode);
62 if(substr_count($fetchMode,'OBJ') > 0)
63 $STH->setFetchMode(PDO::FETCH_OBJ);
64 else
83 $fetchMode = strtoupper($fetchMode);
84 if(substr_count($fetchMode,'OBJ') > 0)
85 $STH->setFetchMode(PDO::FETCH_OBJ);
86 else
Docblock.php (https://github.com/gryzz/crystal_magento.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 18951 2009-11-12 16:26:19Z alexander $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 #require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
Docblock.php (https://github.com/timglabisch/pimcore.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 24593 2012-01-05 20:35:02Z matthew $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 // require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
util.php (https://github.com/aramk/IMDb-Scraper.git) PHP · 179 lines
1 <?php
3 function curl_get_html($url) {
25 // Count how many times the $needles occur in the $haystack
26 function substr_count_array( $haystack, $needles, $insensitive = TRUE ) {
27 $count = 0;
28 foreach ($needles as $substring) {
29 if ($insensitive) {
30 $count += substr_count_i( $haystack, $substring);
31 } else {
32 $count += substr_count( $haystack, $substring);
36 }
38 // Case insensitive substr_count
39 function substr_count_i( $haystack, $substring ) {
AbstractDocElement.php (https://github.com/r1zib/salesforce.git) PHP · 354 lines
61 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
62 * @version Release: 1.3.0RC1
63 * @link http://pear.php.net/package/PHP_CodeSniffer
64 */
65 abstract class PHP_CodeSniffer_CommentParser_AbstractDocElement implements PHP_CodeSniffer_CommentParser_DocElement
141 }
143 $this->phpcsFile = $phpcsFile;
145 $this->previousElement = $previousElement;
316 $previousLine = $this->previousElement->getLine();
318 return ($previousLine + substr_count($previousContent, $this->phpcsFile->eolChar));
319 }
AbstractDocElement.php (https://github.com/mikesname/ehri-ica-atom.git) PHP · 342 lines
61 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
62 * @version Release: @package_version@
63 * @link http://pear.php.net/package/PHP_CodeSniffer
64 */
65 abstract class PHP_CodeSniffer_CommentParser_AbstractDocElement implements PHP_CodeSniffer_CommentParser_DocElement
141 }
143 $this->phpcsFile = $phpcsFile;
145 $this->previousElement = $previousElement;
304 $previousLine = $this->previousElement->getLine();
306 return ($previousLine + substr_count($previousContent, $this->phpcsFile->eolChar));
307 }
Docblock.php (https://github.com/sas05/zf-1.11.x-doctrine-2.x.git) PHP · 294 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: Docblock.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {" . PHP_EOL . PHP_EOL;
96 $str .= " - Tags [" . count($this->_tags) . "] {" . PHP_EOL;
Emulative.php (https://gitlab.com/jjpa2018/dashboard) PHP · 248 lines
42 public function __construct(array $options = [])
43 {
44 $this->targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_1;
45 unset($options['phpVersion']);
63 // and the PHP version we're targeting for emulation.
64 foreach ($emulators as $emulator) {
65 $emulatorPhpVersion = $emulator->getPhpVersion();
66 if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) {
109 return version_compare(\PHP_VERSION, $emulatorPhpVersion, '<')
110 && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>=');
111 }
114 return version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=')
115 && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<');
116 }
Docblock.php (https://github.com/skoop/Gesichtbuch.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 6352 2010-08-16 15:02:45Z tpater $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 // require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
Ip.php (https://github.com/sdh100shaun/Linktuesday.com.git) PHP · 189 lines
NodeFieldFilterTest.php (https://gitlab.com/reasonat/test8) PHP · 109 lines
1 <?php
3 namespace Drupal\node\Tests\Views;
103 // the page twice as many times as the input count.
104 foreach ($counts as $langcode => $count) {
105 $this->assertEqual(substr_count($text, $this->nodeTitles[$langcode]), 2 * $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
106 }
107 }
DrupalInspector.php (https://github.com/grasmash/composerize-drupal.git) PHP · 180 lines
1 <?php
3 namespace Grasmash\ComposerConverter\Utility;
143 /**
144 * Determines the version of Drupal core by looking at Drupal.php contents.
145 *
146 * @param string $file_contents
147 * The contents of Drupal.php.
148 *
149 * @return mixed|string
150 */
151 public static function determineDrupalCoreVersionFromDrupalPhp($file_contents)
152 {
153 /**
ViewScriptTest.php (https://github.com/Exercise/zf2.git) PHP · 159 lines
class.cleaner.php (https://github.com/geekbuntu/Microweber.git) PHP · 379 lines
248 if($lastone == "CURLY_END" && $name == "T_WHITESPACE") $value = str_replace(" " , "" , $value);
250 if($name == "T_OPEN_TAG" && $value == "<?") $value = "<?php";
252 if($incond && $name== "SMALL_START") $smallso++;
322 if($value == '') $value = $token[0];
324 if($name == "T_WHITESPACE" && substr_count($value , chr(10))){
325 $value = str_replace(" " , "" , $value);
349 if($pname == "T_WHITESPACE"){
350 if(substr_count($pvalue , "\n")) $lb++;
351 }
CClientScriptTest.php (https://gitlab.com/RECITEC/yii) PHP · 481 lines
DateRangeList.class.php (https://github.com/bassta/onphp-framework.git) PHP · 202 lines
1 <?php
2 /***************************************************************************
3 * Copyright (C) 2005-2008 by Konstantin V. Arkhipov, Igor V. Gulyaev *
101 {
102 if (
103 (substr_count($string, ' - ') === 1)
104 || (substr_count($string, '-') === 1)
106 $delimiter = ' - ';
108 if (substr_count($string, '-') === 1)
109 $delimiter = '-';
145 if (strpos($date, '.') !== false) {
147 $fieldCount = substr_count($date, '.') + 1;
149 $year = null;
Compiler.php (https://github.com/benja-M-1/Silexor.git) PHP · 153 lines
1 <?php
2 /**
3 * This file is part of the Silexor Project
17 *
18 * Partly taken from Composer and Silex compiler class.
19 * @see https://github.com/composer/composer/blob/master/src/Composer/Compiler.php
20 * @see https://github.com/fabpot/Silex/blob/master/src/Silex/Compiler.php
39 $finder->files()
40 ->ignoreVCS(true)
41 ->name('*.php')
42 ->name('*.dist')
43 ->in(__DIR__.'/..')
44 ->notName('Compiler.php')
45 ->exclude('Tests');
BookTitle.php (https://gitlab.com/ajit57/ajitdas_143229_b35_session30_search_3rdparty) PHP · 183 lines
1 <?php
45 else
46 Message::setMessage("Failed ! Data has not been inserted Successfully ):");
47 Utility::redirect('index.php');
48 }//end of store
51 $STH = $this->DBH->query("SELECT * from book_title WHERE is_deleted='No'");
52 $fetchMode = strtoupper($fetchMode);
53 if(substr_count($fetchMode, 'OBJ') > 0)
54 $STH->setFetchMode(PDO::FETCH_OBJ);
55 else
61 $STH = $this->DBH->query('SELECT * from book_title where id='.$this->id);
62 $fetchMode = strtoupper($fetchMode);
63 if(substr_count($fetchMode,'OBJ') > 0)
64 $STH->setFetchMode(PDO::FETCH_OBJ);
65 else
Paginator.php (https://github.com/toastwaffle/chyrp.git) PHP · 231 lines
1 <?php
2 /**
3 * Class: Paginator
187 # Only used for adding to the end of the URL and clean URLs is off.
188 $mark = (substr_count($request, "?")) ? "&" : "?" ;
190 fallback($page, $this->page + 1);
216 # Only used for adding to the end of the URL and clean URLs is off.
217 $mark = (substr_count($request, "?")) ? "&" : "?" ;
219 fallback($page, $this->page - 1);
AnnotationScanner.php (https://github.com/kiranatama/sagalaya.git) PHP · 331 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
242 if ($MACRO_HAS_CONTEXT($CONTEXT_CONTENT) && $MACRO_HAS_CONTEXT($CONTEXT_ASTERISK)) {
243 $MACRO_TOKEN_SET_TYPE('ANNOTATION_CONTENT');
244 $annotationParentCount += substr_count($currentWord, '(');
245 $annotationParentCount -= substr_count($currentWord, ')');
DoctrineEntityGenerator.php (https://bitbucket.org/vvanuytven/php_auto.git) PHP · 119 lines
1 <?php
3 /*
48 $entityClass = $this->registry->getAliasNamespace($bundle->getName()).'\\'.$entity;
49 $entityPath = $bundle->getPath().'/Entity/'.str_replace('\\', '/', $entity).'.php';
50 if (file_exists($entityPath)) {
51 throw new \RuntimeException(sprintf('Entity "%s" already exists.', $entityClass));
91 if ($withRepository) {
92 $path = $bundle->getPath().str_repeat('/..', substr_count(get_class($bundle), '\\'));
93 $this->getRepositoryGenerator()->writeEntityRepositoryClass($class->customRepositoryClassName, $path);
94 }
Docblock.php (https://github.com/Freeaqingme/ZF1_Lib.git) PHP · 294 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: Docblock.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 // require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
ClassHeaderSniff.php (https://github.com/Gamepay/xp-contrib.git) PHP · 208 lines
17 if (class_exists('PHP_CodeSniffer_CommentParser_ClassCommentParser', true) === false) {
18 throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found');
19 }
138 // Parse the header comment docblock.
139 try {
140 $this->commentParser = new PHP_CodeSniffer_CommentParser_ClassCommentParser($comment, $phpcsFile);
141 $this->commentParser->parse();
142 } catch (PHP_CodeSniffer_CommentParser_ParserException $e) {
169 }
171 $newlineCount = (substr_count($short, $phpcsFile->eolChar) + 1);
173 // Exactly one blank line between short and long description.
176 if (empty($long) === false) {
177 $between = $comment->getWhiteSpaceBetween();
178 $newlineBetween = substr_count($between, $phpcsFile->eolChar);
179 if ($newlineBetween !== 2) {
180 //$error = 'There must be exactly one blank line between description and the ID Tag';
Router.php (https://gitlab.com/team_fsn/fsn-php) PHP · 272 lines
1 <?php
2 /**
3 * Yab Framework
147 $internal_params = trim(substr($internal, $opened_parenthesis + 1, $closed_parenthesis - $opened_parenthesis - 1));
149 if(preg_match_all('#\$[0-9]+#', $internal_params, $match) < substr_count($external, '*'))
150 throw new Yab_Exception('Wrong paramaeters count in this route');
270 }
272 // Do not clause PHP tags unless it is really necessary
BorderContainerTest.php (https://github.com/devilsansclue/ZendFramework.git) PHP · 139 lines
1 <?php
2 /**
3 * Zend Framework
23 // Call Zend_Dojo_View_Helper_BorderContainerTest::main() if this source file is executed directly.
24 if (!defined("PHPUnit_MAIN_METHOD")) {
25 define("PHPUnit_MAIN_METHOD", "Zend_Dojo_View_Helper_BorderContainerTest::main");
28 /** Zend_Dojo_View_Helper_BorderContainer */
29 require_once 'Zend/Dojo/View/Helper/BorderContainer.php';
31 /** Zend_View */
32 require_once 'Zend/View.php';
34 /** Zend_Registry */
db.php (https://github.com/jpvf/boilerplate.git) PHP · 295 lines
1 <?php if ( ! defined('BASE')) exit('Acceso directo prohibido');
3 class db extends Active_Record
258 if ($dashes === TRUE)
259 {
260 if (substr_count($str,'--') > 0)
261 {
262 $str = str_replace('--', '', $str);
263 }
265 if (substr_count($str, ';') > 0)
266 {
267 $str = str_replace(';', '', $str);
ClassesSniff.php (https://github.com/zakgrant/forkcms.git) PHP · 233 lines
17 *
18 * @return void
19 * @param PHP_CodeSniffer_File $phpcsFile The codesniffer file.
20 * @param mixed $stackPtr The stackpointer.
21 */
50 // find comment
51 if($phpcsFile->findPrevious(T_DOC_COMMENT, $stackPtr, $stackPtr - 4) === false) $phpcsFile->addError('PHPDoc expected before class', $stackPtr);
53 // get classname
65 // is it a fork class?
66 if(substr_count($className, 'Frontend') > 0 || substr_count($className, 'Backend') > 0 || substr_count($className, 'Api') > 0 || substr_count($className, 'Installer') > 0)
67 {
68 $folder = substr($phpcsFile->getFilename(), strpos($phpcsFile->getFilename(), DIRECTORY_SEPARATOR . 'default_www') + 1);
159 if(!$hasAuthor) $phpcsFile->addError('No author found in PHPDoc', $startComment);
160 if(!$hasSince) $phpcsFile->addError('No since found in PHPDoc', $startComment);
161 }
162 break;
PhpFileParser.php (https://github.com/heromantor/phpmorphy.git) PHP · 311 lines
82 * @return array|phpMorphy_Generator_PhpFileParser_ClassDescriptor|string
83 */
84 private function parsePhpDoc(phpMorphy_Generator_PhpFileParser_phpDoc $doc) {
85 $start_token = $this->tokens[$this->token_pos];
86 $tokens = $this->tokens;
279 substr_count($next_token[1], "\n") > 1
280 ) {
281 $file_descriptor->phpDoc = new phpMorphy_Generator_PhpFileParser_phpDoc($token);
282 break;
283 }
287 $file_descriptor->classes = array_merge(
288 $file_descriptor->classes,
289 $this->parsePhpDoc(new phpMorphy_Generator_PhpFileParser_phpDoc($token))
290 );
291 break;
extprofile_mb.h (https://github.com/tmjnaid/hiphop-php.git) C Header · 307 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 */
IpUtils.php (https://gitlab.com/hoangduys4k5/laravelproject) PHP · 181 lines
1 <?php
3 /*
39 }
41 $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4';
43 foreach ($ips as $ip) {
95 * In case a subnet is given, it checks if it contains the request IP.
96 *
97 * @author David Soria Parra <dsp at php dot net>
98 *
99 * @see https://github.com/dsp/v6tools
112 if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) {
113 throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
114 }
Multibyte.php (https://github.com/masihnewbie/cakephp.git) PHP · 1106 lines
6 * PHP 5
7 *
8 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
9 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
10 *
369 */
370 public static function stristr($haystack, $needle, $part = false) {
371 $php = (PHP_VERSION < 5.3);
373 if (($php && $part) || Multibyte::checkMultibyte($haystack)) {
709 */
710 public static function strstr($haystack, $needle, $part = false) {
711 $php = (PHP_VERSION < 5.3);
713 if (($php && $part) || Multibyte::checkMultibyte($haystack)) {
List.php (https://gitlab.com/ElvisAns/tiki) PHP · 194 lines
ClassesSniff.php (https://github.com/jasonweng/forkcms.git) PHP · 193 lines
57 // find comment
58 if($phpcsFile->findPrevious(T_DOC_COMMENT, $stackPtr, $stackPtr - 4) === false) $phpcsFile->addError('PHPDoc expected before class', $stackPtr);
60 // get classname
72 // is it a fork class?
73 if(substr_count($className, 'Frontend') > 0 || substr_count($className, 'Backend') > 0 || substr_count($className, 'Api') > 0 || substr_count($className, 'Installer') > 0)
74 {
75 $folder = substr($phpcsFile->getFilename(), strpos($phpcsFile->getFilename(), DIRECTORY_SEPARATOR . 'default_www') + 1);
121 if(!$hasAuthor)
122 {
123 $phpcsFile->addError('No author found in PHPDoc', $startComment);
124 }
125 }
Tokenizer.php (https://bitbucket.org/iiic/iszp.git) PHP · 301 lines
1 <?php
3 /**
83 $match = self::createToken($match[0], $type, $line);
84 $len += strlen($match['value']);
85 $line += substr_count($match['value'], "\n");
86 }
87 if ($len !== strlen($input)) {
99 if (isset($errorOffset)) {
100 $line = $errorOffset ? substr_count($this->input, "\n", 0, $errorOffset) + 1 : 1;
101 $col = $errorOffset - strrpos(substr($this->input, 0, $errorOffset), "\n") + 1;
102 $token = str_replace("\n", '\n', substr($input, $errorOffset, 10));
126 return array(
127 $offset,
128 ($offset ? substr_count($this->input, "\n", 0, $offset) + 1 : 1),
129 $offset - strrpos(substr($this->input, 0, $offset), "\n"),
130 );
StaticStringyTest.php (https://gitlab.com/judielsm/Handora) PHP · 710 lines
Regex.php (https://gitlab.com/I-NOZex/quiz) PHP · 323 lines
DiffusionInternalGitRawDiffQueryConduitAPIMethod.php (https://github.com/dannysu/phabricator.git) PHP · 123 lines
smarty_internal_configfilelexer.php (https://github.com/SquattingSasquatches/Lucidity.git) PHP · 606 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Configfilelexer
110 if ($r === null) {
111 $this->counter += strlen($this->value);
112 $this->line += substr_count($this->value, "\n");
113 // accept this token
114 return true;
119 } elseif ($r === false) {
120 $this->counter += strlen($this->value);
121 $this->line += substr_count($this->value, "\n");
122 if ($this->counter >= strlen($this->data)) {
123 return false; // end of input
217 if ($r === null) {
218 $this->counter += strlen($this->value);
219 $this->line += substr_count($this->value, "\n");
220 // accept this token
221 return true;
Summary_Of_Organization.php (https://gitlab.com/rahad777/atomic_project_Rahad_143368_B36) PHP · 273 lines
1 <?php
2 namespace App\Summary_Of_Organization;
3 use App\Message\Message;
43 else
44 Message::message("Failed! DATA HAS not BEEN INSERTED SUCCESSFULLY");
45 Utility::redirect('create.php');
46 }
47 public function index($fetchMode="ASSOC"){
52 $fetchMode = strtoupper($fetchMode);
53 if(substr_count($fetchMode, "OBJ")>0)
54 $STH->setFetchMode(PDO::FETCH_OBJ);
67 $fetchMode = strtoupper($fetchMode);
68 if(substr_count($fetchMode, "OBJ")>0)
69 $STH->setFetchMode(PDO::FETCH_OBJ);
70 else
City.php (https://gitlab.com/Nilufarjahan/LabExam8) PHP · 268 lines
1 <?php
2 namespace App\City;
3 use App\Model\database as DB;
53 else
54 Message::message("<div id='msg'></div><h5 align='center'>[ Name: $this->name ] ,[ Country: $this->country ], [ City: $this->city ] <br> Data Has not Been Inserted Successfully!</h5></div>");
55 Utility::redirect('create.php');
57 }
78 $fetchMode = strtoupper($fetchMode);
79 if(substr_count($fetchMode, "OBJ")>0) $STH->setFetchMode(PDO::FETCH_OBJ);
80 else $STH->setFetchMode(PDO::FETCH_ASSOC);
100 Message::message("<div id='message'><h3 align='center'> Failed! Data Has Not Been Updated Successfully!</h3></div>");
102 Utility::redirect('index.php');
function.math.php (https://github.com/exponentcms/exponent-cms.git) PHP · 142 lines
1 <?php
2 /**
3 * Smarty plugin
13 * Purpose: handle math computations in template
14 *
15 * @link https://www.smarty.net/manual/en/language.function.math.php {math}
16 * (Smarty online manual)
17 * @author Monte Ohrt <monte at ohrt dot com>
67 $equation = preg_replace('/\s+/', '', $equation);
69 // Adapted from https://www.php.net/manual/en/function.eval.php#107377
70 $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number
71 $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))';
80 // make sure parenthesis are balanced
81 if (substr_count($equation, '(') !== substr_count($equation, ')')) {
82 trigger_error("math: unbalanced parenthesis", E_USER_WARNING);
83 return;
tokenizer.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 261 lines
Admin.php (https://gitlab.com/sdlion/project_the_beginner_b35) PHP · 234 lines
1 <?php
2 namespace App\Admin;
102 $fetchMode = strtoupper($fetchMode);
103 if(substr_count($fetchMode,'OBJ') > 0)
104 $STH->setFetchMode(PDO::FETCH_OBJ);
105 else
119 $fetchMode = strtoupper($fetchMode);
120 if(substr_count($fetchMode,'OBJ') > 0)
121 $STH->setFetchMode(PDO::FETCH_OBJ);
122 else
140 $STH = $this->conn->prepare($sql);
141 $STH->execute($arrData);
142 Utility::redirect('index.php');
143 }
144 public function delete()
FormSelectTest.php (https://github.com/bhaumik25/zend-framework.git) PHP · 292 lines
1 <?php
2 // Call Zend_View_Helper_FormSelectTest::main() if this source file is executed directly.
3 if (!defined("PHPUnit_MAIN_METHOD")) {
4 define("PHPUnit_MAIN_METHOD", "Zend_View_Helper_FormSelectTest::main");
5 }
7 require_once dirname(__FILE__) . '/../../../TestHelper.php';
9 require_once 'Zend/View/Helper/FormSelect.php';
10 require_once 'Zend/View.php';
12 /**
Ip.php (https://github.com/eschabell/openshift-zendframework.git) PHP · 191 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: Ip.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Validate_Abstract
24 */
25 require_once 'Zend/Validate/Abstract.php';
27 /**
106 if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
107 require_once 'Zend/Validate/Exception.php';
108 throw new Zend_Validate_Exception('Nothing to validate. Check your options');
109 }
bootstrap.php (https://github.com/livinglab/openlab.git) PHP · 257 lines
1 <?php
3 namespace SimpleCalendar\plugin_deps;
12 */
13 use SimpleCalendar\plugin_deps\Symfony\Polyfill\Mbstring as p;
14 if (\PHP_VERSION_ID >= 80000) {
15 return require __DIR__ . '/bootstrap80.php';
195 }
196 }
197 if (!\function_exists('mb_substr_count')) {
198 function mb_substr_count($haystack, $needle, $encoding = null)
199 {
200 return p\Mbstring::mb_substr_count($haystack, $needle, $encoding);
201 }
202 }
class-IXR-message.php (https://github.com/AJenbo/ubuntudanmark.dk.git) PHP · 234 lines
1 <?php
3 /**
30 /**
31 * PHP5 constructor.
32 */
33 function __construct( $message )
38 /**
39 * PHP4 constructor.
40 */
41 public function IXR_Message( $message ) {
46 {
47 if ( ! function_exists( 'xml_parser_create' ) ) {
48 trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
49 return false;
50 }
HtmlTrait.php (https://gitlab.com/afzalpotenza/YII_salon) PHP · 168 lines
QueryBuilder.php (https://github.com/voidit/chyrp.git) PHP · 449 lines
1 <?php
2 /**
3 * Class: QueryBuilder
374 $cond = $key." NOT LIKE :".$param;
375 $params[":".$param] = $val;
376 } elseif (substr_count($key, " ")) { # Custom operation, e.g. array("foo >" => $bar)
377 list($param,) = explode(" ", $key);
378 $param = str_replace(array("(", ")", "."), "_", $param);
426 # Does it not already have a table specified?
427 if (!substr_count($full, ".")) {
428 # Don't replace things that are already either prefixed or paramized.
429 $field = preg_replace("/([^\.:'\"_]|^)".preg_quote($full, "/")."/",
ArrayOfTypeComplex.php (https://github.com/leerbag/zf2.git) PHP · 141 lines
1 <?php
2 /**
3 * Zend Framework
55 }
57 $singularType = $this->_getSingularPhpType($type);
58 $nestingLevel = $this->_getNestedCount($type);
120 /**
121 * From a nested definition with type[], get the singular PHP Type
122 *
123 * @param string $type
124 * @return string
125 */
126 protected function _getSingularPhpType($type)
127 {
128 return str_replace('[]', '', $type);
ProgressIndicatorTest.php (https://gitlab.com/martinstti/silex-microframework-rest) PHP · 179 lines
1 <?php
3 namespace Symfony\Component\Console\Tests\Helper;
6 use Symfony\Component\Console\Output\StreamOutput;
8 class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
9 {
10 public function testDefaultIndicator()
43 $this->generateOutput(' | Advancing...').
44 $this->generateOutput(' | Done... ').
45 PHP_EOL.
46 $this->generateOutput(' - Starting Again...').
47 $this->generateOutput(' \\ Starting Again...').
70 ' Midway... '.PHP_EOL.
71 ' Done... '.PHP_EOL.PHP_EOL,
72 stream_get_contents($output->getStream())
73 );
FileReflection.php (https://github.com/kiranatama/sagalaya.git) PHP · 314 lines
Lexer.class.php (https://github.com/thekid/xp-experiments.git) PHP · 188 lines
1 <?php
2 /* This class is part of the XP framework's experiments
3 *
90 // Check for whitespace
91 if (FALSE !== strpos(" \n\r\t", $token)) {
92 $l= substr_count($token, "\n");
93 $this->position[1]= strlen($token) + ($l ? 1 : $this->position[1]);
94 $this->position[0]+= $l;
121 }
122 $t= $this->tokenizer->nextToken('/');
123 $l= substr_count($t, "\n");
124 $this->position[1]= strlen($t) + ($l ? 1 : $this->position[1]);
125 $this->position[0]+= $l;
ClassScanner.php (https://github.com/jtai/zf2.git) PHP · 670 lines
drupal.php (https://gitlab.com/ptisky/API_prestashop) PHP · 134 lines
info.class.php (https://github.com/pschichtel/Infected-CMS.git) PHP · 390 lines
1 <?php
2 defined('MODE') or die('<strong>Access denied!</strong>');
181 private function getCmsPath()
182 {
183 $this->cmsPath = dirname($_SERVER['PHP_SELF']) . '/';
184 $this->log->write(2, 'info', "CMS path: {$this->cmsPath}");
185 }
199 $path .= 'moduls/';
200 if (
201 substr_count($modul, '.') ||
202 !file_exists($path . $_GET['modul'] . '.modul.php')
207 }
208 $this->modul = &$modul;
209 $this->modulFile = $path . $modul . '.modul.php';
210 }
211 elseif (isset($_GET['helper']))
KSchedulerConfig.class.php (https://github.com/richhl/kalturaCE.git) PHP · 596 lines
1 <?php
2 /**
3 * @package Scheduler
230 $task->friendlyName = $taskData->friendlyName ; //7;
231 $task->maxJobsEachRun = $taskData->maxJobsEachRun ; //7;
232 $task->scriptPath = $taskData->scriptPath ; // "php C:/web/kaltura/support_prod/test/procmgr/class1.php";
233 $task->scriptArgs= $taskData->scriptArgs ; // "1";
234 $task->maxInstances = $taskData->maxInstances ; // 1;
288 /**
289 * taken from http://www.zfforum.de/showthread.php?t=1453
290 */
291 private function configArrayToIni($config, $parentPrefix = false, $lastPrefixCount = 0)
301 $prefix = $parentPrefix . '.' . $prefix;
302 }
303 $prefixCount = substr_count($prefix, '.');
304 if(is_array($v))
305 {
Ip.php (https://github.com/kervin/kyzstudio.git) PHP · 191 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Ip.php 22668 2010-07-25 14:50:46Z thomas $
20 */
23 * @see Zend_Validate_Abstract
24 */
25 #require_once 'Zend/Validate/Abstract.php';
27 /**
106 if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
107 #require_once 'Zend/Validate/Exception.php';
108 throw new Zend_Validate_Exception('Nothing to validate. Check your options');
109 }
JsonFile.php (https://github.com/kelvinj/composer.git) PHP · 138 lines
1 <?php
3 /*
122 $msg = 'Syntax error';
123 if (preg_match('#["}\]]\s*(,)\s*\}#', $json, $match, PREG_OFFSET_CAPTURE)) {
124 $msg .= ', extra comma on line '.(substr_count(substr($json, 0, $match[1][1]), "\n")+1);
125 } elseif (preg_match('#(\'.+?\' *:|: *\'.+?\')#', $json, $match, PREG_OFFSET_CAPTURE)) {
126 $msg .= ', use double quotes (") instead of single quotes (\') on line '.(substr_count(substr($json, 0, $match[1][1]), "\n")+1);
Docblock.php (https://github.com/cpatrick/Midas3.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 20096 2010-01-06 02:05:09Z bkarwin $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 // require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
AbstractField.php (https://gitlab.com/madwanz64/laravel) PHP · 286 lines
SwitchSniff.php (https://github.com/acoulton/coding-standards.git) PHP · 147 lines
10 * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
11 * @version CVS: $Id$
12 * @link http://pear.php.net/package/PHP_CodeSniffer
13 */
42 * Processes this test, when one of its tokens is encountered.
43 *
44 * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the
45 * document
46 * @param int $stackPtr Position of the current token in the stack passed
48 * @return void
49 */
50 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
51 {
52 $tokens = $phpcsFile->getTokens();
ListTrait.php (https://gitlab.com/Griffolion/Game-Embargo-Tracker) PHP · 182 lines
1 <?php
2 /**
3 * @copyright Copyright (c) 2014 Carsten Brandt
82 // match list marker on the beginning of the line
83 if (preg_match($type == 'ol' ? '/^( {0,'.$leadSpace.'})(\d+)\.[ \t]+/' : '/^( {0,'.$leadSpace.'})\\'.$marker.'[ \t]+/', $line, $matches)) {
84 if (($len = substr_count($matches[0], "\t")) > 0) {
85 $indent = str_repeat("\t", $len);
86 $line = substr($line, strlen($matches[0]));
Ip.php (https://gitlab.com/Ltaimao/wecenter) PHP · 192 lines
1 <?php
2 /**
3 * Zend Framework
23 * @see Zend_Validate_Abstract
24 */
25 //require_once 'Zend/Validate/Abstract.php';
27 /**
106 if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
107 //require_once 'Zend/Validate/Exception.php';
108 throw new Zend_Validate_Exception('Nothing to validate. Check your options');
109 }
178 }
180 $colonCount = substr_count($value, ':');
181 if ($colonCount < 8) {
182 return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\z/i', $value);
function.mb-substr-count.html (https://bitbucket.org/thncr/manuals.git) HTML · 123 lines
10 <div class="next" style="text-align: right; float: right;"><a href="function.mb-substr.html">mb_substr</a></div>
11 <div class="up"><a href="ref.mbstring.html">多字节字符串 函数</a></div>
12 <div class="home"><a href="index.html">PHP Manual</a></div>
13 </div><hr /><div id="function.mb-substr-count" class="refentry">
14 <div class="refnamediv">
15 <h1 class="refname">mb_substr_count</h1>
16 <p class="verinfo">(PHP 4 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">mb_substr_count</span> — <span class="dc-title">统计字符串出现的次数</span></p>
18 </div>
21 <h3 class="title">说明</h3>
22 <div class="methodsynopsis dc-description">
23 <span class="type">int</span> <span class="methodname"><strong>mb_substr_count</strong></span>
24 ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$haystack</code></span>
25 , <span class="methodparam"><span class="type">string</span> <code class="parameter">$needle</code></span>
95 <div class="phpcode"><code><span style="color: #000000">
96 <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">mb_substr_count</span><span style="color: #007700">(</span><span style="color: #DD0000">"This is a test"</span><span style="color: #007700">, </span><span style="color: #DD0000">"is"</span><span style="color: #007700">); </span><span style="color: #FF8000">// 输出 2<br /></span><span style="color: #0000BB">?></span>
97 </span>
98 </code></div>
query.php
(http://forceworkbench.googlecode.com/svn/trunk/workbench/)
PHP · 996 lines
✨ Summary
This PHP code is part of a Salesforce Workbench application, handling query-related functionality. It generates query results, exports data to CSV, and allows users to execute queries asynchronously. The code also handles errors, warnings, and export options, providing a user-friendly interface for interacting with Salesforce data.
This PHP code is part of a Salesforce Workbench application, handling query-related functionality. It generates query results, exports data to CSV, and allows users to execute queries asynchronously. The code also handles errors, warnings, and export options, providing a user-friendly interface for interacting with Salesforce data.
3 require_once 'soxl/QueryObjects.php';
4 require_once 'session.php';
5 require_once 'shared.php';
65 //query is processed by the correct function
66 if (isset($_POST['queryMore']) && isset($_SESSION['queryLocator'])) {
67 require_once 'header.php';
68 // $queryRequest->setExportTo('screen');
69 displayQueryForm($queryRequest);
99 print "<p> </p>";
100 displayError("count() is not supported for CSV. View as List or choose fields and try again.");
101 include_once 'footer.php';
102 }
103 } else {
937 if ($records) {
938 try {
939 $csvFile = fopen('php://output','w') or die("Error opening php://output");
940 $csvFilename = "export" . date('YmdHis') . ".csv";
941 header("Content-Type: application/csv");
Ajax.php (https://gitlab.com/che234/adn) PHP · 183 lines
1 <?php
2 /**
3 * @version $Id: Ajax.php 10831 2013-05-29 19:32:17Z btowles $
133 echo "ERROR [$errno] $errstr\n";
134 echo " Fatal error on line $errline in file $errfile";
135 echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n";
136 echo "Aborting...\n";
137 exit(1);
151 }
153 /* Don't execute PHP internal error handler */
154 return true;
155 }
162 public static function smartStripSlashes($str)
163 {
164 $cd1 = substr_count($str, "\"");
165 $cd2 = substr_count($str, "\\\"");
Ip.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 192 lines
1 <?php
2 /**
3 * Zend Framework
23 * @see Zend_Validate_Abstract
24 */
25 require_once 'Zend/Validate/Abstract.php';
27 /**
106 if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
107 require_once 'Zend/Validate/Exception.php';
108 throw new Zend_Validate_Exception('Nothing to validate. Check your options');
109 }
178 }
180 $colonCount = substr_count($value, ':');
181 if ($colonCount < 8) {
182 return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\z/i', $value);
DoctrineEntityGenerator.php (https://github.com/israelnoguera/parejas.git) PHP · 119 lines
1 <?php
3 /*
48 $entityClass = $this->registry->getEntityNamespace($bundle->getName()).'\\'.$entity;
49 $entityPath = $bundle->getPath().'/Entity/'.str_replace('\\', '/', $entity).'.php';
50 if (file_exists($entityPath)) {
51 throw new \RuntimeException(sprintf('Entity "%s" already exists.', $entityClass));
91 if ($withRepository) {
92 $path = $bundle->getPath().str_repeat('/..', substr_count(get_class($bundle), '\\'));
93 $this->getRepositoryGenerator()->writeEntityRepositoryClass($class->customRepositoryClassName, $path);
94 }
Cookie.php (https://bitbucket.org/dgavey/rps-hack.git) PHP · 462 lines
1 <?php
3 namespace Guzzle\Http;
411 // Root domains don't match except for .local.
412 if (!substr_count($realDomain, '.') && strcasecmp($realDomain, 'local')) {
413 return false;
414 }
417 // Match exact or 1 deep subdomain.
418 return !strcasecmp($domain, $realDomain) ||
419 substr_count(substr($domain, 0, -strlen($realDomain)), '.') === 1;
420 }
421 }
Ip.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 192 lines
1 <?php
2 /**
3 * Zend Framework
23 * @see Zend_Validate_Abstract
24 */
25 #require_once 'Zend/Validate/Abstract.php';
27 /**
106 if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
107 #require_once 'Zend/Validate/Exception.php';
108 throw new Zend_Validate_Exception('Nothing to validate. Check your options');
109 }
178 }
180 $colonCount = substr_count($value, ':');
181 if ($colonCount < 8) {
182 return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\z/i', $value);
SummaryOfOrganization.php (https://gitlab.com/Soikot/AtomicProject_AmirulIslam_152207) PHP · 404 lines
1 <?php
2 namespace App\BITM\SEIP152207\SummaryOfOrganization;
3 use App\BITM\SEIP152207\Message\Message;
23 $sth=$DBH->prepare("select * from summary_of_organization where is_deleted='0'");
24 $sth->execute();
25 if(substr_count($fetchMode,'OBJ') > 0)
26 $sth->setFetchMode(PDO::FETCH_OBJ);
27 else
81 Utility::redirect('create.php');
103 else
104 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
105 Utility::redirect('index.php');
SummaryOfOrganization.php (https://gitlab.com/Princy008/Princy_143467_B_37_Atomic_project) PHP · 404 lines
1 <?php
2 namespace App\BITM\SEIP143467\SummaryOfOrganization;
3 use App\BITM\SEIP143467\Message\Message;
23 $sth=$DBH->prepare("select * from summary_of_organization where is_deleted='0'");
24 $sth->execute();
25 if(substr_count($fetchMode,'OBJ') > 0)
26 $sth->setFetchMode(PDO::FETCH_OBJ);
27 else
81 Utility::redirect('create.php');
103 else
104 Message::message("<div id='msg'></div><h3 align='center'> <br> Data Hasn't Been Inserted !</h3></div>");
105 Utility::redirect('index.php');
Docblock.php (https://github.com/cosmocommerce/magento-mirror.git) PHP · 294 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Docblock.php 24593 2012-01-05 20:35:02Z matthew $
20 */
23 * @see Zend_Reflection_Docblock_Tag
24 */
25 #require_once 'Zend/Reflection/Docblock/Tag.php';
27 /**
93 public function __toString()
94 {
95 $str = "Docblock [ /* Docblock */ ] {".PHP_EOL.PHP_EOL;
96 $str .= " - Tags [".count($this->_tags)."] {".PHP_EOL;
Multibyte.php (https://github.com/suzuki/candycane.git) PHP · 1134 lines
6 * PHP 5
7 *
8 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
9 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
10 *
396 */
397 public static function stristr($haystack, $needle, $part = false) {
398 $php = (PHP_VERSION < 5.3);
400 if (($php && $part) || Multibyte::checkMultibyte($haystack)) {
736 */
737 public static function strstr($haystack, $needle, $part = false) {
738 $php = (PHP_VERSION < 5.3);
740 if (($php && $part) || Multibyte::checkMultibyte($haystack)) {
smarty_internal_configfilelexer.php (https://github.com/laurentc/NApf.git) PHP · 548 lines
1 <?php
2 /**
3 * Smarty Internal Plugin Configfilelexer
107 if ($r === null) {
108 $this->counter += strlen($this->value);
109 $this->line += substr_count($this->value, "\n");
110 // accept this token
111 return true;
116 } elseif ($r === false) {
117 $this->counter += strlen($this->value);
118 $this->line += substr_count($this->value, "\n");
119 if ($this->counter >= strlen($this->data)) {
120 return false; // end of input
221 if ($r === null) {
222 $this->counter += strlen($this->value);
223 $this->line += substr_count($this->value, "\n");
224 // accept this token
225 return true;
String.php (https://github.com/fanboyJD/styx.git) PHP · 290 lines
1 <?php
2 /**
3 * Styx::String - Acts as a wrapper to String methods. Either uses the mbstring extension
4 * or falls back to the native php functions.
5 *
6 * @package Styx
20 public static $Fn = array();
21 /**
22 * Holds information about the currently installed php extensions related
23 * to this Class
24 *
35 /**
36 * Initializes the String class and decides whether to use mbstring or native php string functions
37 * based on the feature settings passed in
38 *
smarty_internal_compile_include.php (https://github.com/pws5068/RSNCorp.git) PHP · 145 lines
1 <?php
3 /**
33 if ($compiler->smarty->merge_compiled_includes || isset($_attr['inline'])) {
34 // check if compiled code can be merged (contains no variable part)
35 if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) {
36 eval("\$tmp = $include_file;");
37 if ($this->compiler->template->template_resource != $tmp) {
49 $compiled_tpl = $tpl->getCompiledTemplate();
50 // remove header code
51 $compiled_tpl = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_tpl);
52 if ($tpl->has_nocache_code) {
53 // replace nocache_hash
108 }
109 // create template object
110 $_output = "<?php \$_template = new {$compiler->smarty->template_class}($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);\n";
111 // delete {include} standard attributes
112 unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']);