100+ results for 'php is_writable'

Not the results you expected?

Definition.php (https://github.com/ngocanh/pimcore.git) PHP · 293 lines

1 <?php

2 /**

3 * Pimcore

168 $definitionFile = $fieldCollectionFolder . "/" . $this->getKey() . ".psf";

169

170 if(!is_writable(dirname($definitionFile)) || (is_file($definitionFile) && !is_writable($definitionFile))) {

171 throw new Exception("Cannot write definition file in: " . $definitionFile . " please check write permission on this directory.");

172 }

182

183 // create class file

184 $cd = '<?php ';

185

186 $cd .= "\n\n";

239 $classFile = $fieldClassFolder . "/" . ucfirst($this->getKey()) . ".php";

240 if(!is_writable(dirname($classFile)) || (is_file($classFile) && !is_writable($classFile))) {

241 throw new Exception("Cannot write definition file in: " . $classFile . " please check write permission on this directory.");

242 }

SplFileInfo.php (https://github.com/tstarling/hiphop-php.git) PHP · 432 lines

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

4 /**

5 * ( excerpt from http://php.net/manual/en/class.splfileinfo.php )

6 *

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

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

190 /**

191 * ( excerpt from http://php.net/manual/en/splfileinfo.getmtime.php )

192 *

193 * Returns the time when the contents of the file were changed. The time

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

411 /**

412 * ( excerpt from http://php.net/manual/en/splfileinfo.setinfoclass.php )

413 *

414 * Use this method to set a custom class which will be used when

Abstract.php (https://github.com/hettema/Stages.git) PHP · 393 lines

1 <?php

2 /**

3 * class Core_Model_Session_Absctract

30 }

31

32 if (is_writable($this->getSessionSavePath())) {

33 session_save_path($this->getSessionSavePath());

34 }

files.php (https://gitlab.com/webbroteam/satisfaction-mvc) PHP · 306 lines

13 */

14

15 namespace phpFastCache\Drivers;

16

17 use phpFastCache\Core\DriverAbstract;

18 use phpFastCache\Exceptions\phpFastCacheDriverException;

19

20 /**

28 * phpFastCache_files constructor.

29 * @param array $config

30 * @throws phpFastCacheDriverException

31 */

32 public function __construct($config = array())

45 public function checkdriver()

46 {

47 if (is_writable($this->getPath())) {

48 return true;

49 }/* else {

PhpTest.php (https://github.com/kiranatama/sagalaya.git) PHP · 204 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2012, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

11 use Exception;

12 use lithium\core\Libraries;

13 use lithium\g11n\catalog\adapter\Php;

14

15 class PhpTest extends \lithium\test\Unit {

21 public function skip() {

22 $this->_path = $path = Libraries::get(true, 'resources') . '/tmp/tests';

23 $this->skipIf(!is_writable($path), "Path `{$path}` is not writable.");

24 }

25

Serializer.php (https://github.com/abgreeve/moodle.git) PHP · 311 lines

1 <?php

2

3 class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCache

98 $dir = $this->generateDirectoryPath($config);

99 $dh = opendir($dir);

100 // Apparently, on some versions of PHP, readdir will return

101 // an empty string if you pass an invalid argument to readdir.

102 // So you need this test. See #49.

265 {

266 // early abort, if it is writable, everything is hunky-dory

267 if (is_writable($dir)) {

268 return true;

269 }

288 $chmod = $chmod | 0070;

289 } else {

290 // PHP's probably running as nobody, so we'll

291 // need to give global permissions

292 $chmod = $chmod | 0777;

FileUtilsTest.php (https://github.com/schmittjoh/JMSTranslationBundle.git) PHP · 138 lines

1 <?php

2

3 declare(strict_types=1);

22

23 use JMS\TranslationBundle\Util\FileUtils;

24 use PHPUnit\Framework\TestCase;

25 use Symfony\Component\Filesystem\Filesystem;

26 use Symfony\Component\Finder\SplFileInfo;

110 {

111 $tempDir = sys_get_temp_dir();

112 if (!is_writable($tempDir)) {

113 $this->markTestSkipped(sprintf(

114 "Can't execute FileUtils tests because %s is not writable",

xpdozip.class.php (https://github.com/gbds/revolution.git) PHP · 203 lines

1 <?php

2 /*

3 * Copyright 2006, 2007, 2008, 2009, 2010 by Jason Coward <xpdo@opengeek.com>

59 if (!empty($this->_filename) && file_exists(dirname($this->_filename))) {

60 if (file_exists($this->_filename)) {

61 if ($this->getOption(xPDOZip::OVERWRITE, null, false) && is_writable($this->_filename)) {

62 if ($this->_archive->open($this->_filename, ZIPARCHIVE::OVERWRITE) !== true) {

63 $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOZip: Error opening archive at {$this->_filename} for OVERWRITE");

68 }

69 }

70 } elseif ($this->getOption(xPDOZip::CREATE, null, false) && is_writable(dirname($this->_filename))) {

71 if ($this->_archive->open($this->_filename, ZIPARCHIVE::CREATE) !== true) {

72 $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOZip: Could not create archive at {$this->_filename}");

139 $results = false;

140 if ($this->_archive) {

141 if (is_dir($target) && is_writable($target)) {

142 $results = $this->_archive->extractTo($target);

143 }

Controller.php (https://github.com/shooray/oscommerce.git) PHP · 122 lines

1 <?php

2 /**

3 * osCommerce Online Merchant

67

68 foreach ( array('Cache', 'CoreUpdate', 'Database', 'Logs', 'Session', 'Temp') as $w ) {

69 if ( !is_writable(OSCOM::BASE_DIRECTORY . 'Work/' . $w) ) {

70 $work_dirs[] = $w;

71 }

class_writer.php (https://github.com/F5/zetacomponents.git) PHP · 290 lines

1 <?php

2 /**

3 * File containing the ezcDbSchemaPersistentClassWriter class.

26

27 /**

28 * This handler creates PHP classes to be used with PersistentObject from a

29 * DatabaseSchema.

30 *

93 }

94

95 if ( !is_writable( $dir ) )

96 {

97 throw new ezcBaseFilePermissionException( $dir, ezcBaseFileException::WRITE );

175

176 /**

177 * Writes a PHP class.

178 * This method writes a PHP class from a table definition.

file_info.php (https://github.com/nigeldaley/moodle.git) PHP · 292 lines

1 <?php

2

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

125 * @return bool

126 */

127 public function is_writable() {

128 return true;

129 }

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

1 <?php namespace Illuminate\Filesystem;

2

3 use ErrorException;

239 public function isWritable($path)

240 {

241 return is_writable($path);

242 }

243

upload.php (https://bitbucket.org/seyar/kinda.local.git) PHP · 213 lines

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

2 /**

3 * Upload helper class for working with uploaded files and [Validate].

76 }

77

78 if ( ! is_dir($directory) OR ! is_writable(realpath($directory)))

79 {

80 throw new Kohana_Exception('Directory :dir must be writable',

170 if ($file['error'] === UPLOAD_ERR_INI_SIZE)

171 {

172 // Upload is larger than PHP allowed size

173 return FALSE;

174 }

Image.php (https://github.com/back2arie/Panada.git) PHP · 317 lines

1 <?php

2 /**

3 * Panada Image Modifier.

5 * @package Resources

6 * @link http://panadaframework.com/

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

8 * @author Iskandar Soesman <k4ndar@yahoo.com>

9 * @since Version 0.1

152 * Does it folder writable?

153 */

154 if( ! is_writable($this->folder) ) {

155 $this->errorMessages[] = 'The folder '.$this->folder.' is not writable.';

156 return false;

CodeTest.php (https://github.com/ggunlugu/ornekler.git) PHP · 238 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

20 public function setUp() {

21 $this->_path = $path = LITHIUM_APP_PATH . '/resources/tmp/tests';

22 $this->skipIf(!is_writable($this->_path), "{$this->_path} is not writable.");

23

24 $this->adapter = new Code(compact('path'));

25

26 $file = "{$this->_path}/a.php";

27 $data = <<<'EOD'

28 <?php

Filesystem.php (https://gitlab.com/pthapa81/MeroSaaman-1.0) PHP · 441 lines

1 <?php namespace Illuminate\Filesystem;

2

3 use ErrorException;

244 public function isWritable($path)

245 {

246 return is_writable($path);

247 }

248

upload.php (https://bitbucket.org/cgcamilo/multiflora.git) PHP · 162 lines

1 <?php

2

3 /**

10 */

11 function save($path) {

12 $input = fopen("php://input", "r");

13 $temp = tmpfile();

14 $realSize = stream_copy_to_stream($input, $temp);

107 */

108 function handleUpload($uploadDirectory, $replaceOldFile = FALSE){

109 if (!is_writable($uploadDirectory)){

110 return array('error' => "Server error. Upload directory isn't writable.");

111 }

class-setup.php (https://gitlab.com/billyprice1/h5ai) PHP · 185 lines

47

48 private function add_globals_and_envs() {

49 $this->set('PHP_VERSION', PHP_VERSION);

50 $this->set('MIN_PHP_VERSION', MIN_PHP_VERSION);

51 $this->set('PHP_ARCH', (PHP_INT_SIZE * 8) . '-bit');

52

53 $this->set('REQUEST_METHOD', $_SERVER['REQUEST_METHOD']);

61 $this->set('HAS_PHP_EXIF', function_exists('exif_thumbnail'));

62

63 $has_php_jpeg = false;

64 if (function_exists('gd_info')) {

65 $infos = gd_info();

66 $has_php_jpeg = array_key_exists('JPEG Support', $infos) && $infos['JPEG Support'];

67 }

68 $this->set('HAS_PHP_JPEG', $has_php_jpeg);

69 }

70

class-wp-filesystem-ftpsockets.php (https://github.com/muskmelon/Greemo.git) PHP · 327 lines

1 <?php

2 /**

3 * WordPress FTP Sockets Filesystem.

25

26 //Check if possible to use ftp functions.

27 if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )

28 return false;

29 $this->ftp = new ftp();

246 }

247

248 function is_writable($file) {

249 //Get dir list, Check if the file is writable by the current user??

250 return true;

IniFileTask.php (https://gitlab.com/Isaki/le331.fr) PHP · 355 lines

1 <?php

2 /**

3 * INI file modification task for Phing, the PHP build tool.

5 * Based on http://ant-contrib.sourceforge.net/tasks/tasks/inifile.html

6 *

7 * PHP version 5

8 *

9 * @category Tasks

10 * @package phing.tasks.ext

11 * @author Ken Guest <kguest@php.net>

12 * @license LGPL v3 or later http://www.gnu.org/licenses/lgpl.html

13 * @link http://www.phing.info/

14 */

15

16 require_once 'IniFileSet.php';

17 require_once 'IniFileRemove.php';

XmlToSqlTool.inc.php (https://github.com/mcrider/pkpUpgradeTestSuite.git) PHP · 166 lines

1 <?php

2

3 /**

4 * @file classes/cliTool/XmlToSqlTool.inc.php

5 *

6 * Copyright (c) 2000-2009 John Willinsky

13 */

14

15 // $Id: XmlToSqlTool.inc.php,v 1.5 2009/08/26 23:37:33 asmecher Exp $

16

17

65

66 $this->outputFile = isset($this->argv[$argOffset+2]) ? PWD . '/' . $this->argv[$argOffset+2] : null;

67 if (in_array($this->command, array('save', 'save_upgrade')) && ($this->outputFile == null || (file_exists($this->outputFile) && (is_dir($this->outputFile) || !is_writeable($this->outputFile))) || !is_writable(dirname($this->outputFile)))) {

68 printf("Invalid output file \"%s\"!\n", $this->outputFile);

69 exit(1);

Bundle.php (https://github.com/ewandor/horde.git) PHP · 187 lines

47 if ((file_exists(HORDE_BASE . '/config/conf.php') &&

48 !is_writable(HORDE_BASE . '/config/conf.php')) ||

49 !is_writable(HORDE_BASE . '/config')) {

50 $this->_cli->message(Horde_Util::realPath(HORDE_BASE . '/config/conf.php') . ' is not writable.', 'cli.error');

51 }

52

54 if (!file_exists(HORDE_BASE . '/config/conf.php')) {

55 copy(HORDE_BASE . '/config/conf.php.dist', HORDE_BASE . '/config/conf.php');

56 }

57

150 echo 'Writing main configuration file...';

151

152 $php_config = $this->_config->generatePHPConfig($vars, $GLOBALS['conf']);

153 $configFile = $this->_config->configFile();

154 $fp = fopen($configFile, 'w');

upload.php (https://github.com/drslice/regform.git) PHP · 213 lines

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

2 /**

3 * Upload helper class for working with uploaded files and [Validate].

76 }

77

78 if ( ! is_dir($directory) OR ! is_writable(realpath($directory)))

79 {

80 throw new Kohana_Exception('Directory :dir must be writable',

170 if ($file['error'] === UPLOAD_ERR_INI_SIZE)

171 {

172 // Upload is larger than PHP allowed size

173 return FALSE;

174 }

openid_file_store.php (https://github.com/F5/zetacomponents.git) PHP · 301 lines

1 <?php

2 /**

3 * File containing the ezcAuthenticationOpenidFileStore class.

109 }

110

111 if ( !is_writable( $value ) )

112 {

113 throw new ezcBaseFilePermissionException( $value, ezcBaseFileException::WRITE );

image.php (https://github.com/ismanramadhan/Panada.git) PHP · 290 lines

1 <?php defined('THISPATH') or die('Can\'t access directly!');

2 /**

3 * Panada Image Modifier.

130 * ID: Apakah folder tersebut bisa untuk tulis/hapus?

131 */

132 if( ! is_writable($this->folder) ) {

133 $this->error_messages[] = 'The folder '.$this->folder.' is not writable.';

134 return false;

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

1 <?php

2

3 /**

389 protected function saveFileAttributes() {

390 $file = $this->getAttributesFilePath();

391 if (is_file($file) && !file_is_writable($file)) {

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

slider.php (https://bitbucket.org/benjamin_cassinat/meute-apax.git) PHP · 193 lines

1 <?php

2 if($loggedin) {

3 if(isanyadmin($userID))

74

75 ?>

76 <meta http-equiv="refresh" content="0; url=theme_cfg.php?mess=ok" />

77 <?php

128 <tr>

129 <td>Lien vers l'article :</td>

130 <td><input size="25" type="text" value="<?php echo html_entity_decode(stripslashes($link2)); ?>" name="link2" /></td>

131 </tr>

132 <tr>

187

188

189 <center><a href="theme_cfg.php" title="index"><b><?php echo page_mess; ?></b></a></center>

190 <?php

commands.php (https://github.com/shafiqissani/Jewelery-Ecommerce-.git) PHP · 273 lines

1 <?php

2 /*

3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net

20 * == END LICENSE ==

21 *

22 * This is the File Manager Connector for PHP.

23 */

24

125 $sServerDir = ServerMapFolder( $resourceType, $currentFolder, 'CreateFolder' ) ;

126

127 if ( is_writable( $sServerDir ) )

128 {

129 $sServerDir .= $sNewFolderName ;

Factory.php (https://bitbucket.org/alexandretaz/maniac_divers.git) PHP · 277 lines

1 <?php

2 /**

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

48 */

49 protected static $writerExtensions = array(

50 'php' => 'php',

51 'ini' => 'ini',

52 'json' => 'json',

77 $extension = strtolower($pathinfo['extension']);

78

79 if ($extension === 'php') {

80 if (!is_file($filename) || !is_readable($filename)) {

81 throw new Exception\RuntimeException(sprintf(

152 }

153

154 if (!is_writable($directory)) {

155 throw new Exception\RuntimeException(

156 "Cannot write in directory '{$directory}'"

file.php (https://bitbucket.org/enangyusup/vbulletin-cakephp.git) PHP · 278 lines

1 <?php

2 /**

3 * File Storage engine for cache

6 * PHP versions 4 and 5

7 *

8 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

9 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)

10 *

13 *

14 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)

15 * @link http://cakephp.org CakePHP(tm) Project

16 * @package cake

17 * @subpackage cake.cake.libs.cache

18 * @since CakePHP(tm) v 1.2.0.4933

19 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)

MigrationManagerHelperTest.php (https://github.com/eugenix/dbmigrator.git) PHP · 188 lines

1 <?php

2 require_once '../Helpers/MigrationManagerHelper.php';

4 /**

5 * Test class for MigrationManagerHelper.

6 * Generated by PHPUnit on 2011-05-24 at 17:08:26.

7 */

8 class MigrationManagerHelperTest extends PHPUnit_Framework_TestCase

102 $this->object->createDump('data/storage/0');

103

104 $this->assertTrue(is_writable('data/storage/0/data.sql'));

105 $this->assertTrue(is_writable('data/storage/0/procedures.sql'));

106 $this->assertTrue(is_writable('data/storage/0/scheme.sql'));

107 $this->assertTrue(is_writable('data/storage/0/triggers.sql'));

upload.php (https://github.com/xig/SocialFeed.git) PHP · 162 lines

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

2 /**

3 * Upload helper class for working with the global $_FILES

4 * array and Validation library.

5 *

6 * $Id: upload.php 3769 2008-12-15 00:48:56Z zombor $

7 *

8 * @package Core

9 * @author Kohana Team

10 * @copyright (c) 2007-2008 Kohana Team

11 * @license http://kohanaphp.com/license.html

12 */

13 class upload_Core {

54 }

55

56 if ( ! is_writable($directory))

57 throw new Kohana_Exception('upload.not_writable', $directory);

58

Client.php (https://gitlab.com/leduc1984/roBrowser) PHP · 209 lines

1 <?php

2

3 /**

161 }

162

163 if (!is_writable($parent_path)) {

164 Debug::write("Can't write file to '{$parent_path}', need write permission.", 'error');

165 return $content;

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

1 <?php

2

3 /**

409 protected function saveFileAttributes() {

410 $file = $this->getAttributesFilePath();

411 if (is_file($file) && !file_is_writable($file)) {

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

SimpleGdImage.class.old.php (https://gitlab.com/x33n/ProjectPier-Core) PHP · 549 lines

1 <?php

2

3 /**

154 throw new Error('This image was not loaded from the file. Use saveAs() function instead of save() - there you\'ll be able to specify output file and type');

155 } // if

156 if (!file_is_writable($this->getSource())) {

157 throw new FileNotWriableError($this->getSource());

158 } // if

step_3.php (https://bitbucket.org/deringer/opencart.git) PHP · 256 lines

1 <?php

2 class ControllerStep3 extends Controller {

3 private $error = array();

9 $this->model_install->mysql($this->request->post);

10

11 $output = '<?php' . "\n";

12 $output .= '// HTTP' . "\n";

13 $output .= 'define(\'HTTP_SERVER\', \'' . HTTP_OPENCART . '\');' . "\n\n";

239 }

240

241 if (!is_writable(DIR_OPENCART . 'config.php')) {

242 $this->error['warning'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . DIR_OPENCART . 'config.php!';

243 }

244

245 if (!is_writable(DIR_OPENCART . 'admin/config.php')) {

246 $this->error['warning'] = 'Error: Could not write to config.php please check you have set the correct permissions on: ' . DIR_OPENCART . 'admin/config.php!';

server.php (https://gitlab.com/ebrjose/comcebu) PHP · 362 lines

47 'software' => 'Software',

48 'mysql_version' => 'MySQL version',

49 'php_version' => 'PHP Version',

50 'php_max_input_vars' => 'PHP Max Input Vars',

51 'php_max_post_size' => 'PHP Max Post Size',

52 'gd_installed' => 'GD Installed',

53 'zip_installed' => 'ZIP Installed',

73 public function get_os() {

74 return [

75 'value' => PHP_OS,

76 ];

77 }

115 public function get_php_version() {

116 $result = [

117 'value' => PHP_VERSION,

118 ];

119

FileSystem.php (https://github.com/mako-framework/framework.git) PHP · 377 lines

1 <?php

2

3 /**

25 use function is_file;

26 use function is_readable;

27 use function is_writable;

28 use function mkdir;

29 use function pathinfo;

105 public function isWritable(string $file): bool

106 {

107 return is_writable($file);

108 }

109

PolyfillTestCase.php (https://github.com/fabpot/composer.git) PHP · 762 lines

24 abstract class PolyfillTestCase extends TestCase

25 {

26 // all the functions below are form https://github.com/symfony/phpunit-bridge/blob/bd341a45ef79b30918376e8b8e2279fac6894c3b/Legacy/PolyfillAssertTrait.php

27

28 /**

511

512 foreach (array(

513 'PHPUnit\Framework\SelfDescribing',

514 ) as $interface) {

515 if (!interface_exists($interface) && interface_exists(str_replace('\\', '_', $interface))) {

520 if (!class_exists('PHPUnit\Framework\Constraint\Constraint')) {

521 class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint');

522 }

523 }

524

525 // all the code below taken from various PHPUnit versions to make things work on PHPUnit 4.8 / PHP 5.3

526 /*

527 * This file is part of PHPUnit.

PatternOptions.php (https://github.com/kiranatama/sagalaya.git) PHP · 763 lines

1 <?php

2 /**

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

158 {

159 // disable file/directory permissions by default on windows systems

160 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {

161 $this->filePermission = false;

162 $this->dirPermission = false;

644 "Public directory '{$publicDir}' not found or not a directoy"

645 );

646 } elseif (!is_writable($publicDir)) {

647 throw new Exception\InvalidArgumentException(

648 "Public directory '{$publicDir}' not writable"

class-wp-filesystem-ftpsockets.php (https://bitbucket.org/zenoalbisser/webkit.git) PHP · 327 lines

1 <?php

2 /**

3 * WordPress FTP Sockets Filesystem.

28

29 //Check if possible to use ftp functions.

30 if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )

31 return false;

32 $this->ftp = new ftp();

243 }

244

245 function is_writable($file) {

246 //Get dir list, Check if the file is writable by the current user??

247 return true;

generator.php (https://github.com/Yacodo/atoum.git) PHP · 709 lines

1 <?php

2

3 namespace mageekguy\atoum\tests\units\scripts\phar;

9 ;

10

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

12

13 class generator extends atoum\test

24 $adapter = new atoum\test\adapter();

25

26 $adapter->php_sapi_name = function() { return uniqid(); };

27

28 $name = uniqid();

37 ;

38

39 $adapter->php_sapi_name = function() { return 'cli'; };

40

41 $name = uniqid();

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

166 {

167 clearstatcache();

168 $result = @is_writable($this->getScheme() . $path);

169 if ($result === null) {

170 throw new FileSystemException(

smarty_internal_testinstall.php (https://gitlab.com/flyhope/Hiblog) PHP · 571 lines

1 <?php

2 /**

3 * Smarty Internal TestInstall

44 if (!$template_dir) {

45 if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {

46 // try PHP include_path

47 if ($_stream_resolve_include_path) {

48 $template_dir = stream_resolve_include_path($_template_dir);

135 $errors['compile_dir'] = $message;

136 }

137 } elseif (!is_writable($_compile_dir)) {

138 $status = false;

139 $message = "FAILED: {$_compile_dir} is not writable";

382 "smarty_internal_compile_include.php" => true,

383 "smarty_internal_compile_include_php.php" => true,

384 "smarty_internal_compile_insert.php" => true,

422 "smarty_internal_resource_file.php" => true,

423 "smarty_internal_resource_php.php" => true,

424 "smarty_internal_resource_registered.php" => true,

menu_creator.php (https://github.com/GansukhB/phtstr.git) PHP · 231 lines

1 <?PHP

2 session_start();

3 session_register("mgruser");

4 $_SESSION['mgruser'] = 1;

5

6 include( "../database.php" );

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

8 include( "../functions.php" );

9

10 //$lang = $_SESSION['lang'];

59 }

60 if($ca->pub_pri == 1){

61 $output.= "'" . $setting->site_url . "/pri.php?gid=" . $ca->id . "&gal=" . $ca->rdmcode . "',,";

62 } else {

63

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

1 <?php

2

3 /**

4 * File holding the DirectFilesystem class.

5 *

6 * @file DirectFilesystem.php

7 * @ingroup Deployment

8 * @ingroup Filesystem

16

17 /**

18 * Filesystem class for direct PHP file and folder manipulation.

19 *

20 * @author Jeroen De Dauw

350 public function isWritable( $file ) {

351 wfSuppressWarnings();

352 $result = (bool)is_writable( $file );

353 wfRestoreWarnings();

354 return $result;

S_confedit.php (https://github.com/Mithgol/Nephtsys.git) PHP · 343 lines

1 <?php

2 /*\

3 / This is a part of PhFiTo (aka PHP Fido Tosser)

7 /// See docs/license for details

8 //

9 / $Id: S_confedit.php,v 1.5 2011/01/08 12:21:09 kocharin Exp $

10 \*/

11

226 $arr = isset($CONFIG->Links->Vals_loc[$link][$key])?$CONFIG->Links->Vals_loc[$link][$key]:$CONFIG->Links->Vals_defloc[$link];

227 list($file,$line,$exists) = $arr;

228 if (!is_writable($file)) return 0;

229 if ($f = @fopen($file,'r')):

230 $l = 0;

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

1 <?php

2

3 /**

208 $dir = TD_PATH .'skins/s'. $id;

209

210 if ( ! is_dir( $dir ) || ! is_writable( $dir ) ) return false;

211

212 if ( ! $this->_rrmdir( $dir ) ) return false;

245 if ( is_file( $dir .'/'. $file ) )

246 {

247 if ( ! is_writable( $dir .'/'. $file ) ) return false;

248 if ( ! @unlink( $dir .'/'. $file ) ) return false;

249 }

315

316 if ( ! @mkdir( ( $dir = TD_SKIN .'s'. $id ), 0755, true ) ) return false;

317 if ( ! is_dir( $dir ) || ! is_writable( $dir ) ) return false;

318

319 if ( ! @file_put_contents( $dir .'/info.xml', $infoxml->saveXML() ) ) return false;

func_languages.php (https://github.com/lewellyn/TrellisDesk.git) PHP · 522 lines

1 <?php

2

3 /**

104 if ( ! $handle = fopen( $path, 'wb' ) ) return false;

105

106 $file_start = "<?php\n\n/*\n#======================================================\n";

107 $file_start .= "| | Trellis Desk Language File\n";

108 $file_start .= "| | ". $file ."\n";

164 $dir = TD_PATH .'languages/'. $l['key'];

165

166 if ( ! is_dir( $dir ) || ! is_writable( $dir ) ) return false;

167

168 if ( ! $handle = opendir( $dir ) ) return false;

436 while ( false !== ( $file = readdir( $handle ) ) )

437 {

438 if ( is_file( $dir .'/'. $file ) && ( strrchr( $file, "." ) == '.php' ) && $file != "lang_email_content.php" )

439 {

440 $files[] = $file;

Template.php (https://github.com/smarterwebdev/php-motif.git) PHP · 225 lines

1 <?php

2 /* $Id$ */

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

32 }

33

34 if (@is_writable($dir) === false)

35 {

36 throw new Motif_Template_Exception(sprintf(

188

189 /**

190 * Compile template to native PHP

191 */

192 protected function _compile()

207 file_put_contents($tmpFile, $contents);

208

209 // strip php whitespace

210 // $contents = php_strip_whitespace($tmpFile);

Serializer.php (https://gitlab.com/Griffolion/Game-Embargo-Tracker) PHP · 285 lines

1 <?php

2

3 class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCache

239 {

240 // early abort, if it is writable, everything is hunky-dory

241 if (is_writable($dir)) {

242 return true;

243 }

262 $chmod = $chmod | 0070;

263 } else {

264 // PHP's probably running as nobody, so we'll

265 // need to give global permissions

266 $chmod = $chmod | 0777;

Filesystem.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 412 lines

1 <?php namespace Illuminate\Filesystem;

2

3 use FilesystemIterator;

215 public function isWritable($path)

216 {

217 return is_writable($path);

218 }

219

PatternOptions.php (https://github.com/zucchi/zf2.git) PHP · 771 lines

1 <?php

2 /**

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

159 {

160 // disable file/directory permissions by default on windows systems

161 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {

162 $this->filePermission = false;

163 $this->dirPermission = false;

651 "Public directory '{$publicDir}' not found or not a directory"

652 );

653 } elseif (!is_writable($publicDir)) {

654 throw new Exception\InvalidArgumentException(

655 "Public directory '{$publicDir}' not writable"

vfsStreamWrapperTestCase.php (https://github.com/theosp/google_appengine.git) PHP · 783 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.

172

173 /**

174 * assert is_writable() works correct

175 *

176 * @test

177 */

178 public function is_writable()

179 {

180 $this->assertTrue(is_writable($this->fooURL));

smarty_internal_testinstall.php (https://gitlab.com/team_fsn/fsn-php) PHP · 604 lines

1 <?php

2 /**

3 * Smarty Internal TestInstall

44 if (!$template_dir) {

45 if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {

46 // try PHP include_path

47 if ($_stream_resolve_include_path) {

48 $template_dir = stream_resolve_include_path($_template_dir);

136 $errors[ 'compile_dir' ] = $message;

137 }

138 } elseif (!is_writable($_compile_dir)) {

139 $status = false;

140 $message = "FAILED: {$_compile_dir} is not writable";

384 'smarty_internal_compile_include.php' => true,

385 'smarty_internal_compile_include_php.php' => true,

386 'smarty_internal_compile_insert.php' => true,

394 'smarty_internal_compile_private_object_function.php' => true,

395 'smarty_internal_compile_private_php.php' => true,

396 'smarty_internal_compile_private_print_expression.php' => true,

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

451 * @return bool Whether $file is writable.

452 */

453 public function is_writable( $file ) {

454 return @is_writable( $file );

532 */

533 public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {

534 // Safe mode fails with a trailing slash under certain PHP versions.

535 $path = untrailingslashit( $path );

536

FileSystem.php (https://bitbucket.org/jonbiard/nucleus.git) PHP · 723 lines

1 <?php

2 /**

3 * Class FileSystem

18 * @subpackage FileSystem

19 *

20 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)

21 */

22 class FileSystem

66 *

67 * @param string $path The file or directory path

68 * @param int $mode The file mode (see PHP's chmod())

69 *

70 * @throws IOException When the permissions cannot be changed

87 * @throws IOException Whenever an error occurs during copy

88 *

89 * @SuppressWarnings(PHPMD.CyclomaticComplexity)

90 * @SuppressWarnings(PHPMD.NPathComplexity)

debug.fce.php (https://github.com/GE3/GE3.git) PHP · 110 lines

1 <?php

2 /* -- Nastavení logování chyb na email -- */

3 function myErrorHandler($errno, $errstr, $errfile, $errline){

4 /* Poznámky

5 Uživatelské chyby lze uměle vyvolat – trigger_error().

6 set_error_handler() – nastaví callback funkci, která se použije pro ošetření libovolné chyby v PHP

7 debug_backtrace() vrací aktuální stav PHP zásobníku.

32 $errorText = '<span style="color: #666666; font-size: 8pt;">'.date("j.n.Y G:i")." &raquo;</span> <b>".$errortype[$errno].":</b> $errstr in <b>$errfile</b> on line $errline. ";

33

34 If( file_exists("_errlog.html") AND is_writable("_errlog.html") ){

35 $log = @file_get_contents("_errlog.html");

36 $os = fopen("_errlog.html", "w");

37 }

38 If( file_exists("../_errlog.html") AND is_writable("../_errlog.html") ){

39 $log = @file_get_contents("../_errlog.html");

40 $os = fopen("../_errlog.html", "w");

Filesystem.php (https://gitlab.com/AlexandrSy/magento.xxx) PHP · 302 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

283 }

284

285 if (!is_writable($backupsDir)) {

286 throw new \Magento\Framework\Backup\Exception\NotEnoughPermissions(

287 new \Magento\Framework\Phrase('Backups directory is not writeable')

1001.php (https://gitlab.com/dadangnh/sb1-bon) PHP · 262 lines

1 <?php

2 class ModelUpgrade1001 extends Model {

3 public function upgrade() {

152 }

153

154 // Update the config.php by adding a DIR_MODIFICATION

155 if (is_file(DIR_OPENCART . 'config.php')) {

156 $files = glob(DIR_OPENCART . '{config.php,admin/config.php}', GLOB_BRACE);

157

158 foreach ($files as $file) {

159 if (!is_writable($file)) {

160 exit(json_encode(array('error' => 'File is read only. Please adjust and try again: ' . $file)));

161 }

ShapeFile.lib.php (https://bitbucket.org/markmoskalenko/svitor.git) PHP · 649 lines

1 <?php

2 function loadData($type, $data) {

3 if (!$data) return $data;

283

284 function _openDBFFile($toWrite = false) {

285 $checkFunction = $toWrite ? "is_writable" : "is_readable";

286 if (($toWrite) && (!file_exists(str_replace('.*', '.dbf', $this->FileName)))) {

287 if (!@dbase_create(str_replace('.*', '.dbf', $this->FileName), $this->DBFHeader)) {

class.file.php (https://github.com/livinglab/openlab.git) PHP · 582 lines

286 if ( is_writable( $uploads_dir_data['basedir'] ) )

287 $writable_dir = $uploads_dir_data['basedir'];

288 else if ( is_writable( $uploads_dir_data['path'] ) )

289 $writable_dir = $uploads_dir_data['path'];

290 else if ( is_writable( dirname( __FILE__ ) ) )

298 }

299

300 if ( empty( $writable_dir ) || ! is_dir( $writable_dir ) || ! is_writable( $writable_dir ) )

301 return new WP_Error( 'no_writable_path', 'Unable to find a writable path' );

302

437

438 if ( true === $args['create_index'] )

439 AECFile::write( "$directory/index.php", '<?php // Silence is golden.' );

440

441 return true;

class.WpdiscuzCache.php (https://github.com/livinglab/openlab.git) PHP · 212 lines

1 <?php

2

3 if (!defined("ABSPATH")) {

32 $redirect = $referer;

33 } else {

34 $redirect = admin_url("admin.php?page=" . self::PAGE_SETTINGS . "&wpd_tab=" . self::TAB_GENERAL);

35 }

36 wp_redirect($redirect);

49 public function deleteGravatarsFolder() {

50 if (!class_exists("WP_Filesystem_Direct")) {

51 require_once ABSPATH . "wp-admin/includes/class-wp-filesystem-base.php";

52 require_once ABSPATH . "wp-admin/includes/class-wp-filesystem-direct.php";

145 }

146

147 if (is_writable($fileInfo["dir"]) && ($data = serialize($data))) {

148 return file_put_contents($fileInfo["path"], $data);

149 }

Cache.php (https://github.com/livinglab/openlab.git) PHP · 378 lines

1 <?php

2

3 namespace TheLion\OutoftheBox;

264 @file_put_contents($file, $this->_serialize_cache());

265

266 if (!is_writable($file)) {

267 // TODO log error

268 die(sprintf('Cache file (%s) is not writable', $file));

reformat.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 206 lines

1 <?php

2

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

68 }

69 // output modified file to original

70 if ( is_writable($filename) ) {

71

72 if (! $handle =fopen ($filename ,'w' )) {

189

190 // output modified file to original

191 if ( is_writable($filename) ) {

192 if (! $handle =fopen ($filename ,'w' )) {

193 echo "Cannot open file ($filename)" ;

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

316 }

317 // and can we write to it?

318 if ( ! is_writable($item))

319 {

320 throw new \Fuel_Exception('The webserver doesn\'t have write access to the path to store the session data files.');

step_2.tpl (https://gitlab.com/shapcy/opencart) Smarty Template · 340 lines

1 <?php echo $header; ?>

2 <div class="container">

3 <header>

5 <div class="col-sm-6">

6 <h1 class="pull-left">2<small>/4</small></h1>

7 <h3><?php echo $heading_title; ?><br>

8 <small><?php echo $text_step_2; ?></small></h3>

22 <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">

23 <p><?php echo $text_install_php; ?></p>

24 <fieldset>

25 <table class="table">

36 <td><?php echo $text_version; ?></td>

37 <td><?php echo $php_version; ?></td>

38 <td>5.3+</td>

39 <td class="text-center"><?php if ($php_version >= '5.3') { ?>

smarty_internal_testinstall.php (https://gitlab.com/garabedian.kevin/web2TB) PHP · 595 lines

360 $source = SMARTY_SYSPLUGINS_DIR;

361 if (is_dir($source)) {

362 $expectedSysplugins = array('smartycompilerexception.php' => true, 'smartyexception.php' => true,

363 'smarty_cacheresource.php' => true, 'smarty_cacheresource_custom.php' => true,

364 'smarty_cacheresource_keyvaluestore.php' => true, 'smarty_data.php' => true,

365 'smarty_internal_block.php' => true,

383 'smarty_internal_compile_include.php' => true,

384 'smarty_internal_compile_include_php.php' => true,

385 'smarty_internal_compile_insert.php' => true,

394 'smarty_internal_compile_private_object_function.php' => true,

395 'smarty_internal_compile_private_php.php' => true,

396 'smarty_internal_compile_private_print_expression.php' => true,

407 'smarty_internal_config_file_compiler.php' => true,

408 'smarty_internal_data.php' => true, 'smarty_internal_debug.php' => true,

409 'smarty_internal_extension_clear.php' => true,

image.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 236 lines

1 <?php

2 /**

3 * $URL: svn://svn.mzz.ru/mzz/trunk/system/service/image.php $

10 *

11 * @link http://www.mzz.ru

12 * @version $Id: image.php 4390 2011-02-17 06:27:41Z jonix $

13 */

14

50 $this->height = $height;

51 } else {

52 if (!is_file($image_src) && is_writable($image_src)) {

53 throw new mzzIoException($image_src);

54 }

file.php (https://github.com/agallou/atoum.git) PHP · 586 lines

1 <?php

2

3 namespace mageekguy\atoum\tests\units\mock\streams\fs;

9 ;

10

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

12

13 class file extends atoum\test

28 ->variable($fileResource = fopen($file, 'r'))->isNotEqualTo(false)

29 ->boolean(is_readable($file))->isTrue()

30 ->boolean(is_writable($file))->isTrue()

31 ->boolean(rename($file, testedClass::defaultProtocol . '://' . uniqid()))->isTrue()

32 ->boolean(fclose($fileResource))->isTrue()

39 ->variable($fileResource = fopen($file, 'r'))->isNotEqualTo(false)

40 ->boolean(is_readable($file))->isTrue()

41 ->boolean(is_writable($file))->isTrue()

42 ->boolean(rename($file, testedClass::defaultProtocol . '://' . uniqid()))->isTrue()

43 ->boolean(fclose($fileResource))->isTrue()

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 }

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 )

28 }

29

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

31 /**

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

FactoryTest.php (https://github.com/telkins/zf2.git) PHP · 250 lines

86 }

87

88 public function testFromPhpFiles()

89 {

90 $files = array(

91 __DIR__ . '/TestAssets/Php/include-base.php',

92 __DIR__ . '/TestAssets/Php/include-base2.php'

103 __DIR__ . '/TestAssets/Ini/include-base.ini',

104 __DIR__ . '/TestAssets/Xml/include-base2.xml',

105 __DIR__ . '/TestAssets/Php/include-base3.php',

106 );

107 $config = Factory::fromFiles($files);

117 'Ini/include-base.ini',

118 'Xml/include-base2.xml',

119 'Php/include-base3.php',

120 );

121 $config = Factory::fromFiles($files, false, true);

file.php (https://github.com/Keilaron/TweetBeagle.git) PHP · 349 lines

1 <?php

2 /**

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

8 * @license MIT License

9 * @copyright 2010 - 2011 Fuel Development Team

10 * @link http://fuelphp.com

11 */

12

314 }

315 // and can we write to it?

316 if ( ! is_writable($item))

317 {

318 throw new \Fuel_Exception('The webserver doesn\'t have write access to the path to store the session data files.');

347 }

348

349 /* End of file file.php */

350

FileByteStream.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 231 lines

1 <?php

2

3 /*

208 private function _copyReadStream()

209 {

210 if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) {

211 /* We have opened a php:// Stream Should work without problem */

212 } elseif (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) {

213 /* We have opened a tmpfile */

214 } else {

215 throw new Swift_IoException('Unable to copy the file to make it seekable, sys_temp_dir is not writable, php://memory not available');

216 }

217 $currentPos = ftell($this->_reader);

PieCrust.php (https://bitbucket.org/ndj/piecrust.git) PHP · 380 lines

1 <?php

2

3 namespace PieCrust;

262 {

263 $this->cacheDir = rtrim($dir, '/\\') . '/';

264 if (is_writable($this->cacheDir) === false)

265 {

266 try

class.nextgen_style_manager.php (https://github.com/livinglab/openlab.git) PHP · 302 lines

1 <?php

2

3 class C_NextGen_Style_Manager

133

134 wp_mkdir_p(dirname($abspath));

135 if (is_writable($abspath) OR (!@file_exists($abspath) && is_writable(dirname($abspath)))) {

136 $retval = file_put_contents($abspath, $contents);

137 }

dir.php (https://gitlab.com/RikaPM/vrindi) PHP · 209 lines

1 <?php

2

3 /**

10 * @link http://getkirby.com

11 * @copyright Bastian Allgeier

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

13 */

14 class Dir {

182 */

183 public static function writable($dir) {

184 return is_writable($dir);

185 }

186

File.php (https://bitbucket.org/Maron1/taqman.git) PHP · 152 lines

1 <?php

2

3 /*

83 * Returns the extension of the file.

84 *

85 * \SplFileInfo::getExtension() is not available before PHP 5.3.6

86 *

87 * @return string The extension

126 throw new FileException(sprintf('Unable to create the "%s" directory', $directory));

127 }

128 } elseif (!is_writable($directory)) {

129 throw new FileException(sprintf('Unable to write in the "%s" directory', $directory));

130 }

vfsStreamWrapperDirTestCase.php (https://github.com/wiltave/vfsStream.git) PHP · 508 lines

1 <?php

2 /**

3 * Test for org::bovigo::vfs::vfsStreamWrapper around mkdir().

8 require_once 'org/bovigo/vfs/vfsStream.php';

9 require_once 'PHPUnit/Framework.php';

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

194 vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));

195 vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('restrictedFolder', 0000));

196 $this->assertFalse(is_writable(vfsStream::url('root/restrictedFolder/')));

197 $this->assertFalse(mkdir(vfsStream::url('root/restrictedFolder/newFolder')));

198 $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('restrictedFolder/newFolder'));

475 vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000));

476 vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('nonRemovableFolder'));

477 $this->assertFalse(is_writable(vfsStream::url('root')));

478 $this->assertFalse(rmdir(vfsStream::url('root/nonRemovableFolder')));

479 $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('nonRemovableFolder'));

vfsStreamWrapperTestCase.php (https://github.com/wiltave/vfsStream.git) PHP · 571 lines

1 <?php

2 /**

3 * Test for org::bovigo::vfs::vfsStreamWrapper.

8 require_once 'org/bovigo/vfs/vfsStream.php';

9 require_once 'PHPUnit/Framework.php';

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

165 * @test

166 */

167 public function is_writable()

168 {

169 $this->assertTrue(is_writable($this->fooURL));

170 $this->assertTrue(is_writable($this->fooURL . '/.'));

171 $this->assertTrue(is_writable($this->barURL));

172 $this->assertTrue(is_writable($this->barURL . '/.'));

173 $this->assertTrue(is_writable($this->baz1URL));

174 $this->assertTrue(is_writable($this->baz2URL));

db.php (https://github.com/vasile/transit-map.git) PHP · 148 lines

1 <?php

2

3 class DB {

61 private static function checkIfWritable($file) {

62 if (file_exists($file)) {

63 return is_writable($file);

64 } else {

65 return is_writable(dirname($file));

init.dynamicmtml.php (https://github.com/GunioRobot/DynamicMTML.git) PHP · 191 lines

1 <?php

2 global $app;

3 global $mt;

43 $templates_c = $blog->site_path() . DIRECTORY_SEPARATOR . 'templates_c';

44 } else {

45 $templates_c = dirname( $app->root . $_SERVER[ 'PHP_SELF' ] ) . DIRECTORY_SEPARATOR . 'templates_c';

46 }

47 $app->stash( 'templates_c', $templates_c );

48 if ( $templates_c ) $lib = $templates_c . DIRECTORY_SEPARATOR . 'smarty_modifier_dynamicmtml_global.php';

49 if ( $templates_c && is_writable( $templates_c ) ) {

71 if ( $modifier_methods ) {

72 if (! file_exists( $lib ) || $ctx->force_compile || $app->config( 'DynamicForceCompile' ) ) {

73 $code = "<?php\n";

74 $func = '__FUNCTION__';

75 foreach ( $modifier_methods as $meth => $tag ) {

install.copy.php (https://github.com/shafiqissani/Jewelery-Ecommerce-.git) PHP · 201 lines

5 // copydirr.inc.php

6 /*

7 http://de3.php.net/manual/de/function.copy.php#55130

8 26.07.2005

9 Author: Anton Makarenko

20 $errors=array();

21 $messages=array();

22 if (!is_writable($toDir)) {

23 $errors[]='target '.$toDir.' is not writable';

24 }

94 * @version $Revision: 617 $

95 * @internal resource_context is not supported

96 * @since PHP 5

97 * @require PHP 4.0.1 (trigger_error)

133 * @category PHP

134 * @package PHP_Compat

135 * @link http://php.net/function.file_put_contents

AuthenticationController.php (https://github.com/caphrim007/nessquik.git) PHP · 318 lines

1 <?php

2

3 /**

43

44 try {

45 if (!is_writable(_ABSPATH.'/etc/local/authentication.conf')) {

46 if (!is_writable(_ABSPATH.'/etc/local/')) {

47 throw new Zend_Controller_Action_Exception('The location configuration directory is not writable');

48 }

49 } else if (file_exists(_ABSPATH.'/etc/local/authentication.conf') && !is_writable(_ABSPATH.'/etc/local/authentication.conf')) {

50 throw new Zend_Controller_Action_Exception('The local authentication config file exists but is not writable');

51 } else if (!is_writable(_ABSPATH.'/etc/local/authentication.conf')) {

124

125 try {

126 if (!is_writable(_ABSPATH.'/etc/local/authentication.conf')) {

127 if (!is_writable(_ABSPATH.'/etc/local/')) {

file.php (https://github.com/magicmarkker/core.git) PHP · 356 lines

1 <?php

2 /**

3 * Part of the Fuel framework.

8 * @license MIT License

9 * @copyright 2010 - 2011 Fuel Development Team

10 * @link http://fuelphp.com

11 */

12

321 }

322 // and can we write to it?

323 if ( ! is_writable($item))

324 {

325 throw new \FuelException('The webserver doesn\'t have write access to the path to store the session data files.');

vfsStreamWrapperTestCase.php (https://github.com/acoulton/vfsStream.git) PHP · 564 lines

1 <?php

2 /**

3 * Test for org::bovigo::vfs::vfsStreamWrapper.

8 require_once 'org/bovigo/vfs/vfsStream.php';

9 require_once 'PHPUnit/Framework/TestCase.php';

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

158 * @test

159 */

160 public function is_writable()

161 {

162 $this->assertTrue(is_writable($this->fooURL));

163 $this->assertTrue(is_writable($this->fooURL . '/.'));

164 $this->assertTrue(is_writable($this->barURL));

165 $this->assertTrue(is_writable($this->barURL . '/.'));

166 $this->assertTrue(is_writable($this->baz1URL));

167 $this->assertTrue(is_writable($this->baz2URL));

vfsStreamWrapperDirTestCase.php (https://github.com/acoulton/vfsStream.git) PHP · 543 lines

1 <?php

2 /**

3 * Test for org::bovigo::vfs::vfsStreamWrapper around mkdir().

8 require_once 'org/bovigo/vfs/vfsStream.php';

9 require_once 'PHPUnit/Framework/TestCase.php';

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

194 vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));

195 vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('restrictedFolder', 0000));

196 $this->assertFalse(is_writable(vfsStream::url('root/restrictedFolder/')));

197 $this->assertFalse(mkdir(vfsStream::url('root/restrictedFolder/newFolder')));

198 $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('restrictedFolder/newFolder'));

475 vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000));

476 vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('nonRemovableFolder'));

477 $this->assertFalse(is_writable(vfsStream::url('root')));

478 $this->assertFalse(rmdir(vfsStream::url('root/nonRemovableFolder')));

479 $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('nonRemovableFolder'));

MessageCache.php (https://gitlab.com/nacridan/Nacridan) PHP · 189 lines

1 <?php

2 /**

3 * Translation table cache.

4 * @author $Author: weizhuo $

5 * @version $Id: MessageCache.php,v 1.3 2005/01/05 03:15:14 weizhuo Exp $

6 * @package System.I18N.core

7 */

10 * Load the cache lite library.

11 */

12 require_once (dirname(__FILE__) . '/TCache_Lite.php');

13

14 /**

18 * @package System.I18N.core

19 * @author $Author: weizhuo $

20 * @version $Id: MessageCache.php,v 1.3 2005/01/05 03:15:14 weizhuo Exp $

21 */

22 class MessageCache

Enhancer.php (https://github.com/nattaphat/hgis.git) PHP · 158 lines

1 <?php

2

3 /*

22

23 use CG\Generator\Writer;

24 use CG\Generator\PhpMethod;

25 use CG\Generator\PhpDocblock;

26 use CG\Generator\PhpClass;

27 use CG\Core\AbstractClassGenerator;

28

83 }

84

85 if (!is_writable($dir)) {

86 throw new \RuntimeException(sprintf('The directory "%s" is not writable.', $dir));

87 }

JSONStorage.php (https://bitbucket.org/mlsitsystems/yii.job.mlsit.ru.git) PHP · 386 lines

1 <?php

2 /**

3 * JSONStorage.php

126 public function setPath($path)

127 {

128 if (is_dir($path) && is_writable($path))

129 {

130 $this->path = substr($path, -1) == DIRECTORY_SEPARATOR ? $path : $path . DIRECTORY_SEPARATOR;

IniFileConfig.php (https://gitlab.com/Isaki/le331.fr) PHP · 187 lines

1 <?php

2 /**

3 * INI file modification task for Phing, the PHP build tool.

5 * Based on http://ant-contrib.sourceforge.net/tasks/tasks/inifile.html

6 *

7 * PHP version 5

8 *

9 * @category Tasks

10 * @package phing.tasks.ext

11 * @author Ken Guest <kguest@php.net>

12 * @license LGPL v3 or later http://www.gnu.org/licenses/lgpl.html

13 * @link http://www.phing.info/

19 * This preserves comments etc, unlike parse_ini_file and is based heavily on

20 * a solution provided at:

21 * stackoverflow.com/questions/9594238/good-php-classes-that-manipulate-ini-files

22 *

23 * @category Tasks

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

1 <?php

2 /**

3 * File containing the ezcDbSchemaPersistentWriter class.

10

11 /**

12 * This handler creates PHP classes to be used with PersistentObject from a

13 * DatabaseSchema.

14 *

77 }

78

79 if ( !is_writable( $dir ) )

80 {

81 throw new ezcBaseFilePermissionException( $dir, ezcBaseFileException::WRITE );

115 {

116 fwrite( $file, "\$def->idProperty->generator = new ezcPersistentGeneratorDefinition( 'ezcPersistentManualGenerator' );\n" );

117 fwrite( $file, "\$def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_STRING;\n" );

118 }

119 }

CronReadinessCheck.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 150 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

83 // If non-accessible paths are found, log an 'error' entry for the same in update.log

84 if ( !$success ) {

85 $outputString = 'Cron readiness check failure! Found following non-writable paths' . PHP_EOL;

86 $outputString .= "\t" . implode(PHP_EOL . "\t", $nonWritablePaths);

133 foreach ($filesystemIterator as $item) {

134 $path = $item->__toString();

135 if (!is_writable($path)) {

136 $nonWritablePaths[] = $path;

137 }

141 }

142 } else {

143 if (!is_writable($path)) {

144 $nonWritablePaths[] = $path;

145 }

step_3.php (https://gitlab.com/shapcy/opencart) PHP · 303 lines

1 <?php

2 class ControllerInstallStep3 extends Controller {

3 private $error = array();

11 $this->model_install_install->database($this->request->post);

12

13 $output = '<?php' . "\n";

14 $output .= '// HTTP' . "\n";

15 $output .= 'define(\'HTTP_SERVER\', \'' . HTTP_OPENCART . '\');' . "\n\n";

291 }

292

293 if (!is_writable(DIR_OPENCART . 'config.php')) {

294 $this->error['warning'] = $this->language->get('error_config') . DIR_OPENCART . 'config.php!';

295 }

296

297 if (!is_writable(DIR_OPENCART . 'admin/config.php')) {

298 $this->error['warning'] = $this->language->get('error_config') . DIR_OPENCART . 'admin/config.php!';

wpmdb-filesystem.php (https://gitlab.com/najomie/fit-hippie) PHP · 561 lines

1 <?php

2

3 class WPMDB_Filesystem {

31 $this->chmod_file = FS_CHMOD_FILE;

32 } else {

33 $this->chmod_file = ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 );

34 }

35 }

77 * Attempt to initiate WP_Filesystem

78 *

79 * If this fails, $use_filesystem is set to false and all methods in this class should use native php fallbacks

80 * Thwarts `request_filesystem_credentials()` attempt to display a form for obtaining creds from users

81 *

300 * @return bool

301 */

302 public function is_writable( $abs_path ) {

303 $return = is_writable( $abs_path );

upload.php (https://github.com/ffchung/gallery3.git) PHP · 157 lines

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

2 /**

3 * Upload helper class for working with the global $_FILES

7 * @author Kohana Team

8 * @copyright (c) 2007-2009 Kohana Team

9 * @license http://kohanaphp.com/license

10 */

11 class upload_Core {

52 }

53

54 if ( ! is_writable($directory))

55 throw new Kohana_Exception('The upload destination folder, :dir:, does not appear to be writable.', array(':dir:' => $directory));

56

backup_index.php (https://github.com/goldoraf/OBM.git) PHP · 222 lines

1 <?php

2 /*

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

18 */

19 ?>

20 <?php

21 ///////////////////////////////////////////////////////////////////////////////

22 // OBM - File : backup_index.php //

64 if (! file_exists($backup_path)) {

65 $display['msg'] = display_err_msg($l_err_backup_dir_not_exist);

66 } else if (! is_writable($backup_path)) {

67 $display['msg'] = display_err_msg($l_err_backup_dir_not_writable);

68

168 $actions['backup']['index'] = array (

169 'Name' => $l_header_list,

170 'Url' => "$path/backup/backup_index.php?action=index",

171 'Right' => $cright_read_admin,

172 'Condition'=> array ('all')

path.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 308 lines

1 <?php

2 /**

3 * @package Joomla.Platform

219 * @param string $path Path to check ownership.

220 *

221 * @return boolean True if the php script owns the path passed.

222 *

223 * @since 11.1

232

233 // Try to find a writable directory

234 $dir = is_writable('/tmp') ? '/tmp' : false;

235 $dir = (!$dir && is_writable($ssp)) ? $ssp : false;

236 $dir = (!$dir && is_writable($jtp)) ? $jtp : false;

237

238 if ($dir)

sqlite_3.class.php (https://bitbucket.org/webinfopro/sqlitemanager.git) PHP · 311 lines

1 <?php

2 if( !defined('PDO_ATTR_TIMEOUT') ) define('PDO_ATTR_TIMEOUT', PDO::ATTR_TIMEOUT);

3 if( !defined('PDO_FETCH_ASSOC') ) define('PDO_FETCH_ASSOC', PDO::FETCH_ASSOC);

24 $this->readOnly = false;

25 } else {

26 $this->readOnly = !is_writable($dbPath);

27 }

28 parent::__construct($dbPath);

commands.php (https://github.com/robertatakenaka/Regional-2.git) PHP · 273 lines

1 <?php

2 /*

3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net

20 * == END LICENSE ==

21 *

22 * This is the File Manager Connector for PHP.

23 */

24

125 $sServerDir = ServerMapFolder( $resourceType, $currentFolder, 'CreateFolder' ) ;

126

127 if ( is_writable( $sServerDir ) )

128 {

129 $sServerDir .= $sNewFolderName ;

processor.php (https://bitbucket.org/nbaxevanis/p360-dev-test.git) PHP · 168 lines

1 <?php

2

3 /**

127 $error = 'Upload directory does not exist. Please create a directory named `' . self::_FILE_STORAGE_DIR . '`';

128 } else {

129 if (!is_writable(self::_FILE_STORAGE_DIR)) {

130 $error = 'Upload directory is not writable. Please make sure that we can write into this directory `' . self::_FILE_STORAGE_DIR . '`';

131 } else {

132 //lets create a demo file just to make sure that everything is ok

133 $saved = file_put_contents(self::_FILE_STORAGE_DIR . self::_FILE_NAME, '"type1",1,2' . PHP_EOL . '"type2",3,4');

134 if (!$saved) {

135 $error = 'There was an unknown error while trying to create a file into this directory `' . self::_FILE_STORAGE_DIR . '`';

UnixFileSystem.php (git://github.com/alexgorbatchev/SyntaxHighlighter.git) text · 0 lines

1 <?php

2 /*

3 * $Id: UnixFileSystem.php 258 2007-10-21 00:46:45Z hans $

20 */

21

22 include_once 'phing/system/io/FileSystem.php';

23

24 /**

25 * UnixFileSystem class. This class encapsulates the basic file system functions

26 * for platforms using the unix (posix)-stylish filesystem. It wraps php native

27 * functions suppressing normal PHP error reporting and instead uses Exception

29 *

30 * This class is part of a oop based filesystem abstraction and targeted to run

31 * on all supported php platforms.

32 *

33 * Note: For debugging turn track_errors on in the php.ini. The error messages

CHANGES.txt (https://jedit.svn.sourceforge.net/svnroot/jedit) Plain Text · 2241 lines

87 - Updated BibTeX and LaTeX syntax highlighting (Thomas Alspaugh).

88

89 - PHP mode now recognizes <script language="PHP">...</script>.

90

91 - Updated Omnimark syntax highlighting (Lionel Fiol).

892 modes.

893

894 - SCRIPT tags in HTML files no longer recognize <?php ... ?>.

895

896 }}}