コード例 #1
0
ファイル: init.php プロジェクト: abhijitroy07/mibew
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * File system root directory of the Mibew installations
 */
define('MIBEW_FS_ROOT', dirname(dirname(__FILE__)));
// Initialize autoloader for root classes and external dependecies
$loader = (require_once MIBEW_FS_ROOT . '/vendor/autoload.php');
$loader->addPsr4('', MIBEW_FS_ROOT . '/libs/classes/', true);
$loader->addPsr4('', MIBEW_FS_ROOT . '/plugins/');
// Load system configurations
require_once MIBEW_FS_ROOT . '/libs/common/configurations.php';
$configs = load_system_configs();
// Include system constants file
require_once MIBEW_FS_ROOT . '/libs/common/constants.php';
// Include common libs
require_once MIBEW_FS_ROOT . '/libs/common/verification.php';
require_once MIBEW_FS_ROOT . '/libs/common/locale.php';
require_once MIBEW_FS_ROOT . '/libs/common/csrf.php';
require_once MIBEW_FS_ROOT . '/libs/common/datetime.php';
require_once MIBEW_FS_ROOT . '/libs/common/misc.php';
require_once MIBEW_FS_ROOT . '/libs/common/request.php';
require_once MIBEW_FS_ROOT . '/libs/common/response.php';
require_once MIBEW_FS_ROOT . '/libs/common/string.php';
// We need to get some info from the request. Use symfony wrapper because it's
// the simplest way.
$tmp_request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
// Make session cookie more secure
コード例 #2
0
ファイル: locale.php プロジェクト: aburakovskiy/mibew
/**
 * Returns a value of the home locale.
 *
 * Generally, the locale returned by the function, should be used as a locale
 * for operators' native names.
 *
 * In fact the function returns verified value of "home_locale" variable from
 * the system configurations file.
 *
 * @return string Locale code.
 */
function get_home_locale()
{
    static $home_locale = null;
    if (is_null($home_locale)) {
        $configs = load_system_configs();
        $is_correct = !empty($configs['home_locale']) && locale_pattern_check($configs['home_locale']) && locale_is_available($configs['home_locale']);
        $home_locale = $is_correct ? $configs['home_locale'] : 'en';
    }
    return $home_locale;
}
コード例 #3
0
 /**
  * Initialize installer.
  *
  * @return \Mibew\Maintenance\Installer
  */
 protected function getInstaller()
 {
     if (is_null($this->installer)) {
         $this->installer = new Installer(load_system_configs());
     }
     return $this->installer;
 }