Beispiel #1
0
 /**
  * Constructor.
  *
  * @param string $name The name of the application
  * @param string $version The version of the application
  *
  * @api
  */
 public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct('Pimcore CLI', Version::getVersion());
     // init default autoload namespaces
     $this->initDefaultAutoloadNamespaces();
     // allow to register commands here (e.g. through plugins)
     \Pimcore::getEventManager()->trigger('system.console.init', $this);
 }
 /**
  * Constructor.
  *
  * @param string $name The name of the application
  * @param string $version The version of the application
  *
  * @api
  */
 public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct('Pimcore CLI', Version::getVersion());
     foreach ($this->defaultAutoloadNamespaces as $namespace => $directory) {
         $this->addAutoloadNamespace($namespace, $directory);
     }
     // allow to register commands here (e.g. through plugins)
     \Pimcore::getEventManager()->trigger('system.console.init', $this);
 }
Beispiel #3
0
 /**
  * @static
  * @param  $scriptContent
  * @return mixed
  */
 public static function getMinimizedScriptPath($scriptContent)
 {
     $scriptPath = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/minified_javascript_core_" . md5($scriptContent) . ".js";
     if (!is_file($scriptPath)) {
         File::put($scriptPath, $scriptContent);
     }
     $params = ["scriptPath" => "/website/var/system/", "scripts" => basename($scriptPath), "_dc" => \Pimcore\Version::getRevision()];
     return "/admin/misc/script-proxy?" . array_toquerystring($params);
 }
Beispiel #4
0
 /**
  * Constructor.
  *
  * @param string $name The name of the application
  * @param string $version The version of the application
  *
  * @api
  */
 public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct('Pimcore CLI', Version::getVersion());
     // init default autoload namespaces
     $this->initDefaultAutoloadNamespaces();
     // allow to register commands here (e.g. through plugins)
     \Pimcore::getEventManager()->trigger('system.console.init', $this);
     $dispatcher = new EventDispatcher();
     $this->setDispatcher($dispatcher);
     $dispatcher->addListener(ConsoleEvents::COMMAND, function (ConsoleCommandEvent $event) {
         if ($event->getInput()->getOption("maintenance-mode")) {
             // enable maintenance mode if requested
             $maintenanceModeId = 'cache-warming-dummy-session-id';
             $event->getOutput()->writeln('Activating maintenance mode with ID <comment>' . $maintenanceModeId . '</comment> ...');
             Admin::activateMaintenanceMode($maintenanceModeId);
         }
     });
     $dispatcher->addListener(ConsoleEvents::TERMINATE, function (ConsoleTerminateEvent $event) {
         if ($event->getInput()->getOption("maintenance-mode")) {
             $event->getOutput()->writeln('Deactivating maintenance mode...');
             Admin::deactivateMaintenanceMode();
         }
     });
 }
 /**
  * Returns a list of all class definitions.
  */
 public function serverInfoAction()
 {
     $this->checkUserPermission("system_settings");
     $systemSettings = \Pimcore\Config::getSystemConfig()->toArray();
     $system = array("currentTime" => time(), "phpCli" => Tool\Console::getPhpCli());
     $pimcoreConstants = array();
     //only Pimcore_ constants -> others might break the \Zend_Encode functionality
     foreach ((array) get_defined_constants() as $constant => $value) {
         if (strpos($constant, 'PIMCORE_') === 0) {
             $pimcoreConstants[$constant] = $value;
         }
     }
     $pimcore = array("version" => \Pimcore\Version::getVersion(), "revision" => \Pimcore\Version::getRevision(), "instanceIdentifier" => $systemSettings["general"]["instanceIdentifier"], "modules" => array(), "constants" => $pimcoreConstants);
     foreach ((array) \Pimcore\API\Plugin\Broker::getInstance()->getModules() as $module) {
         $pimcore["modules"][] = get_class($module);
     }
     $plugins = \Pimcore\ExtensionManager::getPluginConfigs();
     $this->encoder->encode(array("success" => true, "system" => $system, "pimcore" => $pimcore, "plugins" => $plugins));
 }
Beispiel #6
0
<script type="text/javascript">
    pimcore.settings = {
        upload_max_filesize: <?php 
echo $this->upload_max_filesize;
?>
,
        sessionId: "<?php 
echo htmlentities($_COOKIE["pimcore_admin_sid"], ENT_QUOTES, 'UTF-8');
?>
",
        csrfToken: "<?php 
echo $this->csrfToken;
?>
",
        version: "<?php 
echo \Pimcore\Version::getVersion();
?>
",
        build: "<?php 
echo \Pimcore\Version::$revision;
?>
",
        maintenance_active: <?php 
echo $this->maintenance_enabled;
?>
,
        maintenance_mode: <?php 
echo \Pimcore\Tool\Admin::isInMaintenanceMode() ? "true" : "false";
?>
,
        mail: <?php