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


PHP Repository::load_map方法代码示例

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


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

示例1: start

    /**
     * setupを開始する
     */
    public static function start()
    {
        Repository::load_map(getcwd() . "/__repository__.xml");
        $req = new Request("_inc_session_=false");
        if (!$req->is_cli()) {
            exit;
        }
        if (!is_file(File::absolute(getcwd(), "__settings__.php"))) {
            $app_install = Command::stdin("install application");
            if (!empty($app_install)) {
                try {
                    self::download($app_install);
                } catch (RuntimeException $e) {
                    self::error_print("not foud application " . $app_install);
                    exit;
                }
            }
        }
        $settings_path = File::absolute(getcwd(), "__settings__.php");
        if (!is_file($settings_path)) {
            $ref = new ReflectionClass("Object");
            $jump_path = str_replace("\\", "/", dirname(dirname($ref->getFileName())));
            $pwd = str_replace("\\", "/", getcwd());
            $url = Command::stdin("application url", "http://localhost/" . basename(getcwd()));
            if (!empty($url) && substr($url, -1) != "/") {
                $url .= "/";
            }
            $work = Command::stdin("working directory", App::work());
            $mode = Command::stdin("application mode");
            App::config_path($pwd, $url, $work, $mode);
            $config = sprintf(Text::plain('
								<?php
								require_once("%s/jump.php");
								App::config_path(__FILE__,"%s","%s","%s");
							'), $jump_path, $url, $work, $mode);
            File::write($settings_path, $config . "\n");
        } else {
            $maxlen = 0;
            $cmd = $value = null;
            if ($req->is_vars()) {
                $keys = array_keys($req->vars());
                $cmd = array_shift($keys);
                $value = $req->in_vars($cmd);
            }
            self::search_cmd($req, $cmd, $value, $maxlen, __CLASS__);
            foreach (Lib::classes(true, true) as $path => $name) {
                self::search_cmd($req, $cmd, $value, $maxlen, $path);
            }
            self::info($maxlen);
        }
    }
开发者ID:satully,项目名称:dev_socialapp,代码行数:54,代码来源:Setup.php

示例2: config_path

 /**
  * 初期定義
  *
  * @param string $path アプリケーションのルートパス
  * @param string $url アプリケーションのURL
  * @param string $work 一時ファイルを書き出すパス
  * @param string $mode モード
  */
 public static function config_path($path, $url = null, $work = null, $mode = null)
 {
     if (empty($path)) {
         $debug = debug_backtrace(false);
         $debug = array_pop($debug);
         $path = $debug['file'];
     }
     if (is_file($path)) {
         $path = dirname($path);
     }
     self::$path = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $path)) . "/";
     if (isset($work)) {
         if (is_file($work)) {
             $work = dirname($work);
         }
         self::$work = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $work)) . "/";
     } else {
         self::$work = self::$path . 'work/';
     }
     if (!empty($url)) {
         self::$url = preg_replace("/^(.+)\\/\$/", "\\1", $url) . "/";
         self::$surl = preg_replace("/^http:\\/\\/(.+)\$/", "https://\$1", self::$url);
     }
     if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
         list($lang) = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
         list($lang) = explode('-', $lang);
         self::lang($lang);
         self::set_messages(self::$path);
     }
     self::$mode = empty($mode) ? 'noname' : $mode;
     if (is_file(App::path('__repository__.xml'))) {
         Repository::load_map(App::path('__repository__.xml'));
     }
     if (is_file(App::path('__common__.php'))) {
         require_once App::path('__common__.php');
     }
     if (is_file(App::path('__common_' . $mode) . '__.php')) {
         require_once App::path('__common_' . $mode . '__.php');
     }
 }
开发者ID:satully,项目名称:dev_socialapp,代码行数:48,代码来源:App.php


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