88+ results for 'php str_replace' (0 ms)
Not the results you expected?
unit_tester.php (https://github.com/paintitgold/myspace-php-sdk.git) PHP · 420 lines
1 <?php
2 /**
3 * base include file for SimpleTest
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: unit_tester.php 1723 2008-04-08 00:34:10Z lastcraft $
7 */
10 * include other SimpleTest class files
11 */
12 require_once(dirname(__FILE__) . '/test_case.php');
13 require_once(dirname(__FILE__) . '/dumper.php');
16 /**
17 * Standard unit test class for day to day testing
18 * of PHP code XP style. Adds some useful standard
19 * assertions.
20 * @package SimpleTest
TimeHelperTest.php (https://github.com/masihnewbie/cakephp.git) PHP · 780 lines
1 <?php
2 /**
3 * TimeHelperTest file
5 * PHP 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package Cake.Test.Case.View.Helper
16 * @since CakePHP(tm) v 1.2.0.4206
17 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18 */
19 App::uses('TimeHelper', 'View/Helper');
xml.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 647 lines
1 <?php
2 /**
3 * base include file for SimpleTest
10 * include other SimpleTest class files
11 */
12 require_once(dirname(__FILE__) . '/scorer.php');
13 /**#@-*/
56 */
57 function toParsedXml($text) {
58 return str_replace(
59 array('&', '<', '>', '"', '\''),
60 array('&', '<', '>', '"', '''),
time.test.php (https://github.com/cgajardo/repositorium.git) PHP · 803 lines
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package cake
16 * @subpackage cake.tests.cases.libs.view.helpers
17 * @since CakePHP(tm) v 1.2.0.4206
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
19 */
20 if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
21 define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
comment-template.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 1459 lines
1 <?php
2 /**
3 * Comment template functions
265 * @return string Comment author's IP address.
266 */
267 function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
268 $comment = get_comment( $comment_ID );
278 * @param WP_Comment $comment The comment object.
279 */
280 return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
281 }
290 * Default current comment.
291 */
292 function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
293 echo esc_html( get_comment_author_IP( $comment_ID ) );
294 }
XmlVisitorTest.php (https://gitlab.com/x33n/respond) PHP · 558 lines
1 <?php
3 namespace Guzzle\Tests\Service\Command\LocationVisitor\Request;
306 ->setConstructorArgs(array($input, $operation))
307 ->getMockForAbstractClass();
308 $command->setClient(new Client('http://www.test.com/some/path.php'));
309 $request = $command->prepare();
310 if (!empty($input)) {
313 $this->assertNull($request->getHeader('Content-Type'));
314 }
315 $body = str_replace(array("\n", "<?xml version=\"1.0\"?>"), '', (string) $request->getBody());
316 $this->assertEquals($xml, $body);
317 }
page.php (https://gitlab.com/x33n/respond) PHP · 1684 lines
1 <?php
3 /**
117 if(FILES_ON_S3 == true){
118 $bucket = $site['Bucket'];
119 $imagesURL = str_replace('{{bucket}}', $bucket, S3_URL);
120 $imagesURL = str_replace('{{site}}', $site['FriendlyId'], $imagesURL);
431 // remove file
432 $filename = $filename.$page['FriendlyId'].'.php';
434 if(file_exists($filename)){
926 // strip leading '../' from string
927 $url = str_replace('../', '', $url);
929 $response = new Tonic\Response(Tonic\Response::OK);
file.php (https://gitlab.com/x33n/respond) PHP · 591 lines
1 <?php
3 /**
70 // set URL if on S3
71 if(FILES_ON_S3 == true){
72 $url = str_replace('{{bucket}}', $site['Bucket'], S3_URL);
73 $url = str_replace('{{site}}', $site['FriendlyId'], $url);
107 S3::SaveContents($site, $type, $filename, $file, $meta, $folder);
109 $url = str_replace('{{bucket}}', $site['Bucket'], S3_URL);
110 $url = str_replace('{{site}}', $site['FriendlyId'], $url);
Page.php (https://gitlab.com/x33n/respond) PHP · 788 lines
1 <?php
3 // Page DAO
15 // cleanup friendlyid (escape, trim, remove spaces, tolower)
16 $friendlyId = trim($friendlyId);
17 $friendlyId = str_replace(' ', '', $friendlyId);
18 $friendlyId = strtolower($friendlyId);
82 // cleanup friendlyid (escape, trim, remove spaces, tolower)
83 $friendlyId = trim($friendlyId);
84 $friendlyId = str_replace(' ', '', $friendlyId);
85 $friendlyId = strtolower($friendlyId);
comment-template.php (https://gitlab.com/Blueprint-Marketing/WordPress-1) PHP · 1475 lines
1 <?php
2 /**
3 * Comment template functions
305 $url = get_comment_author_url();
306 $display = ($linktext != '') ? $linktext : $url;
307 $display = str_replace( 'http://www.', '', $display );
308 $display = str_replace( 'http://', '', $display );
694 if ( $number > 1 )
695 $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
696 elseif ( $number == 0 )
697 $output = ( false === $zero ) ? __('No Comments') : $zero;
866 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
867 else
868 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
870 /**
comment-template.php (https://gitlab.com/webkod3r/tripolis) PHP · 1517 lines
1 <?php
2 /**
3 * Comment template functions
358 $url = get_comment_author_url();
359 $display = ($linktext != '') ? $linktext : $url;
360 $display = str_replace( 'http://www.', '', $display );
361 $display = str_replace( 'http://', '', $display );
566 function get_comment_excerpt( $comment_ID = 0 ) {
567 $comment = get_comment( $comment_ID );
568 $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) );
569 $words = explode( ' ', $comment_text );
874 } else {
875 // % Comments
876 $output = str_replace( '%', number_format_i18n( $number ), $more );
877 }
878 } elseif ( $number == 0 ) {
SQLiteGrammar.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 625 lines
class-search-functions.php (https://github.com/NateJacobs/Brickset-API.git) PHP · 697 lines
1 <?php
3 class BricksetAPISearch extends BricksetAPIUtilities
70 $theme = sanitize_text_field( strtolower( $theme ) );
71 $transient_theme = str_replace( " ", "", $theme );
73 $transient = 'bs_'.$transient_theme.'_subthemes';
114 $theme = sanitize_text_field( strtolower( $theme ) );
115 $transient_theme = str_replace( " ", "", $theme );
117 $transient = 'bs_'.$transient_theme.'_years';
195 return $validate_year;
197 $transient_date = str_replace( '/', '', $date );
199 $transient = 'bs_updated_since_'.$transient_date;
time.test.php (https://github.com/motaheri/Coordino.git) PHP · 803 lines
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package cake
16 * @subpackage cake.tests.cases.libs.view.helpers
17 * @since CakePHP(tm) v 1.2.0.4206
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
19 */
20 if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
21 define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
TextData.php (https://github.com/markn86/moodle.git) PHP · 676 lines
1 <?php
3 namespace PhpOffice\PhpSpreadsheet\Calculation;
5 use DateTimeInterface;
6 use PhpOffice\PhpSpreadsheet\Shared\Date;
7 use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
8 use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
10 class TextData
60 if (is_string($stringValue) || is_numeric($stringValue)) {
61 return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F"));
62 }
Database.php (https://github.com/markn86/moodle.git) PHP · 608 lines
1 <?php
3 namespace PhpOffice\PhpSpreadsheet\Calculation;
5 class Database
96 $dataValue = $dataValues[$k];
97 $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
98 $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
99 }
100 }
controller.action.php (https://github.com/mayurr/ND.git) PHP · 795 lines
1 <?php
2 session_start();
3 include_once ("../Model/class.give.php");
4 include_once ("../Model/class.get.php");
5 include_once ("../Model/class.object.php");
6 include_once ("../Model/class.applicant.php");
7 include_once ("../Model/class.user.php");
8 include_once ("../Model/class.action.php");
9 include_once ("../Model/class.mail.php");
347 }
348 $json .= "]";
349 str_replace("},]", "}]", $json);
351 $count = 0;
unit_tester.php (https://github.com/hatone/moodle.git) PHP · 420 lines
1 <?php
2 /**
3 * base include file for SimpleTest
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: unit_tester.php,v 1.5 2010/12/14 17:35:45 moodlerobot Exp $
7 */
10 * include other SimpleTest class files
11 */
12 require_once(dirname(__FILE__) . '/test_case.php');
13 require_once(dirname(__FILE__) . '/dumper.php');
16 /**
17 * Standard unit test class for day to day testing
18 * of PHP code XP style. Adds some useful standard
19 * assertions.
20 * @package SimpleTest
time.test.php (https://github.com/mickey390/cakephp.git) PHP · 810 lines
1 <?php
2 /**
3 * TimeHelperTest file
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package cake
16 * @subpackage cake.tests.cases.libs.view.helpers
17 * @since CakePHP(tm) v 1.2.0.4206
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
categories.php (https://bitbucket.org/seyar/kinda.local.git) PHP · 978 lines
149 $val['prices'] = $curr->getPrice( $rows[$key] );
150 $val['seo_url'] = $val['seo_url'] ? str_replace( self::$url_search, self::$url_replace, urlencode($val['seo_url']) ) : str_replace( self::$url_search, self::$url_replace, Controller_Admin::to_url( $val['name'] ));
151 $val['seo_url'] = str_replace( '__', '_', $val['seo_url'] );
288 $val['prices'] = $curr->getPrice( $rows );
289 $val['seo_url'] = $val['seo_url'] ? str_replace( self::$url_search, self::$url_replace, urlencode( $val['seo_url'] ) ) : str_replace( self::$url_search, self::$url_replace, Controller_Admin::to_url( $val['name'] ));
290 $val['seo_url'] = str_replace( '__', '_', $val['seo_url'] );
751 $rows = $query->execute()->as_array();
752 $val['prices'] = $curr->getPrice( $rows );
753 $val['seo_url'] = $val['seo_url'] ? str_replace( self::$url_search, self::$url_replace, urlencode( $val['seo_url'] ) ) : str_replace( self::$url_search, self::$url_replace, Controller_Admin::to_url( $val['name'] ));
754 $val['seo_url'] = str_replace( '__', '_', $val['seo_url'] );
755 $val['seo_url'] = str_replace( '__', '_', $val['seo_url'] );
756 $val['category_url'] = $val['category_url'] ? str_replace( self::$url_search, self::$url_replace, urlencode( $val['category_url'] ) ) : str_replace( self::$url_search, self::$url_replace, Controller_Admin::to_url( $val['category_name'] ));
757 $val['category_url'] = str_replace( '__', '_', $val['category_url'] );
goods.php (https://bitbucket.org/seyar/kinda.local.git) PHP · 1153 lines
1 <?php
2 defined( 'SYSPATH' ) OR die( 'No direct access allowed.' );
13 foreach( Controller_Goods::$goods_status_list as $value )
14 $statuses[$value] = I18n::get( ucfirst( str_replace( '_', ' ', $value ) ) );
16 return $statuses;
441 // $replace = array('#','?','/','&', "'",'/', '"');
442 $replace = array( '', '', '', '', '', '','_','_','_', '', '','','','','(',')','','','','','' );
443 $post['seo_url'] = $post['seo_url'] ? str_replace( $search, $replace, urlencode($post['seo_url']) ) : str_replace( $search, $replace, Controller_Admin::to_url( $post['name'] ));
444 $post['seo_url'] = str_replace( '__', '_', $post['seo_url'] );
445 $seourl = strtolower( str_replace( '__', '_', $post['seo_url'] ));
447 if( (int)$id )
Procedure.class.php (https://github.com/md-tech/openemr.git) PHP · 1418 lines
Diagnosis.class.php (https://github.com/md-tech/openemr.git) PHP · 592 lines
unit_tester.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 420 lines
1 <?php
2 /**
3 * base include file for SimpleTest
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: unit_tester.php 2460 2008-04-08 21:03:22Z mz $
7 */
10 * include other SimpleTest class files
11 */
12 require_once(dirname(__FILE__) . '/test_case.php');
13 require_once(dirname(__FILE__) . '/dumper.php');
16 /**
17 * Standard unit test class for day to day testing
18 * of PHP code XP style. Adds some useful standard
19 * assertions.
20 * @package SimpleTest
WikiForumClass.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 1745 lines
DataCenter.ui.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 1145 lines
1 <?php
2 /**
3 * UI Class for DataCenter extension
52 /**
53 * Converts a PHP value to a javascript object
54 * @param value Associative Array to convert
55 */
72 /**
73 * Converts a PHP value to a javascript array
74 * @param value Array or Scalar to convert
75 */
92 /**
93 * Converts a PHP value to a javascript value
94 * @param value Array or Scalar to convert, if value is string
95 * it will be escaped and surrounded by quotes
Expr.php (https://github.com/jaikdean/doctrine2.git) PHP · 661 lines
1 <?php
3 declare(strict_types=1);
11 use function is_numeric;
12 use function is_string;
13 use function str_replace;
15 /**
16 * This class is used to generate DQL expressions via a set of PHP static functions.
17 *
18 * @todo Rename: ExpressionBuilder
25 * Example:
26 *
27 * [php]
28 * // (u.type = ?1) AND (u.role = ?2)
29 * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2'));
address.php (https://github.com/sansanwawa/e-commerse.git) PHP · 532 lines
1 <?php
2 class ControllerAccountAddress extends Controller {
3 private $error = array();
211 $this->data['addresses'][] = array(
212 'address_id' => $result['address_id'],
213 'address' => str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format)))),
214 'update' => $this->url->link('account/address/update', 'address_id=' . $result['address_id'], 'SSL'),
215 'delete' => $this->url->link('account/address/delete', 'address_id=' . $result['address_id'], 'SSL')
QueryBuilder.php (https://github.com/voidit/chyrp.git) PHP · 449 lines
1 <?php
2 /**
3 * Class: QueryBuilder
60 if (empty($params))
61 foreach ($data as $key => $val)
62 $params[":".str_replace(array("(", ")", "."), "_", $key)] = $val;
64 return "INSERT INTO __$table\n".
322 if (substr($key, -4) == " not") { # Negation
323 $key = self::safecol(substr($key, 0, -4));
324 $param = str_replace(array("(", ")", "."), "_", $key);
325 if (is_array($val))
326 $cond = $key." NOT IN ".self::build_list($val, $params);
336 $likes = array();
337 foreach ($val as $index => $match) {
338 $param = str_replace(array("(", ")", "."), "_", $key)."_".$index;
339 $likes[] = $key." LIKE :".$param;
340 $params[":".$param] = $match;
ozio.helper.php (https://github.com/MaBelleEcole/Main.git) PHP · 396 lines
1 <?php
2 /**
3 * This file is part of Ozio Gallery 2.
17 *
18 * @copyright Copyright (C) 2010 Open Source Solutions S.L.U. All rights reserved.
19 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see RT-LICENSE.php
20 */
29 global $mainframe;
30 $VAMBpathAssoluto = JPATH_SITE;
31 $VAMBpathAssoluto = str_replace("\\", "/" , $VAMBpathAssoluto);
32 $dir = $VAMBpathAssoluto.'/components/com_oziogallery2/skin/imagerotator';
33 if($objs = @glob($dir.'/xml/*'))
47 $message = JText::_('Cartella XML').' Imagerotator '.JText::_('svuotata correttamente');
48 $link = 'index.php?option=com_oziogallery2&view=reset';
49 $mainframe->redirect( $link, $message);
50 }
comment-template.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 1486 lines
1 <?php
2 /**
3 * Comment template functions
374 $url = get_comment_author_url( $comment );
375 $display = ($linktext != '') ? $linktext : $url;
376 $display = str_replace( 'http://www.', '', $display );
377 $display = str_replace( 'http://', '', $display );
585 function get_comment_excerpt( $comment_ID = 0 ) {
586 $comment = get_comment( $comment_ID );
587 $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) );
588 $words = explode( ' ', $comment_text );
908 $new_text = trim( sprintf( $new_text, '' ) );
910 $more = str_replace( $text, $new_text, $more );
911 if ( false === strpos( $more, '%' ) ) {
912 $more = '% ' . $more;
SharedPageUrls.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 736 lines
1 <?php
3 class W3_SharedPageUrls
110 $full_urls = array();
111 $post_link = post_permalink($post_id);
112 $post_uri = str_replace($this->domain_url, '', $post_link);
114 $full_urls[] = $post_link;
174 $author_link = get_author_posts_url($post_author);
175 $author_uri = str_replace($this->domain_url, '', $author_link);
177 for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
198 foreach ($terms as $term) {
199 $term_link = get_term_link($term, $term->taxonomy);
200 $term_uri = str_replace($this->domain_url, '', $term_link);
201 $posts_pages_number = @ceil($term->count / $posts_per_page);
comment-template.php (https://gitlab.com/darmawan.fatria/df-skp-2014) PHP · 1525 lines
1 <?php
2 /**
3 * Comment template functions
345 $url = get_comment_author_url();
346 $display = ($linktext != '') ? $linktext : $url;
347 $display = str_replace( 'http://www.', '', $display );
348 $display = str_replace( 'http://', '', $display );
778 if ( $number > 1 ) {
779 $output = str_replace( '%', number_format_i18n( $number ), ( false === $more ) ? __( '% Comments' ) : $more );
780 } elseif ( $number == 0 ) {
781 $output = ( false === $zero ) ? __( 'No Comments' ) : $zero;
964 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
965 else
966 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
968 /**
node.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 657 lines
1 <?php
2 /**
3 * File containing the ezcWorkflowNode class.
458 public function verify()
459 {
460 $type = str_replace( 'ezcWorkflowNode', '', get_class( $this ) );
462 if ( $this->minInNodes !== false && $this->numInNodes < $this->minInNodes )
624 public function __toString()
625 {
626 $type = str_replace( 'ezcWorkflowNode', '', get_class( $this ) );
627 $max = strlen( $type );
628 $string = '';
string_functions.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 395 lines
1 <?php
2 /**
3 * File containing the ezcTemplateStringFunctions class
18 {
19 /**
20 * Translates a function used in the Template language to a PHP function call.
21 * The function call is represented by an array with three elements:
22 *
33 switch ( $functionName )
34 {
35 // str_replace( $sl, $index, $len, $sr )
36 // substr( $sl, 0, $index ) . $sr . substr( $sl, $index + $len );
37 case "str_replace":
246 // str_find_replace( $s, $find, $replace, $count )::
247 // str_replace( $s, $replace, $find, $count )
248 case "str_find_replace": return array( ezcTemplateAstNode::TYPE_VALUE, array( "%string", "%find", "%replace", "[%count]" ),
249 self::functionCall( "str_replace", array( "%find", "%replace", "%string", "[%count]") ) );
ezcodepage.php (https://github.com/GunioRobot/ezpublish.git) PHP · 830 lines
394 $dir = dirname( $filename );
395 $file = basename( $filename );
396 $php = new eZPHPCreator( $dir, $file );
398 $php->addVariable( "umap", array() );
422 array( "\\\\", "\\'" ),
423 $item );
424 $php->addVariable( "utf8map[$key]", $val );
425 }
426 next( $this->UTF8Map );
488 $cache_dir = $permissionArray['var_directory'] . "/codepages/";
489 $cache_filename = md5( $this->CharsetCode );
490 $cache = $cache_dir . $cache_filename . ".php";
492 return $cache;
ezwordtoimageoperator.php (https://github.com/GunioRobot/ezpublish.git) PHP · 488 lines
1 <?php
2 /**
3 * File containing the eZWordtoimageoperator class.
11 /*!
12 \class eZWordToImageOperator ezwordtoimageoperator.php
13 \brief The class eZWordToImageOperator does
58 }
60 $operatorValue = str_replace( $replaceText, $icons, $operatorValue );
61 } break;
363 default:
364 {
365 eZDebug::writeError( "Unknown operator: $operatorName", "ezwordtoimageoperator.php" );
366 }
ezintegertype.php (https://github.com/GunioRobot/ezpublish.git) PHP · 508 lines
1 <?php
2 /**
3 * File containing the eZIntegerType class.
11 /*!
12 \class eZIntegerType ezintegertype.php
13 \ingroup eZDatatype
14 \brief A content datatype which handles integers
115 {
116 $data = $http->postVariable( $base . "_data_integer_" . $contentObjectAttribute->attribute( "id" ) );
117 $data = str_replace(" ", "", $data );
119 if ( $data == "" )
180 $data = $http->postVariable( $base . "_data_integer_" . $contentObjectAttribute->attribute( "id" ) );
181 $data = trim( $data ) != '' ? $data : null;
182 $data = str_replace(" ", "", $data);
183 $contentObjectAttribute->setAttribute( "data_int", $data );
184 return true;
ezfloattype.php (https://github.com/GunioRobot/ezpublish.git) PHP · 415 lines
1 <?php
2 /**
3 * File containing the eZFloatType class.
11 /*!
12 \class eZFloatType ezfloattype.php
13 \ingroup eZDatatype
14 \brief Stores a float value
76 $data = $locale->internalNumber( $data );
78 $data = str_replace(" ", "", $data);
80 $contentObjectAttribute->setAttribute( "data_float", $data );
93 {
94 $data = $http->postVariable( $base . "_data_float_" . $contentObjectAttribute->attribute( "id" ) );
95 $data = str_replace(" ", "", $data );
96 $classAttribute = $contentObjectAttribute->contentClassAttribute();
97 $min = $classAttribute->attribute( self::MIN_FIELD );
multibyte.php (https://github.com/rynodivino/system.git) PHP · 820 lines
1 <?php
2 /*
3 * @package Habari
65 * Sets and returns the multibyte library being used internally
66 *
67 * @param $int The new library to use. One of the self::USE_* constants, null to simply return, or false to disable and use native non-multibyte-safe PHP methods.
68 *
69 * @return mixed If $new_library is null, returns the current library
451 * Makes a string's first character uppercase
452 *
453 * @see http://php.net/ucfirst
454 * @param string $str The string to capitalize.
455 * @param string $use_enc The encoding to be used. If null, the internal encoding will be used.
538 * Replace all occurrences of the search string with the replacement string.
539 *
540 * @see http://php.net/str_replace
541 * @param mixed $search A string or an array of strings to search for.
542 * @param mixed $replace A string or an array of strings to replace search values with.
calendar_functions.php (https://github.com/BenBE/ispCP.git) PHP · 1051 lines
1 <?php
3 /**
11 include_once(SM_PATH . 'plugins/calendar_sql_backend/functions.php');
23 * @param string $userType The type of user this is, which
24 * corresponds to the constants defined
25 * in the {@link calendar/calendar_constants.php}
26 * file
27 *
74 //
75 $sql = $owned_calendars_query;
76 $sql = str_replace('%1', $user, $sql);
TableMapperTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 594 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
13 /**
14 * Test for \Magento\CatalogSearch\Model\Search\TableMapper
15 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16 */
17 class TableMapperTest extends \PHPUnit_Framework_TestCase
22 /**
23 * @var \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection|\PHPUnit_Framework_MockObject_MockObject
24 */
25 private $attributeCollection;
27 /**
28 * @var \Magento\Store\Api\Data\WebsiteInterface|\PHPUnit_Framework_MockObject_MockObject
29 */
30 private $website;
Repository.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 579 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
118 {
119 return
120 str_replace('Interface', '', $this->getSourceClassName()) . 'SearchResultInterfaceFactory';
121 }
122 /**
534 $resultClassName = $this->_getResultClassName();
536 if ($resultClassName !== str_replace('Interface', '', $sourceClassName) . '\\Repository') {
537 $this->_addError(
538 'Invalid Factory class name [' . $resultClassName . ']. Use ' . $sourceClassName . 'Repository'
551 protected function _generateCode()
552 {
553 $className = str_replace('Interface', '', str_replace('Data\\', '', $this->getSourceClassName()));
554 $this->_classGenerator->setName(
555 $this->_getResultClassName()
Persistor.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 495 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
137 protected function _getSourceResourceClassName() // Invoice\Resource
138 {
139 $temporary = str_replace('\\Api\\Data\\', '\\Model\\Spi\\', $this->getSourceClassName());
140 $parts = explode('\\', ltrim($temporary, '\\'));
141 $className = array_pop($parts);
142 $className = str_replace('Interface', '', $className);
143 return '\\' . implode('\\', $parts) . '\\' . $className . 'ResourceInterface';
144 }
class.redux_api.php (https://gitlab.com/thisishayat/itv-2016) PHP · 638 lines
88 }
90 return str_replace( 'extension_' . $extension . '.php', '', $path );
91 }
532 if ( is_dir( $path ) ) {
533 $path = trailingslashit( $path );
534 $folder = str_replace( '.php', '', basename( $path ) );
535 if ( file_exists( $path . 'extension_' . $folder . '.php' ) ) {
552 $name = explode( 'extension_', basename( $path ) );
553 if ( isset( $name[1] ) && ! empty( $name[1] ) ) {
554 $name = str_replace( '.php', '', $name[1] );
555 self::checkExtensionClassFile( $opt_name, $name, $path );
556 }
619 foreach ( self::$uses_extensions[ $opt_name ] as $extension ) {
620 $class_file = end( self::$extensions[ $extension ] );
621 $name = str_replace( '.php', '', basename( $extension ) );
622 $extension_class = 'ReduxFramework_Extension_' . $name;
623 $instanceExtensions[ $extension ] = array(
ValidationValidatorTest.php (https://gitlab.com/ezeql/framework) PHP · 1143 lines
1 <?php
3 use Mockery as m;
5 use Symfony\Component\HttpFoundation\File\File;
7 class ValidationValidatorTest extends PHPUnit_Framework_TestCase
8 {
9 public function tearDown()
100 $trans->addResource('array', ['validation.required' => 'foo bar'], 'en', 'messages');
101 $v = new Validator($trans, ['name' => ''], ['name' => 'Required']);
102 $v->addReplacer('required', function ($message, $attribute, $rule, $parameters) { return str_replace('bar', 'taylor', $message); });
103 $this->assertFalse($v->passes());
104 $v->messages()->setFormat(':message');
969 $file = $this->getMock('Symfony\Component\HttpFoundation\File\UploadedFile', ['guessExtension'], $uploadedFile);
970 $file->expects($this->any())->method('guessExtension')->will($this->returnValue('php'));
971 $v = new Validator($trans, [], ['x' => 'Image']);
972 $v->setFiles(['x' => $file]);
breadcrumb.php (https://github.com/durand54/caresite.git) PHP · 502 lines
1 <?php
2 function breadCrumb ()
3 {
23 $qr= mysql_query($q);
24 $r = mysql_fetch_array($qr);
25 $breadcrumb.= " <a href=\"/index.php\" class=\"linkBlack\">Home</a> > ";
26 $breadcrumb.= "<a href=\"/categories/categories.php\" class=\"linkBlack\">Categories</a> > ";
34 $qr2= mysql_query($q2);
35 $r2 = mysql_fetch_array($qr2);
36 $breadcrumb.= " <a href=\"/index.php\" class=\"linkBlack\">Home</a> > ";
37 $breadcrumb.= "<a href=\"/categories/categories.php\" class=\"linkBlack\">Categories</a> > ";
197 {
198 case "view":
199 $breadcrumb.= "View ".str_replace("<p>", " - ", str_replace("</p>", "", $r3["VehicleName"]));
200 break;
discount_save.php (https://gitlab.com/alexprowars/bitrix) PHP · 580 lines
1 <?
2 require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/general/discount_save.php");
4 class CCatalogDiscountSave extends CAllCatalogDiscountSave
144 $arSqls = CCatalog::PrepareSql($arFields, $arOrder, $arFilter, $arGroupBy, $arSelectFields);
146 $arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "DISTINCT", $arSqls["SELECT"]);
148 if (empty($arGroupBy) && is_array($arGroupBy))
225 $arSqls = CCatalog::PrepareSql($arFields, $arOrder, $arFilter, $arGroupBy, $arSelectFields);
227 $arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "", $arSqls["SELECT"]);
229 if (empty($arGroupBy) && is_array($arGroupBy))
304 $arSqls = CCatalog::PrepareSql($arFields, $arOrder, $arFilter, $arGroupBy, $arSelectFields);
306 $arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "", $arSqls["SELECT"]);
308 if (empty($arGroupBy) && is_array($arGroupBy))
component.php (https://gitlab.com/alexprowars/bitrix) PHP · 557 lines
1 <?php
2 /**
3 * @deprecated
119 $arResult['ELEMENT'][] = array(
120 'title' => (str_replace(array(';', ','), ' ', $arRes['TITLE'])),
121 'desc' => $description,
122 'id' => $arRes['SID'],
227 $arResult['ELEMENT'][] = array(
228 'title' => (str_replace(array(';', ','), ' ', $arRes['TITLE'])),
229 'desc' => implode(', ', $arDesc),
230 'id' => $arRes['SID'],
269 $arResult['ELEMENT'][] = array(
270 'title' => (str_replace(array(';', ','), ' ', $arRes['TITLE'])),
271 'desc' => $clientTitle,
272 'id' => $arRes['SID'],
page.tpl.php (https://gitlab.com/manuvelasco/agostoliquida) PHP · 442 lines
80 <?php if ($logo): ?>
81 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="logo">
82 <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
85 <?php if ($site_name): ?>
86 <a href="<?php print $front_page; ?>" class="navbar-brand" title="<?php print t('Home'); ?>" rel="home"><?php //print $site_name; ?></a>
87 <?php endif; ?>
120 <?php if ($logo): ?>
121 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="logo">
122 <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
125 <?php if ($site_name): ?>
126 <a href="<?php print $front_page; ?>" class="navbar-brand" title="<?php print t('Home'); ?>" rel="home"><?php //print $site_name; ?></a>
127 <?php endif; ?>
131 <?php print $site_slogan; ?>
132 </span>
133 <?php endif; ?>
134 <?php endif; ?>
page--blog.tpl.php (https://gitlab.com/manuvelasco/agostoliquida) PHP · 444 lines
74 <?php if ($logo): ?>
75 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="logo">
76 <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
79 <?php if ($site_name): ?>
80 <a href="<?php print $front_page; ?>" class="navbar-brand" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
81 <?php endif; ?>
115 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="logo">
116 <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
117 </a>
118 <?php elseif ($site_name || $site_slogan): ?>
119 <?php if ($site_name): ?>
120 <a href="<?php print $front_page; ?>" class="navbar-brand" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
121 <?php endif; ?>
138 <?php endif; ?>
140 <?php if ($title) : ?>
141 <section class="post-wrapper-top jt-shadow clearfix">
142 <div class="container">
SQLiteGrammar.php (https://gitlab.com/techniconline/kmc) PHP · 604 lines
AssignCourse.php (https://gitlab.com/tonmoy1a/Bitm-Course-Manager) PHP · 466 lines
1 <?php
3 namespace BitmCourseApp\assign_course;
5 use PDO;
7 include_once (dirname(__FILE__) . '/../DBConnection/DBConnection.php');
9 class AssignCourse extends \DBConnection {
102 foreach ($required as $key => $field) {
103 if (empty($field)) {
104 $_SESSION["$key"] = str_replace('_', ' ', $key) . ' Required';
105 $this->error = TRUE;
106 }
255 }
256 }
257 header('location:assign_new_course.php');
258 }
JStringTest.php (https://github.com/dextercowley/joomla-cms.git) PHP · 911 lines
1 <?php
2 /**
3 * @package Joomla.UnitTest
8 */
10 require_once 'TestHelpers/JString-helper-dataset.php';
12 /**
13 * Test class for JString.
14 * Generated by PHPUnit on 2009-10-26 at 22:29:34.
15 *
16 * @package Joomla.UnitTest
18 * @since 11.3
19 */
20 class JStringTest extends PHPUnit_Framework_TestCase
21 {
22 /**
BaseTugasQuery.php (https://bitbucket.org/faisaluje/tugasku.git) PHP · 672 lines
1 <?php
79 *
80 * @param string $dbName The dabase name
81 * @param string $modelName The phpName of a model, e.g. 'Book'
82 * @param string $modelAlias The alias for the model in this query, e.g. 'b'
83 */
272 $comparison = Criteria::IN;
273 } elseif (preg_match('/[\%\*]/', $nis)) {
274 $nis = str_replace('*', '%', $nis);
275 $comparison = Criteria::LIKE;
276 }
294 $comparison = Criteria::IN;
295 } elseif (preg_match('/[\%\*]/', $tanggalPengumpulan)) {
296 $tanggalPengumpulan = str_replace('*', '%', $tanggalPengumpulan);
297 $comparison = Criteria::LIKE;
298 }
BaseSiswaQuery.php (https://bitbucket.org/faisaluje/tugasku.git) PHP · 441 lines
1 <?php
67 *
68 * @param string $dbName The dabase name
69 * @param string $modelName The phpName of a model, e.g. 'Book'
70 * @param string $modelAlias The alias for the model in this query, e.g. 'b'
71 */
198 $comparison = Criteria::IN;
199 } elseif (preg_match('/[\%\*]/', $nis)) {
200 $nis = str_replace('*', '%', $nis);
201 $comparison = Criteria::LIKE;
202 }
220 $comparison = Criteria::IN;
221 } elseif (preg_match('/[\%\*]/', $nama)) {
222 $nama = str_replace('*', '%', $nama);
223 $comparison = Criteria::LIKE;
224 }
class.pmDashlet.php (https://bitbucket.org/ferOnti/processmaker.git) PHP · 351 lines
1 <?php
3 require_once 'classes/interfaces/dashletInterface.php';
4 require_once 'classes/model/Dashlet.php';
5 require_once 'classes/model/DashletInstance.php';
20 if (! class_exists( $className )) {
21 self::setIncludePath();
22 require_once 'classes' . PATH_SEP . 'class.' . $className . '.php';
23 }
24 G::LoadClass( $className );
41 if (! class_exists( $className )) {
42 self::setIncludePath();
43 require_once 'classes' . PATH_SEP . 'class.' . $className . '.php';
44 }
45 $this->dashletObject = new $className();
XmlVisitorTest.php (https://bitbucket.org/alessandro-aglietti/itis-leonardo-da-vinci.git) PHP · 540 lines
db.php (https://bitbucket.org/midasinc/your-submission.git) PHP · 516 lines
1 <?php
3 class gdsrBlgDB {
134 function save_vote_comment_thumb($id, $user, $ip, $ua, $vote) {
135 global $wpdb, $table_prefix;
136 $ua = str_replace("'", "''", $ua);
137 $ua = substr($ua, 0, 250);
146 } else {
147 $modsql = sprintf("INSERT INTO %sgdsr_moderate (id, vote_type, user_id, vote, voted, ip, user_agent) VALUES (%s, 'cmmthumb', %s, %s, '%s', '%s', '%s')",
148 $table_prefix, $id, $user, $vote, str_replace("'", "''", current_time('mysql')), $ip, $ua);
149 $wpdb->query($modsql);
150 }
153 function save_vote_thumb($id, $user, $ip, $ua, $vote, $comment_id = 0) {
154 global $wpdb, $table_prefix;
155 $ua = str_replace("'", "''", $ua);
156 $ua = substr($ua, 0, 250);
theme-settings.php (https://github.com/aakb/sport-aarhus-events.git) PHP · 636 lines
1 <?php
2 // $Id$
3 /**
4 * @file
5 * themesettings.php
6 */
31 // Save default theme settings.
32 variable_set(
33 str_replace('/', '_', 'theme_' . $theme . '_settings'),
34 array_merge($defaults, $settings)
35 );
53 //function phptemplate_settings($saved_settings) {
54 function mothership_settings($saved_settings, $subtheme_defaults = array()) {
parsedown.php (https://gitlab.com/websumon/tosnib) PHP · 1285 lines
1 <?php
3 #
35 # standardize line breaks
36 $text = str_replace( "\r\n", "\n", $text );
37 $text = str_replace( "\r", "\n", $text );
39 # replace tabs with spaces
40 $text = str_replace( "\t", ' ', $text );
42 # remove surrounding line breaks
929 if ( preg_match( '/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE ) ) {
930 $url = str_replace( array( '&', '<' ), array( '&', '<' ), $matches[0][0] );
932 return array(
generate_header.php (https://bitbucket.org/mh268408/infofigures.git) PHP · 510 lines
1 <?php
2 //libraries
3 require_once("gradient-fill.php"); //needed to make the gradients
4 require_once("colors.php"); //pallet and size data
6 //variables
8 $size = $_POST['size'];
9 $title = $_POST['title'];
10 $title = str_replace("\'", "'", $title);
11 $title = str_replace('\"', '"', $title);
12 $author=$_POST['author'];
13 $author = str_replace("\'", "'", $author);
14 $author = str_replace('\"', '"', $author);
si-contact-form-ex-fields.php (https://github.com/dottystylecreative/Dottystyle-Style.git) PHP · 698 lines
159 } else {
160 list($exf_opts_label, $value) = preg_split('#(?<!\\\)\,#',$exf_array_test); //string will be split by "," but "\," will be ignored
161 $exf_opts_label = trim(str_replace('\,',',',$exf_opts_label)); // "\," changes to ","
162 $value = trim(str_replace('\,',',',$value)); // "\," changes to ","
233 } else {
234 list($exf_opts_label, $value) = preg_split('#(?<!\\\)\,#',$exf_array_test); //string will be split by "," but "\," will be ignored
235 $exf_opts_label = trim(str_replace('\,',',',$exf_opts_label)); // "\," changes to ","
236 $value = trim(str_replace('\,',',',$value)); // "\," changes to ","
313 if( preg_match('#(?<!\\\)\,#', $exf_array_test) && preg_match("/;/", $exf_array_test) ) {
314 list($exf_opts_label, $value) = preg_split('#(?<!\\\)\,#',$exf_array_test); //string will be split by "," but "\," will be ignored
315 $exf_opts_label = trim(str_replace('\,',',',$exf_opts_label)); // "\," changes to ","
316 $value = trim(str_replace('\,',',',$value)); // "\," changes to ","
487 break;
488 case 'attachment':
489 if ($si_contact_opt['php_mailer_enable'] != 'php') {
490 if($si_contact_opt['ex_field'.$i.'_notes'] != '') {
491 $string .= $this->ctf_notes($si_contact_opt['ex_field'.$i.'_notes']);
AppTest.php (https://github.com/gustavor/lore.git) PHP · 780 lines
1 <?php
3 /**
244 $component = App::core('Controller/Component');
245 $this->assertEqual(array(CAKE . 'Controller' . DS . 'Component' . DS), str_replace('/', DS, $component));
247 $auth = App::core('Controller/Component/Auth');
248 $this->assertEqual(array(CAKE . 'Controller' . DS . 'Component' . DS . 'Auth' . DS), str_replace('/', DS, $auth));
250 $datasource = App::core('Model/Datasource');
251 $this->assertEqual(array(CAKE . 'Model' . DS . 'Datasource' . DS), str_replace('/', DS, $datasource));
252 }
clsParametrosPesquisas.inc.php (https://github.com/gtinfo/ieducar.git) PHP · 495 lines
1 <?php
2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 * *
26 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28 require_once( "include/Geral.inc.php" );
30 /**
160 */
161 function deserializaCampos( $parametros_serializados ) {
162 $parametros_serializados = str_replace( "\\", null, $parametros_serializados );
163 $parametros_serializados = unserialize( $parametros_serializados );
164 $this->submit = $parametros_serializados["submit"];
function_generation.php (https://bitbucket.org/lordgnu/wxphp.git) PHP · 1080 lines
21 *
22 * @return string Generated code ready to insert on the beginning
23 * of the PHP_METHOD or PHP_FUNCTION body
24 */
25 function function_parameters($method_definitions, $method_name, $class_name=null)
284 *
285 * @return string Generated code ready to insert on the middle of
286 * the PHP_METHOD or PHP_FUNCTION body after the generated code of
287 * function_parameters()
288 */
708 *
709 * @return string Generated code ready to insert on the end of
710 * the PHP_METHOD or PHP_FUNCTION body after the generated code of class_method_called_overload()
711 */
712 function function_return($method_definitions, $method_name, $class_name=null, $is_constructor=false)
blog-posts.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 1287 lines
class-wp-filesystem-direct.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 664 lines
1 <?php
2 /**
3 * WordPress Direct Filesystem.
9 /**
10 * WordPress Filesystem Class for direct PHP file and folder manipulation.
11 *
12 * @since 2.5.0
364 }
366 $file = str_replace( '\\', '/', $file ); // For Win32, occasional problems deleting files otherwise.
368 if ( 'f' === $type || $this->is_file( $file ) ) {
532 */
533 public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
534 // Safe mode fails with a trailing slash under certain PHP versions.
535 $path = untrailingslashit( $path );
class.load.php (https://github.com/Eyenrique/ZanPHP.git) PHP · 702 lines
1 <?php
3 /* ex: set tabstop=2 noexpandtab: */
5 /**
6 * ZanPHP
7 *
8 * An open source agile and rapid development framework for PHP 5
9 *
10 * @package ZanPHP
11 * @author MilkZoft Developer Team
12 * @copyright Copyright (c) 2011, MilkZoft, Inc.
13 * @license http://www.zanphp.com/documentation/en/license/
14 * @link http://www.zanphp.com
abstract-wc-order.php (https://github.com/Canuckaholic/Pop-Digital.git) PHP · 1811 lines
1 <?php
2 /**
3 * Abstract Order
155 foreach ( $args['variation'] as $key => $value ) {
156 wc_add_order_item_meta( $item_id, str_replace( 'attribute_', '', $key ), $value );
157 }
158 }
210 foreach ( $args['variation'] as $key => $value ) {
211 wc_update_order_item_meta( $item_id, str_replace( 'attribute_', '', $key ), $value );
212 }
213 }
parsedown.php (https://github.com/medieteknik/Medieteknik.nu.git) PHP · 1343 lines
CakeTimeTest.php (https://github.com/suzuki/candycane.git) PHP · 811 lines
1 <?php
2 /**
3 * CakeTimeTest file
5 * PHP 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package Cake.Test.Case.View.Helper
16 * @since CakePHP(tm) v 1.2.0.4206
17 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18 */
19 App::uses('CakeTime', 'Utility');
pp_express.php (https://gitlab.com/reclamare/mao) PHP · 1137 lines
1 <?php
2 class ControllerPaymentPPExpress extends Controller {
3 private $error = array();
36 $data['text_browse'] = $this->language->get('text_browse');
37 $data['text_ipn'] = $this->language->get('text_ipn');
38 $data['text_ipn_url'] = HTTPS_CATALOG . 'index.php?route=payment/pp_express/ipn';
39 $data['text_paypal_join'] = $this->language->get('text_paypal_join');
40 $data['text_paypal_join_sandbox'] = $this->language->get('text_paypal_join_sandbox');
304 if (isset($this->request->post['pp_express_page_colour'])) {
305 $data['pp_express_page_colour'] = str_replace('#', '', $this->request->post['pp_express_page_colour']);
306 } else {
307 $data['pp_express_page_colour'] = $this->config->get('pp_express_page_colour');
icl-admin-notifier.php (https://gitlab.com/woxiprogrammers/infinia-wordpress) PHP · 740 lines
1 <?php
2 /**
3 * @package wpml-core
401 $temp_classes = array();
402 if(strpos($type, 'icl-admin-message')) {
403 $type = str_replace('icl-admin-message-', '', $type);
404 }
405 if($admin_notice) {
578 static function troubleshooting() {
579 ?>
580 <h4><?php _e( 'Messages and notifications', 'sitepress' ) ?></h4>
581 <?php
584 ?>
585 <p>
586 <input id="icl_restore_notifications" type="button" class="button-secondary" value="<?php echo __( 'Restore messages and notification', 'sitepress' ); ?>" />
587 <br />
588 <br />
query.php (https://github.com/weissms/owb-mirror.git) PHP · 1527 lines
1 <?php
3 /*
648 if ( false !== strpos($qv['feed'], 'comments-') ) {
649 $qv['feed'] = str_replace('comments-', '', $qv['feed']);
650 $qv['withcomments'] = 1;
651 }
844 if ( ('page' != get_option('show_on_front') ) || ( $reqpage != get_option('page_for_posts') ) ) {
845 $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));
846 $page_paths = '/' . trim($q['pagename'], '/');
847 $q['pagename'] = sanitize_title(basename($page_paths));
850 }
851 } elseif ('' != $q['attachment']) {
852 $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment'])));
853 $attach_paths = '/' . trim($q['attachment'], '/');
854 $q['attachment'] = sanitize_title(basename($attach_paths));
time.test.php (https://github.com/tsep/tsep1.git) PHP · 784 lines
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
9 *
12 *
13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package cake
16 * @subpackage cake.tests.cases.libs.view.helpers
17 * @since CakePHP(tm) v 1.2.0.4206
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
19 */
20 if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
21 define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
ShapeFile.lib.php (https://bitbucket.org/markmoskalenko/svitor.git) PHP · 649 lines
1 <?php
2 function loadData($type, $data) {
3 if (!$data) return $data;
133 function _loadDBFHeader() {
134 $DBFFile = fopen(str_replace('.*', '.dbf', $this->FileName), 'r');
136 $result = array();
228 function _saveRecords() {
229 if (file_exists(str_replace('.*', '.dbf', $this->FileName))) {
230 @unlink(str_replace('.*', '.dbf', $this->FileName));
231 }
232 if (!($this->DBFFile = @dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader))) {
233 return $this->setError(sprintf("It wasn't possible to create the DBase file '%s'", str_replace('.*', '.dbf', $this->FileName)));
AdminInfrastruktur.php (https://gitlab.com/katakutu/gisgis) PHP · 566 lines
24 public function simpan_ruas_jalan()
25 {
26 require('source/php/gPoint.php');
28 $gpoint = new gPoint();
254 public function update_jembatan($id)
255 {
256 require('source/php/gPoint.php');
258 $gpoint = new gPoint();
507 public function update_infrastruktur($id)
508 {
509 require('source/php/gPoint.php');
511 $gpoint = new gPoint();
class.file.php (https://github.com/livinglab/openlab.git) PHP · 582 lines
1 <?php
2 //Code from iThemes Builder
3 class AECFile {
205 if ( ( $uploads = wp_upload_dir() ) && ( false === $uploads['error'] ) ) {
206 if ( 0 === strpos( $file, $uploads['basedir'] ) )
207 $url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file );
208 else if ( false !== strpos( $file, 'wp-content/uploads' ) )
209 $url = $uploads['baseurl'] . substr( $file, strpos( $file, 'wp-content/uploads' ) + 18 );
211 //Store an AEC site option of the basename of the file directory
212 if ( empty( $url ) )
213 $url = get_option( 'siteurl' ) . str_replace( '\\', '/', str_replace( rtrim( ABSPATH, '\\\/' ), '', $file ) );
215 if ( is_network_admin() ) {
438 if ( true === $args['create_index'] )
439 AECFile::write( "$directory/index.php", '<?php // Silence is golden.' );
441 return true;
TextData.php (https://github.com/livinglab/openlab.git) PHP · 672 lines
1 <?php
3 namespace PhpOffice\PhpSpreadsheet\Calculation;
5 use PhpOffice\PhpSpreadsheet\Shared\Date;
6 use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
7 use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
59 if (is_string($stringValue) || is_numeric($stringValue)) {
60 return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F"));
61 }
477 if ($instance == 0) {
478 return str_replace($fromText, $toText, $text);
479 }
Notifications.php (https://github.com/livinglab/openlab.git) PHP · 536 lines
1 <?php
3 class DWQA_Notifications {
56 $subject = __( 'A new question was posted on {site_name}', 'dw-question-answer' );
57 }
58 $subject = str_replace( '{site_name}', get_bloginfo( 'name' ), $subject );
59 $subject = str_replace( '{question_title}', $question->post_title, $subject );
60 $subject = str_replace( '{question_id}', $question->ID, $subject );
61 $subject = str_replace( '{username}', get_the_author_meta( 'display_name', $user_id ), $subject );
69 $admin = get_user_by( 'email', $admin_email[0] );
70 if ( $admin ) {
71 $message = str_replace( '{admin}', get_the_author_meta( 'display_name', $admin->ID ), $message );
72 }
73 //sender
engagements.php (https://github.com/livinglab/openlab.git) PHP · 963 lines
1 <?php
3 /**
5 *
6 * This file contains the common classes and functions for interacting with the
7 * bbPress engagements API. See `includes/users/engagements.php` for more.
8 *
9 * @package bbPress
475 // Loop through terms and get the user ID
476 foreach ( $terms as $term ) {
477 $user_ids[] = str_replace( $user_key, '', $term->slug );
478 }
admin-tools.php (https://github.com/livinglab/openlab.git) PHP · 608 lines
55 <div class="wrap badgeos-tools-page">
56 <div id="icon-options-general" class="icon32"></div>
57 <h2><?php _e( 'Tools', 'badgeos' ); ?></h2>
59 <div class="nav-tab-wrapper">
60 <?php
61 $badgeos_tools_sections = $this->badgeos_get_tools_sections();
62 foreach( $badgeos_tools_sections as $key => $badgeos_tools_section ) {
63 ?>
64 <a href="?page=badgeos_tools&tab=<?php echo $key; ?>" class="nav-tab <?php echo $this->page_tab == $key ? 'nav-tab-active' : ''; ?>">
65 <i class="fa <?php echo $badgeos_tools_section['icon']; ?>" aria-hidden="true"></i>
66 <?php _e( $badgeos_tools_section['title'], 'badgeos' ); ?>
67 </a>
68 <?php
69 }
70 ?>
validation.class.php (https://bitbucket.org/tumivn/phpexamples.git) PHP · 927 lines
1 <?php
2 /**
3 * Generic validation class for validation from most sources
4 *
5 * @copyright 2013-03-29
6 * @link http://phpro.org
7 * @author Kevin Waterson
8 * @version: $ID$
444 {
445 $cc = preg_replace('/(?<=[a-z])(?=[A-Z])/',' ',$string);
446 $cc = ucwords( str_replace( '_', ' ', $cc ) );
447 return $cc;
448 }
753 $allowed_types = $options['allowed_types'];
755 $ini_max = str_replace('M', '', ini_get('upload_max_filesize'));
756 $upload_max = $ini_max * 1024;
BasesfGuardUserQuery.php (https://github.com/pixel-cookers/symfony_bootstrap.git) PHP · 766 lines
1 <?php
83 *
84 * @param string $dbName The dabase name
85 * @param string $modelName The phpName of a model, e.g. 'Book'
86 * @param string $modelAlias The alias for the model in this query, e.g. 'b'
87 */
229 $comparison = Criteria::IN;
230 } elseif (preg_match('/[\%\*]/', $username)) {
231 $username = str_replace('*', '%', $username);
232 $comparison = Criteria::LIKE;
233 }
257 $comparison = Criteria::IN;
258 } elseif (preg_match('/[\%\*]/', $algorithm)) {
259 $algorithm = str_replace('*', '%', $algorithm);
260 $comparison = Criteria::LIKE;
261 }
BasesfGuardUserProfileQuery.php (https://github.com/pixel-cookers/symfony_bootstrap.git) PHP · 442 lines
1 <?php
59 *
60 * @param string $dbName The dabase name
61 * @param string $modelName The phpName of a model, e.g. 'Book'
62 * @param string $modelAlias The alias for the model in this query, e.g. 'b'
63 */
287 $comparison = Criteria::IN;
288 } elseif (preg_match('/[\%\*]/', $firstName)) {
289 $firstName = str_replace('*', '%', $firstName);
290 $comparison = Criteria::LIKE;
291 }
315 $comparison = Criteria::IN;
316 } elseif (preg_match('/[\%\*]/', $lastName)) {
317 $lastName = str_replace('*', '%', $lastName);
318 $comparison = Criteria::LIKE;
319 }
filestore_funcs.php
(http://enginey.googlecode.com/svn/trunk/)
PHP · 363 lines
✨ Summary
This PHP code is a file search engine that matches files against a query based on various attributes such as name, directory, and content. It uses regular expressions to filter results and can recurse into subdirectories. The code returns an array of matching files, which can be used for further processing or display.
This PHP code is a file search engine that matches files against a query based on various attributes such as name, directory, and content. It uses regular expressions to filter results and can recurse into subdirectories. The code returns an array of matching files, which can be used for further processing or display.
1 <?php
2 /**
3 * Helper function to convert a simple pattern to a regular expression for matching.
139 } else {
140 $dir = substr($resolvedDir, (strlen($rootPath) + 1), strlen($resolvedDir));
141 $dir = "./".str_replace("\\","/",$dir);
142 }
143 if (strcmp($rootPath, $resolvedFullPath) === 0) {
145 } else {
146 $path = substr($resolvedFullPath, (strlen($rootPath) + 1), strlen($resolvedFullPath));
147 $path = "./".str_replace("\\","/",$path);
148 }
360 return $matched;
361 }
362 // No closing PHP tag on purpose. Do not want it to print whitepace and thus not allow setting headers later.
TwitterAlikeExample.html
(http://redis.googlecode.com/svn/trunk/)
HTML · 253 lines
✨ Summary
This HTML code outputs a blog post about Redis, a popular in-memory data store. The content explains how to implement a Twitter-like clone using Redis, including setting up followers and posting messages. It also discusses horizontal scaling of the system, including hashing keys, distributing user data across servers, and handling special cases like incrementing IDs and retrieving timeline data.
This HTML code outputs a blog post about Redis, a popular in-memory data store. The content explains how to implement a Twitter-like clone using Redis, including setting up followers and posting messages. It also discusses horizontal scaling of the system, including hashing keys, distributing user data across servers, and handling special cases like incrementing IDs and retrieving timeline data.
17 <div class="index">
18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19 <b>TwitterAlikeExample: Contents</b><br> <a href="#A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a><br> <a href="#Key-value stores basics">Key-value stores basics</a><br> <a href="#Atomic operations">Atomic operations</a><br> <a href="#Beyond key-value stores">Beyond key-value stores</a><br> <a href="#The set data type">The set data type</a><br> <a href="#Prerequisites">Prerequisites</a><br> <a href="#Data layout">Data layout</a><br> <a href="#Following, followers and updates">Following, followers and updates</a><br> <a href="#Authentication">Authentication</a><br> <a href="#Updates">Updates</a><br> <a href="#Paginating updates">Paginating updates</a><br> <a href="#Following users">Following users</a><br> <a href="#Making it horizontally scalable">Making it horizontally scalable</a><br> <a href="#Hashing the key">Hashing the key</a><br> <a href="#Special keys">Special keys</a>
20 </div>
28 <div class="narrow">
29 <h1><a name="A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a></h1>In this article I'll explain the design and the implementation of a <a href="http://retwis.antirez.com" target="_blank">simple clone of Twitter</a> written using PHP and <a href="http://code.google.com/p/redis/" target="_blank">Redis</a> as only database. The programming community uses to look at key-value stores like special databases that can't be used as drop in replacement for a relational database for the development of web applications. This article will try to prove the contrary.<br/><br/>Our Twitter clone, <a href="http://retwis.antirez.com" target="_blank">called Retwis</a>, is structurally simple, has very good performances, and can be distributed among N web servers and M Redis servers with very little efforts. You can find the source code <a href="http://code.google.com/p/redis/downloads/list" target="_blank">here</a>.<br/><br/>We use PHP for the example since it can be read by everybody. The same (or... much better) results can be obtained using Ruby, Python, Erlang, and so on.
30 <h1><a name="Key-value stores basics">Key-value stores basics</a></h1>
31 The essence of a key-value store is the ability to store some data, called <i>value</i>, inside a key. This data can later be retrieved only if we know the exact key used to store it. There is no way to search something by value. So for example I can use the command SET to store the value <b>bar</b> at key <b>foo</b>:<br/><br/><pre class="codeblock python" name="code">
79 </pre>Ok I think we are ready to start coding!
80 <h2><a name="Prerequisites">Prerequisites</a></h2>
81 If you didn't download it already please <a href="http://code.google.com/p/redis/wiki/README" target="_blank">grab the source code of Retwis</a>. It's a simple tar.gz file with a few of .php files inside. The implementation is very simple. You will find the PHP library client inside (redis.php) that is used to talk with the Redis server from PHP. This library was written by <a href="http://qix.it" target="_blank">Ludovico Magnocavallo</a> and you are free to reuse this in your own projects, but for updated version of the library please download the Redis distribution.<br/><br/>Another thing you probably want is a working Redis server. Just get the source, compile with make, and run with ./redis-server and you are done. No configuration is required at all in order to play with it or to run Retwis in your computer.
82 <h2><a name="Data layout">Data layout</a></h2>
83 Working with a relational database this is the stage were the database layout should be produced in form of tables, indexes, and so on. We don't have tables, so what should be designed? We need to identify what keys are needed to represent our objects and what kind of values this keys need to hold.<br/><br/>Let's start from Users. We need to represent this users of course, with the username, userid, password, followers and following users, and so on. The first question is, what should identify an user inside our system? The username can be a good idea since it is unique, but it is also too big, and we want to stay low on memory. So like if our DB was a relational one we can associate an unique ID to every user. Every other reference to this user will be done by id. That's very simple to do, because we have our atomic INCR operation! When we create a new user we can do something like this, assuming the user is callled "antirez":<br/><br/><pre class="codeblock python python python python python python python python python python python python" name="code">