diff --git a/CRM/Admin/Page/APIExplorer.php b/CRM/Admin/Page/APIExplorer.php index c769535be317..31a18dce327c 100644 --- a/CRM/Admin/Page/APIExplorer.php +++ b/CRM/Admin/Page/APIExplorer.php @@ -63,7 +63,7 @@ public function run() { $paths = self::uniquePaths(); foreach ($paths as $path) { $dir = \CRM_Utils_File::addTrailingSlash($path) . 'api' . DIRECTORY_SEPARATOR . 'v3' . DIRECTORY_SEPARATOR . 'examples'; - if (is_dir($dir)) { + if (@is_dir($dir)) { foreach (scandir($dir) as $item) { if ($item && strpos($item, '.') === FALSE && array_search($item, $examples) === FALSE) { $examples[] = $item; @@ -96,7 +96,7 @@ public static function getExampleFile() { $paths = self::uniquePaths(); foreach ($paths as $path) { $dir = \CRM_Utils_File::addTrailingSlash($path) . 'api' . DIRECTORY_SEPARATOR . 'v3' . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $_GET['entity']; - if (is_dir($dir)) { + if (@is_dir($dir)) { foreach (scandir($dir) as $item) { $item = str_replace('.ex.php', '', $item); if ($item && strpos($item, '.') === FALSE) { diff --git a/CRM/Api4/Services.php b/CRM/Api4/Services.php index 18bab2f7ad8d..8cbc8412bf1c 100644 --- a/CRM/Api4/Services.php +++ b/CRM/Api4/Services.php @@ -79,7 +79,7 @@ public static function loadServices($namespace, $tag, $container) { ); foreach ($locations as $location) { $path = \CRM_Utils_File::addTrailingSlash(dirname($location)) . str_replace('\\', DIRECTORY_SEPARATOR, $namespace); - if (!file_exists($path) || !is_dir($path)) { + if (!file_exists($path) || !@is_dir($path)) { $resource = new \Symfony\Component\Config\Resource\FileExistenceResource($path); $container->addResource($resource); } diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index ead2b2435d1f..95193313e182 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -223,7 +223,7 @@ private function _getDataSources() { global $civicrm_root; $dataSourceDir = $civicrm_root . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'Import' . DIRECTORY_SEPARATOR . 'DataSource' . DIRECTORY_SEPARATOR; $dataSources = []; - if (!is_dir($dataSourceDir)) { + if (!@is_dir($dataSourceDir)) { $this->invalidConfig("Import DataSource directory $dataSourceDir does not exist"); } if (!$dataSourceHandle = opendir($dataSourceDir)) { diff --git a/CRM/Core/CodeGen/Util/File.php b/CRM/Core/CodeGen/Util/File.php index 9e30000f86c9..249eec07f76f 100644 --- a/CRM/Core/CodeGen/Util/File.php +++ b/CRM/Core/CodeGen/Util/File.php @@ -10,7 +10,7 @@ class CRM_Core_CodeGen_Util_File { * @param int $perm */ public static function createDir($dir, $perm = 0755) { - if (!is_dir($dir)) { + if (!@is_dir($dir)) { mkdir($dir, $perm, TRUE); } } diff --git a/CRM/Core/Component.php b/CRM/Core/Component.php index 7661eb3e049a..2266d3c0bc85 100644 --- a/CRM/Core/Component.php +++ b/CRM/Core/Component.php @@ -399,7 +399,7 @@ public static function tableNames(&$tables) { public static function getComponentsFromFile($crmFolderDir) { $components = []; //traverse CRM folder and check for Info file - if (is_dir($crmFolderDir) && $dir = opendir($crmFolderDir)) { + if (@is_dir($crmFolderDir) && $dir = opendir($crmFolderDir)) { while ($subDir = readdir($dir)) { // skip the extensions diretory since it has an Info.php file also if ($subDir == 'Extension') { diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 6ca6e68ea45d..9df43b75619d 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -166,7 +166,7 @@ public function cleanup($value, $rmdir = TRUE) { $this->configAndLogDir, $this->customFileUploadDir, ] as $dir) { - if ($dir && is_dir($dir)) { + if ($dir && @is_dir($dir)) { CRM_Utils_File::restrictAccess($dir); } } diff --git a/CRM/Core/Config/MagicMerge.php b/CRM/Core/Config/MagicMerge.php index ab9ef828673b..c01778a85901 100644 --- a/CRM/Core/Config/MagicMerge.php +++ b/CRM/Core/Config/MagicMerge.php @@ -242,7 +242,7 @@ public function __get($k) { if ($value) { $value = CRM_Utils_File::addTrailingSlash($value); if (isset($this->map[$k][2]) && in_array('mkdir', $this->map[$k][2])) { - if (!is_dir($value) && !CRM_Utils_File::createDir($value, FALSE)) { + if (!@is_dir($value) && !CRM_Utils_File::createDir($value, FALSE)) { CRM_Core_Session::setStatus(ts('Failed to make directory (%1) at "%2". Please update the settings or file permissions.', [ 1 => $k, 2 => $value, diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index e4653d3be758..0abb3c0d7ec7 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -199,7 +199,7 @@ public static function languages($justEnabled = FALSE) { // check which ones are available; add them to $all if not there already $codes = []; - if (is_dir(CRM_Core_I18n::getResourceDir()) && $dir = opendir(CRM_Core_I18n::getResourceDir())) { + if (@is_dir(CRM_Core_I18n::getResourceDir()) && $dir = opendir(CRM_Core_I18n::getResourceDir())) { while ($filename = readdir($dir)) { if (preg_match('/^[a-z][a-z]_[A-Z][A-Z]$/', $filename)) { $codes[] = $filename; diff --git a/CRM/Core/Page/QUnit.php b/CRM/Core/Page/QUnit.php index d97ba0012d6b..41448053eb2c 100644 --- a/CRM/Core/Page/QUnit.php +++ b/CRM/Core/Page/QUnit.php @@ -32,7 +32,7 @@ public function run() { } $path = CRM_Extension_System::singleton()->getMapper()->keyToBasePath($ext); - if (!is_dir("$path/tests/qunit/$suite")) { + if (!@is_dir("$path/tests/qunit/$suite")) { throw new CRM_Core_Exception("Failed to locate test suite"); } diff --git a/CRM/Extension/Browser.php b/CRM/Extension/Browser.php index ff173a54a334..49d8b037c87e 100644 --- a/CRM/Extension/Browser.php +++ b/CRM/Extension/Browser.php @@ -52,7 +52,7 @@ public function __construct($repoUrl, $indexPath, $cacheDir) { $this->repoUrl = $repoUrl; $this->cacheDir = $cacheDir; $this->indexPath = empty($indexPath) ? self::SINGLE_FILE_PATH : $indexPath; - if ($cacheDir && !file_exists($cacheDir) && is_dir(dirname($cacheDir)) && is_writable(dirname($cacheDir))) { + if ($cacheDir && !file_exists($cacheDir) && @is_dir(dirname($cacheDir)) && is_writable(dirname($cacheDir))) { CRM_Utils_File::createDir($cacheDir, FALSE); } } @@ -99,7 +99,7 @@ public function checkRequirements() { $errors = []; - if (!$this->cacheDir || !is_dir($this->cacheDir) || !is_writable($this->cacheDir)) { + if (!$this->cacheDir || !@is_dir($this->cacheDir) || !is_writable($this->cacheDir)) { $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1')); $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}"); $errors[] = array( diff --git a/CRM/Extension/Container/Basic.php b/CRM/Extension/Container/Basic.php index 0588c5eeb172..747221182ce7 100644 --- a/CRM/Extension/Container/Basic.php +++ b/CRM/Extension/Container/Basic.php @@ -102,7 +102,7 @@ public function __construct($baseDir, $baseUrl, CRM_Utils_Cache_Interface $cache public function checkRequirements() { $errors = []; - if (empty($this->baseDir) || !is_dir($this->baseDir)) { + if (empty($this->baseDir) || !@is_dir($this->baseDir)) { $errors[] = [ 'title' => ts('Invalid Base Directory'), 'message' => ts('An extension container has been defined with a blank directory.'), diff --git a/CRM/Extension/Container/Default.php b/CRM/Extension/Container/Default.php index f5a6c4ce3cd6..263b960cfe86 100644 --- a/CRM/Extension/Container/Default.php +++ b/CRM/Extension/Container/Default.php @@ -30,7 +30,7 @@ public function checkRequirements() { // In current configuration, we don't construct the default container // unless baseDir is set, so this error condition is more theoretical. - if (empty($this->baseDir) || !is_dir($this->baseDir)) { + if (empty($this->baseDir) || !@is_dir($this->baseDir)) { $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1')); $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}"); $errors[] = array( diff --git a/CRM/Extension/Downloader.php b/CRM/Extension/Downloader.php index 76f4a120bd8e..c2763e7d3ac7 100644 --- a/CRM/Extension/Downloader.php +++ b/CRM/Extension/Downloader.php @@ -51,7 +51,7 @@ public function __construct(CRM_Extension_Manager $manager, $containerDir, $tmpD public function checkRequirements($extensionInfo = NULL) { $errors = []; - if (!$this->containerDir || !is_dir($this->containerDir) || !is_writable($this->containerDir)) { + if (!$this->containerDir || !@is_dir($this->containerDir) || !is_writable($this->containerDir)) { $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1')); $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}"); $errors[] = array( @@ -166,7 +166,7 @@ public function extractFiles($key, $zipFile) { return FALSE; } $extractedZipPath = $this->tmpDir . DIRECTORY_SEPARATOR . $zipSubDir; - if (is_dir($extractedZipPath)) { + if (@is_dir($extractedZipPath)) { if (!CRM_Utils_File::cleanDir($extractedZipPath, TRUE, FALSE)) { CRM_Core_Session::setStatus(ts('Unable to extract the extension: %1 cannot be cleared', array(1 => $extractedZipPath)), ts('Installation Error'), 'error'); return FALSE; diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index 14c7128dd6f2..c78fe9345510 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -537,7 +537,7 @@ public function getStatuses() { while ($dao->fetch()) { try { $path = $this->fullContainer->getPath($dao->full_name); - $codeExists = !empty($path) && is_dir($path); + $codeExists = !empty($path) && @is_dir($path); } catch (CRM_Extension_Exception $e) { $codeExists = FALSE; diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index b9bb47dd3bcc..4c8a73c0c5e5 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -129,7 +129,7 @@ public function getFullContainer() { // At time of writing, D6, D7, and WP support cmsRootPath() but J does not if (NULL !== $this->parameters['cmsRootPath']) { $vendorPath = $this->parameters['cmsRootPath'] . DIRECTORY_SEPARATOR . 'vendor'; - if (is_dir($vendorPath)) { + if (@is_dir($vendorPath)) { $containers['cmsvendor'] = new CRM_Extension_Container_Basic( $vendorPath, CRM_Utils_File::addTrailingSlash($this->parameters['userFrameworkBaseURL'], '/') . 'vendor', diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 79305b2fcedb..7aa07efa75ab 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -605,7 +605,7 @@ public static function doFileCleanup(CRM_Queue_TaskContext $ctx, $postUpgradeMes $files = $source->findOrphanedFiles(); $errors = []; foreach ($files as $file) { - if (is_dir($file['path'])) { + if (@is_dir($file['path'])) { @rmdir($file['path']); } else { diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php index c1d7b767944f..454b0691396c 100644 --- a/CRM/Utils/Check/Component/Env.php +++ b/CRM/Utils/Check/Component/Env.php @@ -542,7 +542,7 @@ public function checkExtensions() { return $messages; } - if (!is_dir($basedir)) { + if (!@is_dir($basedir)) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, ts('Your extensions directory path points to %1, which is not a directory. Please check your file system.', diff --git a/CRM/Utils/Check/Component/Security.php b/CRM/Utils/Check/Component/Security.php index 2036e1b01526..27c54a71b424 100644 --- a/CRM/Utils/Check/Component/Security.php +++ b/CRM/Utils/Check/Component/Security.php @@ -302,7 +302,7 @@ public function checkCxnOverrides() { * @return bool */ public function isBrowsable($dir, $url) { - if (empty($dir) || empty($url) || !is_dir($dir)) { + if (empty($dir) || empty($url) || !@is_dir($dir)) { return FALSE; } @@ -337,7 +337,7 @@ public function isBrowsable($dir, $url) { */ public function isDirAccessible($dir, $url) { $url = rtrim($url, '/'); - if (empty($dir) || empty($url) || !is_dir($dir)) { + if (empty($dir) || empty($url) || !@is_dir($dir)) { return FALSE; } diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 4fd3706bfa08..184fa9aa682a 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -92,7 +92,7 @@ public static function isHtml($name) { * FALSE: Creation failed. */ public static function createDir($path, $abort = TRUE) { - if (is_dir($path) || empty($path)) { + if (@is_dir($path) || empty($path)) { return NULL; } @@ -133,7 +133,7 @@ public static function cleanDir($target, $rmdir = TRUE, $verbose = TRUE) { if (!in_array($sibling, $exceptions)) { $object = $target . DIRECTORY_SEPARATOR . $sibling; - if (is_dir($object)) { + if (@is_dir($object)) { CRM_Utils_File::cleanDir($object, $rmdir, $verbose); } elseif (is_file($object)) { @@ -190,7 +190,7 @@ public static function copyDir($source, $destination) { @mkdir($destination); while (FALSE !== ($file = readdir($dh))) { if (($file != '.') && ($file != '..')) { - if (is_dir($source . DIRECTORY_SEPARATOR . $file)) { + if (@is_dir($source . DIRECTORY_SEPARATOR . $file)) { CRM_Utils_File::copyDir($source . DIRECTORY_SEPARATOR . $file, $destination . DIRECTORY_SEPARATOR . $file); } else { @@ -528,7 +528,7 @@ public static function restrictAccess($dir, $overwrite = FALSE) { // note: empty value for $dir can play havoc, since that might result in putting '.htaccess' to root dir // of site, causing site to stop functioning. // FIXME: we should do more checks here - - if (!empty($dir) && is_dir($dir)) { + if (!empty($dir) && @is_dir($dir)) { $htaccess = << # Apache 2.2 @@ -559,7 +559,7 @@ public static function restrictAccess($dir, $overwrite = FALSE) { * @param $publicDir */ public static function restrictBrowsing($publicDir) { - if (!is_dir($publicDir) || !is_writable($publicDir)) { + if (!@is_dir($publicDir) || !is_writable($publicDir)) { return; } @@ -572,7 +572,7 @@ public static function restrictBrowsing($publicDir) { // child dirs $dir = new RecursiveDirectoryIterator($publicDir); foreach ($dir as $name => $object) { - if (is_dir($name) && $name != '..') { + if (@is_dir($name) && $name != '..') { $nobrowse = realpath($name) . '/index.html'; if (!file_exists($nobrowse)) { @file_put_contents($nobrowse, ''); @@ -742,7 +742,7 @@ public static function tempdir($prefix = 'tmp-') { * @return array(string) */ public static function findFiles($dir, $pattern, $relative = FALSE) { - if (!is_dir($dir) || !is_readable($dir)) { + if (!@is_dir($dir) || !is_readable($dir)) { return []; } // Which dirs should we exclude from our searches? @@ -760,7 +760,7 @@ public static function findFiles($dir, $pattern, $relative = FALSE) { $matches = glob("$subdir/$pattern"); if (is_array($matches)) { foreach ($matches as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $relative ? CRM_Utils_File::relativize($match, "$dir/") : $match; } } @@ -777,7 +777,7 @@ public static function findFiles($dir, $pattern, $relative = FALSE) { $entry !== '.' && $entry !== '..' && (empty($excludeDirsPattern) || !preg_match($excludeDirsPattern, $path)) - && is_dir($path) + && @is_dir($path) && is_readable($path) ) { $todos[] = $path; @@ -834,7 +834,7 @@ public static function isChildPath($parent, $child, $checkRealPath = TRUE) { * TRUE on success */ public static function replaceDir($fromDir, $toDir, $verbose = FALSE) { - if (is_dir($toDir)) { + if (@is_dir($toDir)) { if (!self::cleanDir($toDir, TRUE, $verbose)) { return FALSE; } diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index 43fc9145c351..706b44a6d2e5 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -54,7 +54,7 @@ public static function processBounces($is_create_activities) { */ public static function cleanupDir($dir, $age = 5184000) { // return early if we can’t read/write the dir - if (!is_writable($dir) or !is_readable($dir) or !is_dir($dir)) { + if (!is_writable($dir) or !is_readable($dir) or !@is_dir($dir)) { return; } @@ -69,7 +69,7 @@ public static function cleanupDir($dir, $age = 5184000) { } // it’s an old file/dir, so delete/recurse - is_dir("$dir/$file") ? self::cleanupDir("$dir/$file", $age) : unlink("$dir/$file"); + @is_dir("$dir/$file") ? self::cleanupDir("$dir/$file", $age) : unlink("$dir/$file"); } } diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 862e4603f747..c93d7e0c2d03 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -874,7 +874,7 @@ public static function fileExists($path) { * @return bool */ public static function settingPath($path) { - return is_dir(Civi::paths()->getPath($path)); + return @is_dir(Civi::paths()->getPath($path)); } /** diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index b445a04e0948..a11f5dc173b7 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1756,7 +1756,7 @@ public static function listIncludeFiles($relpath) { $inc_dirs = explode(PATH_SEPARATOR, get_include_path()); foreach ($inc_dirs as $inc_dir) { $target_dir = $inc_dir . DIRECTORY_SEPARATOR . $relpath; - if (is_dir($target_dir)) { + if (@is_dir($target_dir)) { $cur_list = scandir($target_dir); foreach ($cur_list as $fname) { if ($fname != '.' && $fname != '..') { diff --git a/Civi/API/Provider/MagicFunctionProvider.php b/Civi/API/Provider/MagicFunctionProvider.php index febcaa06226a..5ee5f4fdee2e 100644 --- a/Civi/API/Provider/MagicFunctionProvider.php +++ b/Civi/API/Provider/MagicFunctionProvider.php @@ -103,7 +103,7 @@ public function getEntityNames($version) { foreach ($include_dirs as $include_dir) { $api_dir = implode(DIRECTORY_SEPARATOR, [$include_dir, 'api', 'v' . $version]); - if (!is_dir($api_dir)) { + if (!@is_dir($api_dir)) { continue; } $iterator = new \DirectoryIterator($api_dir); @@ -119,7 +119,7 @@ public function getEntityNames($version) { // Check for entities with standalone action files (eg "api/v3/MyEntity/MyAction.php"). $action_dir = $api_dir . DIRECTORY_SEPARATOR . $file; - if (preg_match('/^[A-Z][A-Za-z0-9]*$/', $file) && is_dir($action_dir)) { + if (preg_match('/^[A-Z][A-Za-z0-9]*$/', $file) && @is_dir($action_dir)) { if (count(glob("$action_dir/[A-Z]*.php")) > 0) { $entities[] = $file; } @@ -281,7 +281,7 @@ protected function loadEntity($entity, $version) { foreach ([$camelName, 'Generic'] as $name) { $action_dir = implode(DIRECTORY_SEPARATOR, [$include_dir, 'api', "v${version}", $name]); - if (!is_dir($action_dir)) { + if (!@is_dir($action_dir)) { continue; } diff --git a/Civi/Api4/Action/Entity/Get.php b/Civi/Api4/Action/Entity/Get.php index 024ffadba263..b732862feb15 100644 --- a/Civi/Api4/Action/Entity/Get.php +++ b/Civi/Api4/Action/Entity/Get.php @@ -89,7 +89,7 @@ private function getAllApiClasses() { ); foreach ($locations as $location) { $dir = \CRM_Utils_File::addTrailingSlash(dirname($location)) . 'Civi/Api4'; - if (is_dir($dir)) { + if (@is_dir($dir)) { foreach (glob("$dir/*.php") as $file) { $className = 'Civi\Api4\\' . basename($file, '.php'); if (is_a($className, 'Civi\Api4\Generic\AbstractEntity', TRUE)) { diff --git a/Civi/Api4/Action/GetActions.php b/Civi/Api4/Action/GetActions.php index 1720ee701655..a50224a7cb13 100644 --- a/Civi/Api4/Action/GetActions.php +++ b/Civi/Api4/Action/GetActions.php @@ -60,7 +60,7 @@ protected function getRecords() { */ private function scanDir($dir, $nameSpace) { $dir .= str_replace('\\', '/', $nameSpace); - if (is_dir($dir)) { + if (@is_dir($dir)) { foreach (glob("$dir/*.php") as $file) { $actionName = basename($file, '.php'); $actionClass = new \ReflectionClass($nameSpace . '\\' . $actionName); diff --git a/Civi/CiUtil/PHPUnitScanner.php b/Civi/CiUtil/PHPUnitScanner.php index a1028f52f5c8..57113ec4bca4 100644 --- a/Civi/CiUtil/PHPUnitScanner.php +++ b/Civi/CiUtil/PHPUnitScanner.php @@ -37,7 +37,7 @@ public static function findTestClasses($paths) { $finder = new Finder(); foreach ($paths as $path) { - if (is_dir($path)) { + if (@is_dir($path)) { foreach ($finder->files()->in($paths)->name('*Test.php') as $file) { $testClass = self::_findTestClasses((string) $file); if (count($testClass) == 1) { diff --git a/Civi/Core/Paths.php b/Civi/Core/Paths.php index aaab990d388d..31ea785bb9f5 100644 --- a/Civi/Core/Paths.php +++ b/Civi/Core/Paths.php @@ -84,7 +84,7 @@ public function __construct() { ->register('civicrm.l10n', function () { $dir = defined('CIVICRM_L10N_BASEDIR') ? CIVICRM_L10N_BASEDIR : \Civi::paths()->getPath('[civicrm.private]/l10n'); return [ - 'path' => is_dir($dir) ? $dir : \Civi::paths()->getPath('[civicrm.root]/l10n'), + 'path' => @is_dir($dir) ? $dir : \Civi::paths()->getPath('[civicrm.root]/l10n'), ]; }) ->register('cms', function () { diff --git a/Civi/Core/SettingsMetadata.php b/Civi/Core/SettingsMetadata.php index c91e5b616b96..ed4351555e98 100644 --- a/Civi/Core/SettingsMetadata.php +++ b/Civi/Core/SettingsMetadata.php @@ -87,7 +87,7 @@ protected static function loadSettingsMetaDataFolders($metaDataFolders) { $loadedFolders = []; foreach ($metaDataFolders as $metaDataFolder) { $realFolder = realpath($metaDataFolder); - if (is_dir($realFolder) && !isset($loadedFolders[$realFolder])) { + if (@is_dir($realFolder) && !isset($loadedFolders[$realFolder])) { $loadedFolders[$realFolder] = TRUE; $settingsMetadata = $settingsMetadata + self::loadSettingsMetadata($metaDataFolder); } diff --git a/Civi/Test/Api3DocTrait.php b/Civi/Test/Api3DocTrait.php index 27440f70fa79..2905294937d4 100644 --- a/Civi/Test/Api3DocTrait.php +++ b/Civi/Test/Api3DocTrait.php @@ -120,7 +120,7 @@ private function documentMe($entity, $action, $params, $result, $testFunction, $ global $civicrm_root; if (file_exists($civicrm_root . '/tests/templates/documentFunction.tpl')) { - if (!is_dir($civicrm_root . "/api/v3/examples/$entity")) { + if (!@is_dir($civicrm_root . "/api/v3/examples/$entity")) { mkdir($civicrm_root . "/api/v3/examples/$entity"); } $f = fopen($civicrm_root . "/api/v3/examples/$entity/$exampleName.ex.php", "w+b"); diff --git a/bin/givi b/bin/givi index b9d80fe14722..aba251991521 100755 --- a/bin/givi +++ b/bin/givi @@ -215,7 +215,7 @@ class Givi { // Filter branch list based on what repos actually exist foreach (array_keys($this->repos) as $repo) { - if (!is_dir($this->repos[$repo])) { + if (!@is_dir($this->repos[$repo])) { unset($this->repos[$repo]); } } diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index 5a77a2f1ba26..642a191a0888 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -27,7 +27,7 @@ * @internal param \mode $peram for that directory */ function createDir($dir, $perm = 0755) { - if (!is_dir($dir)) { + if (!@is_dir($dir)) { echo "Outdir: $dir\n"; mkdir($dir, $perm, TRUE); } diff --git a/ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php b/ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php index b81b0251d7ec..528abb5b2c1a 100644 --- a/ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php +++ b/ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php @@ -180,7 +180,7 @@ public static function getGuiSettings() { // Scan all extensions for entities & input types foreach (\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles() as $ext) { $dir = \CRM_Utils_File::addTrailingSlash(dirname($ext['filePath'])); - if (is_dir($dir)) { + if (@is_dir($dir)) { // Scan for entities foreach (glob($dir . 'afformEntities/*.php') as $file) { $entityInfo = include $file; diff --git a/ext/afform/admin/afform_admin.civix.php b/ext/afform/admin/afform_admin.civix.php index 1a1fcfc28ef0..034ba85f6202 100644 --- a/ext/afform/admin/afform_admin.civix.php +++ b/ext/afform/admin/afform_admin.civix.php @@ -267,7 +267,7 @@ function _afform_admin_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _afform_admin_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _afform_admin_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _afform_admin_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _afform_admin_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parent */ function _afform_admin_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/afform/core/afform.civix.php b/ext/afform/core/afform.civix.php index 1a10bb02d084..f08953ec2856 100644 --- a/ext/afform/core/afform.civix.php +++ b/ext/afform/core/afform.civix.php @@ -267,7 +267,7 @@ function _afform_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _afform_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _afform_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _afform_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _afform_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) { */ function _afform_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/afform/html/afform_html.civix.php b/ext/afform/html/afform_html.civix.php index eb663989c5d5..9bc36fb9b50b 100644 --- a/ext/afform/html/afform_html.civix.php +++ b/ext/afform/html/afform_html.civix.php @@ -267,7 +267,7 @@ function _afform_html_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _afform_html_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _afform_html_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _afform_html_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _afform_html_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentI */ function _afform_html_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/afform/html/bin/add-zip-regex.php b/ext/afform/html/bin/add-zip-regex.php index 3ec29eb4acaf..ac706a297ec3 100755 --- a/ext/afform/html/bin/add-zip-regex.php +++ b/ext/afform/html/bin/add-zip-regex.php @@ -26,7 +26,7 @@ } $file = preg_replace(':^\./:', '', $file); $internalName = preg_replace($argv[2], $argv[3], $file); - if (file_exists($file) && is_dir($file)) { + if (file_exists($file) && @is_dir($file)) { $zip->addEmptyDir($internalName); } else { diff --git a/ext/afform/mock/afform_mock.civix.php b/ext/afform/mock/afform_mock.civix.php index 37f787527022..f0508dcddf5d 100644 --- a/ext/afform/mock/afform_mock.civix.php +++ b/ext/afform/mock/afform_mock.civix.php @@ -267,7 +267,7 @@ function _afform_mock_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _afform_mock_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _afform_mock_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _afform_mock_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _afform_mock_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentI */ function _afform_mock_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/afform/mock/tests/phpunit/api/v4/AfformFileUploadTest.php b/ext/afform/mock/tests/phpunit/api/v4/AfformFileUploadTest.php index c8bfb3040d6e..82ff1cf8135e 100644 --- a/ext/afform/mock/tests/phpunit/api/v4/AfformFileUploadTest.php +++ b/ext/afform/mock/tests/phpunit/api/v4/AfformFileUploadTest.php @@ -149,7 +149,7 @@ public function testSubmitFile(): void { */ protected function mockUploadFile() { $tmpDir = sys_get_temp_dir(); - $this->assertTrue($tmpDir && is_dir($tmpDir), 'Tmp dir must exist: ' . $tmpDir); + $this->assertTrue($tmpDir && @is_dir($tmpDir), 'Tmp dir must exist: ' . $tmpDir); $fileName = uniqid() . '.txt'; $filePath = $tmpDir . '/' . $fileName; file_put_contents($filePath, 'Hello'); diff --git a/ext/authx/authx.civix.php b/ext/authx/authx.civix.php index a1ab61ebe325..9ae6fbdb30b7 100644 --- a/ext/authx/authx.civix.php +++ b/ext/authx/authx.civix.php @@ -238,7 +238,7 @@ function _authx_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_authx_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _authx_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _authx_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _authx_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _authx_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _authx_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _authx_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) { */ function _authx_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/ckeditor4/CRM/Ckeditor4/Form/CKEditorConfig.php b/ext/ckeditor4/CRM/Ckeditor4/Form/CKEditorConfig.php index 5842a6297d04..f85386f3b291 100644 --- a/ext/ckeditor4/CRM/Ckeditor4/Form/CKEditorConfig.php +++ b/ext/ckeditor4/CRM/Ckeditor4/Form/CKEditorConfig.php @@ -211,7 +211,7 @@ private function getCKPlugins() { 'text' => ucfirst($name), 'icon' => NULL, ]; - if (is_dir($dir . "icons")) { + if (@is_dir($dir . "icons")) { if (is_file($dir . "icons/$name.png")) { $plugins[$name]['icon'] = "bower_components/ckeditor/plugins/$name/icons/$name.png"; } @@ -311,7 +311,7 @@ public static function setConfigDefault() { if (!self::getConfigFile()) { $config = self::fileHeader() . "CKEDITOR.editorConfig = function( config ) {\n\tconfig.allowedContent = true;\n};\n"; // Make sure directories exist - if (!is_dir(Civi::paths()->getPath('[civicrm.files]/persist'))) { + if (!@is_dir(Civi::paths()->getPath('[civicrm.files]/persist'))) { mkdir(Civi::paths()->getPath('[civicrm.files]/persist')); } $newFileName = Civi::paths()->getPath(self::CONFIG_FILEPATH . 'default.js'); diff --git a/ext/ckeditor4/ckeditor4.civix.php b/ext/ckeditor4/ckeditor4.civix.php index aa0b6e5f490c..482a1c25d13c 100644 --- a/ext/ckeditor4/ckeditor4.civix.php +++ b/ext/ckeditor4/ckeditor4.civix.php @@ -267,7 +267,7 @@ function _ckeditor4_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _ckeditor4_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _ckeditor4_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _ckeditor4_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _ckeditor4_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) */ function _ckeditor4_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/contributioncancelactions/contributioncancelactions.civix.php b/ext/contributioncancelactions/contributioncancelactions.civix.php index 14754302b5f5..ef2ad82dfd2f 100644 --- a/ext/contributioncancelactions/contributioncancelactions.civix.php +++ b/ext/contributioncancelactions/contributioncancelactions.civix.php @@ -238,7 +238,7 @@ function _contributioncancelactions_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_contributioncancelactions_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _contributioncancelactions_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _contributioncancelactions_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _contributioncancelactions_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _contributioncancelactions_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _contributioncancelactions_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _contributioncancelactions_civix_fixNavigationMenuItems(&$nodes, &$maxN */ function _contributioncancelactions_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/eventcart/eventcart.civix.php b/ext/eventcart/eventcart.civix.php index 482ac73bf65e..ddde30497b2c 100644 --- a/ext/eventcart/eventcart.civix.php +++ b/ext/eventcart/eventcart.civix.php @@ -238,7 +238,7 @@ function _eventcart_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_eventcart_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _eventcart_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _eventcart_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _eventcart_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _eventcart_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _eventcart_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _eventcart_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) */ function _eventcart_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/ewaysingle/ewaysingle.civix.php b/ext/ewaysingle/ewaysingle.civix.php index 2a71b5bdba5e..c7093a96786d 100644 --- a/ext/ewaysingle/ewaysingle.civix.php +++ b/ext/ewaysingle/ewaysingle.civix.php @@ -238,7 +238,7 @@ function _ewaysingle_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_ewaysingle_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _ewaysingle_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _ewaysingle_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _ewaysingle_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _ewaysingle_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _ewaysingle_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _ewaysingle_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID */ function _ewaysingle_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/financialacls/financialacls.civix.php b/ext/financialacls/financialacls.civix.php index 2f5da6596187..85b79ef99b3e 100644 --- a/ext/financialacls/financialacls.civix.php +++ b/ext/financialacls/financialacls.civix.php @@ -238,7 +238,7 @@ function _financialacls_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_financialacls_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _financialacls_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _financialacls_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _financialacls_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _financialacls_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _financialacls_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _financialacls_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $paren */ function _financialacls_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/flexmailer/flexmailer.civix.php b/ext/flexmailer/flexmailer.civix.php index 9fb3aa28e31c..aa6ea7cb1d60 100644 --- a/ext/flexmailer/flexmailer.civix.php +++ b/ext/flexmailer/flexmailer.civix.php @@ -238,7 +238,7 @@ function _flexmailer_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_flexmailer_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _flexmailer_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _flexmailer_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _flexmailer_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _flexmailer_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _flexmailer_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _flexmailer_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID */ function _flexmailer_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/greenwich/greenwich.civix.php b/ext/greenwich/greenwich.civix.php index 45a6619d008c..3559a2b9506e 100644 --- a/ext/greenwich/greenwich.civix.php +++ b/ext/greenwich/greenwich.civix.php @@ -238,7 +238,7 @@ function _greenwich_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_greenwich_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _greenwich_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _greenwich_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _greenwich_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _greenwich_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _greenwich_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _greenwich_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) */ function _greenwich_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/legacycustomsearches/legacycustomsearches.civix.php b/ext/legacycustomsearches/legacycustomsearches.civix.php index b1a7c1b60fac..e622c4874349 100644 --- a/ext/legacycustomsearches/legacycustomsearches.civix.php +++ b/ext/legacycustomsearches/legacycustomsearches.civix.php @@ -267,7 +267,7 @@ function _legacycustomsearches_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _legacycustomsearches_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _legacycustomsearches_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _legacycustomsearches_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _legacycustomsearches_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, */ function _legacycustomsearches_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/oauth-client/oauth_client.civix.php b/ext/oauth-client/oauth_client.civix.php index 0347786a07a0..b0be265ad040 100644 --- a/ext/oauth-client/oauth_client.civix.php +++ b/ext/oauth-client/oauth_client.civix.php @@ -267,7 +267,7 @@ function _oauth_client_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _oauth_client_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _oauth_client_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _oauth_client_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _oauth_client_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parent */ function _oauth_client_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/payflowpro/payflowpro.civix.php b/ext/payflowpro/payflowpro.civix.php index 5a368a27114c..203dbfd3c487 100644 --- a/ext/payflowpro/payflowpro.civix.php +++ b/ext/payflowpro/payflowpro.civix.php @@ -238,7 +238,7 @@ function _payflowpro_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_payflowpro_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _payflowpro_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _payflowpro_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _payflowpro_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _payflowpro_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _payflowpro_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _payflowpro_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID */ function _payflowpro_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/recaptcha/recaptcha.civix.php b/ext/recaptcha/recaptcha.civix.php index 53696864e20c..43a057d52703 100644 --- a/ext/recaptcha/recaptcha.civix.php +++ b/ext/recaptcha/recaptcha.civix.php @@ -238,7 +238,7 @@ function _recaptcha_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_recaptcha_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -247,7 +247,7 @@ function _recaptcha_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -291,7 +291,7 @@ function _recaptcha_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _recaptcha_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -319,7 +319,7 @@ function _recaptcha_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _recaptcha_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -460,7 +460,7 @@ function _recaptcha_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) */ function _recaptcha_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/search_kit/search_kit.civix.php b/ext/search_kit/search_kit.civix.php index 9ed76d92146e..51e8841d4ef6 100644 --- a/ext/search_kit/search_kit.civix.php +++ b/ext/search_kit/search_kit.civix.php @@ -267,7 +267,7 @@ function _search_kit_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _search_kit_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -295,7 +295,7 @@ function _search_kit_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _search_kit_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -436,7 +436,7 @@ function _search_kit_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID */ function _search_kit_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php b/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php index 891a0c069c78..f4350be2a156 100644 --- a/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php +++ b/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php @@ -237,7 +237,7 @@ function _sequentialcreditnotes_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_sequentialcreditnotes_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -246,7 +246,7 @@ function _sequentialcreditnotes_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry[0] == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -290,7 +290,7 @@ function _sequentialcreditnotes_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _sequentialcreditnotes_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -318,7 +318,7 @@ function _sequentialcreditnotes_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _sequentialcreditnotes_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -459,7 +459,7 @@ function _sequentialcreditnotes_civix_fixNavigationMenuItems(&$nodes, &$maxNavID */ function _sequentialcreditnotes_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/install/civicrm.php b/install/civicrm.php index 2f895d550dbc..5d8c3441f5a1 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -29,18 +29,18 @@ function civicrm_setup($filesDirectory) { $sqlPath = $crmPath . DIRECTORY_SEPARATOR . 'sql'; $tplPath = $crmPath . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR; - if (!is_dir($filesDirectory)) { + if (!@is_dir($filesDirectory)) { mkdir($filesDirectory, 0777); chmod($filesDirectory, 0777); } $scratchDir = $filesDirectory . DIRECTORY_SEPARATOR . 'civicrm'; - if (!is_dir($scratchDir)) { + if (!@is_dir($scratchDir)) { mkdir($scratchDir, 0777); } $compileDir = $scratchDir . DIRECTORY_SEPARATOR . 'templates_c' . DIRECTORY_SEPARATOR; - if (!is_dir($compileDir)) { + if (!@is_dir($compileDir)) { mkdir($compileDir, 0777); } $compileDir = addslashes($compileDir); diff --git a/tests/phpunit/CRM/Mailing/MailStoreTest.php b/tests/phpunit/CRM/Mailing/MailStoreTest.php index ae164f2b1c13..51d2e0b380bf 100644 --- a/tests/phpunit/CRM/Mailing/MailStoreTest.php +++ b/tests/phpunit/CRM/Mailing/MailStoreTest.php @@ -16,7 +16,7 @@ public function setUp(): void { public function tearDown(): void { parent::tearDown(); - if (is_dir($this->workDir)) { + if (@is_dir($this->workDir)) { CRM_Utils_File::cleanDir($this->workDir); } } diff --git a/tests/phpunit/Civi/Angular/ManagerTest.php b/tests/phpunit/Civi/Angular/ManagerTest.php index 7d82c5bb1e20..436d85a35de9 100644 --- a/tests/phpunit/Civi/Angular/ManagerTest.php +++ b/tests/phpunit/Civi/Angular/ManagerTest.php @@ -71,7 +71,7 @@ public function testGetModules() { if (isset($module['partials'])) { $this->assertTrue(is_array($module['partials'])); foreach ((array) $module['partials'] as $basedir) { - $this->assertTrue(is_dir($this->res->getPath($module['ext']) . '/' . $basedir)); + $this->assertTrue(@is_dir($this->res->getPath($module['ext']) . '/' . $basedir)); $counts['partials']++; } } diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 8c3dbc2982e1..739f16cf10cb 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -2185,7 +2185,7 @@ public function cleanTempDirs() { return; } foreach ($this->tempDirs as $tempDir) { - if (is_dir($tempDir)) { + if (@is_dir($tempDir)) { CRM_Utils_File::cleanDir($tempDir, TRUE, FALSE); } } diff --git a/tests/phpunit/E2E/Core/PathUrlTest.php b/tests/phpunit/E2E/Core/PathUrlTest.php index c555ccc6f01d..ae0fd6d7db8a 100644 --- a/tests/phpunit/E2E/Core/PathUrlTest.php +++ b/tests/phpunit/E2E/Core/PathUrlTest.php @@ -59,7 +59,7 @@ public function testPaths_getVariable() { foreach (array_merge($pathOnly, $pathAndUrl) as $var) { $path = \Civi::paths()->getVariable($var, 'path'); - $this->assertTrue(file_exists($path) && is_dir($path), "The path for $var should be a valid directory."); + $this->assertTrue(file_exists($path) && @is_dir($path), "The path for $var should be a valid directory."); } foreach (array_merge($urlOnly, $pathAndUrl) as $var) { diff --git a/tests/phpunit/api/v3/AttachmentTest.php b/tests/phpunit/api/v3/AttachmentTest.php index 151b4de8f459..e23cc8024a01 100644 --- a/tests/phpunit/api/v3/AttachmentTest.php +++ b/tests/phpunit/api/v3/AttachmentTest.php @@ -693,7 +693,7 @@ public function testGetIcon() { */ protected function tmpFile($name) { $tmpDir = sys_get_temp_dir(); - $this->assertTrue($tmpDir && is_dir($tmpDir), 'Tmp dir must exist: ' . $tmpDir); + $this->assertTrue($tmpDir && @is_dir($tmpDir), 'Tmp dir must exist: ' . $tmpDir); return $tmpDir . '/' . self::getFilePrefix() . $name; } diff --git a/tools/extensions/org.civicrm.angularex/angularex.civix.php b/tools/extensions/org.civicrm.angularex/angularex.civix.php index 308a7699e560..6e75febdfe7b 100644 --- a/tools/extensions/org.civicrm.angularex/angularex.civix.php +++ b/tools/extensions/org.civicrm.angularex/angularex.civix.php @@ -237,7 +237,7 @@ function _angularex_civix_find_files($dir, $pattern) { while (!empty($todos)) { $subdir = array_shift($todos); foreach (_angularex_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { + if (!@is_dir($match)) { $result[] = $match; } } @@ -246,7 +246,7 @@ function _angularex_civix_find_files($dir, $pattern) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; if ($entry{0} == '.') { } - elseif (is_dir($path)) { + elseif (@is_dir($path)) { $todos[] = $path; } } @@ -289,7 +289,7 @@ function _angularex_civix_civicrm_managed(&$entities) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes */ function _angularex_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { + if (!@is_dir(__DIR__ . '/xml/case')) { return; } @@ -317,7 +317,7 @@ function _angularex_civix_civicrm_caseTypes(&$caseTypes) { * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules */ function _angularex_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { + if (!@is_dir(__DIR__ . '/ang')) { return; } @@ -458,7 +458,7 @@ function _angularex_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) */ function _angularex_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { + if (!in_array($settingsDir, $metaDataFolders) && @is_dir($settingsDir)) { $metaDataFolders[] = $settingsDir; } } diff --git a/tools/scripts/phpunit b/tools/scripts/phpunit index e941348381b7..01262b94487e 100755 --- a/tools/scripts/phpunit +++ b/tools/scripts/phpunit @@ -86,7 +86,7 @@ putenv("CIVICRM_UF=$CIVICRM_UF"); // Transition: Make sure we use phpunit code from PATH, not // civicrm-packages. This will be unnecessary once civicrm-packages is // updated. -if (is_dir('packages/PHPUnit/')) { +if (@is_dir('packages/PHPUnit/')) { if (!rename('packages/PHPUnit', 'packages/PHPUnit.bak')) { echo "Failed to move aside stale copy of PHPUnit.\n"; exit(1);