当前位置: 首页>>代码示例>>PHP>>正文


PHP jApp::initPaths方法代码示例

本文整理汇总了PHP中jApp::initPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP jApp::initPaths方法的具体用法?PHP jApp::initPaths怎么用?PHP jApp::initPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jApp的用法示例。


在下文中一共展示了jApp::initPaths方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testEntryPointsList

 function testEntryPointsList()
 {
     jApp::saveContext();
     jApp::initPaths(dirname(__FILE__) . '/app1/');
     $app = new testInstallApp('project_empty.xml');
     $this->assertEquals(array(), $app->getEntryPointsList());
     $app = new testInstallApp('project_empty2.xml');
     $this->assertEquals(array(), $app->getEntryPointsList());
     $app = new testInstallApp('project.xml');
     $list = $app->getEntryPointsList();
     $this->assertEquals(2, count($list));
     $ep = $app->getEntryPointInfo('index');
     $this->assertFalse($ep->isCliScript);
     $this->assertEquals('/index.php', $ep->scriptName);
     $this->assertEquals('index.php', $ep->file);
     $this->assertEquals('', $ep->type);
     $this->assertEquals('aaa', $ep->config->startModule);
     $ep = $app->getEntryPointInfo('foo');
     $this->assertFalse($ep->isCliScript);
     $this->assertEquals('/foo.php', $ep->scriptName);
     $this->assertEquals('foo.php', $ep->file);
     $this->assertEquals('', $ep->type);
     $this->assertEquals('foo', $ep->config->startModule);
     jApp::restoreContext();
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:25,代码来源:installAppTest.php

示例2: 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());
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:57,代码来源:jAppContextTest.php

示例3: initAppPaths

 function initAppPaths($applicationDir)
 {
     $applicationDir = rtrim($applicationDir, '/');
     $applicationDir = rtrim($applicationDir, '\\');
     $appname = basename($applicationDir);
     $search = array('%appdir%', '%appname%');
     $replace = array($applicationDir, $appname);
     jApp::initPaths($applicationDir . '/', str_replace($search, $replace, $this->layoutWwwPath), str_replace($search, $replace, $this->layoutVarPath), str_replace($search, $replace, $this->layoutLogPath), str_replace($search, $replace, $this->layoutConfigPath), str_replace($search, $replace, $this->layoutScriptsPath));
     jApp::setTempBasePath(str_replace($search, $replace, $this->layoutTempPath));
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:10,代码来源:JelixScriptCommandConfig.class.php

示例4: realpath

<?php

/**
* @package   amigatlk
* @subpackage
* @author    your name
* @copyright 2011 your name
* @link      http://www.yourwebsite.undefined
* @license    All rights reserved
*/
require realpath(__DIR__ . '/../lib/jelix/') . '/' . 'init.php';
jApp::initPaths(__DIR__ . '/', __DIR__ . '/www/', __DIR__ . '/var/', __DIR__ . '/var/log/', __DIR__ . '/var/config/', __DIR__ . '/scripts/');
jApp::setTempBasePath(realpath(__DIR__ . '/../temp/amigatlk/') . '/');
开发者ID:brunonymous,项目名称:bubux-php-scripts,代码行数:13,代码来源:application.init.php

示例5:

<?php

/**
* @package   lizmap
* @subpackage
* @author    3liz
* @copyright 2011 3liz
* @link      http://3liz.com
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
$appPath = __DIR__ . '/';
require $appPath . '../lib/jelix/init.php';
jApp::initPaths($appPath);
jApp::setTempBasePath(realpath($appPath . '../temp/lizmap/') . '/');
开发者ID:laurentj,项目名称:lizmap-web-client,代码行数:14,代码来源:application.init.php

示例6: dirname

<?php

/**
* @package   havefnubb
* @subpackage havefnubb
* @author    FoxMaSk
* @contributor Laurentj
* @copyright 2008-2011 FoxMaSk, 2012 Laurentj
* @link      http://havefnubb.org
* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
*/
$appPath = dirname(__FILE__) . '/';
require $appPath . '../lib/jelix/init.php';
jApp::initPaths($appPath, realpath($appPath . '../') . DIRECTORY_SEPARATOR, $appPath . 'var/' . DIRECTORY_SEPARATOR, $appPath . 'var/log/' . DIRECTORY_SEPARATOR, $appPath . 'var/config/' . DIRECTORY_SEPARATOR, $appPath . 'scripts/' . DIRECTORY_SEPARATOR);
jApp::setTempBasePath(realpath($appPath . '../temp/havefnubb/') . '/');
开发者ID:havefnubb,项目名称:havefnubb,代码行数:15,代码来源:application.init.php


注:本文中的jApp::initPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。