We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2189
    • 6 Posts
    Hi!
    There is a variable because of i have no peace. It’s called «documentListing». It is located in DocumentParser class (./manager/includes/document.parser.class.inc.php).
    So, where exactly does it assigned? Where is that line number where is written smth like «$this->documentListing = bla-bla some function or smth»?
      • 3749
      • 24,544 Posts
      The only assignments I could find for that are two places in

      manager/actions/import_site_static.php

      (lines 115 and 137 in the version I have.)
        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
        • 2189
        • 6 Posts
        Yes, i see — $modx->documentListing[$alias] = true;
        No, it’s not what i was searching for.

        documentListing is an array of my homepage structure:
        Array
        (
        [minimal-base] => 1
        [admin] => 2
        [admin/login] => 3
        [admin/logout] => 5
        [admin/login/recover] => 4
        )

        So, somewhere should be a function which make this array?
          • 3749
          • 24,544 Posts
          Here’s a listing of every reference to $documentListing in the Evolution codebase. Take your pick (the filenames and line numbers are at the end of each one.

          BTW, if you tell us what you’re trying to accomplish, there’s a very good chance that it can be done without hacking the MODx core code. Altering the code is almost never necessary in MODx.


          $d = &$this->documentListing;	C:\xampp\htdocs\evo\assets\cache\siteCache.idx.php (83:14)
          
          $alias = !isset($modx->documentListing[$id]) ? $id:$id.'-'.substr(uniqid(''),-3);
          	C:\xampp\htdocs\evo\manager\actions\import_site.static.php (114:36)
          
          $modx->documentListing[$alias] = true;	C:\xampp\htdocs\evo\manager\actions\import_site.static.php (115:20)
          
          $alias = !isset($modx->documentListing[$value]) ? $value:$value.'-'.substr(uniqid(''),-3);	C:\xampp\htdocs\evo\manager\actions\import_site.static.php (136:36)
          
          $modx->documentListing[$alias] = true;	C:\xampp\htdocs\evo\manager\actions\import_site.static.php (137:20)
          
          var $rs, $result, $sql, $table_prefix, $debug, $documentIdentifier, $documentMethod, $documentGenerated, $documentContent, $tstart, $minParserPasses, $maxParserPasses, $documentObject, $templateObject, $snippetObjects, $stopOnNotice, $executedQueries, $queryTime, $currentSnippet, $documentName, $aliases, $visitor, $entrypage, $documentListing, $dumpSnippets, $chunkCache, $snippetCache, $contentTypes, $dumpSQL, $queryCode, $virtualDir, $placeholders, $sjscripts, $jscripts, $loadedjscripts, $documentMap;	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (14:334)
          
          if (is_numeric($q) && !$this->documentListing[$q]) { /* we got an ID returned, check to make sure it's not an alias */	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (342:39)
          
          if ((($this->virtualDir != '' && !$this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !$this->documentListing[$q])) && (($this->virtualDir != '' && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (345:58)
          
          if ((($this->virtualDir != '' && !$this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !$this->documentListing[$q])) && (($this->virtualDir != '' && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (345:144)
          
          if ((($this->virtualDir != '' && !$this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !$this->documentListing[$q])) && (($this->virtualDir != '' && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (345:237)
          if (!is_numeric($identifier) && array_key_exists($identifier, $this->documentListing)) {	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (927:86)
          
          $identifier= $this->documentListing[$identifier];	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (928:41)
          
          if (array_key_exists($alias, $this->documentListing)) {	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (1094:53)
          
          $this->documentIdentifier= $this->documentListing[$alias];	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (1095:55)
          
          $this->documentIdentifier= $this->documentListing[$this->documentIdentifier];	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (1100:51)
          
          $parentKey= array_search($parentId, $this->documentListing);	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (1217:60)
          
          $childKey= array_search($childId, $this->documentListing);	C:\xampp\htdocs\evo\manager\includes\document.parser.class.inc.php (1237:58)
          
          $tmpPHP .= '$d = &$this->documentListing;' . "\n";	C:\xampp\htdocs\evo\manager\processors\cache_sync.class.processor.php (121:28)
            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
            • 2189
            • 6 Posts
            BobRay, thanx for big work you’ve done. But it look likes you misunderstood me. It is very easy to find every reference to $documentListing. I would never asked a question about it. )))

            «tell us what you’re trying to accomplish»
            Variable $this->documentListing is an array, true? I was searching for some function that makes (constructs) this array (eg. $this->documentListing = some_function_that_makes_array_for_documentListing(); ).

            Now i know there is no such function. There only is an array called «$d» in file "\assets\cache\siteCache.idx.php".

            So, where is function which constructs $d array?
              • 36416
              • 589 Posts
              Quote from: artuska at Oct 26, 2009, 01:27 PM

              Now i know there is no such function. There only is an array called «$d» in file "\assets\cache\siteCache.idx.php".
              So, where is function which constructs $d array?

              /manager/processors/cache_sync.class.processor.php
              (rebuilding the site cache from MODx database)
                • 2189
                • 6 Posts
                Great! Ufff. Eol, thank you.
                Question is solved.
                  • 3749
                  • 24,544 Posts
                  Take another look at the the last line of the listing in my message to you above: wink

                  $tmpPHP .= '$d = &$this->documentListing;' . "\n";	C:\xampp\htdocs\evo\manager\processors\cache_sync.class.processor.php (121:28)
                    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