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


PHP jApp::isInit方法代码示例

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


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

示例1: checkAppOpened

/**
 * check if the application is opened. If not, it displays the yourapp/install/closed.html
 * file with a http error (or lib/jelix/installer/closed.html), and exit.
 * This function should be called in all entry point, before the creation of the coordinator.
 * @see jAppManager
 * @todo migrate the code to jAppManager or jApp
 */
function checkAppOpened()
{
    if (!jApp::isInit()) {
        header("HTTP/1.1 500 Application not available");
        header('Content-type: text/html');
        echo "checkAppOpened: jApp is not initialized!";
        exit(1);
    }
    if (file_exists(jApp::configPath('CLOSED'))) {
        $message = file_get_contents(jApp::configPath('CLOSED'));
        if (jServer::isCLI()) {
            echo "Application closed." . ($message ? "\n{$message}\n" : "\n");
            exit(1);
        }
        if (file_exists(jApp::appPath('install/closed.html'))) {
            $file = jApp::appPath('install/closed.html');
        } else {
            $file = JELIX_LIB_PATH . 'installer/closed.html';
        }
        header("HTTP/1.1 500 Application not available");
        header('Content-type: text/html');
        echo str_replace('%message%', $message, file_get_contents($file));
        exit(1);
    }
}
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:32,代码来源:init.php

示例2: checkAppPaths

 function checkAppPaths()
 {
     $ok = true;
     if (!defined('JELIX_LIB_PATH') || !jApp::isInit()) {
         throw new Exception($this->messages->get('path.core'));
     }
     if (!file_exists(jApp::tempBasePath()) || !is_writable(jApp::tempBasePath())) {
         $this->error('path.temp');
         $ok = false;
     }
     if (!file_exists(jApp::logPath()) || !is_writable(jApp::logPath())) {
         $this->error('path.log');
         $ok = false;
     }
     if (!file_exists(jApp::varPath())) {
         $this->error('path.var');
         $ok = false;
     }
     if (!file_exists(jApp::configPath())) {
         $this->error('path.config');
         $ok = false;
     } elseif ($this->checkForInstallation) {
         if (!is_writable(jApp::configPath())) {
             $this->error('path.config.writable');
             $ok = false;
         }
         if (file_exists(jApp::configPath('profiles.ini.php')) && !is_writable(jApp::configPath('profiles.ini.php'))) {
             $this->error('path.profiles.writable');
             $ok = false;
         }
         if (file_exists(jApp::mainConfigFile()) && !is_writable(jApp::mainConfigFile())) {
             $this->error('path.mainconfig.writable');
             $ok = false;
         } elseif (file_exists(jApp::configPath('defaultconfig.ini.php')) && !is_writable(jApp::configPath('defaultconfig.ini.php'))) {
             $this->error('path.mainconfig.writable');
             $ok = false;
         }
         if (file_exists(jApp::configPath('installer.ini.php')) && !is_writable(jApp::configPath('installer.ini.php'))) {
             $this->error('path.installer.writable');
             $ok = false;
         }
     }
     if (!file_exists(jApp::wwwPath())) {
         $this->error('path.www');
         $ok = false;
     }
     foreach ($this->otherPaths as $path) {
         $realPath = jFile::parseJelixPath($path);
         if (!file_exists($realPath)) {
             $this->error('path.custom.not.exists', array($path));
             $ok = false;
         } else {
             if (!is_writable($realPath)) {
                 $this->error('path.custom.writable', array($path));
                 $ok = false;
             } else {
                 $this->ok('path.custom.ok', array($path));
             }
         }
     }
     if ($ok) {
         $this->ok('paths.ok');
     } else {
         throw new Exception($this->messages->get('too.critical.error'));
     }
     /*if(!isset($GLOBALS['config_file']) ||
          empty($GLOBALS['config_file']) ||
          !file_exists(jApp::configPath($GLOBALS['config_file']))){
           throw new Exception($this->messages->get('config.file'));
       }*/
     return $ok;
 }
开发者ID:laurentj,项目名称:lizmap-web-client,代码行数:72,代码来源:jInstallChecker.class.php

示例3: error_reporting

*/
// caller script should setup :
// $commandName
error_reporting(E_ALL);
define('JELIX_SCRIPTS_PATH', dirname(__FILE__) . '/../');
if (PHP_SAPI != 'cli') {
    echo "You must use the CLI version of PHP, not the " . PHP_SAPI . " version\n";
    exit(1);
}
// ------------- retrieve the name of the jelix command
$argv = $_SERVER['argv'];
$scriptName = array_shift($argv);
// shift the script name
// ------------ load the config and retrieve the command object
require JELIX_SCRIPTS_PATH . '../jelix/init.php';
require JELIX_SCRIPTS_PATH . 'includes/JelixScript.class.php';
set_error_handler('JelixScriptsErrorHandler');
set_exception_handler('JelixScriptsExceptionHandler');
$command = JelixScript::getCommand($commandName, null, true);
if (jApp::isInit()) {
    echo "Error: shouldn't run within an application\n";
    exit(1);
}
if ($command->applicationRequirement == JelixScriptCommand::APP_MUST_EXIST) {
    echo "Error: This command needs an existing application\n";
    exit(1);
}
// --------- launch the command now
$command->init($argv);
$command->run();
exit(0);
开发者ID:hadrienl,项目名称:jelix,代码行数:31,代码来源:scripts.inc.php

示例4: 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

示例5: checkAppPaths

 function checkAppPaths()
 {
     $ok = true;
     if (!defined('JELIX_LIB_PATH') || !jApp::isInit()) {
         throw new Exception($this->messages->get('path.core'));
     }
     if (!file_exists(jApp::tempBasePath()) || !is_writable(jApp::tempBasePath())) {
         $this->error('path.temp');
         $ok = false;
     }
     if (!file_exists(jApp::logPath()) || !is_writable(jApp::logPath())) {
         $this->error('path.log');
         $ok = false;
     }
     if (!file_exists(jApp::varPath())) {
         $this->error('path.var');
         $ok = false;
     }
     if (!file_exists(jApp::configPath())) {
         $this->error('path.config');
         $ok = false;
     } elseif ($this->checkForInstallation) {
         if (!is_writable(jApp::configPath())) {
             $this->error('path.config.writable');
             $ok = false;
         }
         if (file_exists(jApp::configPath('profiles.ini.php')) && !is_writable(jApp::configPath('profiles.ini.php'))) {
             $this->error('path.profiles.writable');
             $ok = false;
         }
         if (file_exists(jApp::configPath('defaultconfig.ini.php')) && !is_writable(jApp::configPath('defaultconfig.ini.php'))) {
             $this->error('path.defaultconfig.writable');
             $ok = false;
         }
         if (file_exists(jApp::configPath('installer.ini.php')) && !is_writable(jApp::configPath('installer.ini.php'))) {
             $this->error('path.installer.writable');
             $ok = false;
         }
     }
     if (!file_exists(jApp::wwwPath())) {
         $this->error('path.www');
         $ok = false;
     }
     foreach ($this->otherPaths as $path) {
         $realPath = str_replace(array('app:', 'lib:', 'var:', 'www:'), array(jApp::appPath(), LIB_PATH, jApp::varPath(), jApp::wwwPath()), $path);
         if (!file_exists($realPath)) {
             $this->error('path.custom.not.exists', array($path));
             $ok = false;
         } else {
             if (!is_writable($realPath)) {
                 $this->error('path.custom.writable', array($path));
                 $ok = false;
             } else {
                 $this->ok('path.custom.ok', array($path));
             }
         }
     }
     if ($ok) {
         $this->ok('paths.ok');
     } else {
         throw new Exception($this->messages->get('too.critical.error'));
     }
     return $ok;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:64,代码来源:jInstallChecker.class.php


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