svn: /web/doc-editor/trunk/php/ File.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Sat, 08 May 2010 20:12:33 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=299152

Log:
Fix new folder when we save a file in an non-existing folder. Spotted by pedram

Changed paths:
    U   web/doc-editor/trunk/php/File.php

Modified: web/doc-editor/trunk/php/File.php
===================================================================
--- web/doc-editor/trunk/php/File.php	2010-05-08 19:42:27 UTC (rev 299151)
+++ web/doc-editor/trunk/php/File.php	2010-05-08 20:12:33 UTC (rev 299152)
@@ -144,19 +144,19 @@
      *
      * @return true
      */
-    public function createFolder()
+    public function createFolder($createPath)
     {
        $am      = AccountManager::getInstance();
        $appConf = $am->appConf;
        $project = $am->project;

        // We create this folder localy
-       if( ! @mkdir($appConf[$project]['vcs.path'].$this->lang.$this->path) ) {
+       if( ! @mkdir($appConf[$project]['vcs.path'].$this->lang.$createPath) ) {
            return false;
        }

        // We register this new folder to be committed
-       $obj = (object) array('lang' => $this->lang, 'path' => $this->path, 'name' => '-');
+       $obj = (object) array('lang' => $this->lang, 'path' => $createPath, 'name' => '-');
        RepositoryManager::getInstance()->addPendingCommit($obj, '-', '-', '-', '-', 'new');

        return true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.