We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11742 ☆ A M B ☆
    • 53 Posts
    Hello,
    I found a problem when I am tried to create a custom table. I made a XML schema and in next step tried to built it. I get this errors:

    [2010-08-30 10:53:20] (ERROR @ /var/www/vhosts/site.com/httpdocs/core/xpdo/om/xpdogenerator.class.php : 438)
    
    PHP warning: mkdir() [function.mkdir]: No such file or directory
    
    [2010-08-30 10:53:20] (ERROR @ /var/www/vhosts/site.com/httpdocs/core/xpdo/om/xpdogenerator.class.php : 444)
    
    PHP warning: mkdir() [function.mkdir]: No such file or directory
    
    [2010-08-30 10:53:20] (ERROR @ /_comps/newsletter/trunk/_build/build.schema.php)
    
    Could not open or create dir: /var/www/vhosts/site.com/httpdocs/_comps/newsletter/trunk/core/components/newsletter/model/newsletter/
    
    [2010-08-30 10:53:20] (ERROR @ /_comps/newsletter/trunk/_build/build.schema.php)
    
    Could not open or create dir: /var/www/vhosts/site.com/httpdocs/_comps/newsletter/trunk/core/components/newsletter/model/newsletter/
    
    [2010-08-30 10:53:20] (ERROR @ /var/www/vhosts/site.com/httpdocs/core/xpdo/om/xpdogenerator.class.php : 524)
    
    PHP warning: mkdir() [function.mkdir]: No such file or directory
    
    [2010-08-30 10:53:20] (ERROR @ /var/www/vhosts/site.com/httpdocs/core/xpdo/om/xpdogenerator.class.php : 528)
    
    PHP warning: mkdir() [function.mkdir]: No such file or directory
    
    [2010-08-30 10:53:20] (ERROR @ /_comps/newsletter/trunk/_build/build.schema.php)
    
    Could not open or create dir: /var/www/vhosts/site.com/httpdocs/_comps/newsletter/trunk/core/components/newsletter/model/newsletter/mysql
    
    Execution time: 0.4418 s 
    

    I found the problem is in XPDO generator class (/core/xpdo/om/xpdogenerator.class.php) in calls of mkdir() function.

    It doesn’t use recursive mode. Third parameter of mkdir() http://php.net/manual/en/function.mkdir.php, I replaced mkdir($path, 0777); with mkdir($path, 0777, true); and tried to build again. Success!

    Now, is this a "bug" or I made some mistake??

    Thx for response.

    ---
    My enviroment:
    Windows 7
    PHP 5.3.1
      Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

      GitHub: https://github.com/hansek
      Follow me: https://twitter.com/jantezner
      Or follow us: https://twitter.com/coexcz

      http://www.modx.cz || http://www.coex.cz
      • 11742 ☆ A M B ☆
      • 53 Posts
      No user on Windows system had this problem?
        Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

        GitHub: https://github.com/hansek
        Follow me: https://twitter.com/jantezner
        Or follow us: https://twitter.com/coexcz

        http://www.modx.cz || http://www.coex.cz
        • 26903
        • 1,336 Posts
        I’d say you could file that as a bug personally, also why create with 0777? Why does it need to be writeable by all? 0775 would be better.
          Use MODx, or the cat gets it!
          • 1276
          • 1 Posts
          Thanks loads -- exactly the same issue here - running on a hosted windows environment.

          Adding the true parameter to line 438 & 444 fixed the issue.

          Alex
            • 11742 ☆ A M B ☆
            • 53 Posts
            Quote from: shamblett at Sep 03, 2010, 02:36 AM

            I’d say you could file that as a bug personally, also why create with 0777? Why does it need to be writeable by all? 0775 would be better.

            But look into /core/xpdo/om/xpdogenerator.class.php and at lines #438 and #444, there are parameters set to 0777, it is native XPDO settings.
              Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

              GitHub: https://github.com/hansek
              Follow me: https://twitter.com/jantezner
              Or follow us: https://twitter.com/coexcz

              http://www.modx.cz || http://www.coex.cz
              • 3749
              • 24,544 Posts
              FYI, windows ignores the mode parameter, so it doesn’t matter what you set it to there. 777 is indeed the xPDO default (and the mkdir default value for mode).
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 11742 ☆ A M B ☆
                • 53 Posts
                Quote from: BobRay at Sep 05, 2010, 06:13 PM

                FYI, windows ignores the mode parameter, so it doesn’t matter what you set it to there. 777 is indeed the xPDO default (and the mkdir default value for mode).

                I know, it was only response for previous reply to my post. Problem is third parameter of mkdir call bool $recursive = false. Through this is PHP not possible to create a folder structure and PHP throws an error.
                  Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

                  GitHub: https://github.com/hansek
                  Follow me: https://twitter.com/jantezner
                  Or follow us: https://twitter.com/coexcz

                  http://www.modx.cz || http://www.coex.cz