100+ results for 'php realpath'

Not the results you expected?

categories.php (https://github.com/mcmurdok/oscommerce.git) PHP · 247 lines

1 <?php

2 /*

3 $Id: $

83

84 if ( $error === false ) {

85 $categories_image = new upload($data['image'], realpath('../' . DIR_WS_IMAGES . 'categories'));

86

87 if ( $categories_image->exists() && $categories_image->parse() && $categories_image->save() ) {

192

193 if ( $Qcheck->numberOfRows() === 0 ) {

194 if (file_exists(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image')))) {

195 @unlink(realpath('../' . DIR_WS_IMAGES . 'categories/' . $Qimage->value('categories_image')));

Set.php (https://github.com/eexit/Smak.git) PHP · 362 lines

1 <?php

2

3 namespace Smak\Portfolio\tests\units;

8 use tests\units\Smak\Portfolio\Fs;

9

10 require_once __DIR__ . '/../../../../vendor/autoload.php';

11

12 class Set extends Fs\FsAdapter

221 ->isEqualTo('Chile');

222

223 $this->string($set->getSplInfo()->getRealPath())

224 ->isEqualTo($set_root);

225 }

314 );

315

316 $set_root = $set->getSplInfo()->getRealPath();

317 $set_name = $set->name;

318

FinderTest.php (https://github.com/Yrwein/symfony.git) PHP · 333 lines

131 $finder = new Finder();

132 $this->assertSame($finder, $finder->ignoreVCS(false));

133 $this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

134

135 $finder = new Finder();

188 {

189 $finder = new Finder();

190 $this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }));

191 $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

196 $finder = new Finder();

197 $this->assertSame($finder, $finder->filter(function (\SplFileInfo $f) { return preg_match('/test/', $f) > 0; }));

198 $this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());

199 }

200

223 $iterator = $finder->files()->name('*.php')->depth('< 1')->in(array(self::$tmpDir, __DIR__))->getIterator();

224

225 $this->assertIterator(array(self::$tmpDir.DIRECTORY_SEPARATOR.'test.php', __DIR__.DIRECTORY_SEPARATOR.'FinderTest.php', __DIR__.DIRECTORY_SEPARATOR.'bootstrap.php', __DIR__.DIRECTORY_SEPARATOR.'GlobTest.php'), $iterator);

226 }

227

OS_NS_stdlib.h (https://gitlab.com/Kanedias/MangosDeprecated) C Header · 332 lines

8 *

9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>

10 * @author Jesper S. M|ller<stophph@diku.dk>

11 * @author and a cast of thousands...

12 *

203

204 #if !defined (ACE_HAS_WINCE)

205 # if !defined (ACE_LACKS_REALPATH)

206 ACE_NAMESPACE_INLINE_FUNCTION

207 # else

208 extern ACE_Export

209 # endif /* !ACE_LACKS_REALPATH */

210 char *realpath (const char *file_name, char *resolved_name);

212 # if defined (ACE_HAS_WCHAR)

213 ACE_NAMESPACE_INLINE_FUNCTION

214 wchar_t *realpath (const wchar_t *file_name, wchar_t *resolved_name);

215 # endif /* ACE_HAS_WCHAR */

216 #endif /* ACE_HAS_WINCE */

categories.php (https://github.com/azouts/oscommerce.git) PHP · 270 lines

1 <?php

2 /*

3 $Id: $

185

186 if ( $error === false ) {

187 $categories_image = new upload($data['image'], realpath('../' . DIR_WS_IMAGES . 'categories'));

188

189 if ( $categories_image->exists() && $categories_image->parse() && $categories_image->save() ) {

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

1 <?php

2

3 // This doc comment block generated by idl/sysdoc.php

4 /**

5 * ( excerpt from http://docs.hhvm.com/manual/en/class.splfileinfo.php )

6 *

7 * The SplFileInfo class offers a high-level object oriented interface to

15 private $infoClass = "SplFileInfo";

16

17 // This doc comment block generated by idl/sysdoc.php

18 /**

19 * ( excerpt from http://docs.hhvm.com/manual/en/splfileinfo.construct.php )

338 // This doc comment block generated by idl/sysdoc.php

339 /**

340 * ( excerpt from http://docs.hhvm.com/manual/en/splfileinfo.getrealpath.php )

341 *

342 * This method expands all symbolic links, resolves relative references

AddressTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 298 lines

1 <?php

2 require_once realpath(dirname(__FILE__)) . '/../TestHelper.php';

3

4 class Braintree_AddressTest extends PHPUnit_Framework_TestCase

Configuration.php (https://gitlab.com/CORP-RESELLER/shopping-cart-lite) PHP · 346 lines

1 <?php

2 /**

3 *

215 'ssl' . DIRECTORY_SEPARATOR;

216

217 $caPath = realpath(

218 dirname(__FILE__) .

219 $sslPath . 'api_braintreegateway_com.ca.crt'

Config.php (https://gitlab.com/x33n/ImpressPages) PHP · 172 lines

1 <?php

2 /**

3 * @package ImpressPages

42 if (strpos($server['REQUEST_URI'], $baseUrl) !== 0) {

43 // show instructions how to set baseUrl manually

44 include __DIR__ . '/Internal/Config/view/couldNotDetectBaseUrl.php';

45 exit();

46 }

48 if (strpos(strtolower($server['REQUEST_URI']), strtolower($baseUrl)) !== 0) {

49 // show instructions how to set baseUrl manually

50 include __DIR__ . '/Internal/Config/view/couldNotDetectBaseUrl.php';

51 exit();

52 }

57

58 if (empty($this->config['baseDir'])) {

59 $this->config['baseDir'] = realpath(dirname($server['SCRIPT_FILENAME']));

60 }

61

axModuleManager.class.php (https://github.com/bdelespierre/php-axiom.git) PHP · 271 lines

1 <?php

2 /**

3 * @brief Module manager class file

4 * @file axModuleManager.class.php

5 */

6

21 * @var string

22 */

23 const CACHE_FILE = "module.cache.php";

24

25 /**

64 );

65

66 if (!$this->_path = realpath($path)) {

67 throw new axMissingFileException($path);

68 }

BrokerTest.php (https://github.com/bhaumik25/zend-framework.git) PHP · 299 lines

4 define("PHPUnit_MAIN_METHOD", "Zend_Controller_Plugin_BrokerTest::main");

5

6 $basePath = realpath(dirname(__FILE__) . str_repeat(DIRECTORY_SEPARATOR . '..', 3));

7

8 set_include_path(

13 }

14

15 require_once "PHPUnit/Framework/TestCase.php";

16 require_once "PHPUnit/Framework/TestSuite.php";

17

18 require_once 'Zend/Controller/Front.php';

19 require_once 'Zend/Controller/Action/HelperBroker.php';

33 public static function main()

34 {

35 require_once "PHPUnit/TextUI/TestRunner.php";

36

37 $suite = new PHPUnit_Framework_TestSuite("Zend_Controller_Plugin_BrokerTest");

cache_manager_test.php (https://github.com/activeingredient/ezComponents.git) PHP · 246 lines

1 <?php

2 /**

3 * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved.

9 */

10

11 require "db_cache_manager.php";

12 require "fetch.php";

24 public static function suite()

25 {

26 return new PHPUnit_Framework_TestSuite( __CLASS__ );

27 }

28

40 $this->markTestSkipped( 'No database handler defined' );

41 }

42 $this->basePath = realpath( dirname( __FILE__ ) ) . '/';

43

44 // Setup the template engine

FinderTest.php (https://github.com/l3l0/BehatExamples.git) PHP · 274 lines

81 $finder->name('test.ph*');

82 $finder->name('test.py');

83 $this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());

84 }

85

107 $finder = new Finder();

108 $this->assertSame($finder, $finder->files()->size('< 1K')->size('> 500'));

109 $this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());

110 }

111

152 {

153 $finder = new Finder();

154 $this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }));

155 $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

187 $iterator = $finder->files()->name('*.php')->depth('< 1')->in(array(self::$tmpDir, __DIR__))->getIterator();

188

189 $this->assertIterator(array(self::$tmpDir.DIRECTORY_SEPARATOR.'test.php', __DIR__.DIRECTORY_SEPARATOR.'FinderTest.php', __DIR__.DIRECTORY_SEPARATOR.'GlobTest.php'), $iterator);

190 }

191

FilesystemLoaderTest.php (https://github.com/israelnoguera/parejas.git) PHP · 87 lines

52 $path = self::$fixturesPath.'/templates';

53 $loader = new ProjectTemplateLoader2($pathPattern);

54 $storage = $loader->load(new TemplateReference($path.'/foo.php', 'php'));

55 $this->assertInstanceOf('Symfony\Component\Templating\Storage\FileStorage', $storage, '->load() returns a FileStorage if you pass an absolute path');

56 $this->assertEquals($path.'/foo.php', (string) $storage, '->load() returns a FileStorage pointing to the passed absolute path');

58 $this->assertFalse($loader->load(new TemplateReference('bar', 'php')), '->load() returns false if the template is not found');

59

60 $storage = $loader->load(new TemplateReference('foo.php', 'php'));

61 $this->assertInstanceOf('Symfony\Component\Templating\Storage\FileStorage', $storage, '->load() returns a FileStorage if you pass a relative template that exists');

62 $this->assertEquals($path.'/foo.php', (string) $storage, '->load() returns a FileStorage pointing to the absolute path of the template');

69 $loader = new ProjectTemplateLoader2(array(self::$fixturesPath.'/null/%name%', $pathPattern));

70 $loader->setDebugger($debugger = new \ProjectTemplateDebugger());

71 $loader->load(new TemplateReference('foo.php', 'php'));

72 $this->assertTrue($debugger->hasMessage('Loaded template file'), '->load() logs a "Loaded template file" message if the template is found');

73 }

Configuration.php (https://github.com/GunioRobot/phpca.git) PHP · 444 lines

1 <?php

2 /**

3 * Copyright (c) 2009 Stefan Priebsch <stefan@priebsch.de>

30 * POSSIBILITY OF SUCH DAMAGE.

31 *

32 * @package PHPca

33 * @author Stefan Priebsch <stefan@priebsch.de>

34 * @copyright Stefan Priebsch <stefan@priebsch.de>. All rights reserved.

36 */

37

38 namespace spriebsch\PHPca;

39

40 /**

41 * The PHPca configuration.

42 *

43 * @author Stefan Priebsch <stefan@priebsch.de>

UpdateCommand.php (https://github.com/genemu/GenemuDoctrineExtraBundle.git) PHP · 290 lines

1 <?php

2

3 /*

63

64 $controllers = array();

65 if ($dir = realpath($class->getPath().'/Controller')) {

66 $files = new Finder();

67 $files->files()->name('*Controller.php')->in($dir);

68

69 foreach ($files as $file) {

70 if ('Controller.php' !== $controllerName = $file->getBasename('Controller.php')) {

71 $ns = $class->getNamespace().'\\Controller';

72

75 }

76

77 $reflection = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));

78

79 $methods = array();

UtilTest.php (https://github.com/peteboere/css-crush.git) PHP · 135 lines

1 <?php

2

3 namespace CssCrush\UnitTest;

7 use CssCrush\Url;

8

9 class UtilTest extends \PHPUnit\Framework\TestCase

10 {

11 public function setUp(): void

89 {

90 $path1 = __DIR__;

91 $path2 = realpath(__DIR__ . '/../../');

92 $this->assertEquals('../../', Util::getLinkBetweenPaths($path1, $path2));

93 $this->assertEqualsIgnoringCase('Unit/CssCrush/', Util::getLinkBetweenPaths($path2, $path1));

121 {

122 $contents = <<<'NOW_DOC'

123 <?php

124

125 $plugins = ['svg', 'px2em'];

SplFileInfo.php (https://gitlab.com/iranjith4/hhvm) PHP · 444 lines

87 // This doc comment block generated by idl/sysdoc.php

88 /**

89 * ( excerpt from http://php.net/manual/en/splfileinfo.getpathname.php )

90 *

91 * Returns the path to the file.

129 // This doc comment block generated by idl/sysdoc.php

130 /**

131 * ( excerpt from http://php.net/manual/en/splfileinfo.getinode.php )

132 *

133 * Gets the inode number for the filesystem object.

338 // This doc comment block generated by idl/sysdoc.php

339 /**

340 * ( excerpt from http://php.net/manual/en/splfileinfo.getrealpath.php )

341 *

342 * This method expands all symbolic links, resolves relative references

FilesystemAdapter.php (https://gitlab.com/pr0055/symfonypizza) PHP · 158 lines

1 <?php

2

3 /*

37 @mkdir($directory, 0777, true);

38 }

39 if (false === $dir = realpath($dir)) {

40 throw new InvalidArgumentException(sprintf('Cache directory does not exist (%s)', $directory));

41 }

host.d.ts (https://gitlab.com/girmayegebremedhin/student_managment) TypeScript Typings · 76 lines

41 readDirectory: ((rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number | undefined) => string[]) | undefined;

42 readFile: (fileName: string) => string | undefined;

43 realpath: ((path: string) => string) | undefined;

44 resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedModule | undefined)[]) | undefined;

45 resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;

TransparentRedirectTest.php (https://github.com/99designs/braintree_php.git) PHP · 261 lines

1 <?php

2 require_once realpath(dirname(__FILE__)) . '/../TestHelper.php';

3

4 class Braintree_TransparentRedirectTest extends PHPUnit_Framework_TestCase

splfileinfo.getperms.html (https://bitbucket.org/thncr/manuals.git) HTML · 76 lines

8 <body><div class="manualnavbar" style="text-align: center;">

9 <div class="prev" style="text-align: left; float: left;"><a href="splfileinfo.getpathname.html">SplFileInfo::getPathname</a></div>

10 <div class="next" style="text-align: right; float: right;"><a href="splfileinfo.getrealpath.html">SplFileInfo::getRealPath</a></div>

11 <div class="up"><a href="class.splfileinfo.html">SplFileInfo</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

14 <div class="refnamediv">

15 <h1 class="refname">SplFileInfo::getPerms</h1>

16 <p class="verinfo">(PHP 5 &gt;= 5.1.2)</p><p class="refpurpose"><span class="refname">SplFileInfo::getPerms</span> &mdash; <span class="dc-title">Gets file permissions</span></p>

17

18 </div>

71 </div><hr /><div class="manualnavbar" style="text-align: center;">

72 <div class="prev" style="text-align: left; float: left;"><a href="splfileinfo.getpathname.html">SplFileInfo::getPathname</a></div>

73 <div class="next" style="text-align: right; float: right;"><a href="splfileinfo.getrealpath.html">SplFileInfo::getRealPath</a></div>

74 <div class="up"><a href="class.splfileinfo.html">SplFileInfo</a></div>

75 <div class="home"><a href="index.html">PHP Manual</a></div>

contact.modul.php (https://github.com/pschichtel/Infected-CMS.git) PHP · 302 lines

1 <?php

2 realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME']) and die('<strong>Access denied!</strong>');

3 if (!user::loggedIn())

4 {

Minifier.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 280 lines

1 <?php

2

3 /**

41

42 /**

43 * PHP5-style constructor

44 */

45 function __construct() {

121 switch ($engine) {

122 case 'js':

123 w3_require_once(W3TC_LIB_MINIFY_DIR . '/JSMin.php');

124 break;

125

126 case 'css':

127 w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/CSS.php');

128 break;

129

dfs.php (https://github.com/edorfaus/ezpublish.git) PHP · 342 lines

1 <?php

2 /**

3 * File containing the eZDFSFileHandlerDFSBackend class.

15 $mountPointPath = eZINI::instance( 'file.ini' )->variable( 'eZDFSClusteringSettings', 'MountPointPath' );

16

17 if ( !$mountPointPath = realpath( $mountPointPath ) )

18 throw new eZDFSFileHandlerNFSMountPointNotFoundException( $mountPointPath );

19

Renderer.php (https://gitlab.com/szlongshu/manaphp) PHP · 174 lines

9 {

10 /**

11 * @var \ManaPHP\Mvc\View\Renderer\EngineInterface[]

12 */

13 protected $_resolvedEngines = [];

20 public function __construct()

21 {

22 $this->_registeredEngines['.phtml'] = 'ManaPHP\Mvc\View\Renderer\Engine\Php';

23 $this->_registeredEngines['.tpl'] = 'ManaPHP\Mvc\View\Renderer\Engine\Smarty';

70 if (file_exists($file)) {

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

72 $realPath = str_replace('\\', '/', realpath($file));

73 if ($file !== $realPath) {

146 *<code>

147 *$renderer->registerEngines(array(

148 * ".phtml" => "ManaPHP\Mvc\View\Renderer\Engine\Php",

149 * ".html" => "ManaPHP\Mvc\View\Renderer\Engine\Html",

generate-standalone.php (https://github.com/mgifford/Government-of-Canada-Drupal.git) PHP · 152 lines

84

85 /**

86 * Copies a file to another location recursively, if it is a PHP file

87 * remove includes

88 * @param string $file Original file

103 $preserve = array(

104 // PEAR (external)

105 'XML/HTMLSax3.php' => 1

106 );

107 if (isset($preserve[$file])) {

114

115 echo 'Generating includes file... ';

116 shell_exec('php generate-includes.php');

117 echo "done!\n";

118

Admin_course.php (https://github.com/caesarjuly/flowertime.git) PHP · 346 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2 class Admin_course extends MY_Controller {

3

147 else

148 {

149 $this->gallery_path = realpath(APPPATH . '../top');

150 $config = array(

151 'allowed_types' => 'jpg|jpeg|png|gif',

296 else

297 {

298 $this->gallery_path = realpath(APPPATH . '../top');

299 $config = array(

300 'allowed_types' => 'jpg|jpeg|png|gif',

Doctrine.php (https://github.com/leadhome/handmade.git) PHP · 345 lines

1 <?php

2 /**

3 * ZFDoctrine

301 foreach ($value as $subKey => $subVal) {

302 if (!empty($subVal)) {

303 $path = realpath($subVal);

304

305 if (!is_dir($path)) {

MaildirStore.class.php (https://github.com/ghiata/xp-framework.git) PHP · 323 lines

1 <?php

2 /* This class is part of the XP framework

3 *

56

57 $this->currentfolder= '';

58 $this->_root= realpath ($folder);

59

60 return TRUE;

71 $this->_root,

72 '',

73 realpath ($folder)

74 );

75 }

LC_Page_Test.php (https://github.com/hatone/EC-CUBE-Ver2.11.3.git) PHP · 158 lines

25 require_once(realpath(dirname(__FILE__)) . '/../../require.php');

26 require_once(realpath(dirname(__FILE__)) . '/../../../data/class/pages/LC_Page.php');

27

28 /**

31 * @package Page

32 * @author LOCKON CO.,LTD.

33 * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $

34 */

35 class LC_Page_Test extends PHPUnit_Framework_TestCase {

40 /*

41 * FIXME LC_Page::sendRedirect() は, リダイレクトしてしまうため,

42 * PHPUnit3 ではテストできない...

43 */

44

103 $_SERVER['DOCUMENT_ROOT'] = realpath(dirname(__FILE__) . "/../../../html");

104 $url = $objPage->getLocation(ROOT_URLPATH . 'abouts/index.php');

105

106 $this->assertEquals(HTTP_URL . "abouts/index.php", $url);

xls.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 195 lines

1 <?php

2 /* $Id: xls.php 8964 2006-04-26 19:16:52Z nijel $ */

5 // Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writer

6 if (!empty($GLOBALS['cfg']['TempDir'])) {

7 @include_once('Spreadsheet/Excel/Writer.php');

8 if (class_exists('Spreadsheet_Excel_Writer')) {

9 $xls = TRUE;

88 return FALSE;

89 }

90 $tmp_filename = tempnam(realpath($GLOBALS['cfg']['TempDir']), 'pma_xls_');

91 $workbook = new Spreadsheet_Excel_Writer($tmp_filename);

92

155

156 $worksheet =& $workbook->addWorksheet($table);

157 $workbook->setTempDir(realpath($GLOBALS['cfg']['TempDir']));

158

159 // Gets the data from the database

file-folder.rst (https://github.com/jamiemill/docs.git) ReStructuredText · 436 lines

206

207

208 .. php:method:: read( $sort = true, $exceptions = false, $fullPath = false )

209

210 :rtype: mixed

214

215

216 .. php:method:: realpath( $path )

217

218 :rtype: string

283

284

285 .. php:method:: exists( )

286

287 :rtype: boolean

TianQiKeyService.java (https://gitlab.com/spiderworts/ab_weixin_cms) Java · 132 lines

45 Map<String, Object> map2 = new HashMap<String, Object>();

46 try {

47 String filepach = request.getSession().getServletContext().getRealPath(

48 "/WEB-INF/classes/weixin");

49 Weather util = new Weather();

ClassFileLocator.php (https://github.com/obias/zf2.git) PHP · 155 lines

1 <?php

2

3 /** @namespace */

12

13 /**

14 * Locate files containing PHP classes, interfaces, or abstracts

15 *

16 * @package Zend_File

52

53 /**

54 * Filter for files containing PHP classes, interfaces, or abstracts

55 *

56 * @return bool

71 }

72

73 // If not a PHP file, skip

74 if ($file->getBasename('.php') == $file->getBasename()) {

requirejs.php (https://gitlab.com/unofficial-mirrors/moodle) PHP · 135 lines

1 <?php

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

3 //

122 if (strpos($filename, '-lazy') === false) {

123 $modulename = $component . '/' . $filename;

124 $jsfiles[$modulename] = $item->getRealPath();

125 }

126 }

gallery.php (https://github.com/kelios/imshop.git) PHP · 306 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2

3 /**

271 ));

272

273 $file = realpath(dirname(__FILE__)).'/templates/public/main.tpl';

274 $this->template->display('file:' . $file);

275 }

280 ));

281

282 if (file_exists(realpath(dirname(__FILE__)).'/templates/public/main.tpl'))

283 {

284 $file = realpath(dirname(__FILE__)).'/templates/public/main.tpl';

298 private function fetch_tpl($file = '')

299 {

300 $file = realpath(dirname(__FILE__)).'/templates/public/'.$file.'.tpl';

301 return $this->template->fetch('file:'.$file);

302 }

FinderTest.php (https://github.com/stedekay/symfony.git) PHP · 313 lines

82 $this->assertSame($finder, $finder->name('*.php'));

83 $this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());

84

85 $finder = new Finder();

168 {

169 $finder = new Finder();

170 $this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }));

171 $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

187 $finder = new Finder();

188 $this->assertSame($finder, $finder->followLinks());

189 $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

190 }

191

203 $iterator = $finder->files()->name('*.php')->depth('< 1')->in(array(self::$tmpDir, __DIR__))->getIterator();

204

205 $this->assertIterator(array(self::$tmpDir.DIRECTORY_SEPARATOR.'test.php', __DIR__.DIRECTORY_SEPARATOR.'FinderTest.php', __DIR__.DIRECTORY_SEPARATOR.'GlobTest.php'), $iterator);

206 }

207

ezimagefont.php (https://github.com/GunioRobot/ezpublish.git) PHP · 230 lines

1 <?php

2 /**

3 * File containing the eZImageFont class.

10

11 /*!

12 \class eZImageFont ezimagefont.php

13 \ingroup eZImageObject

14 \brief Specifies a font used for drawing text

77 function realFile()

78 {

79 return realpath( "." ) . "/" . $this->FontFile;

80 }

81

file_temp_cleanup_task.php (https://github.com/markn86/moodle.git) PHP · 122 lines

1 <?php

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

3 //

59 // once a file is deleted, so we need a list of the original values.

60 for ($iter->rewind(); $iter->valid(); $iter->next()) {

61 $node = $iter->getRealPath();

62 if (!is_readable($node)) {

63 continue;

68 // Now loop through again and remove old files and directories.

69 for ($iter->rewind(); $iter->valid(); $iter->next()) {

70 $node = $iter->getRealPath();

71 if (!isset($modifieddateobject[$node]) || !is_readable($node)) {

72 continue;

115

116 // Run on $CFG->backuptempdir too, if different from the default one, '$CFG->tempdir/backup'.

117 if (realpath(dirname($CFG->backuptempdir)) !== realpath($CFG->tempdir)) {

118 // The $CFG->backuptempdir setting is different from the default '$CFG->tempdir/backup'.

119 $this->execute_on($CFG->backuptempdir);

Error.class.php (https://github.com/BenBE/ispCP.git) PHP · 417 lines

1 <?php

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

3 /**

4 * Holds class PMA_Error

5 *

6 * @package phpMyAdmin

7 */

8

10 * base class

11 */

12 require_once './libraries/Message.class.php';

13

14 /**

15 * a single error

16 *

17 * @package phpMyAdmin

18 */

19 class PMA_Error extends PMA_Message

Loader.php (https://github.com/kazy111/g_feeder.git) PHP · 147 lines

1 <?php

2

3 /**

49

50 // include class paths or rebuild paths if the cache file isn't there

51 $cacheFile = $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php';

52 if (file_exists($cacheFile)) {

53 $classpath = file_get_contents($cacheFile);

78 $this->rebuildClassPathCache($f, false);

79 } else {

80 $this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f;

81 }

82 }

86 if ($cacheFile!==false) {

87 if (!file_put_contents($cacheFile, serialize($this->classPath))) {

88 throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');

89 }

90 $this->classPath += $tmp;

Console.php (https://github.com/GunioRobot/madeam.git) PHP · 206 lines

1 <?php

2 namespace madeam;

3 /**

4 * Madeam PHP Framework <http://madeam.com>

5 * Copyright (c) 2009, Joshua Davey

6 * 202-212 Adeliade St. W, Toronto, Ontario, Canada

12 * @link http://www.madeam.com

13 * @package madeam

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

15 * @author Joshua Davey

16 */

99 // If we aren't in the applicatin's root path then tell the user and exit

100 if ($scriptName != 'make') {

101 if (!file_exists(realpath('application/vendor/Madeam.php'))) {

102 console\CLI::outError('Please point Madeam Console to the root directory of your application.');

103 exit();

File.php (https://gitlab.com/hwmack/LibtorrentPHP) PHP · 201 lines

1 <?php

2

3 namespace CWE\Libraries\LibtorrentPHP\File;

4

5 use CWE\Libraries\LibtorrentPHP\File\Error\UnreadableError;

6 use CWE\Libraries\LibtorrentPHP\File\Error\NotExistsError;

10 * torrent file generation and serving.

11 *

12 * @package PHPTracker

13 * @subpackage File

14 */

40 $this->shouldExist();

41

42 $this->path = realpath( $this->path );

43 }

44

MediaTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 238 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

10 /**

11 * Test class for \Magento\Catalog\Model\Product\Attribute\Backend\Media.

12 * @magentoDataFixture Magento/Catalog/_files/product_simple.php

13 */

14 class MediaTest extends \PHPUnit_Framework_TestCase

42 self::$_mediaTmpDir = $mediaDirectory->getAbsolutePath($config->getBaseTmpMediaPath());

43 self::$_mediaDir = $mediaDirectory->getAbsolutePath($config->getBaseMediaPath());

44 $fixtureDir = realpath(__DIR__ . '/../../../../_files');

45

46 $mediaDirectory->create($config->getBaseTmpMediaPath());

setup.sh (https://gitlab.com/lisit1003/TTAutoDeploy) Shell · 616 lines

10 NGINX_PHP=nginx_php

11 NGINX=nginx

12 PHP=php

13 JDK=jdk

14

105 else

106 # LINK is relative.

107 REALPATH="`dirname "$REALPATH"`""/$LINK"

108 fi

109 done

467 #php

468 check_module $PHP $PHP_SETUP_BEGIN $PHP_SETUP_SUCCESS

469 if [ $? -eq 1 ]; then

470 exit 1

557 #php

558 build_module $PHP $PHP_SETUP_BEGIN $PHP_SETUP_SUCCESS

559 if [ $? -eq 1 ]; then

560 exit 1

WebTestCase.php (https://github.com/fernanDOTdo/symfony.git) PHP · 154 lines

1 <?php

2

3 /*

47

48 /**

49 * Finds the directory where the phpunit.xml(.dist) is stored.

50 *

51 * If you run tests with the PHPUnit CLI tool, everything will work as expected.

52 * If not, override this method in your test classes.

53 *

54 * @return string The directory where phpunit.xml(.dist) is stored

55 */

56 protected function getPhpUnitXmlDir()

57 {

58 $dir = null;

59 if (!isset($_SERVER['argv']) || false === strpos($_SERVER['argv'][0], 'phpunit')) {

60 throw new \RuntimeException('You must override the WebTestCase::createKernel() method.');

61 }

ImageUploadServiceTest.php (https://gitlab.com/dayitv89/laravel-tricks) PHP · 244 lines

1 <?php

2

3 namespace Tricks\Services\Upload;

95

96 $this->assertEquals(

97 realpath(__DIR__ . '/../../../../../public/favicon.ico'),

98 $imageUploadServiceMock->getFullPath('favicon.ico')

99 );

Iterator.php (https://bitbucket.org/rybadour/todo_list_site.git) PHP · 196 lines

1 <?php

2 /**

3 * php-file-iterator

50 * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License

51 * @version Release: @package_version@

52 * @link http://github.com/sebastianbergmann/php-file-iterator/tree

53 * @since Class available since Release 1.0.0

54 */

116 $current = $this->getInnerIterator()->current();

117 $filename = $current->getFilename();

118 $realpath = $current->getRealPath();

119

120 if ($this->basepath !== NULL) {

121 $realpath = str_replace($this->basepath, '', $realpath);

122 }

123

register-in.inc.php (https://gitlab.com/Gashler/dp) PHP · 104 lines

1 <?php

2 /**

3 * Registration Links (inner processing routines).

15 * @since 3.5

16 */

17 if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))

18 exit("Do not access this file directly.");

19

ErrorHandlerTest.php (https://github.com/bhaumik25/zend-framework.git) PHP · 257 lines

12 }

13

14 require_once "PHPUnit/Framework/TestCase.php";

15 require_once "PHPUnit/Framework/TestSuite.php";

18 require_once 'Zend/Controller/Request/Http.php';

19 require_once 'Zend/Controller/Response/Http.php';

20

21 require_once 'Zend/Controller/Dispatcher/Exception.php';

22 require_once 'Zend/Controller/Action/Exception.php';

23

24 require_once 'Zend/Controller/Front.php';

56 public static function main()

57 {

58 require_once "PHPUnit/TextUI/TestRunner.php";

59

60 $suite = new PHPUnit_Framework_TestSuite("Zend_Controller_Plugin_ErrorHandlerTest");

DumpCompletionCommand.php (https://gitlab.com/hoangduys4k5/laravelproject) PHP · 133 lines

1 <?php

2

3 /*

40 protected function configure()

41 {

42 $fullCommand = $_SERVER['PHP_SELF'];

43 $commandName = basename($fullCommand);

44 $fullCommand = realpath($fullCommand) ?: $fullCommand;

splfileinfo.getpath.html (https://bitbucket.org/stillzhl/manuals.git) HTML · 88 lines

10 <div class="next" style="text-align: right; float: right;"><a href="splfileinfo.getpathinfo.html">SplFileInfo::getPathInfo</a></div>

11 <div class="up"><a href="class.splfileinfo.html">SplFileInfo</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="splfileinfo.getpath" class="refentry">

14 <div class="refnamediv">

15 <h1 class="refname">SplFileInfo::getPath</h1>

16 <p class="verinfo">(PHP 5 &gt;= 5.1.2)</p><p class="refpurpose"><span class="refname">SplFileInfo::getPath</span> &mdash; <span class="dc-title">Gets the path without filename</span></p>

17

18 </div>

53 <div class="phpcode"><code><span style="color: #000000">

54 <span style="color: #0000BB">&lt;?php<br />$info&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'/usr/bin/php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPath</span><span style="color: #007700">());<br /><br /><br /></span><span style="color: #0000BB">$info&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'/usr/'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPath</span><span style="color: #007700">());</span><span style="color: #0000BB">?&gt;</span>

55 </span>

56 </code></div>

73 <p class="para">

74 <ul class="simplelist">

75 <li class="member"> <span class="methodname"><a href="splfileinfo.getrealpath.html" class="methodname" rel="rdfs-seeAlso">SplFileInfo::getRealPath()</a> - Gets absolute path to file</span></li>

76 <li class="member"> <span class="methodname"><a href="splfileinfo.getfilename.html" class="methodname" rel="rdfs-seeAlso">SplFileInfo::getFilename()</a> - Gets the filename</span></li>

77 <li class="member"> <span class="methodname"><a href="splfileinfo.getpathinfo.html" class="methodname" rel="rdfs-seeAlso">SplFileInfo::getPathInfo()</a> - Gets an SplFileInfo object for the path</span></li>

HelperBrokerTest.php (https://github.com/bhaumik25/zend-framework.git) PHP · 248 lines

13 }

14

15 require_once "PHPUnit/Framework/TestCase.php";

16 require_once "PHPUnit/Framework/TestSuite.php";

19 require_once 'Zend/Controller/Request/Http.php';

20 require_once 'Zend/Controller/Response/Cli.php';

21

22 require_once 'Zend/Controller/Action/HelperBroker.php';

23 require_once 'Zend/Controller/Action/Helper/ViewRenderer.php';

24 require_once 'Zend/Controller/Action/Helper/Redirector.php';

34 public static function main()

35 {

36 require_once "PHPUnit/TextUI/TestRunner.php";

37

38 $suite = new PHPUnit_Framework_TestSuite("Zend_Controller_Action_HelperBrokerTest");

FilterPluginManager.php (https://bitbucket.org/alexandretaz/maniac_divers.git) PHP · 118 lines

1 <?php

2 /**

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

61 'numberformat' => 'Zend\I18n\Filter\NumberFormat',

62 'pregreplace' => 'Zend\Filter\PregReplace',

63 'realpath' => 'Zend\Filter\RealPath',

64 'stringtolower' => 'Zend\Filter\StringToLower',

65 'stringtoupper' => 'Zend\Filter\StringToUpper',

config.php (https://gitlab.com/daniruizcamacho/pfcascensores) PHP · 117 lines

1 <?php

2

3 $basePath = $app['path.base'];

4

5 return array_map('realpath', array(

6 $basePath.'/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php',

7 $basePath.'/vendor/laravel/framework/src/Illuminate/Container/Container.php',

8 $basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php',

9 $basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php',

10 $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Contracts/ResponsePreparerInterface.php',

11 $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Application.php',

12 $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/EnvironmentDetector.php',

Log.php (https://github.com/bireme/isis-oai-provider.git) PHP · 159 lines

1 <?php

2

3 define('LOG_SEPARATOR', ";");

40 {

41 if (!defined('LOG_DIR')) {

42 define('LOG_DIR', realpath( dirname(__FILE__) . "/../logs") . "/");

43 }

44 if ( is_dir(LOG_DIR) ){

Error.class.php (https://github.com/jackygrahamez/DrugDiscovery-Home.git) PHP · 440 lines

1 <?php

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

3 /**

4 * Holds class PMA_Error

5 *

6 * @version $Id: Error.class.php 12202 2009-01-20 18:04:20Z lem9 $

7 * @package phpMyAdmin

11 * base class

12 */

13 require_once './libraries/Message.class.php';

14

15 /**

16 * a single error

17 *

18 * @package phpMyAdmin

19 */

20 class PMA_Error extends PMA_Message

Memcache.php (https://gitlab.com/bhargavi_dcw/dflocal) PHP · 178 lines

1 <?php

2 /*

3 * Copyright 2008 Google Inc.

15 * limitations under the License.

16 */

17 require_once realpath(dirname(__FILE__) . '/../../../autoload.php');

18

19 /**

JFolderTest.php (https://github.com/Paladin/joomla-platform.git) PHP · 409 lines

1 <?php

2 /**

3 * @package Joomla.UnitTest

7 */

8

9 JLoader::register('JFolder', JPATH_PLATFORM . '/joomla/filesystem/folder.php');

10

11 /**

12 * Test class for JFolder.

13 * Generated by PHPUnit on 2011-10-26 at 19:32:37.

14 *

15 * @package Joomla.UnitTest

134 file_put_contents(JPath::clean(JPATH_TESTS . '/tmp/test/test/index.txt'), 'test');

135

136 // Use of realpath to ensure test works for on all platforms

137 $result = JFolder::files(JPath::clean(JPATH_TESTS . '/tmp/test'), 'index.*', true, true, array('index.html'));

138 $result[0] = realpath($result[0]);

OrientDBRecordSpeedTest.php (https://github.com/davidino/OrientDB-PHP.git) PHP · 145 lines

1 <?php

2

3 /**

4 * @author Anton Terekhov <anton@netmonsters.ru>

5 * @copyright Copyright Anton Terekhov, NetMonsters LLC, 2011

6 * @license https://github.com/AntonTerekhov/OrientDB-PHP/blob/master/LICENSE

7 * @link https://github.com/AntonTerekhov/OrientDB-PHP

8 * @package OrientDB-PHP

9 */

10

11 require_once 'OrientDB/OrientDB.php';

12

13 /**

DefaultListenerAggregateTest.php (https://github.com/zucchi/zf2.git) PHP · 118 lines

1 <?php

2 /**

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

12

13 use InvalidArgumentException;

14 use PHPUnit_Framework_TestCase as TestCase;

15 use Zend\EventManager\EventManager;

16 use Zend\Loader\ModuleAutoloader;

38 new ListenerOptions(array(

39 'module_paths' => array(

40 realpath(__DIR__ . '/TestAsset'),

41 ),

42 ))

AutoloaderTest.php (https://github.com/devilsansclue/ZendFramework.git) PHP · 190 lines

1 <?php

2 /**

3 * Zend Framework

21 */

22

23 if (!defined('PHPUnit_MAIN_METHOD')) {

24 define('PHPUnit_MAIN_METHOD', 'Zend_Application_Module_AutoloaderTest::main');

28 * @see Zend_Loader_Autoloader

29 */

30 require_once 'Zend/Loader/Autoloader.php';

31

32 /**

33 * @see Zend_Application_Module_Autoloader

34 */

35 require_once 'Zend/Loader/Autoloader/Resource.php';

36

37 /**

ext_fb.h (https://bitbucket.org/gnanakeethan/hiphop-php.git) C Header · 101 lines

1 /*

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

3 | HipHop for PHP |

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

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

6 | Copyright (c) 1997-2010 The PHP Group |

7 +----------------------------------------------------------------------+

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

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

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

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

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

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

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

15 +----------------------------------------------------------------------+

16 */

view.php (https://bitbucket.org/tumivn/phpexamples.git) PHP · 437 lines

1 <?php

2 /**

3 *

4 * @View Class

5 *

6 * @copyright Copyright (C) 2009 PHPRO.ORG. All rights reserved.

7 *

8 * @license new bsd http://www.opensource.org/licenses/bsd-license.php

136 if (!empty($this->template_dir))

137 {

138 $template_file = realpath($this->template_dir) . '/' . $template_file;

139 }

140

196 public function setTemplateDir($dir)

197 {

198 $template_dir = realpath($dir);

199 if (is_dir($template_dir))

200 {

FileTraits.php (https://gitlab.com/nitm/yii2-filemanager) PHP · 206 lines

1 <?php

2

3 namespace nitm\filemanager\traits;

59 public function exists()

60 {

61 return file_exists($this->getRealPath());

62 }

63

64 public function getRealPath()

65 {

66 try {

79 public function getContents()

80 {

81 if (Storage::exists($this->getRealPath())) {

82 return Storage::getContents($this->getRealPath());

AppNameCommand.php (https://gitlab.com/pomirleanu.florentin/SMS-Client) PHP · 306 lines

1 <?php namespace Illuminate\Foundation\Console;

2

3 use Illuminate\Console\Command;

79 $this->setComposerNamespace();

80

81 $this->setPhpSpecNamespace();

82

83 $this->info('Application namespace set!');

97 $files = Finder::create()

98 ->in($this->laravel['path'])

99 ->name('*.php');

100

101 foreach ($files as $file)

102 {

103 $this->replaceNamespace($file->getRealPath());

104 }

105 }

PluginLoaderTest.php (https://github.com/bhaumik25/zend-framework.git) PHP · 348 lines

1 <?php

2 // Call Zend_Loader_PluginLoaderTest::main() if this source file is executed directly.

3 if (!defined('PHPUnit_MAIN_METHOD')) {

4 define('PHPUnit_MAIN_METHOD', 'Zend_Loader_PluginLoaderTest::main');

5 }

6

8 * Test helper

9 */

10 require_once dirname(__FILE__) . '/../../TestHelper.php';

11

12 require_once 'Zend/Loader/PluginLoader.php';

24 public static function main()

25 {

26 require_once "PHPUnit/TextUI/TestRunner.php";

27

28 $suite = new PHPUnit_Framework_TestSuite("Zend_Loader_PluginLoaderTest");

ShowAuditTrail.php (https://github.com/CoreyTisdale/YiiAuditTrail.git) PHP · 166 lines

1 <?php

2 /**

3 * ShowAuditTrail class file.

14

15 Yii::import('zii.widgets.CPortlet');

16 require_once(realpath(dirname(__FILE__) . '/../../AuditTrailModule.php'));

17

18 class ShowAuditTrail extends CPortlet

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

1 <?php

2 /*

3 * forms

15

16 if (!defined('_DIR_PLUGIN_FORMS')){

17 $p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__))));

18 define('_DIR_PLUGIN_FORMS',(_DIR_PLUGINS.end($p))."/");

19 }

ApacheMatcherDumperTest.php (https://github.com/ivebeenlinuxed/Boiler.git) PHP · 196 lines

1 <?php

2

3 /*

16 use Symfony\Component\Routing\Matcher\Dumper\ApacheMatcherDumper;

17

18 class ApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase

19 {

20 protected static $fixturesPath;

22 public static function setUpBeforeClass()

23 {

24 self::$fixturesPath = realpath(__DIR__.'/../../Fixtures/');

25 }

26

58 $collection->add('foo', new Route('/foo'));

59 $dumper = new ApacheMatcherDumper($collection);

60 $this->assertStringEqualsFile(self::$fixturesPath.'/dumper/url_matcher2.apache', $dumper->dump(array('script_name' => 'ap p_d\ ev.php')));

61 }

62

XsdTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 277 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

9 * Test for validation rules implemented by XSD schema for API integration configuration.

10 */

11 class XsdTest extends \PHPUnit_Framework_TestCase

12 {

13 /**

22 }

23 $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();

24 $this->_schemaFile = $urnResolver->getRealPath(

25 'urn:magento:module:Magento_Integration:etc/integration/api.xsd'

26 );

46 /**

47 * @return array

48 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)

49 */

50 public function exemplarXmlDataProvider()

index.php (https://bitbucket.org/denisOg/soft-site.git) PHP · 161 lines

1 <?php

2 error_reporting(E_ALL | E_STRICT);

3 ini_set('display_errors', 'On');

4 ini_set('short_open_tag', 'On');

5 include_once(__DIR__ . '/config.php');

6 $PAGE = !empty($_GET['page']) ? $_GET['page'] : 'list';

7 $data = array('test' => 'Success');

14 $data['title'] = 'Список программ';

15 $data['aResult'] = $oMySQL->Select('soft');

16 render('_list.php', $data);

17 }

18

22 $data['title'] = 'Список программ';

23 $data['aResult'] = $oMySQL->Select('soft');

24 render('_admin_list.php', $data);

25 }

26

FileSystem.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 267 lines

1 <?php

2 /**

3 * LICENSE

18 */

19

20 // require_once 'Zend/Cloud/StorageService/Adapter.php';

21 // require_once 'Zend/Cloud/StorageService/Exception.php';

63 $this->_directory = $options[self::LOCAL_DIRECTORY];

64 } else {

65 $this->_directory = realpath(sys_get_temp_dir());

66 }

67 }

79 {

80 $filepath = $this->_getFullPath($path);

81 $path = realpath($filepath);

82

83 if (!$path) {

InfBinarySectionTest.py (https://gitlab.com/envieidoc/Clover) Python · 386 lines

7 # under the terms and conditions of the BSD License which accompanies this

8 # distribution. The full text of the license may be found at

9 # http://opensource.org/licenses/bsd-license.php

10 #

11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,

267 # Create a temp file for test.

268 #

269 FileName = os.path.normpath(os.path.realpath(ValueList[1].strip()))

270 try:

271 TempFile = open (FileName, "w")

File.php (https://bitbucket.org/rybadour/todo_list_site.git) PHP · 241 lines

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

2 /**

3 * File helper class.

13 /**

14 * Attempt to get the mime type from a file. This method is horribly

15 * unreliable, due to PHP being horribly unreliable when it comes to

16 * determining the mime type of a file.

17 *

25 {

26 // Get the complete path to the file

27 $filename = realpath($filename);

28

29 // Get the extension from the filename

67 * $mime = File::mime_by_ext('png'); // "image/png"

68 *

69 * @param string $extension php, pdf, txt, etc

70 * @return string mime type on success

71 * @return FALSE on failure

CITestBase.php (https://github.com/rickogden/joind.in.git) PHP · 216 lines

17 /*

18 |---------------------------------------------------------------

19 | PHP ERROR REPORTING LEVEL

20 |---------------------------------------------------------------

21 |

22 | By default CI runs with error reporting set to ALL. For security

23 | reasons you are encouraged to change this when your site goes live.

24 | For more info visit: http://www.php.net/error_reporting

25 |

26 */

75 */

76

77 if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)

78 {

79 $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;

85 |---------------------------------------------------------------

86 |

87 | EXT - The file extension. Typically ".php"

88 | SELF - The name of THIS file (typically "index.php")

generator.php (https://github.com/Hywan/atoum.git) PHP · 239 lines

1 <?php

2

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

8 use mageekguy\atoum\test\generator as testedClass;

9

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

11

12 class generator extends atoum\test

212 ->and($testClassesDirectoryPath = new \mock\mageekguy\atoum\fs\path(DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['a', 'b', 'c'])))

213 ->and($this->calling($testClassesDirectoryPath)->exists = true)

214 ->and($this->calling($testClassesDirectoryPath)->getRealPath = $testClassesDirectoryPath)

215 ->and($testedClassPath = new \mock\mageekguy\atoum\fs\path(DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['x', 'y', 'z', 'f.php'])))

216 ->and($this->calling($testedClassPath)->putContents = $testedClassPath)

217 ->and($testClassPath = new \mock\mageekguy\atoum\fs\path(DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['a', 'b', 'c', 'd', 'e', 'f.php'])))

218 ->and($this->calling($testClassPath)->getRealParentDirectoryPath = new \mock\mageekguy\atoum\fs\path(DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['a', 'b', 'c', 'd', 'e'])))

219 ->and($this->calling($testClassPath)->getRealPath = $testClassPath)

gift.php (https://github.com/pinhao/giftweb.git) PHP · 171 lines

1 <?php

2 defined('BASEPATH') OR exit('No direct script access allowed');

3

9 *

10 */

11 require APPPATH.'/libraries/REST_Controller.php';

12 require APPPATH.'/libraries/GIFTLib.php';

23 $port = $this->config->item('gift_port');

24 $this->GIFTLib = new GIFTLib($host, $port);

25 $this->rootWebPath = rtrim(realpath('.'), '/').'/';

26 }

27

file.php (https://github.com/akutaktau/feedmalaya.git) PHP · 351 lines

1 <?php

2 /**

3 * Fuel

4 *

5 * Fuel is a fast, lightweight, community driven PHP5 framework.

6 *

7 * @package Fuel

10 * @license MIT License

11 * @copyright 2010 - 2011 Fuel Development Team

12 * @link http://fuelphp.com

13 */

14

321 }

322 // update the path, and add the trailing slash

323 $item = realpath($item).'/';

324 break;

325

Map.php (https://github.com/ggunlugu/ornekler.git) PHP · 143 lines

1 <?php

2 /**

3 *

42 {

43 $dir = Solar_Class::dir('Solar', '../tests');

44 $base = realpath($dir);

45

46 $map = Solar::factory('Solar_Class_Map');

49 $actual = $map->fetch('Mock_Solar');

50 $expect = array(

51 "Mock_Solar_Controller_Page" => "$base/Mock/Solar/Controller/Page.php",

52 "Mock_Solar_Example" => "$base/Mock/Solar/Example.php",

53 "Mock_Solar_Exception" => "$base/Mock/Solar/Exception.php",

54 "Mock_Solar_Exception_CustomCondition" => "$base/Mock/Solar/Exception/CustomCondition.php",

SetupInfo.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 165 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

148 $setupDir = $this->getDir($this->projectRoot);

149 $isSubDir = false !== strpos($setupDir . '/', $this->docRoot . '/');

150 return $isSubDir && realpath($setupDir);

151 }

152

AppNameCommand.php (https://gitlab.com/Sigpot/AirSpot) PHP · 286 lines

1 <?php

2

3 namespace Illuminate\Foundation\Console;

97 ->in($this->laravel['path'])

98 ->contains($this->currentRoot)

99 ->name('*.php');

100

101 foreach ($files as $file) {

102 $this->replaceNamespace($file->getRealPath());

103 }

104 }

225 {

226 $this->replaceIn(

227 $this->laravel->databasePath().'/factories/ModelFactory.php', $this->currentRoot, $this->argument('name')

228 );

229 }

FileReflection.php (https://github.com/zucchi/zf2.git) PHP · 313 lines

1 <?php

2 /**

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

78 public function __construct($filename)

79 {

80 if (($fileRealPath = realpath($filename)) === false) {

81 $fileRealPath = stream_resolve_include_path($filename);

82 }

83

84 if (!$fileRealPath || !in_array($fileRealPath, get_included_files())) {

85 throw new Exception\RuntimeException('File ' . $filename . ' must be required before it can be reflected');

86 }

87

88 $this->filePath = $fileRealPath;

89 $this->reflect();

90 }

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

1 <?php

2 /**

3 * Zend Framework

25

26 if (isset($_GET['progress'])) {

27 set_include_path(realpath(dirname(__FILE__) . '/../../../library')

28 . PATH_SEPARATOR . get_include_path());

29

30 require_once 'Zend/ProgressBar.php';

31 require_once 'Zend/ProgressBar/Adapter/JsPush.php';

131 var iFrame = document.createElement('iframe');

132 document.getElementsByTagName('body')[0].appendChild(iFrame);

133 iFrame.src = 'JsPush.php?progress';

134 }

135

Minifier.php (https://github.com/elleeott/WPOC-boilerplate.git) PHP · 287 lines

1 <?php

2

3 /**

41

42 /**

43 * PHP5-style constructor

44 */

45 function __construct() {

48

49 /**

50 * PHP4-style constructor

51 */

52 function W3_Minifier() {

128 switch ($engine) {

129 case 'js':

130 require_once W3TC_LIB_MINIFY_DIR . '/JSMin.php';

131 break;

132

ClassNotFoundFatalErrorHandler.php (https://gitlab.com/ealexis.t/trends) PHP · 206 lines

1 <?php

2

3 /*

134 private function findClassInPath($path, $class, $prefix)

135 {

136 if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {

137 return array();

138 }

139

140 $classes = array();

141 $filename = $class.'.php';

142 foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {

143 if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {

160 $candidates = array(

161 // namespaced class

162 $namespacedClass = str_replace(array($path.DIRECTORY_SEPARATOR, '.php', '/'), array('', '', '\\'), $file),

163 // namespaced class (with target dir)

164 $prefix.$namespacedClass,

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

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

10 /**

11 * Test class for \Magento\Catalog\Model\Product\Gallery\Processor.

12 * @magentoDataFixture Magento/Catalog/_files/product_simple.php

13 */

14 class ProcessorTest extends \PHPUnit_Framework_TestCase

42 self::$_mediaTmpDir = $mediaDirectory->getAbsolutePath($config->getBaseTmpMediaPath());

43 self::$_mediaDir = $mediaDirectory->getAbsolutePath($config->getBaseMediaPath());

44 $fixtureDir = realpath(__DIR__ . '/../../../_files');

45

46 $mediaDirectory->create($config->getBaseTmpMediaPath());

config.php (https://bitbucket.org/ccromos/zusammenspiel2.git) PHP · 117 lines

1 <?php

2

3 $basePath = $app['path.base'];

4

5 return array_map('realpath', array(

6 $basePath.'/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php',

7 $basePath.'/vendor/laravel/framework/src/Illuminate/Container/Container.php',

8 $basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php',

9 $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Contracts/ResponsePreparerInterface.php',

10 $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Application.php',

11 $basePath.'/vendor/laravel/framework/src/Illuminate/Http/Request.php',

12 $basePath.'/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php',

ClassMapAutoloader.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 248 lines

1 <?php

2 /**

3 * Zend Framework

20

21 // Grab SplAutoloader interface

22 #require_once dirname(__FILE__) . '/SplAutoloader.php';

23

24 /**

96

97 if (!is_array($map)) {

98 #require_once dirname(__FILE__) . '/Exception/InvalidArgumentException.php';

99 throw new Zend_Loader_Exception_InvalidArgumentException('Map file provided does not return a map');

100 }

199 * Resolve the real_path() to a file within a phar.

200 *

201 * @see https://bugs.php.net/bug.php?id=52769

202 * @param string $path

203 * @return string

LegacyApacheMatcherDumperTest.php (https://gitlab.com/techniconline/kmc) PHP · 204 lines

1 <?php

2

3 /*

19 * @group legacy

20 */

21 class LegacyApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase

22 {

23 protected static $fixturesPath;

25 public static function setUpBeforeClass()

26 {

27 self::$fixturesPath = realpath(__DIR__ . '/../../Fixtures/');

28 }

29

66 $collection->add('foo', new Route('/foo'));

67 $dumper = new ApacheMatcherDumper($collection);

68 $this->assertStringEqualsFile(self::$fixturesPath . '/dumper/url_matcher2.apache', $dumper->dump(array('script_name' => 'ap p_d\ ev.php')));

69 }

70

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.

1 <?php

2 /**

3 * Helper function to convert a simple pattern to a regular expression for matching.

130 $atts = stat($fullPath);

131

132 $rootPath = realPath($rootDir);

133 $resolvedDir = realPath($rootDir."/".$dir);

134 $resolvedFullPath = realPath($fullPath);

135

136 //Try to normalize down the paths so it does a consistent return.

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.

363

LegacyApacheMatcherDumperTest.php (https://gitlab.com/mohamedchiheb.bida/workshopFOS) PHP · 204 lines

1 <?php

2

3 /*

19 * @group legacy

20 */

21 class LegacyApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase

22 {

23 protected static $fixturesPath;

25 public static function setUpBeforeClass()

26 {

27 self::$fixturesPath = realpath(__DIR__.'/../../Fixtures/');

28 }

29

66 $collection->add('foo', new Route('/foo'));

67 $dumper = new ApacheMatcherDumper($collection);

68 $this->assertStringEqualsFile(self::$fixturesPath.'/dumper/url_matcher2.apache', $dumper->dump(array('script_name' => 'ap p_d\ ev.php')));

69 }

70

Client.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 228 lines

1 <?php

2

3 /*

102 $r = new \ReflectionClass('\\Symfony\\Component\\ClassLoader\\ClassLoader');

103 $requirePath = str_replace("'", "\\'", $r->getFileName());

104 $symfonyPath = str_replace("'", "\\'", realpath(__DIR__.'/../../..'));

105 $errorReporting = error_reporting();

106

107 $code = <<<EOF

108 <?php

109

110 error_reporting($errorReporting);

160 * method can be called on those instances.

161 *

162 * If the size of a file is greater than the allowed size (from php.ini) then

163 * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE.

164 *

ArchiveManager.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 171 lines

1 <?php

2

3 /*

21 /**

22 * @author Matthieu Moquet <matthieu@moquet.net>

23 * @author Till Klampaeckel <till@php.net>

24 */

25 class ArchiveManager

127 // Archive filename

128 $filesystem->ensureDirectoryExists($targetDir);

129 $target = realpath($targetDir).'/'.$packageName.'.'.$format;

130 $filesystem->ensureDirectoryExists(dirname($target));

131

135

136 if ($package instanceof RootPackageInterface) {

137 $sourcePath = realpath('.');

138 } else {

139 // Directory used to download the sources

AppNameCommand.php (https://gitlab.com/techniconline/kmc) PHP · 327 lines

1 <?php namespace Illuminate\Foundation\Console;

2

3 use Illuminate\Console\Command;

80 $this->setComposerNamespace();

81

82 $this->setPhpSpecNamespace();

83

84 $this->info('Application namespace set!');

98 $files = Finder::create()

99 ->in($this->laravel['path'])

100 ->name('*.php');

101

102 foreach ($files as $file) {

103 $this->replaceNamespace($file->getRealPath());

104 }

105 }

Tools.php (https://github.com/Slaver/kohana-wordpress.git) PHP · 187 lines

1 <?php defined('SYSPATH') OR die('No direct access allowed.');

2

3 class Wordpress_Tools {

91 $select = (isset($select) && is_numeric($select)) ? $select : rand(0, $count);

92 $image_url = ltrim($images[1][$select], '/');

93 $image_path = realpath($image_url);

94

95 if ( ! empty($image_url))

99 {

100 $tmp_dir = $image_root.'/cache';

101 $tmp_path = realpath($tmp_dir);

102 $tmp_name = substr(md5($image_url.'-'.$sizes[0].'-'.$sizes[1]), 0, 7).'.jpg';

103 $tmp_file = $tmp_path.'/'.$tmp_name;

143 if ( ! empty($file)) {

144 $home = Wordpress_Options::instance()->get_option('siteurl').'/';

145 $file_path = realpath(str_replace($home, '', $file));

146

147 if ( ! empty($file_path)) {

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

1 #!/usr/bin/env php

2 <?php

25 }

26

27 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));

28

29 function update_core($dir, $domain)

36 --default-domain=$domain \

37 --output=locale/$domain.pot \

38 --language=PHP \

39 --add-comments=TRANS \

40 --keyword="_m:1,1t" \

44 --keyword="pgettext:1c,2" \

45 --keyword="npgettext:1c,2,3" \

46 index.php \

47 actions/*.php \

EditorUploadImageScaleTest.php (https://gitlab.com/andecode/theme-spark) PHP · 234 lines

1 <?php

2

3 namespace Drupal\Tests\editor\Functional;

200 protected function uploadImage($uri) {

201 $edit = [

202 'files[fid]' => \Drupal::service('file_system')->realpath($uri),

203 ];

204 $this->drupalGet('editor/dialog/image/basic_html');

index.php (https://github.com/Maigre/SupAir.git) PHP · 222 lines

1 <?php

2

3 define('APP_NAME','SupAir');

5 define('CLIENT_NAME','Client1'); //TODO find a way to choose client !

6

7 if (is_file('../'.APP_NAME.'_'.CLIENT_NAME.'_seed.php'))

8 {

9 define('APP_TYPE','local');

10 require_once('../'.APP_NAME.'_'.CLIENT_NAME.'_seed.php');

11 }

12 elseif (is_file('../'.APP_NAME.'_'.CLIENT_NAME.'.php'))

13 {

14 define('APP_TYPE','server');

15 require_once('../'.APP_NAME.'_'.CLIENT_NAME.'.php');

16 }

17

CWebModule.php (https://bitbucket.org/rezanachmad/php-selenium-training.git) PHP · 202 lines

1 <?php

2 /**

3 * CWebModule class file.

112 public function setControllerPath($value)

113 {

114 if(($this->_controllerPath=realpath($value))===false || !is_dir($this->_controllerPath))

115 throw new CException(Yii::t('yii','The controller path "{path}" is not a valid directory.',

116 array('{path}'=>$value)));

135 public function setViewPath($path)

136 {

137 if(($this->_viewPath=realpath($path))===false || !is_dir($this->_viewPath))

138 throw new CException(Yii::t('yii','The view path "{path}" is not a valid directory.',

139 array('{path}'=>$path)));

158 public function setLayoutPath($path)

159 {

160 if(($this->_layoutPath=realpath($path))===false || !is_dir($this->_layoutPath))

161 throw new CException(Yii::t('yii','The layout path "{path}" is not a valid directory.',

162 array('{path}'=>$path)));

yaf-application.environ.html (https://bitbucket.org/stillzhl/manuals.git) HTML · 77 lines

10 <div class="next" style="text-align: right; float: right;"><a href="yaf-application.execute.html">Yaf_Application::execute</a></div>

11 <div class="up"><a href="class.yaf-application.html">Yaf_Application</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="yaf-application.environ" class="refentry">

14 <div class="refnamediv">

56 <div class="phpcode"><code><span style="color: #000000">

57 <span style="color: #0000BB">&lt;?php<br />$config&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"application"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"directory"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">))&nbsp;.&nbsp;</span><span style="color: #DD0000">"/application"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;),<br />);<br /><br /></span><span style="color: #FF8000">/**&nbsp;Yaf_Application&nbsp;*/<br /></span><span style="color: #0000BB">$application&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">environ</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>

58 </span>

59 </code></div>

74 <div class="next" style="text-align: right; float: right;"><a href="yaf-application.execute.html">Yaf_Application::execute</a></div>

75 <div class="up"><a href="class.yaf-application.html">Yaf_Application</a></div>

76 <div class="home"><a href="index.html">PHP Manual</a></div>

77 </div></body></html>

78

darcs.py (https://bitbucket.org/nbargnesi/idea.git) Python · 167 lines

49 raise util.Abort(_("Python ElementTree module is not available"))

50

51 self.path = os.path.realpath(path)

52

53 self.lastrev = None

ScriptingCore.cpp (https://bitbucket.org/Tsiannian/cocos2d-x.git) C++ · 882 lines

303 cocos2d::CCFileUtils *futil = cocos2d::CCFileUtils::sharedFileUtils();

304

305 const char *realPath = futil->fullPathFromRelativePath(path);

306

307 if (!realPath) {

308 CCLOG("!realPath. returning JS_FALSE");

309 return JS_FALSE;

310 }

313 unsigned long contentSize = 0;

314

315 content = (unsigned char*)CCString::createWithContentsOfFile(realPath)->getCString();

316 contentSize = strlen((char*)content);

317

execute.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 287 lines ✨ Summary

This C code is part of a caching compiler for C programs, ccache. It provides functions to execute compilers and find executables by name in the system’s PATH environment variable. The execute function runs a compiler with output redirected to specified files, while find_executable searches for an executable by name, excluding links to a specific excluded name.

248 point at something called exclude_name */

249 if (S_ISLNK(st1.st_mode)) {

250 char *buf = x_realpath(fname);

251 if (buf) {

252 char *p = str_basename(buf);