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


PHP jApp::setEnv方法代码示例

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


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

示例1: __construct

 function __construct($configFile, $enableErrorHandler = true)
 {
     if (PHP_SAPI != 'cli' && strpos(PHP_SAPI, 'cgi') === false) {
         throw new Exception("Error: you're not allowed to execute this script outside a command line shell.");
     }
     if (PHP_SAPI != 'cli') {
         // only php-cgi used from the command line can be used, not the one called by apache
         if (isset($_SERVER['HTTP_HOST']) || isset($_SERVER['REDIRECT_URL']) || isset($_SERVER['SERVER_PORT'])) {
             throw new Exception("Error: you're not allowed to execute this script with php-cgi outside a command line shell.");
         }
         header('Content-type: text/plain');
         if (!isset($_SERVER['argv'])) {
             $_SERVER['argv'] = array_keys($_GET);
             $_SERVER['argc'] = count($_GET);
         }
         if (!isset($_SERVER['SCRIPT_NAME'])) {
             $_SERVER['SCRIPT_NAME'] = $_SERVER['argv'][0];
         }
         if (!isset($_SERVER['DOCUMENT_ROOT'])) {
             $_SERVER['DOCUMENT_ROOT'] = '';
         }
     }
     jApp::setEnv('cli');
     parent::__construct($configFile, $enableErrorHandler);
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:25,代码来源:jCmdlineCoordinator.class.php

示例2: __construct

 function __construct($configFile, $enableErrorHandler = true)
 {
     if (!jServer::isCLI()) {
         throw new Exception("Error: you're not allowed to execute this script outside a command line shell.");
     }
     jApp::setEnv('cli');
     parent::__construct($configFile, $enableErrorHandler);
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:8,代码来源:jCmdlineCoordinator.class.php

示例3: define

 *   * Neither the name of Sebastian Bergmann nor the names of his
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
jApp::setEnv('phpunit');
if (strpos('/usr/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
}
require_once 'PHPUnit/Autoload.php';
if (version_compare(PHPUnit_Runner_Version::id(), '3.6') == -1) {
    if (extension_loaded('xdebug')) {
        xdebug_disable();
    }
    define('PHPUnit_MAIN_METHOD', 'jelix_TextUI_Command::main');
}
$currentDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
require_once $currentDir . 'classes/command.php';
jelix_TextUI_Command::main();
开发者ID:havefnubb,项目名称:havefnubb,代码行数:31,代码来源:phpunit.inc.php

示例4: dirname

<?php

/**
* @package  jelix
* @subpackage testapp
* @author   Laurent Jouanneau
* @contributor Rahal Aboulfeth
* @copyright 2009-2010 Laurent Jouanneau, 2011 Rahal Aboulfeth
* @link     http://jelix.org
* @licence  http://www.gnu.org/licenses/gpl.html GNU General Public Licence, see LICENCE file
*/
require_once dirname(__FILE__) . '/../application.init.php';
jApp::setEnv('install');
jAppManager::close();
$installer = new jInstaller(new textInstallReporter());
$installer->installApplication();
jAppManager::clearTemp();
jAppManager::open();
开发者ID:hadrienl,项目名称:jelix,代码行数:18,代码来源:installer.php

示例5: exit

}
// ------------- retrieve the name of the jelix command
if ($_SERVER['argc'] < 2) {
    echo "Error: command is missing. See '" . $_SERVER['argv'][0] . " help'.\n";
    exit(1);
}
$argv = $_SERVER['argv'];
$scriptName = array_shift($argv);
// shift the script name
$commandName = array_shift($argv);
// get the command name
// ------------ load the config and retrieve the command object
require JELIX_SCRIPTS_PATH . 'includes/JelixScript.class.php';
set_error_handler('JelixScriptsErrorHandler');
set_exception_handler('JelixScriptsExceptionHandler');
$config = JelixScript::loadConfig();
$command = JelixScript::getCommand($commandName, $config);
if (!jApp::isInit()) {
    echo "Error: should run within an application\n";
    exit(1);
}
if ($command->applicationRequirement == JelixScriptCommand::APP_MUST_NOT_EXIST) {
    echo "Error: This command doesn't apply on an existing application\n";
    exit(1);
}
jApp::setEnv('jelix-scripts');
JelixScript::checkTempPath();
// --------- launch the command now
$command->init($argv);
$command->run();
exit(0);
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:31,代码来源:cmd.inc.php

示例6: dirname

<?php

require_once dirname(__FILE__) . '/../application.init.php';
jApp::setEnv('jelixtests');
function jelix_init_test_env()
{
    require_once JELIX_LIB_CORE_PATH . 'jConfigCompiler.class.php';
    global $gJConfig;
    $gJConfig = jConfigCompiler::read('index/config.ini.php', false, true);
}
开发者ID:hadrienl,项目名称:jelix,代码行数:10,代码来源:bootstrap.php

示例7: run

 public function run()
 {
     require_once LIB_PATH . 'clearbricks/jelix.inc.php';
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     $appPath = $this->getParam('path');
     $appPath = $this->getRealPath($appPath);
     $appName = basename($appPath);
     $appPath .= '/';
     if (file_exists($appPath)) {
         throw new Exception("this application is already created");
     }
     $this->config = JelixScript::loadConfig($appName);
     $this->config->infoIDSuffix = $this->config->newAppInfoIDSuffix;
     $this->config->infoWebsite = $this->config->newAppInfoWebsite;
     $this->config->infoLicence = $this->config->newAppInfoLicence;
     $this->config->infoLicenceUrl = $this->config->newAppInfoLicenceUrl;
     $this->config->infoLocale = $this->config->newAppInfoLocale;
     $this->config->infoCopyright = $this->config->newAppInfoCopyright;
     $this->config->initAppPaths($appPath);
     jApp::setEnv('jelix-scripts');
     jApp::initLegacy();
     JelixScript::checkTempPath();
     if ($p = $this->getOption('-wwwpath')) {
         $wwwpath = path::real($appPath . $p, false) . '/';
     } else {
         $wwwpath = jApp::wwwPath();
     }
     $this->createDir($appPath);
     $this->createDir(jApp::tempBasePath());
     $this->createDir($wwwpath);
     $varPath = jApp::varPath();
     $configPath = jApp::configPath();
     $this->createDir($varPath);
     $this->createDir(jApp::logPath());
     $this->createDir($configPath);
     $this->createDir($configPath . 'index/');
     $this->createDir($varPath . 'overloads/');
     $this->createDir($varPath . 'themes/');
     $this->createDir($varPath . 'themes/default/');
     $this->createDir($varPath . 'uploads/');
     $this->createDir($varPath . 'sessions/');
     $this->createDir($varPath . 'mails/');
     $this->createDir($appPath . 'install');
     $this->createDir($appPath . 'modules');
     $this->createDir($appPath . 'plugins');
     $this->createDir($appPath . 'plugins/coord/');
     $this->createDir($appPath . 'plugins/tpl/');
     $this->createDir($appPath . 'plugins/tpl/common');
     $this->createDir($appPath . 'plugins/tpl/html');
     $this->createDir($appPath . 'plugins/tpl/text');
     $this->createDir($appPath . 'plugins/db/');
     $this->createDir($appPath . 'plugins/auth/');
     $this->createDir($appPath . 'responses');
     $this->createDir($appPath . 'tests');
     $this->createDir(jApp::scriptsPath());
     $param = array();
     $param['default_id'] = $appName . $this->config->infoIDSuffix;
     if ($this->getOption('-nodefaultmodule')) {
         $param['tplname'] = 'jelix~defaultmain';
         $param['modulename'] = 'jelix';
     } else {
         // note: since module name are used for name of generated name,
         // only this characters are allowed
         $param['modulename'] = preg_replace('/([^a-zA-Z_0-9])/', '_', $appName);
         $param['tplname'] = $param['modulename'] . '~main';
     }
     $param['config_file'] = 'index/config.ini.php';
     $param['rp_temp'] = $this->getRelativePath($appPath, jApp::tempBasePath());
     $param['rp_var'] = $this->getRelativePath($appPath, jApp::varPath());
     $param['rp_log'] = $this->getRelativePath($appPath, jApp::logPath());
     $param['rp_conf'] = $this->getRelativePath($appPath, $configPath);
     $param['rp_www'] = $this->getRelativePath($appPath, $wwwpath);
     $param['rp_cmd'] = $this->getRelativePath($appPath, jApp::scriptsPath());
     $param['rp_jelix'] = $this->getRelativePath($appPath, JELIX_LIB_PATH);
     $param['rp_app'] = $this->getRelativePath($wwwpath, $appPath);
     $this->createFile(jApp::logPath() . '.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::varPath() . 'mails/.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::varPath() . 'sessions/.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::varPath() . 'overloads/.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::varPath() . 'themes/default/.dummy', 'dummy.tpl', array());
     $this->createFile($appPath . 'plugins/.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::scriptsPath() . '.dummy', 'dummy.tpl', array());
     $this->createFile(jApp::tempBasePath() . '.dummy', 'dummy.tpl', array());
     $this->createFile($appPath . '.htaccess', 'htaccess_deny', $param, "Configuration file for Apache");
     $this->createFile($appPath . 'project.xml', 'project.xml.tpl', $param, "Project description file");
     $this->createFile($appPath . 'cmd.php', 'cmd.php.tpl', $param, "Script for developer commands");
     $this->createFile($configPath . 'defaultconfig.ini.php', 'var/config/defaultconfig.ini.php.tpl', $param, "Main configuration file");
     $this->createFile($configPath . 'defaultconfig.ini.php.dist', 'var/config/defaultconfig.ini.php.tpl', $param, "Main configuration file for your repository");
     $this->createFile($configPath . 'profiles.ini.php', 'var/config/profiles.ini.php.tpl', $param, "Profiles file");
     $this->createFile($configPath . 'profiles.ini.php.dist', 'var/config/profiles.ini.php.tpl', $param, "Profiles file for your repository");
     $this->createFile($configPath . 'preferences.ini.php', 'var/config/preferences.ini.php.tpl', $param, "Preferences file");
     $this->createFile($configPath . 'urls.xml', 'var/config/urls.xml.tpl', $param, "URLs mapping file");
     //$this->createFile(JELIX_APP_CONFIG_PATH.'installer.ini.php', 'var/config/installer.ini.php.tpl', $param);
     $this->createFile($configPath . 'index/config.ini.php', 'var/config/index/config.ini.php.tpl', $param, "Entry point configuration file");
     $this->createFile($appPath . 'responses/myHtmlResponse.class.php', 'responses/myHtmlResponse.class.php.tpl', $param, "Main response class");
     $this->createFile($appPath . 'install/installer.php', 'installer/installer.php.tpl', $param, "Installer script");
     $this->createFile($appPath . 'tests/runtests.php', 'tests/runtests.php', $param, "Tests script");
     $temp = dirname(jApp::tempBasePath());
     if (file_exists($temp . '/.gitignore')) {
         $gitignore = file_get_contents($temp . '/.gitignore') . "\n" . $appName . "/*\n";
//.........这里部分代码省略.........
开发者ID:havefnubb,项目名称:havefnubb,代码行数:101,代码来源:createapp.cmd.php

示例8: require

<?php
/**
* @package   havefnubb
* @subpackage havefnubb
* @author    Olivier Demah
* @copyright 2010 Olivier Demah
* @link      http://www.havefnubb.org
* @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
*/
require ('havefnubb/application.init.php');
jApp::setEnv('webinstall');

require('lib/installwizard/installWizard.php');

$config = 'havefnubb/migration/wizard.ini.php';

$install = new installWizard($config);
$install->run(!isAppInstalled());
开发者ID:havefnubb,项目名称:havefnubb,代码行数:18,代码来源:migration.php


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