本文整理汇总了PHP中eZDir::findSubitems方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDir::findSubitems方法的具体用法?PHP eZDir::findSubitems怎么用?PHP eZDir::findSubitems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZDir
的用法示例。
在下文中一共展示了eZDir::findSubitems方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eZSetupPrvtAreDirAndFilesWritable
function eZSetupPrvtAreDirAndFilesWritable($dir)
{
if (!eZDir::isWriteable($dir)) {
return FALSE;
}
// Check if all files within a given directory are writeable
$files = eZDir::findSubitems($dir, 'f');
// find only files, skip dirs and symlinks
$fileSeparator = eZSys::fileSeparator();
foreach ($files as $file) {
if (!eZFile::isWriteable($dir . $fileSeparator . $file)) {
return FALSE;
}
}
return TRUE;
}
示例2: suite
static public function suite()
{
if ( !class_exists( 'eZTestSuite', true ) )
{
echo "\nThe eZTestSuite class isn't defined. Are the tests autoloads generated ?\n";
echo "You can generate them using php bin/php/ezpgenerateautoloads.php -s\n\n";
exit( PHPUnit_TextUI_TestRunner::FAILURE_EXIT );
}
$suite = new eZTestSuite;
// Add suites from extensions.
$extensions = eZDir::findSubitems( eZExtension::baseDirectory(), 'dl', true );
foreach( $extensions as $extension )
{
$suiteFile = eZDir::path( array( $extension, "tests", "suite.php" ) );
if ( file_exists( $suiteFile ) )
{
$suite->addTestFile( $suiteFile );
}
}
return $suite;
}
示例3: packageRepositories
static function packageRepositories($parameters = array())
{
if (isset($parameters['path']) and $parameters['path']) {
$path = $parameters['path'];
$packageRepositories = array(array('path' => $path, 'id' => 'local', 'name' => ezpI18n::tr('kernel/package', 'Local'), 'type' => 'local'));
} else {
$repositoryPath = eZPackage::repositoryPath();
$packageRepositories = array(array('path' => $repositoryPath . '/local', 'id' => 'local', 'name' => ezpI18n::tr('kernel/package', 'Local'), 'type' => 'local'));
$subdirs = eZDir::findSubitems($repositoryPath, 'd');
foreach ($subdirs as $dir) {
if ($dir == 'local') {
continue;
}
$packageRepositories[] = array('path' => $repositoryPath . '/' . $dir, 'id' => $dir, 'name' => $dir, 'type' => 'global');
}
}
return $packageRepositories;
}
示例4: fetchList
/**
* Fetches the list of available translations, as an eZTSTranslator for each translation.
*
* @param array $localList
*
* @return array( eZTSTranslator ) list of eZTranslator objects representing available translations
*/
static function fetchList($localeList = array())
{
$ini = eZINI::instance();
$dir = $ini->variable('RegionalSettings', 'TranslationRepository');
$fileInfoList = array();
$translationList = array();
$locale = '';
if (count($localeList) == 0) {
$localeList = eZDir::findSubdirs($dir);
}
foreach ($localeList as $locale) {
if ($locale != 'untranslated') {
$translationFiles = eZDir::findSubitems($dir . '/' . $locale, 'f');
foreach ($translationFiles as $translationFile) {
if (eZFile::suffix($translationFile) == 'ts') {
$translationList[] = new eZTSTranslator($locale, $translationFile);
}
}
}
}
return $translationList;
}
示例5: copy
static function copy( $sourceDirectory, &$destinationDirectory,
$asChild = true, $recursive = true, $includeHidden = false, $excludeItems = false )
{
if ( !is_dir( $sourceDirectory ) )
{
eZDebug::writeError( "Source $sourceDirectory is not a directory, cannot copy from it", __METHOD__ );
return false;
}
if ( !is_dir( $destinationDirectory ) )
{
eZDebug::writeError( "Destination $destinationDirectory is not a directory, cannot copy to it", __METHOD__ );
return false;
}
if ( $asChild )
{
if ( preg_match( "#^.+/([^/]+)$#", $sourceDirectory, $matches ) )
{
eZDir::mkdir( $destinationDirectory . '/' . $matches[1], eZDir::directoryPermission(), false );
$destinationDirectory .= '/' . $matches[1];
}
}
$items = eZDir::findSubitems( $sourceDirectory, 'df', false, $includeHidden, $excludeItems );
$totalItems = $items;
while ( count( $items ) > 0 )
{
$currentItems = $items;
$items = array();
foreach ( $currentItems as $item )
{
$fullPath = $sourceDirectory . '/' . $item;
if ( is_file( $fullPath ) )
eZFileHandler::copy( $fullPath, $destinationDirectory . '/' . $item );
else if ( is_dir( $fullPath ) )
{
eZDir::mkdir( $destinationDirectory . '/' . $item, eZDir::directoryPermission(), false );
$newItems = eZDir::findSubitems( $fullPath, 'df', $item, $includeHidden, $excludeItems );
$items = array_merge( $items, $newItems );
$totalItems = array_merge( $totalItems, $newItems );
unset( $newItems );
}
}
}
// eZDebugSetting::writeNotice( 'lib-ezfile-copy',
// "Copied directory $sourceDirectory to destination $destinationDirectory",
// 'eZDir::copy' );
return $totalItems;
}
示例6: getTranslationListFile
/**
* @desc Get the file list translation
* @author David LE RICHE <david.leriche@openwide.fr>
* @return array
* @copyright 2012
* @version 1.1
*/
public static function getTranslationListFile()
{
$extensionIni = eZINI::instance('owtranslate.ini');
$directoryMainExtension = $extensionIni->variable('MainExtension', 'directory');
$rootExtensionDirectory = eZExtension::baseDirectory();
$baseDirectory = $rootExtensionDirectory . '/' . $directoryMainExtension . '/translations';
$dirTranslationList = eZDir::findSubitems($baseDirectory, false, true);
$fileTranslationList = array();
foreach ($dirTranslationList as $dir) {
$locale = substr($dir, strripos($dir, '/') + 1);
$fileList = eZDir::findSubitems($dir, false, true);
foreach ($fileList as $file) {
$fileTranslationList[$locale] = $file;
}
}
return $fileTranslationList;
}