• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isInstalled函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中isInstalled函数的典型用法代码示例。如果您正苦于以下问题:PHP isInstalled函数的具体用法?PHP isInstalled怎么用?PHP isInstalled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: initialize

 /**
  * initialize
  * 
  * @param Controller $controller
  * @return void
  * @access public
  */
 function initialize(&$controller)
 {
     /* 未インストール・インストール中の場合はすぐリターン */
     if (!isInstalled()) {
         return;
     }
     $plugins = Configure::read('Baser.enablePlugins');
     /* プラグインフックコンポーネントが実際に存在するかチェックしてふるいにかける */
     $pluginHooks = array();
     if ($plugins) {
         foreach ($plugins as $plugin) {
             $pluginName = Inflector::camelize($plugin);
             if (App::import('Component', $pluginName . '.' . $pluginName . 'Hook')) {
                 $pluginHooks[] = $pluginName;
             }
         }
     }
     /* プラグインフックを初期化 */
     foreach ($pluginHooks as $pluginName) {
         $className = $pluginName . 'HookComponent';
         $this->pluginHooks[$pluginName] =& new $className();
         // 各プラグインの関数をフックに登録する
         if (isset($this->pluginHooks[$pluginName]->registerHooks)) {
             foreach ($this->pluginHooks[$pluginName]->registerHooks as $hookName) {
                 $this->registerHook($hookName, $pluginName);
             }
         }
     }
     /* initialize のフックを実行 */
     $this->executeHook('initialize', $controller);
 }
开发者ID:nojimage,项目名称:basercms,代码行数:38,代码来源:plugin_hook.php


示例2: _check

 function _check()
 {
     if (isInstalled()) {
         $this->Session->setFlash(__('Already installed', true));
         $this->redirect('/');
     }
 }
开发者ID:nicoeche,项目名称:Finalus,代码行数:7,代码来源:wizard_controller.php


示例3: getModuleClasses

 function getModuleClasses($module_dir = _PS_MODULE_DIR_, $sub = '/libs/classes')
 {
     $classes = array();
     foreach (scandir($module_dir) as $file) {
         if (!in_array($file, array('.', '..', 'index.php', '.htaccess', '.DS_Store'))) {
             if ($sub == '/libs/classes' && @is_dir($module_dir . $file . $sub)) {
                 if (in_array($file, array('pst', 'pstmenumanager')) || isInstalled($file)) {
                     $classes = array_merge($classes, getModuleClasses($module_dir . $file . $sub));
                 }
             } elseif (strpos($module_dir, '/libs/classes')) {
                 $path = $module_dir . '/' . $file;
                 if (is_dir($path)) {
                     $classes = array_merge($classes, getModuleClasses($path, ''));
                 } elseif (substr($file, -4) == '.php') {
                     $content = file_get_contents($path);
                     $pattern = '#\\W((abstract\\s+)?class|interface)\\s+(?P<classname>' . basename($file, '.php') . '(?:Core)?)' . '(?:\\s+extends\\s+[a-z][a-z0-9_]*)?(?:\\s+implements\\s+[a-z][a-z0-9_]*(?:\\s*,\\s*[a-z][a-z0-9_]*)*)?\\s*\\{#i';
                     if (preg_match($pattern, $content, $m)) {
                         $path = 'modules/' . str_replace(_PS_MODULE_DIR_, '', $module_dir) . '/';
                         $classes[$m['classname']] = array('path' => $path . $file, 'type' => trim($m[1]));
                         if (substr($m['classname'], -4) == 'Core') {
                             $classes[substr($m['classname'], 0, -4)] = array('path' => '', 'type' => $classes[$m['classname']]['type']);
                         }
                     }
                 }
             }
         }
     }
     return $classes;
 }
开发者ID:simonbonjean,项目名称:PrestaSuperTool-Api,代码行数:29,代码来源:modulesClasses16.php


示例4: __construct

 /**
  * コンストラクタ
  *
  * @return void
  * @access public
  */
 function __construct()
 {
     $this->_view =& ClassRegistry::getObject('view');
     if (isInstalled()) {
         if (ClassRegistry::isKeySet('Permission')) {
             $this->Permission = ClassRegistry::getObject('Permission');
         } else {
             $this->Permission = ClassRegistry::init('Permission');
         }
         if (ClassRegistry::isKeySet('Page')) {
             $this->Page = ClassRegistry::getObject('Page');
         } else {
             $this->Page = ClassRegistry::init('Page');
         }
         if (ClassRegistry::isKeySet('PageCategory')) {
             $this->PageCategory = ClassRegistry::getObject('PageCategory');
         } else {
             $this->PageCategory = ClassRegistry::init('PageCategory');
         }
         if (isset($this->_view->viewVars['siteConfig'])) {
             $this->siteConfig = $this->_view->viewVars['siteConfig'];
         }
         // プラグインのBaserヘルパを初期化
         $this->_initPluginBasers();
     }
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:32,代码来源:baser.php


示例5: isAdminGlobalmenuUsed

 /**
  * 管理システムグローバルメニューの利用可否確認
  * 
  * @return boolean
  * @access public
  */
 function isAdminGlobalmenuUsed()
 {
     if (!isInstalled()) {
         return false;
     }
     if (empty($this->params['admin']) && !empty($this->_view->viewVars['user'])) {
         return false;
     }
     $UserGroup = ClassRegistry::getObject('UserGroup');
     return $UserGroup->isAdminGlobalmenuUsed($this->_view->viewVars['user']['user_group_id']);
 }
开发者ID:nojimage,项目名称:basercms,代码行数:17,代码来源:baser_admin.php


示例6: exec

 public function exec()
 {
     try {
         /* check installed module */
         if (false === isInstalled($this->parm)) {
             /* target module is already installed */
             throw new \err\ComErr('specified module is not installed', 'please check \'spac mod list\'');
         }
         /* confirm */
         echo 'Uninstall ' . $this->parm . ' module.' . PHP_EOL;
         echo 'Are you sure ?(y,n):';
         $line = rtrim(fgets(STDIN), "\n");
         if (!(0 === strcmp($line, 'y') || 0 === strcmp($line, 'Y'))) {
             exit;
         }
         /* delete module files */
         if (true === isDirExists(__DIR__ . '/../../mod/' . $this->parm)) {
             try {
                 delDir(__DIR__ . '/../../mod/' . $this->parm);
             } catch (\Exception $e) {
                 throw new \err\ComErr('could not delete ' . __DIR__ . '/../../mod/' . $this->parm, 'please check directory');
             }
         }
         /* edit module config */
         $modcnf = yaml_parse_file(__DIR__ . '/../../../../conf/module.yml');
         if (false === $modcnf) {
             throw new \err\ComErr('could not read module config file', 'please check ' . __DIR__ . '/../../../../conf/module.yml');
         }
         $newcnf = array();
         foreach ($modcnf as $elm) {
             if (0 === strcmp($this->parm, $elm['name'])) {
                 continue;
             }
             $newcnf[] = $elm;
         }
         if (0 === count($newcnf)) {
             $newcnf = null;
         }
         if (false === copy(__DIR__ . '/../../../../conf/module.yml', __DIR__ . '/../../../../conf/module.yml_')) {
             throw new \err\ComErr('could not create backup of module config', 'please check ' . __DIR__ . '/../../../../conf');
         }
         if (false === file_put_contents(__DIR__ . '/../../../../conf/module.yml', yaml_emit($newcnf))) {
             throw new \err\ComErr('could not edit module config file', 'please check ' . __DIR__ . '/../../../../conf/module.yml');
         }
         unlink(__DIR__ . '/../../../../conf/module.yml_');
         echo 'Successful uninstall ' . $this->parm . ' module ' . PHP_EOL;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:simpart,项目名称:trut,代码行数:50,代码来源:ModDelete.php


示例7: isInstalledOnUsb

/**
 * Test if a command is installed on usb
 * @param String The command to check
 * @return 2 if installed on usb | 1 if not on usb | 0 if not installed
 * 
 */
function isInstalledOnUsb($command)
{
    if (isInstalled($command)) {
        if (file_exists("/usb/usr/bin/{$command}")) {
            return 2;
        } else {
            if (file_exists("/usr/bin/{$command}")) {
                return 1;
            }
        }
    } else {
        return 0;
    }
}
开发者ID:vaginessa,项目名称:reaver,代码行数:20,代码来源:reaver_functions.php


示例8: loadPlugins

function loadPlugins()
{
    if (!isInstalled()) {
        return;
    }
    $pluginsDir = "{$GLOBALS['PROGRAM_DIR']}/plugins";
    $pluginList = getPluginList();
    //
    foreach ($pluginList as $filename => $pluginData) {
        if ($pluginData['isActive']) {
            $filepath = "{$pluginsDir}/{$filename}";
            include $filepath;
        }
    }
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:15,代码来源:plugin_functions.php


示例9: beforeRender

 /**
  * beforeRender
  * 
  * @return void
  * @access public
  */
 function beforeRender()
 {
     /* 未インストール・インストール中の場合はすぐリターン */
     if (!isInstalled()) {
         return;
     }
     $view = ClassRegistry::getObject('View');
     $plugins = Configure::read('BcStatus.enablePlugins');
     // 現在のテーマのフックも登録する(テーマフック)
     // TODO プラグインではないので、プラグインフックというこの仕組の名称自体を検討する必要がある?
     $plugins[] = Configure::read('BcSite.theme');
     /* プラグインフックコンポーネントが実際に存在するかチェックしてふるいにかける */
     $pluginHooks = array();
     if ($plugins) {
         foreach ($plugins as $plugin) {
             $pluginName = Inflector::camelize($plugin);
             if (App::import('Helper', $pluginName . '.' . $pluginName . 'Hook')) {
                 $pluginHooks[] = $pluginName;
             }
         }
     }
     /* プラグインフックを初期化 */
     $vars = array('base', 'webroot', 'here', 'params', 'action', 'data', 'themeWeb', 'plugin');
     $c = count($vars);
     foreach ($pluginHooks as $key => $pluginName) {
         // 各プラグインのプラグインフックを初期化
         $className = $pluginName . 'HookHelper';
         $this->pluginHooks[$pluginName] =& new $className();
         for ($j = 0; $j < $c; $j++) {
             if (isset($view->{$vars[$j]})) {
                 $this->pluginHooks[$pluginName]->{$vars[$j]} = $view->{$vars[$j]};
             }
         }
         // 各プラグインの関数をフックに登録する
         if (isset($this->pluginHooks[$pluginName]->registerHooks)) {
             foreach ($this->pluginHooks[$pluginName]->registerHooks as $hookName) {
                 $this->registerHook($hookName, $pluginName);
             }
         }
     }
     /* beforeRenderをフック */
     $this->executeHook('beforeRender');
 }
开发者ID:ryuring,项目名称:basercms,代码行数:49,代码来源:bc_plugin_hook.php


示例10: exec

 public function exec()
 {
     try {
         /* check specified directory */
         chkRequireConts($this->getPrm());
         $desc = yaml_parse_file($this->getPrm() . 'conf/desc.yml');
         if (false === $desc) {
             throw new \err\ComErr('could not read module description file', 'please check ' . $tgt . 'conf/desc.yml');
         }
         /* check installed module */
         if (true === isInstalled($desc['name'])) {
             /* target module is already installed */
             throw new \err\ComErr('specified module is already installed', 'please check \'spac mod list\'');
         }
         /* copy module contents */
         copyDir($this->getPrm(), __DIR__ . '/../../mod/' . $desc['name']);
         /* add module name to module config file */
         $modcnf = yaml_parse_file(__DIR__ . '/../../../../conf/module.yml');
         $first = false;
         if (null === $modcnf) {
             $first = true;
             $modcnf = array();
         }
         $add = array('name' => $desc['name'], 'select' => false);
         if (true === $first) {
             $add['select'] = true;
         }
         $modcnf[] = $add;
         if (false === copy(__DIR__ . '/../../../../conf/module.yml', __DIR__ . '/../../../../conf/module.yml_')) {
             throw new \err\ComErr('could not create backup of module config', 'please check ' . __DIR__ . '/../../../../conf');
         }
         if (false === file_put_contents(__DIR__ . '/../../../../conf/module.yml', yaml_emit($modcnf))) {
             throw new \err\ComErr('could not edit module config file', 'please check ' . __DIR__ . '/../../../../conf/module.yml');
         }
         unlink(__DIR__ . '/../../../../conf/module.yml_');
         echo 'Successful install ' . $desc['name'] . ' module' . PHP_EOL;
         echo 'You can check installed module \'spac mod list\',' . PHP_EOL;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:simpart,项目名称:trut,代码行数:41,代码来源:ModAdd.php


示例11: exec

 public function exec()
 {
     try {
         if (false === isInstalled($this->parm)) {
             /* target module is already installed */
             throw new \err\ComErr('specified module is not installed', 'please check \'spac mod list\'');
         }
         $desc = yaml_parse_file(__DIR__ . '/../../mod/' . $this->getPrm() . '/conf/desc.yml');
         if (false === $desc) {
             throw new \err\ComErr('could not read module description file', 'please check ' . __DIR__ . '/../../mod/' . $this->getPrm() . '/conf/desc.yml');
         }
         $mcnf = yaml_parse_file(__DIR__ . '/../../../conf/module.yml');
         if (false === $mcnf) {
             throw new \err\ComErr('could not read module config', 'please check ' . __DIR__ . '/../../../conf/module.yml');
         }
         $select = '';
         foreach ($mcnf as $elm) {
             if (true !== $elm['select']) {
                 continue;
             }
             if (0 === strcmp($desc['name'], $elm['name'])) {
                 $select .= '(selected)';
                 break;
             }
         }
         echo '<' . $desc['name'] . ' Module' . $select . '>' . PHP_EOL;
         echo 'Version ' . $desc['version'];
         echo ', Author ' . $desc['author'] . PHP_EOL;
         echo 'URL : ';
         if (true === isset($desc['url'])) {
             echo $desc['url'];
         }
         echo PHP_EOL;
         if (true === isset($desc['desc'])) {
             echo $desc['desc'];
         }
         echo PHP_EOL;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:simpart,项目名称:trut,代码行数:41,代码来源:ModShow.php


示例12: __loadDataToView

 /**
  * View用のデータを読み込む。
  * beforeRenderで呼び出される
  *
  * @return	void
  * @access	private
  */
 function __loadDataToView()
 {
     $this->set('subMenuElements', $this->subMenuElements);
     // サブメニューエレメント
     $this->set('crumbs', $this->crumbs);
     // パンくずなび
     $this->set('search', $this->search);
     $this->set('help', $this->help);
     /* ログインユーザー */
     if (isInstalled() && isset($_SESSION['Auth']['User']) && $this->name != 'Installations') {
         $this->set('user', $_SESSION['Auth']['User']);
         $this->set('favorites', $this->Favorite->find('all', array('conditions' => array('Favorite.user_id' => $_SESSION['Auth']['User']['id']), 'order' => 'Favorite.sort', 'recursive' => -1)));
     }
     /* 携帯用絵文字データの読込 */
     // TODO 実装するかどうか検討する
     /*if(isset($this->params['prefix']) && $this->params['prefix'] == 'mobile' && !empty($this->EmojiData)) {
     			$emojiData = $this->EmojiData->findAll();
     			$this->set('emoji',$this->Emoji->EmojiData($emojiData));
     		}*/
 }
开发者ID:nojimage,项目名称:basercms,代码行数:27,代码来源:baser_app_controller.php


示例13: pageLogin

/**
 * Display the login screen.
 *
 * This screen should also check if PivotX is set up correctly. If it isn't, the
 * user will be redirected to the Troubleshooting or Setup screen.
 *
 */
function pageLogin($template = "normal")
{
    global $PIVOTX;
    if (!isInstalled()) {
        pageSetupUser();
        die;
    }
    $PIVOTX['template']->assign('title', __("Login"));
    $PIVOTX['template']->assign('heading', __("Login"));
    $template = getDefault($_POST['template'], $template);
    if (isMobile()) {
        $template = "mobile";
    }
    $form = getLoginForm($template);
    // If a 'return to' is set, pass it onto the template, but only the 'path' and 'query'
    // part. This means that we do NOT allow redirects to another domain!!
    $returnto = getDefault($_GET['returnto'], $_POST['returnto']);
    if (!empty($returnto)) {
        $returnto = parse_url($returnto);
        $returnto_link = $returnto['path'];
        if (!empty($returnto['query'])) {
            $returnto_link .= '?' . $returnto['query'];
        }
        $form->setvalue('returnto', $returnto_link);
    }
    // Get the validation result
    $result = $form->validate();
    $extraval = array();
    if ($result != FORM_OK) {
        if (isset($_GET['resetpassword']) && isset($_GET['username']) && isset($_GET['id'])) {
            $form->setvalue('username', $_GET['username']);
            $user = $PIVOTX['users']->getUser($_GET['username']);
            if ($user && !empty($user['reset_id']) && $_GET['id'] == $user['reset_id']) {
                $extraval['pass1'] = randomString(8, true);
                $extraval['reset_id'] = '';
                $pass = "'<strong>" . $extraval['pass1'] . "</strong>'";
                $message = "<p>" . __('Your new password is %pass%.') . "</p>";
                $message = str_replace('%pass%', $pass, $message);
                $PIVOTX['messages']->addMessage($message);
                $html = $message;
                $PIVOTX['users']->updateUser($user['username'], $extraval);
                $PIVOTX['events']->add('password_reset', "", $user['username']);
            } else {
                $PIVOTX['messages']->addMessage(__('Oops') . ' - ' . __('Password reset request failed.'));
                debug('Password reset request failed - wrong id.');
            }
        }
        $PIVOTX['template']->assign("html", $html);
        $PIVOTX['template']->assign("form", $form->fetch(true));
    } else {
        $val = $form->getvalues();
        if ($val['resetpassword'] == 1) {
            $can_send_mail = true;
            $user = $PIVOTX['users']->getUser($val['username']);
            if ($user) {
                $extraval['reset_id'] = md5($PIVOTX['config']->get('server_spam_key') . $user['password']);
                $PIVOTX['users']->updateUser($user['username'], $extraval);
                $link = $PIVOTX['paths']['host'] . makeAdminPageLink('login') . '&resetpassword&username=' . urlencode($user['username']) . '&id=' . $extraval['reset_id'];
                $can_send_mail = mailResetPasswordLink(array('name' => $user['username'], 'email' => $user['email'], 'reset_id' => $extraval['reset_id'], 'link' => $link));
            }
            if ($can_send_mail) {
                // Posting this message even if an invalid username is given so
                // crackers can't enumerate usernames.
                $PIVOTX['messages']->addMessage(__('A link to reset your password was sent to your mailbox.'));
            } else {
                $PIVOTX['messages']->addMessage(__('PivotX was not able to send a mail with the reset link.'));
            }
            $PIVOTX['events']->add('request_password', "", $user['username']);
            $PIVOTX['template']->assign("form", $form->fetch(true));
        } elseif ($PIVOTX['session']->login($val['username'], $val['password'], $val['stayloggedin'])) {
            // User successfully logged in... set language and go to Dashboard or 'returnto'
            $currentuser = $PIVOTX['users']->getUser($PIVOTX['session']->currentUsername());
            $PIVOTX['languages']->switchLanguage($currentuser['language']);
            if (!empty($returnto_link)) {
                header("Location: " . $returnto_link);
                die;
            } else {
                if ($template == "normal") {
                    pageDashboard();
                } else {
                    if ($template == "mobile") {
                        header('Location: index.php');
                    } else {
                        pageBookmarklet();
                    }
                }
                die;
            }
        } else {
            // User couldn't be logged in
            $PIVOTX['events']->add('failed_login', "", safeString($_POST['username']));
            $PIVOTX['messages']->addMessage($PIVOTX['session']->getMessage());
            $PIVOTX['template']->assign("form", $form->fetch(true));
//.........这里部分代码省略.........
开发者ID:laiello,项目名称:pivotx-sqlite,代码行数:101,代码来源:pages.php


示例14: displayLogoOnlyHeader

use SubjectsPlus\Control\Installer;
use SubjectsPlus\Control\Querier;
//set varirables needed in header
$subcat = "install";
$page_title = "Installation";
$sessionCheck = 'no';
$no_header = "yes";
$installCheck = 'no';
$updateCheck = 'no';
include "includes/header.php";
//logo only header
displayLogoOnlyHeader();
//find what step we are in
$lintStep = isset($_GET['step']) ? (int) $_GET['step'] : 0;
//if installed already, display message and discontinue
if (isInstalled()) {
    ?>
	<div id="maincontent" style="max-width: 800px; margin-right: auto; margin-left: auto;">
<div class="box required_field">
    <h2 class="bw_head"><?php 
    echo _("Already Installed");
    ?>
</h2>

			<p><?php 
    echo _('There appears to already be an installation of SubjectsPlus. To reinstall please clear old database tables first.');
    ?>
</p>
			<p><a href="login.php"><?php 
    echo _('Log In');
    ?>
开发者ID:breaker84,项目名称:SubjectsPlus,代码行数:31,代码来源:install.php


示例15: __construct

 /**
  * コンストラクタ
  *
  * @return	void
  * @access	private
  */
 function __construct()
 {
     parent::__construct();
     $base = baseUrl();
     // サイト基本設定の読み込み
     if (file_exists(CONFIGS . 'database.php')) {
         $dbConfig = new DATABASE_CONFIG();
         if ($dbConfig->baser['driver']) {
             $SiteConfig = ClassRegistry::init('SiteConfig', 'Model');
             $this->siteConfigs = $SiteConfig->findExpanded();
             if (empty($this->siteConfigs['version'])) {
                 $this->siteConfigs['version'] = $this->getBaserVersion();
                 $SiteConfig->saveKeyValue($this->siteConfigs);
             }
             // テーマの設定
             if ($base) {
                 $reg = '/^' . str_replace('/', '\\/', $base) . '(installations)/i';
             } else {
                 $reg = '/^\\/(installations)/i';
             }
             if (!preg_match($reg, @$_SERVER['REQUEST_URI']) || isInstalled()) {
                 $this->theme = $this->siteConfigs['theme'];
                 // ===============================================================================
                 // テーマ内プラグインのテンプレートをテーマに梱包できるようにプラグインパスにテーマのパスを追加
                 // 実際には、プラグインの場合も下記パスがテンプレートの検索対象となっている為不要だが、
                 // ビューが存在しない場合に、プラグインテンプレートの正規のパスがエラーメッセージに
                 // 表示されてしまうので明示的に指定している。
                 // (例)
                 // [変更後] app/webroot/themed/demo/blog/news/index.ctp
                 // [正 規] app/plugins/blog/views/themed/demo/blog/news/index.ctp
                 // 但し、CakePHPの仕様としてはテーマ内にプラグインのテンプレートを梱包できる仕様となっていないので
                 // 将来的には、blog / mail / feed をプラグインではなくコアへのパッケージングを検討する必要あり。
                 // ※ AppView::_pathsも関連している
                 // ===============================================================================
                 $pluginThemePath = WWW_ROOT . 'themed' . DS . $this->theme . DS;
                 $pluginPaths = Configure::read('pluginPaths');
                 if (!in_array($pluginThemePath, $pluginPaths)) {
                     Configure::write('pluginPaths', am(array($pluginThemePath), $pluginPaths));
                 }
             }
         }
     }
     // TODO beforeFilterでも定義しているので整理する
     if ($this->name == 'CakeError') {
         // モバイルのエラー用
         if (Configure::read('AgentPrefix.on')) {
             $this->layoutPath = Configure::read('AgentPrefix.currentPrefix');
             if (Configure::read('AgentPrefix.currentAgent') == 'mobile') {
                 $this->helpers[] = 'Mobile';
             }
         }
         if ($base) {
             $reg = '/^' . str_replace('/', '\\/', $base) . 'admin/i';
         } else {
             $reg = '/^\\/admin/i';
         }
         if (preg_match($reg, $_SERVER['REQUEST_URI'])) {
             $this->layoutPath = 'admin';
             $this->subDir = 'admin';
         }
     }
     if (Configure::read('AgentPrefix.currentAgent') == 'mobile') {
         if (!Configure::read('Baser.mobile')) {
             $this->notFound();
         }
     }
     if (Configure::read('AgentPrefix.currentAgent') == 'smartphone') {
         if (!Configure::read('Baser.smartphone')) {
             $this->notFound();
         }
     }
     /* 携帯用絵文字のモデルとコンポーネントを設定 */
     // TODO 携帯をコンポーネントなどで判別し、携帯からのアクセスのみ実行させるようにする
     // ※ コンストラクト時点で、$this->params['prefix']を利用できない為。
     // TODO 2008/10/08 egashira
     // beforeFilterに移動してみた。実際に携帯を使うサイトで使えるかどうか確認する
     //$this->uses[] = 'EmojiData';
     //$this->components[] = 'Emoji';
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:85,代码来源:baser_app_controller.php


示例16: testIsInstalled

 /**
  * baserCMSのインストールが完了しているかチェックする
  */
 public function testIsInstalled()
 {
     $installedPath = APP . 'Config' . DS . 'install.php';
     // app/Config/installed.phpが存在しない場合
     if (rename($installedPath, $installedPath . '_copy')) {
         $result = isInstalled();
         $this->assertFalse($result, 'app/Config/installed.phpが存在していない場合にtrueが返ってきます');
     } else {
         $this->markTestIncomplete('app/Config/installed.phpのファイル名変更に失敗したのでテストをスキップしました。');
     }
     // app/Config/installed.phpが存在する場合
     if (rename($installedPath . '_copy', $installedPath)) {
         $result = isInstalled();
         $this->assertTrue($result, 'app/Config/installed.phpが存在している場合にfalseが返ってきます');
     } else {
         $this->markTestIncomplete('app/Config/installed.phpのファイル名変更に失敗したのでテストをスキップしました。');
     }
 }
开发者ID:baserproject,项目名称:basercms,代码行数:21,代码来源:BcBasicsTest.php


示例17: output

// output("Checking for AWStats");
// $is_ok_awstats = isInstalled("[ -f /opt/local/www/awstats/cgi-bin/awstats.pl ] && echo 'exists' || echo 'Not found'", array("exists"), false);
// output($is_ok_awstats ? "AWStats is OK" : "AWStats not found - installing now");
// if(!$is_ok_awstats) {
// 	command("sudo port install awstats");
// }
// check for imagick
output("Checking for PHP imagick");
$is_ok_imagick = isInstalled("[ -f /opt/local/lib/php55/extensions/no-debug-non-zts-20121212/imagick.so ] && echo 'exists' || echo 'Not found'", array("exists"), false);
output($is_ok_imagick ? "PHP imagick is OK" : "PHP imagick not found - installing now");
if (!$is_ok_imagick) {
    command("sudo port install php55-imagick");
}
// check for imagick
output("Checking for PHP memcached");
$is_ok_memcached = isInstalled("[ -f /opt/local/lib/php55/extensions/no-debug-non-zts-20121212/memcached.so ] && echo 'exists' || echo 'Not found'", array("exists"), false);
output($is_ok_memcached ? "PHP memcached is OK" : "PHP memcached not found - installing now");
if (!$is_ok_memcached) {
    command("sudo port install php55-memcached");
}
// is software available
if (!$is_ok_xcode || !$is_ok_macports || !$is_ok_ffmpeg || !$is_ok_php || !$is_ok_imagick || !$is_ok_memcached) {
    goodbye("Update your software as specified above");
}
// ensure sudo power before continuing
enableSuperCow();
output("\nChecking paths");
// check if configuration files are available
checkFile("_conf/httpd.conf", "Required file is missing from your configuration source");
checkFile("_conf/my.cnf", "Required file is missing from your configuration source");
checkFile("_conf/httpd-vhosts.conf", "Required file is missing from your configuration source");
开发者ID:parentnode,项目名称:os_x_environment,代码行数:31,代码来源:update_dev_env.php


示例18: Languages

 function Languages($language = '')
 {
     global $l10n, $PIVOTX;
     if ($language == '') {
         if (!isInstalled()) {
             $language = $this->default;
         } elseif (defined('PIVOTX_INADMIN') || defined('PIVOTX_INEDITOR')) {
             $currentuser = $PIVOTX['users']->getUser($PIVOTX['session']->currentUsername());
             $language = $currentuser['language'];
         } elseif (defined('PIVOTX_INWEBLOG')) {
             $language = $PIVOTX['weblogs']->get('', 'language');
         }
         // Fallback - system default
         if ($language == '') {
             $language = $PIVOTX['config']->get('language');
         }
         // Final fallback - English.
         if ($language == '') {
             $language = $this->default;
         }
     }
     // FIXME: Add check if language exists - fallback to English.
     $l10n['currlang'] = $language;
     $this->loadLanguage($language);
     $this->code = $language;
     $this->name = $this->codes[$language];
 }
开发者ID:laiello,项目名称:pivotx-sqlite,代码行数:27,代码来源:module_lang.php


示例19: __construct

 /**
  * コンストラクタ
  *
  * @param boolean $id
  * @param string $table
  * @param string $ds
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     if (isConsole() && !isInstalled()) {
         App::uses('PageCategory', 'Model');
         $this->PageCategory = new PageCategory(null, null, $ds);
     }
 }
开发者ID:naow9y,项目名称:basercms,代码行数:15,代码来源:Page.php


示例20: find

 /**
  * find
  * 
  * キャッシュビヘイビアが利用状態の場合、モデルデータキャッシュを読み込む
  * 
  * 【AppModelではキャッシュを定義しない事】
  * 自動的に生成されるクラス定義のない関連モデルの処理で勝手にキャッシュを利用されないようにする為
  * (HABTMの更新がうまくいかなかったので)
  * 
  * 【PHP5限定】
  * PHP4では次のような処理ができない為
  * Model ⇒ Behavior ⇒ call_user_func_array ⇒ Model ⇒ Behavior
  * ※ ビヘイビア内で自モデルのメソッドを呼び出しそのメソッド内でさらにビヘイビアを使う
  *
  * @param mixed...
  * @return type 
  * @access public
  */
 function find($conditions = null, $fields = array(), $order = null, $recursive = null)
 {
     $args = func_get_args();
     $cache = true;
     if (isset($args[1]['cache']) && is_bool($args[1]['cache'])) {
         $cache = $args[1]['cache'];
         unset($args[1]['cache']);
     }
     if (PHP5 && isInstalled() && isset($this->Behaviors) && $this->Behaviors->attached('Cache') && $this->Behaviors->enabled('Cache') && Configure::read('debug') == 0) {
         if ($this->cacheEnabled()) {
             return $this->cacheMethod($cache, __FUNCTION__, $args);
         }
     }
     return parent::find($conditions, $fields, $order, $recursive);
 }
开发者ID:nojimage,项目名称:basercms,代码行数:33,代码来源:baser_app_model.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isJSON函数代码示例发布时间:2022-05-15
下一篇:
PHP isIndex函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap