Exemplo n.º 1
0
 static function getConfigPaths()
 {
     $paths = array('base' => __DIR__ . '/config.php');
     if (file_exists(\jApp::appConfigPath('minifyGroupsConfig.php'))) {
         $paths['groups'] = \jApp::appConfigPath('minifyGroupsConfig.php');
     }
     return $paths;
 }
Exemplo n.º 2
0
 function install()
 {
     // configure the entry point
     $entrypoint = $this->getParameter('entrypoint');
     if (!$entrypoint) {
         $entrypoint = 'soap';
     }
     if (!file_exists(jApp::wwwPath($entrypoint . '.php'))) {
         $this->copyFile('files/soap.php', jApp::wwwPath($entrypoint . '.php'));
     }
     // setup the configuration
     if (!file_exists(jApp::appConfigPath($entrypoint . '/config.ini.php'))) {
         $this->copyFile('files/config.ini.php', jApp::appConfigPath($entrypoint . '/config.ini.php'));
     }
     if ($this->entryPoint->getMainConfigIni()->getValue('soap', 'responses') === null) {
         $this->entryPoint->getMainConfigIni()->setValue('soap', "jsoap~jResponseSoap", "responses");
     }
     $this->declareNewEntryPoint($entrypoint, 'soap', $entrypoint . '/config.ini.php');
 }
Exemplo n.º 3
0
 function install()
 {
     if (!$this->firstExec('config')) {
         return;
     }
     $config = $this->entryPoint->getMainConfigIni();
     $plugins = $config->getValue('plugins', 'jResponseHtml');
     if (strpos($plugins, 'minify') === false) {
         $plugins .= ',minify';
         $config->setValue('plugins', $plugins, 'jResponseHtml', null, true);
     }
     if (null == $config->getValue('minifyCSS', 'jResponseHtml', null, true)) {
         $config->setValue('minifyCSS', 'off', 'jResponseHtml', null, true);
     }
     if (null == $config->getValue('minifyJS', 'jResponseHtml', null, true)) {
         $config->setValue('minifyJS', 'on', 'jResponseHtml', null, true);
     }
     if (null == $config->getValue('minifyExcludeCSS', 'jResponseHtml', null, true)) {
         $config->setValue('minifyExcludeCSS', '', 'jResponseHtml', null, true);
     }
     if (null == $config->getValue('minifyExcludeJS', 'jResponseHtml', null, true)) {
         $config->setValue('minifyExcludeJS', 'jelix/wymeditor/jquery.wymeditor.js', 'jResponseHtml', null, true);
     }
     $entrypoint = $config->getValue('minifyEntryPoint', 'jResponseHtml', null, true);
     if ($entrypoint === null) {
         $config->setValue('minifyEntryPoint', 'minify.php', 'jResponseHtml', null, true);
         $entrypoint = 'minify.php';
     }
     if (!file_exists(jApp::wwwPath($entrypoint))) {
         $this->copyFile('files/minify.php', jApp::wwwPath($entrypoint));
     }
     if (!file_exists(jApp::appConfigPath('minifyConfig.php'))) {
         $this->copyFile('files/minifyConfig.php', jApp::appConfigPath('minifyConfig.php'));
     }
     if (!file_exists(jApp::appConfigPath('minifyGroupsConfig.php'))) {
         $this->copyFile('files/minifyGroupsConfig.php', jApp::appConfigPath('minifyGroupsConfig.php'));
     }
 }
Exemplo n.º 4
0
<?php

require MINIFY_MIN_DIR . '/config.php';
if (file_exists(\jApp::appConfigPath('minifyConfig.php'))) {
    require \jApp::appConfigPath('minifyConfig.php');
}
\Jelix\Minify\MinifySetup::initOptions();
Exemplo n.º 5
0
 protected function _execute(InputInterface $input, OutputInterface $output)
 {
     $entrypoint = $input->getArgument('entrypoint');
     if (($p = strpos($entrypoint, '.php')) !== false) {
         $entrypoint = substr($entrypoint, 0, $p);
     }
     $ep = $this->getEntryPointInfo($entrypoint);
     if ($ep == null) {
         try {
             $options = array('entrypoint' => $entrypoint);
             $this->executeSubCommand('app:createentrypoint', $options, $output);
             $this->appInfos = null;
             $ep = $this->getEntryPointInfo($entrypoint);
         } catch (\Exception $e) {
             throw new \Exception("The entrypoint has not been created because of this error: " . $e->getMessage() . ". No other files have been created.\n");
         }
     }
     $installConfig = new \Jelix\IniFile\IniModifier(App::configPath('installer.ini.php'));
     $inifile = new \Jelix\IniFile\MultiIniModifier(App::mainConfigFile(), App::appConfigPath($ep['config']));
     $params = array();
     $this->createFile(App::appPath('app/responses/adminHtmlResponse.class.php'), 'app/responses/adminHtmlResponse.class.php.tpl', $params, "Response for admin interface");
     $this->createFile(App::appPath('app/responses/adminLoginHtmlResponse.class.php'), 'app/responses/adminLoginHtmlResponse.class.php.tpl', $params, "Response for login page");
     $inifile->setValue('html', 'adminHtmlResponse', 'responses');
     $inifile->setValue('htmlauth', 'adminLoginHtmlResponse', 'responses');
     $repositoryPath = \jFile::parseJelixPath('lib:jelix-admin-modules');
     $this->registerModulesDir('lib:jelix-admin-modules', $repositoryPath);
     $installConfig->setValue('jacl.installed', '0', $entrypoint);
     $inifile->setValue('jacl.access', '0', 'modules');
     $installConfig->setValue('jacldb.installed', '0', $entrypoint);
     $inifile->setValue('jacldb.access', '0', 'modules');
     $inifile->save();
     $urlsFile = jApp::appConfigPath($inifile->getValue('significantFile', 'urlengine'));
     $xmlMap = new \Jelix\Routing\UrlMapping\XmlMapModifier($urlsFile, true);
     $xmlEp = $xmlMap->getEntryPoint($entrypoint);
     $xmlEp->addUrlAction('/', 'master_admin', 'default:index', null, null, array('default' => true));
     $xmlEp->addUrlModule('', 'master_admin');
     $xmlEp->addUrlInclude('/admin/acl', 'jacl2db_admin', 'urls.xml');
     $xmlEp->addUrlInclude('/admin/auth', 'jauthdb_admin', 'urls.xml');
     $xmlEp->addUrlInclude('/admin/pref', 'jpref_admin', 'urls.xml');
     $xmlEp->addUrlInclude('/auth', 'jauth', 'urls.xml');
     $xmlMap->save();
     $reporter = new \Jelix\Installer\Reporter\Console($output->isVerbose() ? 'notice' : 'warning');
     $installer = new \Jelix\Installer\Installer($reporter);
     $installer->installModules(array('jauth', 'master_admin'), $entrypoint . '.php');
     $authini = new \Jelix\IniFile\IniModifier(App::configPath($entrypoint . '/auth.coord.ini.php'));
     $authini->setValue('after_login', 'master_admin~default:index');
     $authini->setValue('timeout', '30');
     $authini->save();
     $profile = $input->getOption('profile');
     if (!$input->getOption('noauthdb')) {
         if ($profile != '') {
             $authini->setValue('profile', $profile, 'Db');
         }
         $authini->save();
         $installer->setModuleParameters('jauthdb', array('defaultuser' => true));
         $installer->installModules(array('jauthdb', 'jauthdb_admin'), $entrypoint . '.php');
     } else {
         $installConfig->setValue('jauthdb_admin.installed', '0', $entrypoint);
         $installConfig->save();
         $inifile->setValue('jauthdb_admin.access', '0', 'modules');
         $inifile->save();
     }
     if (!$input->getOption('noacl2db')) {
         if ($profile != '') {
             $dbini = new \Jelix\IniFile\IniModifier(App::configPath('profiles.ini.php'));
             $dbini->setValue('jacl2_profile', $profile, 'jdb');
             $dbini->save();
         }
         $installer = new \Jelix\Installer\Installer($reporter);
         $installer->setModuleParameters('jacl2db', array('defaultuser' => true));
         $installer->installModules(array('jacl2db', 'jacl2db_admin'), $entrypoint . '.php');
     } else {
         $installConfig->setValue('jacl2db_admin.installed', '0', $entrypoint);
         $installConfig->save();
         $inifile->setValue('jacl2db_admin.access', '0', 'modules');
         $inifile->save();
     }
     $installer->installModules(array('jpref_admin'), $entrypoint . '.php');
 }