100+ results for 'php file_get_contents'

Not the results you expected?

FileRepository_Backend_FileSystem.class.php (https://github.com/cj/Project-Pier.git) PHP · 443 lines

1 <?php

2

3 /**

74 } // if

75

76 return file_get_contents($file_path);

77 } // getFileContent

78

392 throw new FileNotWriableError($file);

393 } // if

394 return file_put_contents($file, "<?php\n\nreturn " . var_export($this->attributes, true) . ";\n\n?>");

395 } // saveFileAttributes

396

402 */

403 protected function getAttributesFilePath() {

404 return with_slash($this->getRepositoryDir()) . 'attributes.php';

405 } // getAttributesFilePath

406

PaginationPaginatorTest.php (https://gitlab.com/tillkruss/framework) PHP · 268 lines

1 <?php

2

3 use Mockery as m;

9 use Illuminate\Pagination\BootstrapFourPresenter as BootstrapFourPresenter;

10

11 class PaginationPaginatorTest extends PHPUnit_Framework_TestCase

12 {

13 public function tearDown()

111 $presenter = new BootstrapPresenter($p);

112

113 $this->assertEquals(trim(file_get_contents(__DIR__.'/fixtures/slider.html')), $presenter->render());

114 }

115

123 $presenter = new BootstrapFourPresenter($p);

124

125 $this->assertEquals(trim(file_get_contents(__DIR__.'/fixtures/slider_bs4.html')), $presenter->render());

126 }

127

example09_forms.php (https://gitlab.com/varsha_evonix/intranet) PHP · 204 lines

1 <?php

2

3

5

6 define('_MPDF_PATH','../');

7 include("../mpdf.php");

8

9

175 //==============================================================

176 //==============================================================

177 if (isset($_REQUEST['html'])) { echo '<html><head><style>'.file_get_contents('mpdfstyletables.css').'</style></head><body>'.$html.'</body></html>'; exit; }

178 if (isset($_REQUEST['source'])) {

179 $file = __FILE__;

191

192 // LOAD a stylesheet

193 $stylesheet = file_get_contents('mpdfstyletables.css');

194 $mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text

195

smarty_internal_config.php (https://bitbucket.org/mrajoelisolo/ci_smarty.git) PHP · 302 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Config

118 }

119 $_compile_dir = $this->smarty->getCompileDir();

120 return $_compile_dir . $_filepath . '.' . basename($this->source->name) . '.config' . '.php';

121 }

122

161 $this->compileConfigSource();

162 } else {

163 $this->compiled_config = file_get_contents($this->getCompiledFilepath());

164 }

165 }

action_options.php (https://github.com/dmi3yy/modx.evo.custom.git) PHP · 265 lines

1 <?php

2 $installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;

3

195 break;

196 case 1:

197 include $base_path . MGR_DIR . '/includes/config.inc.php';

198 $host = explode(':', $database_server, 2);

199 if (@ $conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) {

251

252 # load setup information file

253 include($base_path . 'install/setup.info.php');

254 $ph['templates'] = getTemplates($moduleTemplates);

255 $ph['tvs'] = getTVs($moduleTVs);

261 $ph['action'] = ($installMode == 1) ? 'mode' : 'connection';

262

263 $tpl = file_get_contents($base_path . 'install/actions/tpl_options.html');

264 $content = parse($tpl,$ph);

265 echo parse($content,$_lang,'[%','%]');

YamlFileLoader.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 236 lines

1 <?php

2

3 /*

59

60 try {

61 $parsedConfig = $this->yamlParser->parse(file_get_contents($path));

62 } catch (ParseException $e) {

63 throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);

SendEventNotificationsTest.php (https://github.com/leerbag/zf2.git) PHP · 126 lines

1 <?php

2 /**

3 * Zend Framework

35 * @group Zend_GData_Calendar

36 */

37 class SendEventNotificationsTest extends \PHPUnit_Framework_TestCase

38 {

39

40 public function setUp() {

41 $this->sendEventNotificationsText = file_get_contents(

42 'Zend/GData/Calendar/_files/SendEventNotificationsElementSample1.xml',

43 true);

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

1 <?php

2

3 /**

4 * A PHP code beautifier aimed at adding lots of spaces to files that lack them,

5 * in keeping with MediaWiki's spacey site style.

6 */

7

8

9 if ( php_sapi_name() != 'cli' ) {

10 print "This script must be run from the command line\n";

11 exit( 1 );

39 $line_count = 0;

40 foreach ( $files as $file ) {

41 if ( substr( $file, - 4 ) == '.php' ) {

42 print 'do style: ' . $file . "\n";

43 // stylize_file

EmailListEntryTest.php (https://github.com/momeunier/lisaa-loyly.git) PHP · 140 lines

1 <?php

2 /**

3 * Zend Framework

21 */

22

23 require_once 'Zend/Gdata/Gapps/EmailListEntry.php';

24 require_once 'Zend/Gdata/Gapps.php';

33 * @group Zend_Gdata_Gapps

34 */

35 class Zend_Gdata_Gapps_EmailListEntryTest extends PHPUnit_Framework_TestCase

36 {

37

38 public function setUp() {

39 $this->entryText = file_get_contents(

40 'Zend/Gdata/Gapps/_files/EmailListEntryDataSample1.xml',

41 true);

registry.php (https://github.com/elinw/joomla-cms.git) PHP · 476 lines

1 <?php

2 /**

3 * @package Joomla.Platform

89 *

90 * @since 12.2

91 * @note The interface is only present in PHP 5.4 and up.

92 */

93 public function jsonSerialize()

270 public function loadFile($file, $format = 'JSON', $options = array())

271 {

272 $data = file_get_contents($file);

273

274 return $this->loadString($data, $format, $options);

ReleaseController.php (https://gitlab.com/brucealdridge/yii2) PHP · 211 lines

1 <?php

2 /**

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

69 $headline .= str_repeat('-', strlen($headline) - 2) . "\n\n";

70 foreach($this->getChangelogs() as $file) {

71 $lines = explode("\n", file_get_contents($file));

72 $hl = [

73 array_shift($lines),

120 protected function splitChangelog($file, $version)

121 {

122 $lines = explode("\n", file_get_contents($file));

123

124 // split the file into relevant parts

200 '/function getVersion\(\)\n \{\n return \'(.+?)\';/',

201 "function getVersion()\n {\n return '$version';",

202 YII2_PATH . '/BaseYii.php');

203 }

204

FileLockRegion.php (https://gitlab.com/mario.uriarte/doctrine2.5-tutorial) PHP · 265 lines

1 <?php

2

3 /*

129 private function getLockContent($filename)

130 {

131 return @file_get_contents($filename);

132 }

133

WebContentTest.php (https://github.com/mfairchild365/zf2.git) PHP · 142 lines

1 <?php

2 /**

3 * Zend Framework

35 * @group Zend_GData_Calendar

36 */

37 class WebContentTest extends \PHPUnit_Framework_TestCase

38 {

39

40 public function setUp() {

41 $this->webContentText = file_get_contents(

42 'Zend/GData/Calendar/_files/WebContentElementSample1.xml',

43 true);

DumpCommandTest.php (https://gitlab.com/freebird/WebApp) PHP · 220 lines

1 <?php

2

3 /*

17 use Symfony\Component\Console\Output\NullOutput;

18

19 class DumpCommandTest extends \PHPUnit_Framework_TestCase

20 {

21 private $writeTo;

157

158 $this->assertFileExists($this->writeTo.'/test_asset.css');

159 $this->assertEquals('/* test_asset */', file_get_contents($this->writeTo.'/test_asset.css'));

160 }

161

215 $this->assertFileExists($this->writeTo.'/test_asset.css');

216 $this->assertFileExists($this->writeTo.'/test_leaf.css');

217 $this->assertEquals('/* test_asset */', file_get_contents($this->writeTo.'/test_asset.css'));

218 $this->assertEquals('/* test_leaf */', file_get_contents($this->writeTo.'/test_leaf.css'));

Profile.php (https://github.com/grandison/budo16.git) PHP · 242 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: Profile.php 16971 2009-07-22 18:05:45Z mikaelkael $

21 */

22

24 * @see Zend_Tool_Project_Profile_FileParser_Xml

25 */

26 // require_once 'Zend/Tool/Project/Profile/FileParser/Xml.php';

27

28 /**

29 * @see Zend_Tool_Project_Profile_Resource_Container

30 */

31 // require_once 'Zend/Tool/Project/Profile/Resource/Container.php';

32

33 /**

CmsCompoundObjectTest.php (https://gitlab.com/fbi/october) PHP · 259 lines

1 <?php

2

3 use Cms\Classes\Theme;

98 $srcPath = $themePath.'/testobjects/compound.htm';

99 $this->assertFileExists($srcPath);

100 $testContent = file_get_contents($srcPath);

101 $this->assertNotEmpty($testContent);

102

248 protected function assertFileEqualsNormalized($expected, $actual)

249 {

250 $expected = file_get_contents($expected);

251 $expected = preg_replace('~\R~u', PHP_EOL, $expected); // Normalize EOL

252

253 $actual = file_get_contents($actual);

254 $actual = preg_replace('~\R~u', PHP_EOL, $actual); // Normalize EOL

theme.php (https://gitlab.com/x33n/respond) PHP · 363 lines

1 <?php

2

3 /**

30 if(file_exists($config)){

31

32 $theme_json = file_get_contents($config);

33

34 // add commas for following json objects

183

184 if(file_exists($location)){

185 $content = file_get_contents($location);

186

187 // fix images

296 $response = new Tonic\Response(Tonic\Response::OK);

297 $response->contentType = 'application/json';

298 $response->body = file_get_contents($file);

299

300 return $response;

WhereTest.php (https://github.com/Exercise/zf2.git) PHP · 144 lines

1 <?php

2 /**

3 * Zend Framework

35 * @group Zend_GData

36 */

37 class WhereTest extends \PHPUnit_Framework_TestCase

38 {

39

40 public function setUp() {

41 $this->whereText = file_get_contents(

42 'Zend/GData/_files/WhereElementSample1.xml',

43 true);

OpenSearchTotalResultsTest.php (https://github.com/Exercise/zf2.git) PHP · 129 lines

1 <?php

2 /**

3 * Zend Framework

36 * @group Zend_GData_OpenSearch

37 */

38 class OpenSearchTotalResultsTest extends \PHPUnit_Framework_TestCase

39 {

40

41 public function setUp() {

42 $this->openSearchTotalResultsText = file_get_contents(

43 'Zend/GData/_files/OpenSearchTotalResultsElementSample1.xml',

44 true);

GenerateDoctrineCrudCommandTest.php (https://gitlab.com/pr0055/symfonypizza) PHP · 289 lines

1 <?php

2

3 /*

102 $expected = 'acme_blog_post:';

103

104 $this->assertContains($expected, file_get_contents($rootDir.'/config/routing.yml'));

105 }

106

133 $tester->execute($options);

134

135 $this->assertEquals($routing, file_get_contents($rootDir.'/config/routing.yml'));

136 }

137

142 $routing = <<<DATA

143 acme_blog:

144 resource: "@AcmeBlogBundle/Controller/OtherController.php"

145 type: annotation

146 DATA;

Version20150413102515.php (https://gitlab.com/adrianovieira/cacic) PHP · 585 lines

1 <?php

2

3 namespace Cacic\CommonBundle\Migrations;

33 $rootDir = $this->container->get('kernel')->getRootDir();

34 $upgrade1 = $rootDir."/../src/Cacic/CommonBundle/Resources/data/upgrade-3.1.12-3.sql";

35 $upgradeSQL1 = file_get_contents($upgrade1);

36

37 $logger->debug("Arquivo de atualização: $upgrade1");

PluginLoader.php (https://github.com/adrienne/Readability.git) PHP · 464 lines

1 <?php

2 /**

3 * Zend Framework

21

22 /** Zend_Loader_PluginLoader_Interface */

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

24

25 /** Zend_Loader */

26 require_once 'Zend/Loader.php';

27

28 /**

136 {

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

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

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

140 }

new_demo.php (https://bitbucket.org/michaelku/tumblr-note-stats-v2.git) PHP · 260 lines

1 <?php

2

3 /**********************************/

11 $start = $time;

12

13 $notes = file_get_contents('notes.txt', true);

14 $notes = trim($notes);

15

Loader.php (https://gitlab.com/madwanz64/laravel) PHP · 255 lines

1 <?php

2

3 namespace Dotenv;

6 use Dotenv\Exception\InvalidPathException;

7 use Dotenv\Regex\Regex;

8 use PhpOption\Option;

9

10 /**

141 * @param string $filePath

142 *

143 * @return \PhpOption\Option

144 */

145 private static function readFromFile($filePath)

146 {

147 $content = @file_get_contents($filePath);

148

149 return Option::fromValue($content, false);

20120702Test.php (https://github.com/istos/DrupalRooms.git) PHP · 289 lines

1 <?php

2 require_once('../geoPHP.inc');

3 require_once('PHPUnit/Autoload.php');

4

5 class Tests_20120702 extends PHPUnit_Framework_TestCase {

11 function testMethods() {

12 $format = 'gpx';

13 $value = file_get_contents('./input/20120702.gpx');

14 $geometry = geoPHP::load($value, $format);

GifCreator.php (https://gitlab.com/billyprice1/mc-skintools) PHP · 349 lines

1 <?php

2

3 namespace GifCreator;

8 * @link https://github.com/Sybio/GifCreator

9 * @author Sybio (Clément Guillemain / @Sybio01)

10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License

11 * @copyright Clément Guillemain

12 * @modified by Max Korlaar

106 if (file_exists($frames[$i]) || filter_var($frames[$i], FILTER_VALIDATE_URL)) { // File path

107

108 $frames[$i] = file_get_contents($frames[$i]);

109 }

110

adminController.php (https://gitlab.com/higordaniell/SIN-352) PHP · 403 lines

1 <?php

2 class adminController extends Controller {

3

139 $it->setImage($image);

140

141 $image->setData( file_get_contents($_FILES["image"]["tmp_name"], 'rb') );

142 $image->setMime( $_FILES["image"]["type"] );

143 if($livro_id < 0) { //Novo livro

Mail.php (https://github.com/shooray/oscommerce.git) PHP · 375 lines

1 <?php

2 /**

3 * osCommerce Online Merchant

105 if ( $is_uploaded === true ) {

106 } elseif ( file_exists($file) && is_readable($file) ) {

107 $data = file_get_contents($file);

108 $filename = basename($file);

109 $mimetype = $this->_get_mime_type($filename);

120 if ( $is_uploaded === true ) {

121 } elseif ( file_exists($file) && is_readable($file) ) {

122 $data = file_get_contents($file);

123 $filename = basename($file);

124 $mimetype = $this->_get_mime_type($filename);

IteratorTestDocBlox.php (https://github.com/studioskylab/Docblox.git) PHP · 290 lines

1 <?php

2 /**

3 * DocBlox

4 *

5 * PHP Version 5

6 *

7 * @category DocBlox

10 * @author Mike van Riel <mike.vanriel@naenius.com>

11 * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)

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

13 * @link http://docblox-project.org

14 */

253

254 public function testGetBrokenTokenIdsOfBracePair() {

255 $tokens = token_get_all(file_get_contents(dirname(__FILE__) . '/../../../data/TokenIteratorTestFixture.php'));

256 $mock = new DocBlox_Reflection_TokenIteratorMock($tokens);

257

cacheTest.php (https://github.com/makerlabs/Symfohub.git) PHP · 513 lines

1 <?php

2

3 /*

10

11 $app = 'cache';

12 if (!include(dirname(__FILE__).'/../bootstrap/functional.php'))

13 {

14 return;

323

324 // non HTML cache

325 $image = file_get_contents(dirname(__FILE__).'/fixtures/apps/cache/modules/cache/data/ok48.png');

326 sfConfig::set('sf_web_debug', true);

327 $b->

smarty_internal_template.php (https://github.com/taptouchclick/The-Event-Day.git) PHP · 1000 lines

414 * Render the output using the compiled template or the PHP template source

415 *

416 * The rendering process is accomplished by just including the PHP files.

417 * The only exceptions are evaluated templates (string template). Their code has

418 * to be evaluated

506 // escape PHP tags in template content

507 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

508 if (isset($cache_parts[0][$curr_idx])) {

509 $this->properties['has_nocache_code'] = true;

521 $this->rendered_content = ob_get_clean();

522 // write cache file content

523 $this->writeCachedContent('<?php if (!$no_render) {?>'. $output. '<?php } ?>');

524 if ($this->smarty->debugging) {

525 Smarty_Internal_Debug::end_cache($this);

783 if (!empty($this->required_plugins['nocache'])) {

784 $this->has_nocache_code = true;

785 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

786 foreach($this->required_plugins['nocache'] as $tmp) {

787 foreach($tmp as $data) {

file_handling_over_ftp.php (https://github.com/ameximes/akelos.git) PHP · 291 lines

1 <?php

2

3 //

6 if(!defined('AK_UPLOAD_FILES_USING_FTP')){

7 if(!function_exists('ftp_connect')){

8 echo "PHP is not compiled with FTP support\n";

9 return;

10 }

20 }

21

22 require_once(dirname(__FILE__).'/../config.php');

23

24 class FileHandlingOverFtp_TestCase extends ActiveSupportUnitTest

61 }

62

63 public function test_file_get_contents() {

64 if(!RUN_FTP_TESTS) return;

65 $file_name = 'cache'.DS.'test_file_1.txt';

FileRepository_Backend_FileSystem.class.php (https://github.com/dbernar1/Project-Pier.git) PHP · 463 lines

1 <?php

2

3 /**

94 } // if

95

96 return file_get_contents($file_path);

97 } // getFileContent

98

412 throw new FileNotWritableError($file);

413 } // if

414 return file_put_contents($file, "<?php\n\nreturn " . var_export($this->attributes, true) . ";\n\n?>");

415 } // saveFileAttributes

416

422 */

423 protected function getAttributesFilePath() {

424 return with_slash($this->getRepositoryDir()) . 'attributes.php';

425 } // getAttributesFilePath

426

example27_CJK_using_Adobe_fonts.php (https://bitbucket.org/vsposato/vivo-tools.git) PHP · 91 lines

1 <?php

2

3 ini_set("memory_limit","256M");

68 //==============================================================

69

70 include("../mpdf.php");

71

72 $mpdf=new mPDF('+aCJK','A4','','',32,25,27,25,16,13);

77

78 // LOAD a stylesheet

79 $stylesheet = file_get_contents('mpdfstyleA4.css');

80 $mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text

81

image.php (https://gitlab.com/Ltaimao/wecenter) PHP · 437 lines

1 <?php

2 /*

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

193 $im = new Imagick();

194

195 $im->readimageblob(file_get_contents($this->source_image));

196

197 $im->setCompressionQuality($this->quality);

smarty_internal_config.php (https://github.com/raphaelbastide/berta.git) PHP · 270 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Config

116 // read source file

117 if (file_exists($this->getConfigFilepath())) {

118 $this->config_source = file_get_contents($this->getConfigFilepath());

119 return true;

120 } else {

150 $_compile_dir .= DS;

151 }

152 return $_compile_dir . $_filepath . '.' . basename($this->config_resource_name) . '.config' . '.php';

153 }

154 /**

190 $this->compileConfigSource();

191 } else {

192 $this->compiled_config = file_get_contents($this->getCompiledFilepath());

193 }

194 }

methodsTest.php (https://bitbucket.org/rmoger/gdp-testsite1.git) PHP · 365 lines

1 <?php

2 require_once('../geoPHP.inc');

3 require_once('PHPUnit/Autoload.php');

4

5 class MethodsTests extends PHPUnit_Framework_TestCase {

14 if ($parts[0]) {

15 $format = $parts[1];

16 $value = file_get_contents('./input/'.$file);

17 $geometry = geoPHP::load($value, $format);

291 function _methods_tester_with_geos($geometry) {

292 // Cannot test methods if GEOS is not intstalled

293 if (!geoPHP::geosInstalled()) return;

294

295 $methods = array(

Storage.php (https://github.com/jmarien/phpBayeux.git) PHP · 316 lines

1 <?php

2

3 /**

48 $clientPath = $this->_cacheBackend . DIRECTORY_SEPARATOR . 'client_'.$clientid;

49 //_log(' '.__FILE__.' '.__LINE__.' | get client info from '.$clientPath);

50 $clientinfo = unserialize(file_get_contents($clientPath));

51 if (isset($clientinfo[$channel])) {

52 $lastid = $clientinfo[$channel];

87 //_log(' '.__FILE__.' '.__LINE__.' | get client info from '.$clientPath);

88 if (file_exists($clientPath)) {

89 $clientinfo = unserialize(file_get_contents($clientPath));

90 return($clientinfo);

91 }

114 case 'file':

115 $clientPath = $this->_cacheBackend . DIRECTORY_SEPARATOR . 'client_'.$clientid;

116 $clientinfo = unserialize(file_get_contents($clientPath));

117 foreach($clientinfo as $channel => $id) {

118 $this->setChannel($channel);

S3.php (https://gitlab.com/endomorphosis/jeffersonsmithmayor) PHP · 410 lines

1 <?php

2

3 /**

9

10 if (!class_exists('S3')) {

11 require_once W3TC_LIB_DIR . '/S3.php';

12 }

13

14 require_once W3TC_LIB_W3_DIR . '/Cdn/Base.php';

15

16 /**

26

27 /**

28 * PHP5 Constructor

29 *

30 * @param array $config

Filesystem.php (https://gitlab.com/zan_zan/laravel_sample) PHP · 442 lines

1 <?php

2

3 namespace Illuminate\Filesystem;

35 {

36 if ($this->isFile($path)) {

37 return file_get_contents($path);

38 }

39

getff.php (https://gitlab.com/AaronDeb/cloudbox) PHP · 518 lines

1 <?PHP

2 include 'init.php';

41 $actFN = $fActNameResult[0]['clmnActFN'];

42 }

43 $data = file_get_contents("../files/" . $actFN);

44 echo base64_encode($data);

45 echo "</filecontents>";

GithubWebhookTest.php (https://gitlab.com/x33n/kanboard) PHP · 459 lines

1 <?php

2

3 require_once __DIR__.'/Base.php';

24 $this->assertNotFalse($g->parsePayload(

25 'issues',

26 json_decode(file_get_contents(__DIR__.'/fixtures/github_issue_opened.json'), true)

27 ));

28 }

49 $this->assertNotFalse($g->parsePayload(

50 'issues',

51 json_decode(file_get_contents(__DIR__.'/fixtures/github_issue_assigned.json'), true)

52 ));

53 }

61 $g->setProjectId(1);

62

63 $payload = json_decode(file_get_contents(__DIR__.'/fixtures/github_issue_assigned.json'), true);

64

65 $this->assertFalse($g->handleIssueAssigned($payload['issue']));

BitbucketWebhookTest.php (https://gitlab.com/x33n/kanboard) PHP · 398 lines

1 <?php

2

3 require_once __DIR__.'/Base.php';

19 $p = new Project($this->container);

20 $bw = new BitbucketWebhook($this->container);

21 $payload = json_decode(file_get_contents(__DIR__.'/fixtures/bitbucket_push.json'), true);

22

23 $this->assertEquals(1, $p->create(array('name' => 'test')));

51 $this->assertNotFalse($bw->parsePayload(

52 'issue:created',

53 json_decode(file_get_contents(__DIR__.'/fixtures/bitbucket_issue_opened.json'), true)

54 ));

55 }

70 $this->assertNotFalse($g->parsePayload(

71 'issue:comment_created',

72 json_decode(file_get_contents(__DIR__.'/fixtures/bitbucket_comment_created.json'), true)

73 ));

74 }

smarty_internal_template.php (https://github.com/raphaelbastide/berta.git) PHP · 901 lines

1 <?php

2

3 /**

405 * Render the output using the compiled template or the PHP template source

406 *

407 * The rendering process is accomplished by just including the PHP files.

408 * The only exceptions are evaluated templates (string template). Their code has

409 * to be evaluated

495 // escape PHP tags in template content

496 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

497 if (isset($cache_parts[0][$curr_idx])) {

498 $this->properties['has_nocache_code'] = true;

754 if (!empty($this->required_plugins['nocache'])) {

755 $this->has_nocache_code = true;

756 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

757 foreach($this->required_plugins['nocache'] as $tmp) {

758 foreach($tmp as $data) {

example28_CJK_using_embedded_fonts.php (https://gitlab.com/sylver.gocloud/gocloudasia-college-system-framework) PHP · 89 lines

1 <?php

2

3 ini_set("memory_limit","256M");

66 //==============================================================

67

68 include("../mpdf.php");

69

70 $mpdf=new mPDF('-aCJK','A4','','',32,25,27,25,16,13);

75

76 // LOAD a stylesheet

77 $stylesheet = file_get_contents('mpdfstyleA4.css');

78 $mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text

79

Filesystem.php (https://gitlab.com/techniconline/kmc) PHP · 426 lines

1 <?php namespace Illuminate\Filesystem;

2

3 use ErrorException;

33 public function get($path)

34 {

35 if ($this->isFile($path)) return file_get_contents($path);

36

37 throw new FileNotFoundException("File does not exist at path {$path}");

gists.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 593 lines

1 <?php

2 /**

3 * @package Joomla.Platform

585 else

586 {

587 $data[basename($file)] = array('content' => file_get_contents($file));

588 }

589 }

func_skins.php (https://github.com/lewellyn/TrellisDesk.git) PHP · 976 lines

1 <?php

2

3 /**

79 if ( ! is_readable( $file ) || ! is_file( $file ) ) return false;

80

81 return file_get_contents( $file );

82 }

83

92 if ( ! is_readable( $file ) || ! is_file( $file ) ) return false;

93

94 return file_get_contents( $file );

95 }

96

105 if ( ! is_readable( $file ) || ! is_file( $file ) ) return false;

106

107 return file_get_contents( $file );

108 }

109

Status.php (https://gitlab.com/daigiangaitu91/magento) PHP · 221 lines

1 <?php

2 /**

3 * Copyright © 2015 Magento. All rights reserved.

77 {

78 if (file_exists($this->statusFilePath)) {

79 return file_get_contents($this->statusFilePath);

80 }

81 return '';

126 {

127 $isNewFile = !file_exists($filePath);

128 if (!$isNewFile && file_get_contents($filePath)) {

129 $text = $newline ? PHP_EOL . "{$text}" :"{$text}";

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

1 <?php

2 /**

3 * @package Joomla.Tests

8 */

9

10 // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace

11

12 use Codeception\Util\FileSystem;

267 [

268 'path' => $this->testDirectory . '/test.jpg',

269 'content' => base64_encode(file_get_contents(codecept_data_dir() . '/com_media/test-image-1.jpg'))

270 ]

271 );

316 [

317 'path' => 'local-images:/' . $this->testDirectory . '/test.jpg',

318 'content' => base64_encode(file_get_contents(codecept_data_dir() . '/com_media/test-image-1.jpg'))

319 ]

320 );

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

1 <?php

2

3 /**

113 if (!static::$types) {

114 $path = __DIR__ . '/types.json';

115 static::$types = json_decode(file_get_contents($path), true);

116 }

117 }

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

1 <?php

2 /**

3 * @package Joomla.Platform

124 {

125 $path = JPATH_PLATFORM . '/joomla/microdata/types.json';

126 static::$types = json_decode(file_get_contents($path), true);

127 }

128 }

RssTest.php (https://github.com/leerbag/zf2.git) PHP · 1433 lines

1 <?php

2 /**

3 * Zend Framework

36 * @group Zend_Feed_Reader

37 */

38 class RssTest extends \PHPUnit_Framework_TestCase

39 {

40

121 {

122 $feed = Reader\Reader::importString(

123 file_get_contents($this->_feedSamplePath.'/title/plain/rss20.xml')

124 );

125 $this->assertEquals('My Title', $feed->getTitle());

129 {

130 $feed = Reader\Reader::importString(

131 file_get_contents($this->_feedSamplePath.'/title/plain/rss094.xml')

132 );

133 $this->assertEquals('My Title', $feed->getTitle());

RssTest.php (https://github.com/leerbag/zf2.git) PHP · 1490 lines

1 <?php

2 /**

3 * Zend Framework

36 * @group Zend_Feed_Reader

37 */

38 class RssTest extends \PHPUnit_Framework_TestCase

39 {

40

121 {

122 $feed = Reader\Reader::importString(

123 file_get_contents($this->_feedSamplePath.'/id/plain/rss20.xml')

124 );

125 $entry = $feed->current();

130 {

131 $feed = Reader\Reader::importString(

132 file_get_contents($this->_feedSamplePath.'/id/plain/rss094.xml')

133 );

134 $entry = $feed->current();

smarty_internal_template.php (https://github.com/hatone/revolution.git) PHP · 972 lines

494 // escape PHP tags in template content

495 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

496 if (isset($cache_parts[0][$curr_idx])) {

497 $this->properties['has_nocache_code'] = true;

506 $this->rendered_content = ob_get_clean();

507 // write cache file content

508 $this->writeCachedContent('<?php if (!$no_render) {?>'. $output. '<?php } ?>');

509 if ($this->smarty->debugging) {

510 Smarty_Internal_Debug::end_cache($this);

524 *

525 * If the cache is valid the cached content is used, otherwise

526 * the output is rendered from the compiled template or PHP template source

527 *

528 * @return string rendered HTML output

758 if (!empty($this->required_plugins['nocache'])) {

759 $this->has_nocache_code = true;

760 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

761 foreach($this->required_plugins['nocache'] as $tmp) {

762 foreach($tmp as $data) {

smarty_internal_template.php (https://github.com/pws5068/RSNCorp.git) PHP · 813 lines

1 <?php

2

3 /**

229 } else {

230 if ($this->compiled_template === null) {

231 $this->compiled_template = !$this->resource_object->isEvaluated && $this->resource_object->usesCompiler ? file_get_contents($this->getCompiledFilepath()) : false;

232 }

233 }

478 // escape PHP tags in template content

479 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

480 if (isset($cache_parts[0][$curr_idx])) {

481 $this->properties['has_nocache_code'] = true;

737 if (!empty($this->required_plugins['nocache'])) {

738 $this->has_nocache_code = true;

739 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

740 foreach($this->required_plugins['nocache'] as $tmp) {

741 foreach($tmp as $data) {

RssTest.php (https://github.com/zucchi/zf2.git) PHP · 1438 lines

1 <?php

2 /**

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

21 * @group Zend_Feed_Reader

22 */

23 class RssTest extends \PHPUnit_Framework_TestCase

24 {

25

91 {

92 $feed = Reader\Reader::importString(

93 file_get_contents($this->feedSamplePath.'/title/plain/rss20.xml')

94 );

95 $this->assertEquals('My Title', $feed->getTitle());

99 {

100 $feed = Reader\Reader::importString(

101 file_get_contents($this->feedSamplePath.'/title/plain/rss094.xml')

102 );

103 $this->assertEquals('My Title', $feed->getTitle());

RssTest.php (https://github.com/zucchi/zf2.git) PHP · 1495 lines

1 <?php

2 /**

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

21 * @group Zend_Feed_Reader

22 */

23 class RssTest extends \PHPUnit_Framework_TestCase

24 {

25

91 {

92 $feed = Reader\Reader::importString(

93 file_get_contents($this->feedSamplePath.'/id/plain/rss20.xml')

94 );

95 $entry = $feed->current();

100 {

101 $feed = Reader\Reader::importString(

102 file_get_contents($this->feedSamplePath.'/id/plain/rss094.xml')

103 );

104 $entry = $feed->current();

popularity.php (https://gitlab.com/akbaryu/intro_magang_web) PHP · 296 lines

1 <?php

2 namespace Grav\Plugin;

3

280 {

281 if (file_exists($path)) {

282 return (array)json_decode(file_get_contents($path), true);

283 } else {

284 return [];

TestCase.php (https://github.com/shevron/zf2.git) PHP · 389 lines

1 <?php

2 /**

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

14 use Zend\Cloud\StorageService\Factory;

15 use Zend\Config\Config,

16 PHPUnit_Framework_TestCase as PHPUnitTestCase;

17

18 /**

24 * @subpackage UnitTests

25 */

26 abstract class TestCase extends PHPUnitTestCase

27 {

28 /**

122 //

123 // $returnedData = $this->_commonStorage->fetchItem($dummyNameStream);

124 // $this->assertEquals(file_get_contents($originalFilename), $returnedData);

125 // $this->_commonStorage->deleteItem($dummyNameStream);

126 // } catch (Exception $e) {

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

1 <?php

2 /**

3 * File containing the ezcTemplateSourceCode class

56 *

57 * @property string $stream

58 * The PHP stream path for the template source file.

59 * @property string $resource

60 * The resource string which requested this template.

145 * Initialises the source object with the code and output context.

146 *

147 * @param string $stream The actual PHP stream path for the template source

148 * file.

149 * @param string $resource The requested resource string, if false $stream

164

165 /**

166 * Loads the data from the PHP stream into the $code member variable.

167 *

168 * @throws ezcTemplateFileNotFoundException if the file does not exist on disk.

Tmx.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 233 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Locale */

24 // require_once 'Zend/Locale.php';

25

26 /** Zend_Translate_Adapter */

27 // require_once 'Zend/Translate/Adapter.php';

28

29

59 $this->_data = array();

60 if (!is_readable($filename)) {

61 // require_once 'Zend/Translate/Exception.php';

62 throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');

63 }

file.php (https://bitbucket.org/Maron1/taqman.git) PHP · 355 lines

1 <?php namespace Laravel; use FilesystemIterator as fIterator;

2

3 class File {

31 public static function get($path, $default = null)

32 {

33 return (file_exists($path)) ? file_get_contents($path) : value($default);

34 }

35

164 * Determine if a file is of a given type.

165 *

166 * The Fileinfo PHP extension is used to determine the file's MIME type.

167 *

168 * <code>

smarty_internal_template.php (https://github.com/Alex8452/Kurogo-Mobile-Web-Doc-Translation.git) PHP · 998 lines

412 * Render the output using the compiled template or the PHP template source

413 *

414 * The rendering process is accomplished by just including the PHP files.

415 * The only exceptions are evaluated templates (string template). Their code has

416 * to be evaluated

504 // escape PHP tags in template content

505 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

506 if (isset($cache_parts[0][$curr_idx])) {

507 $this->properties['has_nocache_code'] = true;

519 $this->rendered_content = ob_get_clean();

520 // write cache file content

521 $this->writeCachedContent('<?php if (!$no_render) {?>'. $output. '<?php } ?>');

522 if ($this->smarty->debugging) {

523 Smarty_Internal_Debug::end_cache($this);

781 if (!empty($this->required_plugins['nocache'])) {

782 $this->has_nocache_code = true;

783 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

784 foreach($this->required_plugins['nocache'] as $tmp) {

785 foreach($tmp as $data) {

Microdata.php (https://github.com/Hackwar/joomla-cms.git) PHP · 899 lines

1 <?php

2 /**

3 * Joomla! Content Management System

117 {

118 $path = __DIR__ . '/types.json';

119 static::$types = json_decode(file_get_contents($path), true);

120 }

121 }

Filesystem.php (https://gitlab.com/kimting254/wbms) PHP · 441 lines

1 <?php namespace Illuminate\Filesystem;

2

3 use ErrorException;

32 public function get($path)

33 {

34 if ($this->isFile($path)) return file_get_contents($path);

35

36 throw new FileNotFoundException("File does not exist at path {$path}");

RssTest.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 1414 lines

1 <?php

2 /**

3 * Zend Framework

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

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

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

21 */

22

23 require_once 'Zend/Feed/Reader.php';

24 require_once 'Zend/Registry.php';

33 * @group Zend_Feed_Reader

34 */

35 class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase

36 {

37

RssTest.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 1471 lines

1 <?php

2 /**

3 * Zend Framework

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

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

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

21 */

22

23 require_once 'Zend/Feed/Reader.php';

24

25 /**

32 * @group Zend_Feed_Reader

33 */

34 class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase

35 {

36

ProductRepositoryTest.php (https://gitlab.com/axeltizon/magento-demopoweraccess) PHP · 624 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

52 'link_file_content' => [

53 'name' => 'link1_content.jpg',

54 'file_data' => base64_encode(file_get_contents($this->testImagePath)),

55 ],

56 'sample_type' => 'file',

57 'sample_file_content' => [

58 'name' => 'link1_sample.jpg',

59 'file_data' => base64_encode(file_get_contents($this->testImagePath)),

60 ],

61 ],

115 'sample_file_content' => [

116 'name' => 'sample2.jpg',

117 'file_data' => base64_encode(file_get_contents($this->testImagePath)),

118 ],

119 ],

parser.php (https://github.com/Yacodo/atoum.git) PHP · 699 lines

1 <?php

2

3 namespace mageekguy\atoum\tests\units\template;

9 ;

10

11 require_once __DIR__ . '/../../runner.php';

12

13 class parser extends atoum\test

36 ;

37

38 $parser = new template\parser($namespace = rand(1, PHP_INT_MAX));

39

40 $this->assert

61

62 $this->assert

63 ->object($parser->setNamespace($namespace = rand(1, PHP_INT_MAX)))->isIdenticalTo($parser)

64 ->string($parser->getNamespace())->isEqualTo((string) $namespace)

65 ;

controller.php (https://github.com/Yacodo/atoum.git) PHP · 1000 lines

1 <?php

2

3 namespace mageekguy\atoum\tests\units\mock\stream;

9 ;

10

11 require_once __DIR__ . '/../../../runner.php';

12

13 class controller extends atoum\test

375 ;

376

377 $streamController->resetCalls()->file_get_contents = $contents = uniqid();

378

379 $this->assert

FilesystemTest.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 1015 lines

46 public function testCopyUnreadableFileFails()

47 {

48 // skip test on Windows; PHP can't easily set file as unreadable on Windows

49 if ('\\' === DIRECTORY_SEPARATOR) {

50 $this->markTestSkipped('This test cannot run on Windows.');

120 public function testCopyWithOverrideWithReadOnlyTargetFails()

121 {

122 // skip test on Windows; PHP can't easily set file as unwritable on Windows

123 if ('\\' === DIRECTORY_SEPARATOR) {

124 $this->markTestSkipped('This test cannot run on Windows.');

167

168 $this->assertFileExists($targetFilePath);

169 $this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath));

170 }

171

ImagickSystemTest.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 1091 lines

1 <?php

2

3 class ImagickSystemTest extends PHPUnit_Framework_TestCase

22 public function testMakeFromString()

23 {

24 $str = file_get_contents('tests/images/circle.png');

25 $img = $this->manager()->make($str);

26 $this->assertInstanceOf('Intervention\Image\Image', $img);

856 public function testInsertBinary()

857 {

858 $data = file_get_contents('tests/images/tile.png');

859 $img = $this->manager()->make('tests/images/trim.png');

860 $img->insert($data);

995 public function testFillImageWithBinary()

996 {

997 $data = file_get_contents('tests/images/tile.png');

998 $img = $this->manager()->make('tests/images/trim.png');

999 $img->fill($data, 0, 0);

GdSystemTest.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 1083 lines

1 <?php

2

3 class GdSystemTest extends PHPUnit_Framework_TestCase

23 public function testMakeFromString()

24 {

25 $str = file_get_contents('tests/images/circle.png');

26 $img = $this->manager()->make($str);

27 $this->assertInstanceOf('Intervention\Image\Image', $img);

851 public function testInsertBinary()

852 {

853 $data = file_get_contents('tests/images/tile.png');

854 $img = $this->manager()->make('tests/images/trim.png');

855 $img->insert($data);

990 public function testFillImageWithBinary()

991 {

992 $data = file_get_contents('tests/images/tile.png');

993 $img = $this->manager()->make('tests/images/trim.png');

994 $img->fill($data, 0, 0);

File.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 934 lines

1 <?php

2 /**

3 * Origin filesystem driver

14 * Class File

15 * @package Magento\Framework\Filesystem\Driver

16 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)

17 */

18 class File implements DriverInterface

144 {

145 clearstatcache();

146 $result = @file_get_contents($this->getScheme() . $path, $flag, $context);

147 if (false === $result) {

148 throw new FileSystemException(

methodsTest.php (https://gitlab.com/leoplanxxi/dr7-web-buap-2016) PHP · 359 lines

1 <?php

2 require_once('../geoPHP.inc');

3 class MethodsTests extends PHPUnit_Framework_TestCase {

4

5 function setUp() {

12 if ($parts[0]) {

13 $format = $parts[1];

14 $value = file_get_contents('./input/'.$file);

15 echo "\nloading: " . $file . " for format: " . $format;

16 $geometry = geoPHP::load($value, $format);

285 function _methods_tester_with_geos($geometry) {

286 // Cannot test methods if GEOS is not intstalled

287 if (!geoPHP::geosInstalled()) return;

288

289 $methods = array(

ImagickSystemTest.php (https://gitlab.com/techniconline/kmc) PHP · 1112 lines

1 <?php

2

3 class ImagickSystemTest extends PHPUnit_Framework_TestCase

22 public function testMakeFromString()

23 {

24 $str = file_get_contents('tests/images/circle.png');

25 $img = $this->manager()->make($str);

26 $this->assertInstanceOf('Intervention\Image\Image', $img);

871 public function testInsertBinary()

872 {

873 $data = file_get_contents('tests/images/tile.png');

874 $img = $this->manager()->make('tests/images/trim.png');

875 $img->insert($data);

GdSystemTest.php (https://gitlab.com/techniconline/kmc) PHP · 1106 lines

1 <?php

2

3 class GdSystemTest extends PHPUnit_Framework_TestCase

23 public function testMakeFromString()

24 {

25 $str = file_get_contents('tests/images/circle.png');

26 $img = $this->manager()->make($str);

27 $this->assertInstanceOf('Intervention\Image\Image', $img);

866 public function testInsertBinary()

867 {

868 $data = file_get_contents('tests/images/tile.png');

869 $img = $this->manager()->make('tests/images/trim.png');

870 $img->insert($data);

fStatementTest.php (https://github.com/netcarver/flourish.git) PHP · 681 lines

1 <?php

2 require_once('./support/init.php');

3

4 class fStatementTest extends PHPUnit_Framework_TestSuite

5 {

6 public static function suite()

13 }

14

15 class fStatementTestModifications extends PHPUnit_Framework_TestCase

16 {

17 public $db;

23 }

24 $this->db = new fDatabase(DB_TYPE, DB, DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT);

25 $this->db->execute(file_get_contents(DB_SETUP_FILE));

26 }

27

fORMOrderingTest.php (https://github.com/netcarver/flourish.git) PHP · 502 lines

1 <?php

2 require_once('./support/init.php');

14 class TopAlbum extends fActiveRecord { }

15

16 class fORMOrderingTest extends PHPUnit_Framework_TestCase

17 {

18 protected static $db;

25 }

26 $db = new fDatabase(DB_TYPE, DB, DB_USERNAME, DB_PASSWORD, DB_HOST, DB_PORT);

27 $db->execute(file_get_contents(DB_SETUP_FILE));

28 $db->execute(file_get_contents(DB_EXTENDED_SETUP_FILE));

class-wp-filesystem-direct.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 664 lines

1 <?php

2 /**

3 * WordPress Direct Filesystem.

8

9 /**

10 * WordPress Filesystem Class for direct PHP file and folder manipulation.

11 *

12 * @since 2.5.0

37 */

38 public function get_contents( $file ) {

39 return @file_get_contents( $file );

40 }

41

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

536

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

68 }

69 $this->bot->maxredirs = 0;

70 if ( $this->bot->submit( $this->bot->wikiServer . PREFIX . '/index.php', $post_vars ) ) {

71 // Now we need to check whether our edit was accepted. If it was, we'll get a 302 redirecting us to the article. If it wasn't (e.g. because of an edit conflict), we'll get a 200.

72 $code = substr( $this->bot->response_code, 9, 3 ); // shorten 'HTTP 1.1 200 OK' to just '200'

147 }

148 } else {

149 echo "pull submit failed:(" . $this->bot->wikiServer . PREFIX . '/index.php' . $post_vars . ")";

150 return false;

151 }

176 $post_vars['action'] = 'logootize';

177 $this->bot->maxredirs = 0;

178 // $url = $this->bot->wikiServer.PREFIX.'/index.php/Special:DSMWAdmin';

179 if ( $this->bot->submit( $this->bot->wikiServer . PREFIX . '/index.php/Special:DSMWAdmin', $post_vars ) ) {

277

278 function getFileFeatures( $file, $size ) {

279 $url = $this->bot->wikiServer . PREFIX . '/api.php?action=query&titles=File:' . $file . '&prop=imageinfo&iilimit=50&iiend=20071231235959&iiprop=timestamp|user|url|size&format=php';

280 $image = file_get_contents( $url );

graph.test.php (https://github.com/kwijibo/sparql-proxy.git) PHP · 415 lines

1 <?php

2 require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'constants.inc.php';

3 require_once MORIARTY_DIR . 'graph.class.php';

4 require_once MORIARTY_TEST_DIR . 'fakecredentials.class.php';

5

6 class GraphTest extends PHPUnit_Framework_TestCase {

7 var $_empty_changeset = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cs="http://purl.org/vocab/changeset/schema#">

8 <rdf:Description rdf:nodeID="cs">

10 <cs:subjectOfChange rdf:nodeID="a" />

11 <cs:creatorName>Ian</cs:creatorName>

12 <cs:changeReason>PHP Client Test</cs:changeReason>

13 </rdf:Description>

14 </rdf:RDF>';

20120702Test.php (https://gitlab.com/leoplanxxi/dr7-web-buap-2016) PHP · 287 lines

1 <?php

2 require_once('../geoPHP.inc');

3 class Tests_20120702 extends PHPUnit_Framework_TestCase {

4

5 function setUp() {

9 function testMethods() {

10 $format = 'gpx';

11 $value = file_get_contents('./input/20120702.gpx');

12 $geometry = geoPHP::load($value, $format);

Rsa.php (https://github.com/sidealice/zf2.git) PHP · 306 lines

1 <?php

2 /**

3 * Zend Framework

196 $publicKey = null;

197 $resource = openssl_pkey_new($config);

198 // above fails on PHP 5.3

199

200 openssl_pkey_export($resource, $private, $passPhrase);

228 {

229 $this->_pemPath = $value;

230 $this->setPemString(file_get_contents($this->_pemPath));

231 }

232

240 {

241 $this->_certificatePath = $value;

242 $this->setCertificateString(file_get_contents($this->_certificatePath));

243 }

244

TemporaryFileFilterTest.php (https://github.com/fruux/sabre-dav.git) PHP · 199 lines

1 <?php declare (strict_types=1);

2

3 namespace Sabre\DAV;

26 $this->assertEquals('0', $this->response->getHeader('Content-Length'));

27

28 $this->assertEquals('Testing new file', file_get_contents(SABRE_TEMPDIR . '/testput.txt'));

29

30 }

Abstract.php (https://gitlab.com/Zinnurain/destination_finder_beta) PHP · 255 lines

22 * @package PHPExcel_Reader

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

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

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

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

35 */

36 abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader

37 {

38 /**

116 * @param boolean $pValue

117 *

118 * @return PHPExcel_Reader_IReader

119 */

120 public function setIncludeCharts($pValue = FALSE) {

158 * Tells the Reader to load all worksheets from the workbook.

159 *

160 * @return PHPExcel_Reader_IReader

161 */

162 public function setLoadAllSheets()

smarty_internal_template.php (https://github.com/laurentc/NApf.git) PHP · 1003 lines

416 * Render the output using the compiled template or the PHP template source

417 *

418 * The rendering process is accomplished by just including the PHP files.

419 * The only exceptions are evaluated templates (string template). Their code has

420 * to be evaluated

508 // escape PHP tags in template content

509 $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);

510 if (isset($cache_parts[0][$curr_idx])) {

511 $this->properties['has_nocache_code'] = true;

523 $this->rendered_content = ob_get_clean();

524 // write caches common content

525 $this->writeCachedContent('<?php if (!$no_render) {?>' . $output . '<?php } ?>');

526 if ($this->smarty->debugging) {

527 Smarty_Internal_Debug::end_cache($this);

785 if (!empty($this->required_plugins['nocache'])) {

786 $this->has_nocache_code = true;

787 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";

788 foreach ($this->required_plugins['nocache'] as $tmp) {

789 foreach ($tmp as $data) {

FileReflection.php (https://github.com/kiranatama/sagalaya.git) PHP · 314 lines

1 <?php

2 /**

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

250 public function getContents()

251 {

252 return file_get_contents($this->filePath);

253 }

254

FilesystemTest.php (https://gitlab.com/MineYourMind/BoNeMEAL) PHP · 1148 lines

1 <?php

2

3 /*

27

28 $this->assertFileExists($targetFilePath);

29 $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));

30 }

31

46 public function testCopyUnreadableFileFails()

47 {

48 // skip test on Windows; PHP can't easily set file as unreadable on Windows

49 if ('\\' === DIRECTORY_SEPARATOR) {

50 $this->markTestSkipped('This test cannot run on Windows.');

167

168 $this->assertFileExists($targetFilePath);

169 $this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath));

170 }

171

Loader.php (https://gitlab.com/Skull3x/FlagSpiral) PHP · 273 lines

1 <?php

2 namespace xbeastmode\flagspiral;

3 use pocketmine\level\particle\DustParticle;

114 $dir = glob($this->getDataFolder()."custom/*", GLOB_BRACE);

115 foreach($dir as $d){

116 $data[] = unserialize(file_get_contents($d));

117 }

118 return $data === null ? null : $data;

Tmx.php (https://github.com/Shreef/zf2.git) PHP · 234 lines

1 <?php

2 /**

3 * Zend Framework

76 xml_set_character_data_handler($this->_file, "_contentElement");

77

78 if (!xml_parse($this->_file, file_get_contents($filename))) {

79 $ex = sprintf('XML error: %s at line %d',

80 xml_error_string(xml_get_error_code($this->_file)),

214 protected function _findEncoding($filename)

215 {

216 $file = file_get_contents($filename, null, null, 0, 100);

217 if (strpos($file, "encoding") !== false) {

218 $encoding = substr($file, strpos($file, "encoding") + 9);

FilesystemTest.php (https://github.com/societies/SOCIETIES-Platform.git) PHP · 881 lines

1 <?php

2

3 /*

17 * Test class for Filesystem.

18 */

19 class FilesystemTest extends \PHPUnit_Framework_TestCase

20 {

21 /**

69

70 $this->assertFileExists($targetFilePath);

71 $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));

72 }

73

95

96 $this->assertFileExists($targetFilePath);

97 $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));

98 }

99

class_image.php (https://github.com/masterscript/DLE-module-Portfolio.git) PHP · 463 lines

1 <?php

2

3 /* ---------------------------------------------------------------------- *

224

225 function gif_animated ()

226 { $content = @file_get_contents ( $this->data['file'] );

227

228 if ( trim ( $content ) == '' )

AdminAPIModule.php (https://github.com/hxfnd/Kurogo-Mobile-Web.git) PHP · 807 lines

1 <?php

2

3 class AdminAPIModule extends APIModule

41 if (!$configData) {

42 $file = APP_DIR . "/common/config/admin-site.json";

43 if (!$configData = json_decode(file_get_contents($file), true)) {

44 throw new KurogoDataException($this->getLocalizedString('ERROR_PARSING_FILE', $file));

45 }

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>

58

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 ?>

H-OnlineComAtom10Test.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 227 lines

1 <?php

2 /**

3 * Zend Framework

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

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

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

21 */

22

23 require_once 'Zend/Feed/Reader.php';

24

25 /**

32 * @group Zend_Feed_Reader

33 */

34 class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framework_TestCase

35 {

36

vfsStreamWrapperFileTestCase.php (https://bitbucket.org/rafaelcaribe/seresta.git) PHP · 472 lines

1 <?php

2 /**

3 * This file is part of vfsStream.

9 */

10 namespace org\bovigo\vfs;

11 require_once __DIR__ . '/vfsStreamWrapperBaseTestCase.php';

12 /**

13 * Test for org\bovigo\vfs\vfsStreamWrapper.

16 {

17 /**

18 * assert that file_get_contents() delivers correct file contents

19 *

20 * @test

21 */

22 public function file_get_contents()

23 {

24 $this->assertEquals('baz2', file_get_contents($this->baz2URL));

FilesystemTest.php (https://bitbucket.org/helfreire/tccsite.git) PHP · 879 lines

1 <?php

2

3 /*

40

41 $this->assertFileExists($targetFilePath);

42 $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));

43 }

44

66

67 $this->assertFileExists($targetFilePath);

68 $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath));

69 }

70

85

86 $this->assertFileExists($targetFilePath);

87 $this->assertEquals('TARGET FILE', file_get_contents($targetFilePath));

88 }

89

ImageTest.php (https://bitbucket.org/helfreire/tccsite.git) PHP · 1186 lines

1 <?php

2

3 use Intervention\Image\Image;

4

5 class ImageTest extends PHPUnit_Framework_Testcase

6 {

7 protected function setUp()

75 public function testConstructoWithString()

76 {

77 $data = file_get_contents('public/test.jpg');

78 $img = new Image($data);

79 $this->assertInstanceOf('Intervention\Image\Image', $img);

155 public function testStaticCallMakeFromString()

156 {

157 $data = file_get_contents('public/test.jpg');

158 $img = Image::make($data);

159 $this->assertInternalType('resource', $img->resource);

DoCoMoDisplayMap.php (https://github.com/usagi-project/mynets1.git) PHP · 826 lines

1 <?php

2 /* vim: set expandtab tabstop=4 shiftwidth=4: */

3

4 /**

5 * PHP versions 4 and 5

6 *

7 * LICENSE: This source file is subject to version 3.0 of the PHP license

15 * @author KUBO Atsuhiro <iteman@users.sourceforge.net>

16 * @copyright 2003-2006 KUBO Atsuhiro <iteman@users.sourceforge.net>

17 * @license http://www.php.net/license/3_0.txt PHP License 3.0

18 * @version CVS: $Id: DoCoMoDisplayMap.php,v 1.29 2006/11/07 09:25:14 kuboa Exp $

31 * @author KUBO Atsuhiro <iteman@users.sourceforge.net>

32 * @copyright 2003-2006 KUBO Atsuhiro <iteman@users.sourceforge.net>

33 * @license http://www.php.net/license/3_0.txt PHP License 3.0

34 * @version Release: @package_version@

35 * @link http://www.nttdocomo.co.jp/service/imode/make/content/spec/screen_area/index.html