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


PHP Folder::get_path方法代码示例

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


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

示例1: list_test_suite_recursive

function list_test_suite_recursive($directory, $recursive = false)
{
    $folders = array();
    $folder = new Folder($directory);
    foreach ($folder->get_folders('`^[^.].+$`') as $folder) {
        $folders[] = preg_replace('`^[\\./]*kernel`', '', $folder->get_path());
        if ($recursive) {
            $folders = array_merge($folders, list_test_suite_recursive($folder->get_path(), true));
        }
    }
    return $folders;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:phpboost_unit_tests.inc.php

示例2: create

 /**
  * Creates a new Sample Folder including Folder
  * @param integer $sample_id
  * @return integer
  */
 public function create($sample_id)
 {
     if (is_numeric($sample_id)) {
         $sample = new Sample($sample_id);
         // Folder
         $sample_folder_id = constant("SAMPLE_FOLDER_ID");
         $folder = new Folder($sample_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element($sample_id);
         $name = $sample->get_name() . " (" . $sample->get_formatted_id() . ")";
         if (($folder_id = parent::create($name, $sample_folder_id, $path->get_path_string(), $sample->get_owner_id(), null)) != null) {
             $sample_has_folder_access = new SampleHasFolder_Access(null);
             if ($sample_has_folder_access->create($sample_id, $folder_id) == null) {
                 return null;
             }
             // Virtual Folders (Event)
             $sample_folder_create_event = new SampleFolderCreateEvent($folder_id);
             $event_handler = new EventHandler($sample_folder_create_event);
             if ($event_handler->get_success() == false) {
                 $this->delete();
                 return false;
             } else {
                 return $folder_id;
             }
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:36,代码来源:sample_folder.class.php

示例3: create

 /**
  * @param integer $group_id
  * @return bool
  */
 public function create($group_id)
 {
     global $transaction;
     if (is_numeric($group_id)) {
         $group = new Group($group_id);
         // Folder
         $group_folder_id = constant("GROUP_FOLDER_ID");
         $folder = new Folder($group_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element($group_id);
         $folder = new Folder(null);
         if (($folder_id = parent::create($group->get_name(), $group_folder_id, $path->get_path_string(), 1, $group_id)) != null) {
             $folder_is_group_folder_access = new FolderIsGroupFolder_Access(null);
             if ($folder_is_group_folder_access->create($group_id, $folder_id) == null) {
                 return false;
             }
             // Virtual Folders (Event)
             $group_folder_create_event = new GroupFolderCreateEvent($folder_id);
             $event_handler = new EventHandler($group_folder_create_event);
             if ($event_handler->get_success() == false) {
                 $this->delete();
                 return false;
             } else {
                 return true;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:36,代码来源:group_folder.class.php

示例4: create

 /**
  * Creates a new Project Folder including Folder
  * @param integer $project_id
  * @return integer
  */
 public function create($project_id, $base_folder_id)
 {
     if (is_numeric($project_id)) {
         $project = new Project($project_id);
         // Folder
         if ($base_folder_id == null) {
             $project_folder_id = constant("PROJECT_FOLDER_ID");
         } else {
             $project_folder_id = $base_folder_id;
         }
         $folder = new Folder($project_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element($project_id);
         if (($folder_id = parent::create($project->get_name(), $project_folder_id, $path->get_path_string(), $project->get_owner_id(), null)) != null) {
             $project_has_folder_access = new ProjectHasFolder_Access(null);
             if ($project_has_folder_access->create($project_id, $folder_id) == null) {
                 return null;
             }
             // Virtual Folder
             $project_folder_create_event = new ProjectFolderCreateEvent($folder_id);
             $event_handler = new EventHandler($project_folder_create_event);
             if ($event_handler->get_success() == false) {
                 $this->delete();
                 return false;
             } else {
                 return $folder_id;
             }
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:39,代码来源:project_folder.class.php

示例5: create

 /**
  * @param integer $organisation_unit_id
  * @return bool
  */
 public function create($organisation_unit_id)
 {
     if (is_numeric($organisation_unit_id)) {
         $organisation_unit = new OrganisationUnit($organisation_unit_id);
         // Folder
         $organisation_unit_folder_id = constant("ORGANISATION_UNIT_FOLDER_ID");
         $folder = new Folder($organisation_unit_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element($organisation_unit_id);
         $folder = new Folder(null);
         if (($folder_id = parent::create($organisation_unit->get_name(), $organisation_unit_folder_id, $path->get_path_string(), $organisation_unit->get_master_owner_id(), null)) != null) {
             $folder_is_organisation_unit_folder_access = new FolderIsOrganisationUnitFolder_Access(null);
             if ($folder_is_organisation_unit_folder_access->create($organisation_unit_id, $folder_id) == null) {
                 return false;
             }
             // Virtual Folders (Event)
             $organisation_unit_folder_create_event = new OrganisationUnitFolderCreateEvent($folder_id);
             $event_handler = new EventHandler($organisation_unit_folder_create_event);
             if ($event_handler->get_success() == false) {
                 $this->delete();
                 return false;
             } else {
                 return true;
             }
         } else {
             $this->delete(true, true);
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:36,代码来源:organisation_unit_folder.class.php

示例6: add_classes

 private static function add_classes($directory, $pattern, $recursive = true)
 {
     $files = array();
     $folder = new Folder($directory);
     $relative_path = Path::get_path_from_root($folder->get_path());
     $files = $folder->get_files($pattern);
     foreach ($files as $file) {
         $filename = $file->get_name();
         $classname = $file->get_name_without_extension();
         self::$autoload[$classname] = $relative_path . '/' . $filename;
     }
     if ($recursive) {
         $folders = $folder->get_folders('`^[a-z]{1}.*$`i');
         foreach ($folders as $a_folder) {
             if (!in_array($a_folder->get_path_from_root(), self::$exclude_paths) && !in_array($a_folder->get_name(), self::$exclude_folders_names)) {
                 self::add_classes($a_folder->get_path(), $pattern);
             }
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:20,代码来源:ClassLoader.class.php

示例7: create

 /**
  * Creates a new folder
  * @param string $name
  * @param integer $toid
  * @param string $path
  * @param integer $owner_id
  * @param integer $owner_group_id
  * @return integer
  * @throws FolderCreateFailedException
  * @throws FolderCreateFolderAlreadyExistsException
  * @throws FolderCreatePhysicalCreationFailedException
  * @throws FolderCreateIDMissingException
  */
 public function create($name, $toid, $path, $owner_id, $owner_group_id)
 {
     global $transaction;
     if (is_numeric($toid)) {
         $transaction_id = $transaction->begin();
         try {
             $folder = new Folder($toid);
             $parent_data_entity_id = $folder->get_data_entity_id();
             if (!$path) {
                 $folder = new Folder($toid);
                 $folder_name = str_replace(" ", "_", trim($name));
                 $path = $folder->get_path() . "/" . $folder_name;
             }
             $data_entity_id = parent::create($owner_id, $owner_group_id);
             parent::set_as_child_of($parent_data_entity_id);
             if (($folder_id = $this->folder->create($data_entity_id, $name, $path)) == null) {
                 throw new FolderCreateFailedException();
             }
             self::__construct($folder_id);
             $system_path = constant("BASE_DIR") . "/" . $path;
             if (file_exists($system_path)) {
                 throw new FolderCreateFolderAlreadyExistsException();
             }
             if (mkdir($system_path) == false) {
                 throw new FolderCreatePhysicalCreationFailedException();
             }
         } catch (BaseException $e) {
             if ($transaction_id != null) {
                 $transaction->rollback($transaction_id);
             }
             throw $e;
         }
         if ($transaction_id != null) {
             $transaction->commit($transaction_id);
         }
         return $folder_id;
     } else {
         throw new FolderCreateIDMissingException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:53,代码来源:folder.class.php

示例8: create

 /**
  * Creates a new Project Folder including Folder
  * @param integer $project_id
  * @return integer
  */
 public function create($project_id, $project_status_id)
 {
     if (is_numeric($project_id) and is_numeric($project_status_id)) {
         $project_status = new ProjectStatus($project_status_id);
         $project = new Project($project_id);
         $project_folder_id = ProjectFolder::get_folder_by_project_id($project_id);
         $folder = new Folder($project_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element("status-" . $project_status_id);
         if (($folder_id = parent::create($project_status->get_name(), $project_folder_id, $path->get_path_string(), $project->get_owner_id(), null)) != null) {
             $project_status_has_folder_access = new ProjectStatusHasFolder_Access(null);
             if ($project_status_has_folder_access->create($project_id, $project_status_id, $folder_id) == null) {
                 return null;
             }
             return $folder_id;
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:27,代码来源:project_status_folder.class.php

示例9: create

 /**
  * @param integer $user_id
  * @return bool
  */
 public function create($user_id)
 {
     if (is_numeric($user_id)) {
         $user = new User($user_id);
         // Folder
         $user_folder_id = constant("USER_FOLDER_ID");
         $folder = new Folder($user_folder_id);
         $path = new Path($folder->get_path());
         $path->add_element($user_id);
         if (($folder_id = parent::create($user->get_username(), $user_folder_id, $path->get_path_string(), $user_id, null)) != null) {
             $folder_is_user_folder_access = new FolderIsUserFolder_Access(null);
             if ($folder_is_user_folder_access->create($user_id, $folder_id) == null) {
                 return false;
             }
             // _Public
             $public_path = new Path($path->get_path_string());
             $public_path->add_element("_public");
             $public_folder = new Folder(null);
             if ($public_folder->create("_public", $folder_id, $public_path->get_path_string(), $user_id, null) == null) {
                 $this->delete();
                 return false;
             }
             // _Private
             $private_path = new Path($path->get_path_string());
             $private_path->add_element("_private");
             $private_folder = new Folder(null);
             if ($private_folder->create("_private", $folder_id, $private_path->get_path_string(), $user_id, null) == null) {
                 $this->delete();
                 return false;
             }
             // Virtual Folders (Event)
             $user_folder_create_event = new UserFolderCreateEvent($folder_id);
             $event_handler = new EventHandler($user_folder_create_event);
             if ($event_handler->get_success() == false) {
                 $this->delete();
                 return false;
             } else {
                 return true;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:50,代码来源:user_folder.class.php


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