Ensure that directory of newly created devtools project exists
authorMatthias Schmidt <gravatronics@live.com>
Sun, 9 Dec 2018 09:13:10 +0000 (10:13 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 9 Dec 2018 09:13:10 +0000 (10:13 +0100)
See  #2772

wcfsetup/install/files/lib/data/devtools/project/DevtoolsProjectAction.class.php

index af975350ff9e918c90563a0c1e113f0a94955da6..342b67a5959eaf8f39c6d4a26266c5ba28cd6f4d 100644 (file)
@@ -43,6 +43,23 @@ class DevtoolsProjectAction extends AbstractDatabaseObjectAction {
         */
        public $queue;
        
+       /**
+        * @inheritDoc
+        * @return      DevtoolsProject
+        * @since       3.2
+        */
+       public function create() {
+               $this->parameters['data']['path'] = FileUtil::addTrailingSlash($this->parameters['data']['path']);
+               
+               /** @var DevtoolsProject $project */
+               $project = parent::create();
+               
+               // ensure that the project directory exists
+               FileUtil::makePath($project->path);
+               
+               return $project;
+       }
+       
        /**
         * @inheritDoc
         */