当前位置: 首页>>代码示例>>PHP>>正文


PHP eZDir::doMkdir方法代码示例

本文整理汇总了PHP中eZDir::doMkdir方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDir::doMkdir方法的具体用法?PHP eZDir::doMkdir怎么用?PHP eZDir::doMkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZDir的用法示例。


在下文中一共展示了eZDir::doMkdir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Test setup
  *
  * Load an instance of file.ini
  * Assigns DB parameters for cluster
  **/
 public function setUp()
 {
     if (!$this->sharedFixture instanceof eZMySQLDB) {
         self::markTestSkipped("Not using mysql interface, skipping");
     }
     parent::setUp();
     // We need to clear the existing handler if it was loaded before the INI
     // settings changes
     if (isset($GLOBALS['eZClusterFileHandler_chosen_handler']) and !$GLOBALS['eZClusterFileHandler_chosen_handler'] instanceof eZDFSFileHandler) {
         unset($GLOBALS['eZClusterFileHandler_chosen_handler']);
     }
     // Load database parameters for cluster
     // The same DSN than the relational database is used
     $fileINI = eZINI::instance('file.ini');
     $this->previousFileHandler = $fileINI->variable('ClusteringSettings', 'FileHandler');
     $fileINI->setVariable('ClusteringSettings', 'FileHandler', 'eZDFSFileHandler');
     $dsn = ezpTestRunner::dsn()->parts;
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBHost', $dsn['host']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBPort', $dsn['port']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBSocket', $dsn['socket']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBName', $dsn['database']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBUser', $dsn['user']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'DBPassword', $dsn['password']);
     $fileINI->setVariable('eZDFSClusteringSettings', 'MountPointPath', $this->DFSPath);
     if (!file_exists($this->DFSPath)) {
         eZDir::doMkdir($this->DFSPath, 0755);
         $this->haveToRemoveDFSPath = true;
     }
     ezpTestDatabaseHelper::insertSqlData($this->sharedFixture, $this->sqlFiles);
     $this->db = $this->sharedFixture;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:37,代码来源:ezdfsfilehandler_test.php

示例2: setUp

 /**
  * Test setup
  *
  * Load an instance of file.ini
  * Assigns DB parameters for cluster
  **/
 public function setUp()
 {
     parent::setUp();
     self::setUpDatabase($this->clusterClass);
     if (!file_exists(self::$DFSPath)) {
         eZDir::doMkdir(self::$DFSPath, 0755);
         $this->haveToRemoveDFSPath = true;
     }
     $this->db = eZDB::instance();
 }
开发者ID:radca,项目名称:ezpublish,代码行数:16,代码来源:ezdfsfilehandler_test.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->previousFileHandler = eZINI::instance('file.ini')->variable('ClusteringSettings', 'FileHandler');
     $this->DFSPath = eZDFSFileHandlerTest::getDfsPath();
     eZDFSFileHandlerTest::setUpDatabase();
     if (!file_exists($this->DFSPath)) {
         eZDir::doMkdir($this->DFSPath, 0755);
         $this->haveToRemoveDFSPath = true;
     }
     $this->db = $this->sharedFixture;
 }
开发者ID:radca,项目名称:ezpublish,代码行数:12,代码来源:ezdfsclusterstalecache_test.php

示例4: setUp

    /**
     * Test setup
     *
     * Load an instance of file.ini
     * Assigns DB parameters for cluster
     */
    public function setUp()
    {
        if ( ezpTestRunner::dsn()->dbsyntax !== 'mysql' && ezpTestRunner::dsn()->dbsyntax !== 'mysqli' )
            self::markTestSkipped( "Not running MySQL, skipping" );

        parent::setUp();
        $this->sharedFixture = ezpTestDatabaseHelper::create( ezpTestRunner::dsn() );
        ezpTestDatabaseHelper::insertSqlData( $this->sharedFixture,  array( 'tests/tests/kernel/classes/clusterfilehandlers/sql/cluster_dfs_schema.sql' ) );

        // We need to clear the existing handler if it was loaded before the INI
        // settings changes
        if ( !eZClusterFileHandler::$globalHandler instanceof eZDFSFileHandler )
            eZClusterFileHandler::$globalHandler = null;

        unset( $GLOBALS['eZClusterInfo'] );

        // Load database parameters for cluster
        // The same DSN than the relational database is used
        $fileINI = eZINI::instance( 'file.ini' );
        $this->previousFileHandler = $fileINI->variable( 'ClusteringSettings', 'FileHandler' );
        $fileINI->setVariable( 'ClusteringSettings', 'FileHandler', 'eZDFSFileHandler' );

        $dsn = ezpTestRunner::dsn()->parts;
        switch ( $dsn['phptype'] )
        {
            case 'mysql':
                $backend = 'eZDFSFileHandlerMySQLBackend';
                break;

            case 'mysqli':
                $backend = 'eZDFSFileHandlerMySQLiBackend';
                break;

            default:
                $this->markTestSkipped( "Unsupported database type '{$dsn['phptype']}'" );
        }
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBBackend', $backend );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBHost',    $dsn['host'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBPort',    $dsn['port'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBSocket',  $dsn['socket'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBName',    $dsn['database'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBUser',    $dsn['user'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'DBPassword', $dsn['password'] );
        $fileINI->setVariable( 'eZDFSClusteringSettings', 'MountPointPath', $this->DFSPath );

        if ( !file_exists( $this->DFSPath ) )
        {
            eZDir::doMkdir( $this->DFSPath, 0755 );
            $this->haveToRemoveDFSPath = true;
        }

        $this->db = $this->sharedFixture;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:59,代码来源:ezdfsfilehandler_test.php

示例5: cleanupEmptyDirectories

 static function cleanupEmptyDirectories($dir)
 {
     $dir = eZDir::cleanPath($dir, self::SEPARATOR_UNIX);
     $dirElements = explode('/', $dir);
     if (count($dirElements) == 0) {
         return true;
     }
     $currentDir = $dirElements[0];
     $result = true;
     if (!file_exists($currentDir) and $currentDir != "") {
         $result = eZDir::doMkdir($currentDir, $perm);
     }
     if (!$result) {
         return false;
     }
     for ($i = count($dirElements); $i > 0; --$i) {
         $dirpath = implode('/', array_slice($dirElements, 0, $i));
         if (file_exists($dirpath) and is_dir($dirpath)) {
             $rmdirStatus = @rmdir($dirpath);
             if (!$rmdirStatus) {
                 return true;
             }
         }
     }
     return true;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:26,代码来源:ezdir.php


注:本文中的eZDir::doMkdir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。