本文整理汇总了PHP中jApp::configPath方法的典型用法代码示例。如果您正苦于以下问题:PHP jApp::configPath方法的具体用法?PHP jApp::configPath怎么用?PHP jApp::configPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jApp
的用法示例。
在下文中一共展示了jApp::configPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
function install()
{
if (self::$key === null) {
$cryptokey = \Defuse\Crypto\Key::createNewRandomKey();
self::$key = $cryptokey->saveToAsciiSafeString();
}
$authconfig = $this->getConfigIni()->getValue('auth', 'coordplugins');
$authconfigMaster = $this->getLocalConfigIni()->getValue('auth', 'coordplugins');
$forWS = in_array($this->entryPoint->type, array('json', 'jsonrpc', 'soap', 'xmlrpc'));
if (!$authconfig || $forWS && $authconfig == $authconfigMaster) {
if ($forWS) {
$pluginIni = 'authsw.coord.ini.php';
} else {
$pluginIni = 'auth.coord.ini.php';
}
$authconfig = dirname($this->entryPoint->getConfigFile()) . '/' . $pluginIni;
if ($this->firstExec('auth:' . $authconfig)) {
// no configuration, let's install the plugin for the entry point
$this->config->setValue('auth', $authconfig, 'coordplugins');
if (!file_exists(jApp::configPath($authconfig))) {
$this->copyFile('var/config/' . $pluginIni, jApp::configPath($authconfig));
}
}
}
$this->getLocalConfigIni()->setValue('persistant_encryption_key', self::$key, 'coordplugin_auth');
}
示例2: install
function install()
{
// installer le CSS
$cssFile = jApp::wwwPath('css/localiz.css');
if (!file_exists($cssFile)) {
$this->copyFile('css/localiz.css', $cssFile);
}
// installer le JS
$jsFile = jApp::wwwPath('js/localiz.js');
if (!file_exists($jsFile)) {
$this->copyFile('js/localiz.js', $jsFile);
}
// conf DB
$localConfFile = jApp::configPath('localconfig.ini.php');
if (file_exists($localConfFile)) {
$ini = new jIniFileModifier($localConfFile);
$ini->setValue('db_driver', 'pgsql', 'localiz_plugin');
$ini->setValue('db_host', 'pgpool', 'localiz_plugin');
$ini->setValue('db_port', '5432', 'localiz_plugin');
$ini->setValue('db_database', 'refgeo2', 'localiz_plugin');
$ini->setValue('db_user', 'visu', 'localiz_plugin');
$ini->setValue('db_password', 'visu', 'localiz_plugin');
$ini->setValue('db_query', "select oid, geometrytype, value, label, longlabel, xmin, ymin, xmax, ymax from MYTABLE where label like '%s%%'", 'localiz_plugin');
/* Ex with plain text search
"select oid, typcode, geometrytype(geom) as geometrytype, code as value, lib || complement as label,
typ || ' ' || lib || complement || ' (' || code || ')' as longlabel,
st_xmin(st_transform(bbox, 4326)) xmin, st_ymin(st_transform(bbox, 4326)) ymin, st_xmax(st_transform(bbox, 4326)) xmax, st_ymax(st_transform(bbox, 4326)) ymax
from services.ref_search
where (v @@ to_tsquery('fr', regexp_replace('%1$s', '\\s+', '&', 'g')) )
order by st_area(bbox) desc" */
$ini->save();
}
}
示例3: install
function install()
{
if (self::$key === null) {
self::$key = jAuth::getRandomPassword(30, true);
}
$authconfig = $this->config->getValue('auth', 'coordplugins');
$authconfigMaster = $this->config->getValue('auth', 'coordplugins', null, true);
$forWS = in_array($this->entryPoint->type, array('json', 'jsonrpc', 'soap', 'xmlrpc'));
if (!$authconfig || $forWS && $authconfig == $authconfigMaster) {
if ($forWS) {
$pluginIni = 'authsw.coord.ini.php';
} else {
$pluginIni = 'auth.coord.ini.php';
}
$authconfig = dirname($this->entryPoint->configFile) . '/' . $pluginIni;
if ($this->firstExec('auth:' . $authconfig)) {
// no configuration, let's install the plugin for the entry point
$this->config->setValue('auth', $authconfig, 'coordplugins');
if (!file_exists(jApp::configPath($authconfig))) {
$this->copyFile('var/config/' . $pluginIni, jApp::configPath($authconfig));
}
}
}
$localConfigIni = $this->entryPoint->localConfigIni;
$key = $localConfigIni->getValue('persistant_crypt_key', 'coordplugin_auth');
if ($key === 'exampleOfCryptKey' || $key == '') {
$localConfigIni->getMaster()->setValue('persistant_crypt_key', self::$key, 'coordplugin_auth');
}
}
示例4: getMenus
/**
* get the menus to be added inside the ohers menu item
* @return $menus array of menus
*/
public function getMenus()
{
$menus = array();
if (file_exists(jApp::configPath() . '/havefnubb/hfnumenus.xml')) {
$doc = new DOMDocument();
$doc->load(realpath(jApp::configPath()) . '/havefnubb/hfnumenus.xml');
$xpath = new DOMXPath($doc);
$query = '/menus/menu';
$entries = $xpath->query($query);
$gJConfig = jApp::config();
foreach ($entries as $idx => $menu) {
$queryName = '//name[@lang="' . $gJConfig->locale . '"]';
$items = $xpath->query($queryName);
$name = $items->item($idx)->nodeValue;
$queryItemName = '//menu/itemName';
$items = $xpath->query($queryItemName);
$itemName = $items->item($idx)->nodeValue;
$queryUrl = '//menu/url';
$items = $xpath->query($queryUrl);
$url = $items->item($idx)->nodeValue;
$queryOrder = '//menu/order';
$items = $xpath->query($queryOrder);
$order = $items->item($idx)->nodeValue;
$menus[] = array('itemName' => $itemName, 'name' => $name, 'url' => $url, 'order' => $order);
}
}
return $menus;
}
示例5: process
/**
* action to process the page after the submit
*/
function process()
{
$configFile = jApp::configPath('localconfig.ini.php');
if (!file_exists($configFile)) {
copy(jApp::configPath('localconfig.ini.php.dist'), $configFile);
}
$ini = new jIniFileModifier($configFile);
$_SESSION['installdemo'] = $_POST['installdemo'] == 'on';
$parameters = $ini->getValue('lizmap.installparam', 'modules');
if ($parameters === null) {
$parameters = '';
}
if (strpos($parameters, 'demo') === false) {
if ($_SESSION['installdemo']) {
$parameters .= trim($parameters) == '' ? 'demo' : ',demo';
}
} else {
if (!$_SESSION['installdemo']) {
$parameters = str_replace('demo', '', $parameters);
}
}
$ini->setValue('lizmap.installparam', $parameters, 'modules');
$ini->save();
unset($_SESSION['installdemo']);
return 0;
}
示例6: index
/**
* Main page
*/
public function index()
{
$submit = $this->param('validate');
if ($submit == jLocale::get('hfnucontact~contact.form.saveBt')) {
$form = jForms::fill('hfnucontact~admincontact');
$rep = $this->getResponse('redirect');
if (!$form->check()) {
$rep->action = 'hfnucontact~admin:index';
return $rep;
}
$HfnucontactConfig = new jIniFileModifier(jApp::configPath('defaultconfig.ini.php'));
$HfnucontactConfig->setValue('email_contact', $this->param('contact'), 'hfnucontact');
$HfnucontactConfig->save();
jMessage::add(jLocale::get('hfnucontact~contact.admin.form.email.saved'), 'ok');
jForms::destroy('hfnucontact~admincontact');
$rep->action = 'hfnucontact~admin:index';
return $rep;
} else {
$form = jForms::create('hfnucontact~admincontact');
}
$form->setData('contact', jApp::config()->hfnucontact['email_contact']);
$rep = $this->getResponse('html');
$tpl = new jTpl();
$tpl->assign('form', $form);
$rep->body->assign('MAIN', $tpl->fetch('hfnucontact~admincontact'));
$rep->body->assign('selectedMenuItem', 'contact');
return $rep;
}
示例7: install
function install()
{
if (!$this->firstDbExec()) {
return;
}
// --- install table for session storage if needed
$sessionStorage = $this->config->getValue("storage", "sessions");
$sessionDao = $this->config->getValue("dao_selector", "sessions");
$sessionProfile = $this->config->getValue("dao_db_profile", "sessions");
if ($sessionStorage == "dao" && $sessionDao == "jelix~jsession") {
$this->execSQLScript('sql/install_jsession.schema');
}
// --- install table for jCache if needed
$cachefile = jApp::configPath('profiles.ini.php');
if (file_exists($cachefile)) {
$ini = new \Jelix\IniFile\IniModifier($cachefile);
foreach ($ini->getSectionList() as $section) {
if (substr($section, 0, 7) != 'jcache:') {
continue;
}
$driver = $ini->getValue('driver', $section);
$dao = $ini->getValue('dao', $section);
$this->useDbProfile($ini->getValue('dbprofile', $section));
if ($driver == 'db' && $dao == 'jelix~jcache' && $this->firstExec('cachedb:' . $this->dbProfile)) {
$this->execSQLScript('sql/install_jcache.schema');
}
}
}
}
示例8: testContext
function testContext()
{
$appPath = jApp::appPath();
$varPath = jApp::varPath();
$logPath = jApp::logPath();
$configPath = jApp::configPath();
$wwwPath = jApp::wwwPath();
$scriptsPath = jApp::scriptsPath();
$tempPath = jApp::tempPath();
// first save
jApp::saveContext();
// verify that we still have the current path
$this->assertEquals($appPath, jApp::appPath());
$this->assertEquals($varPath, jApp::varPath());
$this->assertEquals($logPath, jApp::logPath());
$this->assertEquals($configPath, jApp::configPath());
$this->assertEquals($wwwPath, jApp::wwwPath());
$this->assertEquals($scriptsPath, jApp::scriptsPath());
$this->assertEquals($tempPath, jApp::tempPath());
// change the path
jApp::initPaths('/myapp/');
$this->assertEquals('/myapp/', jApp::appPath());
$this->assertEquals('/myapp/var/', jApp::varPath());
$this->assertEquals('/myapp/var/log/', jApp::logPath());
$this->assertEquals('/myapp/var/config/', jApp::configPath());
$this->assertEquals('/myapp/www/', jApp::wwwPath());
$this->assertEquals('/myapp/scripts/', jApp::scriptsPath());
$this->assertEquals($tempPath, jApp::tempPath());
// second save
jApp::saveContext();
jApp::initPaths('/myapp2/');
$this->assertEquals('/myapp2/', jApp::appPath());
$this->assertEquals('/myapp2/var/', jApp::varPath());
$this->assertEquals('/myapp2/var/log/', jApp::logPath());
$this->assertEquals('/myapp2/var/config/', jApp::configPath());
$this->assertEquals('/myapp2/www/', jApp::wwwPath());
$this->assertEquals('/myapp2/scripts/', jApp::scriptsPath());
$this->assertEquals($tempPath, jApp::tempPath());
// pop the second save, we should be with the first saved values
jApp::restoreContext();
$this->assertEquals('/myapp/', jApp::appPath());
$this->assertEquals('/myapp/var/', jApp::varPath());
$this->assertEquals('/myapp/var/log/', jApp::logPath());
$this->assertEquals('/myapp/var/config/', jApp::configPath());
$this->assertEquals('/myapp/www/', jApp::wwwPath());
$this->assertEquals('/myapp/scripts/', jApp::scriptsPath());
$this->assertEquals($tempPath, jApp::tempPath());
// pop the first save, we should be with initial paths
jApp::restoreContext();
$this->assertEquals($appPath, jApp::appPath());
$this->assertEquals($varPath, jApp::varPath());
$this->assertEquals($logPath, jApp::logPath());
$this->assertEquals($configPath, jApp::configPath());
$this->assertEquals($wwwPath, jApp::wwwPath());
$this->assertEquals($scriptsPath, jApp::scriptsPath());
$this->assertEquals($tempPath, jApp::tempPath());
}
示例9: install
function install()
{
if ($this->firstExec('cacheqgis')) {
$profiles = new jIniFileModifier(jApp::configPath('profiles.ini.php'));
if (!$profiles->isSection('jcache:qgisprojects')) {
$profiles->setValues(array('enabled' => 1, 'driver' => 'file', 'ttl' => 0), 'jcache:qgisprojects');
$profiles->save();
}
}
}
示例10: getTests
function getTests()
{
$conf = parse_ini_file(jApp::configPath() . 'profiles.ini.php', true);
if (isset($conf['jkvdb:' . $this->profile])) {
return parent::getTests();
} else {
$this->sendMessage('UTjKVDb cannot be run with ' . $this->profile . ' : undefined profile');
return array();
}
}
示例11: initPaths
/**
* initialize the application paths
*
* Warning: given paths should be ended by a directory separator.
* @param string $appPath application directory
* @param string $wwwPath www directory
* @param string $varPath var directory
* @param string $logPath log directory
* @param string $configPath config directory
* @param string $scriptPath scripts directory
*/
public static function initPaths($appPath, $wwwPath = null, $varPath = null, $logPath = null, $configPath = null, $scriptPath = null)
{
self::$appPath = $appPath;
self::$wwwPath = is_null($wwwPath) ? $appPath . 'www/' : $wwwPath;
self::$varPath = is_null($varPath) ? $appPath . 'var/' : $varPath;
self::$logPath = is_null($logPath) ? self::$varPath . 'log/' : $logPath;
self::$configPath = is_null($configPath) ? self::$varPath . 'config/' : $configPath;
self::$scriptPath = is_null($scriptPath) ? $appPath . 'scripts/' : $scriptPath;
self::$_isInit = true;
}
示例12: __construct
/**
* @param jIniFileModifier $mainConfig the mainconfig.ini.php file
* @param string $configFile the path of the configuration file, relative
* to the var/config directory
* @param string $file the filename of the entry point
* @param string $type type of the entry point ('classic', 'cli', 'xmlrpc'....)
*/
function __construct($mainConfig, $configFile, $file, $type)
{
$this->type = $type;
$this->isCliScript = $type == 'cmdline';
$this->configFile = $configFile;
$this->scriptName = $this->isCliScript ? $file : '/' . $file;
$this->file = $file;
$this->configIni = new jIniMultiFilesModifier($mainConfig, jApp::configPath($configFile));
$this->config = jConfigCompiler::read($configFile, true, $this->isCliScript, $this->scriptName);
}
示例13: setUp
public function setUp()
{
$conf = parse_ini_file(jApp::configPath() . 'auth_class.coord.ini.php', true);
global $gJCoord;
require_once JELIX_LIB_PATH . 'plugins/coord/auth/auth.coord.php';
if (isset($gJCoord->plugins['auth'])) {
$this->oldAuthPlugin = $gJCoord->plugins['auth'];
}
$gJCoord->plugins['auth'] = new AuthCoordPlugin($conf);
$this->config =& $gJCoord->plugins['auth']->config;
$_SESSION[$this->config['session_name']] = new jAuthDummyUser();
jAuth::login('laurent', 'foo', false);
}
示例14: install
function install()
{
$doc = new DOMDocument();
$doc->Load(dirname(__FILE__) . '/../module.xml');
$xpath = new DOMXPath($doc);
$xpath->registerNamespace('jelix', "http://jelix.org/ns/module/1.0");
$query = "//jelix:module/jelix:info/jelix:version/text()";
$entries = $xpath->evaluate($query);
$version = $entries->item(0)->nodeValue;
$ini = new jIniFileModifier(jApp::configPath() . 'defaultconfig.ini.php');
$ini->setValue('version', $version, 'havefnubb');
$ini->save();
}
示例15: setUp
public function setUp()
{
if (!file_exists(jApp::configPath() . 'auth_ldap.coord.ini.php')) {
$this->config = null;
return;
}
$conf = parse_ini_file(jApp::configPath() . 'auth_ldap.coord.ini.php', true);
global $gJCoord;
require_once JELIX_LIB_PATH . 'plugins/coord/auth/auth.coord.php';
$gJCoord->plugins['auth'] = new AuthCoordPlugin($conf);
$this->config =& $gJCoord->plugins['auth']->config;
$_SESSION[$this->config['session_name']] = new jAuthDummyUser();
}