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


PHP PHPWS_Core::isBranch方法代码示例

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


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

示例1: core_update

/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function core_update(&$content, $version)
{
    $content[] = '';
    // Versions previous to 1.9.8 removed 2 May, 2013.
    switch (1) {
        case version_compare($version, '1.9.8', '<'):
            $content[] = '<h2>Sorry</h2>
<p>Your version of phpWebSite is too old to update using 1.8.0. Please update to
1.7.3 and return.</p>';
        case version_compare($version, '2.0.0', '<'):
            if (PHPWS_Core::isBranch()) {
                $content[] = 'This update can only be performed on the hub.';
                return false;
            }
            if (!PHPWS_Boost::inBranch()) {
                $config_dir = PHPWS_SOURCE_DIR . 'config/core/';
                if (!is_writable($config_dir)) {
                    $content[] = '<p>Core update can not continue until your hub installation\'s <strong>config/core/</strong> directory is writable.</p>';
                    return false;
                }
                $source_http = sprintf("<?php\ndefine('PHPWS_SOURCE_HTTP', '%s');\n?>", PHPWS_CORE::getHomeHttp());
                if (!file_put_contents($config_dir . 'source.php', $source_http)) {
                    $content[] = '<p>Could not create config/core/source.php file.</p>';
                    return false;
                }
                $content[] = <<<EOT
                <pre>2.0.0 changes
-----------------
+ Hub/Branch overhaul. Branches pull config, templates, javascript,
  and theme files from hub instead of locally.
+ Added Icon class. Standardizes icons and prevents overlap.
+ Added Tag class: extendable class used with Image and Form2.
+ Added tag_implode function.
+ Created Form2 class.
+ Added CKeditor.
+ Added Lightbox.
+ getConfigFile does not throw error now.
+ Dutch translation updated.
+ Added autoload function for core classes.
+ Source dir derived from file path and not simply "./"
+ Added Image class.
+ Critical functions changed to throw exceptions.
+ Setup steamlined.</pre>

<p><strong>Note:</strong> this update creates a backup of your config/core/config.php file named<br />
config-prior170.php.<br />
If your installation is working, this file may be safely deleted.</p>
<p>IMPORTANT! Many settings in the old config.php have been moved to core/conf/defines.php in the hub.
You can delete all settings <strong>except</strong> the following:</p>
<ul><li>PHPWS_SOURCE_DIR</li>
<li>PHPWS_HOME_DIR</li>
<li>PHPWS_SOURCE_HTTP</li>
<li>SITE_HASH</li>
<li>PHPWS_DSN</li>
<li>PHPWS_TABLE_PREFIX</li></ul>
</pre>
EOT;
            }
            if ($branch = PHPWS_Boost::inBranch(true)) {
                if (!PHPWS_File::copy_directory(PHPWS_SOURCE_DIR . 'javascript/editors/fckeditor/', $branch->directory . 'javascript/editors/fckeditor', true)) {
                    mkdir($branch->directory . 'images/ckeditor/');
                    $this->content[] = dgettext('branch', 'Failed to copy FCKeditor to branch.');
                } else {
                    $content[] = 'FCKeditor not copied to branch. Check directory permissions.';
                }
            } else {
                mkdir(PHPWS_SOURCE_DIR . 'images/ckeditor/');
            }
        case version_compare($version, '2.0.1', '<'):
            $content[] = <<<UPDATES
            <pre>2.0.1 changes
----------------------
+ Fixed captcha trying to pull from branch directory.
+ Fixed templates ignoring use_hub_themes setting.
+ Image class will accept tilde in source directory.
+ Database fix for insert and update on multiple tables.
+ Powerpoint types added to file check.
+ Background mode added to index (allows for selective loading on Ajax calls)
+ Freecap ereg_replace updated to preg_replace
+ Fix for js_calendar
+ Fix for javascript alert script
+ Fixes for Fckeditor and Tinymce
+ Inclusion of ngBackup
</pre>
UPDATES;
        case version_compare($version, '2.0.2', '<'):
            $content[] = <<<UPDATES
<pre>2.0.2 changes
----------------------
+ Added To top icon
+ Fixed table bug where names used in foreign key constrains (in CREATE TABLE statements) were not prefixed correctly
+ Removed HTML from some translations.
+ Fixed bug causing a table name to be repeated in a JOIN statement
+ Fixed some PHP notice errors.
+ Fixed some hub icon directory problems (Thanks Eloi).
+ Image resizing reworked to correct problems with irregular images.
//.........这里部分代码省略.........
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:101,代码来源:update.php

示例2: log

 /**
  * Uses the Pear log class to write a log file to the logs directory
  */
 public static function log($message, $filename, $type = NULL)
 {
     if (!is_writable(LOG_DIRECTORY)) {
         exit(_('Unable to write to log directory.'));
     }
     if (is_file(LOG_DIRECTORY . $filename) && !is_writable(LOG_DIRECTORY . $filename)) {
         exit(sprintf(_('Unable to write %s file.'), $filename));
     }
     $conf = array('mode' => LOG_PERMISSION, 'timeFormat' => LOG_TIME_FORMAT);
     if (PHPWS_Core::isBranch()) {
         $branch_name = Branch::getCurrentBranchName();
         $message = '{' . $branch_name . '} ' . $message;
     } else {
         $message = '{HUB} ' . $message;
     }
     logMessage($message, $filename);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:20,代码来源:PHPWS_Core.php

示例3: checkDirectories

 /**
  * Copy of the setup function of the same name
  * This one also checks the write and read capabilities of
  * the log files.
  */
 public static function checkDirectories(&$content, $home_dir = null, $check_branch = true)
 {
     $errorDir = true;
     if (empty($home_dir)) {
         $home_dir = PHPWS_Boost::getHomeDir();
     }
     $directory[] = $home_dir . 'images/';
     $directory[] = $home_dir . 'files/';
     $directory[] = LOG_DIRECTORY;
     foreach ($directory as $id => $check) {
         if (!is_dir($check)) {
             $dirExist[] = $check;
         } elseif (!is_writable($check)) {
             $writableDir[] = $check;
         }
     }
     if (isset($dirExist)) {
         $content[] = dgettext('boost', 'The following directories need to be created:');
         $content[] = implode("\n", $dirExist);
         $errorDir = false;
     }
     if (isset($writableDir)) {
         $content[] = dgettext('boost', 'The following directories are not writable:');
         $content[] = implode(chr(10), $writableDir);
         $errorDir = false;
     }
     $files = array('boost.log', 'error.log');
     foreach ($files as $log_name) {
         if (is_file('logs/' . $log_name) && (!is_readable('logs/' . $log_name) || !is_writable('logs/' . $log_name))) {
             $content[] = sprintf(dgettext('boost', 'Your logs/%s file must be readable and writable.'), $log_name);
             $errorDir = false;
         }
     }
     if (!isset($GLOBALS['Boost_Ready'])) {
         $GLOBALS['Boost_Ready'] = $errorDir;
     }
     if (!$errorDir) {
         $GLOBALS['Boost_Current_Directory'] = false;
     }
     if ($check_branch && !PHPWS_Core::isBranch() && PHPWS_Core::moduleExists('branch')) {
         $db = new PHPWS_DB('branch_sites');
         $db->addColumn('branch_name');
         $db->addColumn('directory');
         $result = $db->select();
         if (!empty($result)) {
             if (PHPWS_Error::logIfError($result)) {
                 $content[] = dgettext('boost', 'An error occurred when tryingt to access your branch site listing.');
                 $content[] = dgettext('boost', 'Branches could not be checked.');
                 return $errorDir;
             }
             foreach ($result as $branch) {
                 $contentTmp = array();
                 if (!PHPWS_Boost::checkDirectories($contentTmp, $branch['directory'], false)) {
                     $content[] = sprintf(dgettext('boost', 'Checking branch "%s"'), $branch['branch_name']);
                     foreach ($contentTmp as $tmp) {
                         $content[] = $tmp;
                     }
                     $content[] = '';
                     $errorDir = false;
                 }
             }
         }
     }
     return $errorDir;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:70,代码来源:Boost.php

示例4: users_update


//.........这里部分代码省略.........
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.5', '<'):
            $content[] = '<pre>';
            $files = array('conf/error.php', 'conf/languages.php', 'templates/forms/settings.tpl', 'templates/manager/groups.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_5.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.6', '<'):
            $content[] = '<pre>';
            $files = array('templates/forms/forgot.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = '
2.4.6 changes
-------------------
+ Added error check to permission menu.
+ Error for missing user groups now reports user id.
+ Forgot password will work if CAPTCHA is disabled.
+ Using new savePermissions function instead of save.
+ Current_User was calling giveItemPermissions incorrectly.';
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.7', '<'):
            $content[] = '<pre>
2.4.7 changes
-------------------
+ Removed global authorization from change password check since it is not
  written yet.
</pre>';
        case version_compare($currentVersion, '2.4.9', '<'):
            $content[] = '<pre>';
            if (PHPWS_Core::isBranch() || PHPWS_Boost::inBranch()) {
                $user_db = new PHPWS_DB('users');
                $user_db->addWhere('deity', 1);
                $user_db->addColumn('id');
                $user_db->addColumn('username');
                $user_db->setIndexBy('id');
                $user_ids = $user_db->select('col');
                if (!empty($user_ids) && !PHPWS_Error::logIfError($user_ids)) {
                    $group_db = new PHPWS_DB('users_groups');
                    foreach ($user_ids as $id => $username) {
                        $group_db->addWhere('user_id', $id);
                        $result = $group_db->select('row');
                        if (!$result) {
                            $group_db->reset();
                            $group_db->addValue('active', 1);
                            $group_db->addValue('name', $username);
                            $group_db->addValue('user_id', $id);
                            if (!PHPWS_Error::logIfError($group_db->insert())) {
                                $content[] = '--- Created missing group for user: ' . $username;
                            }
                        }
                        $group_db->reset();
                    }
                }
            }
            $content[] = '2.4.9 changes
-----------------
+ Raised sql character limit in default username, display_name, and
  group name installs.
+ Fixed bug with forbidden usernames
+ Added a function to group to remove its permissions upon deletion.
+ Bookmark won\'t return a user to a authkey page if their session dies.
+ Fixed bug #1850815 : unknown function itemIsAllowed in Permission.php
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:67,代码来源:update.php


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