rabin 1 gün önce
ebeveyn
işleme
39f0640987
5 değiştirilmiş dosya ile 12 ekleme ve 7 silme
  1. 4 1
      boot.php
  2. 1 3
      src/Dever/Helper/Curl.php
  3. 2 1
      src/Dever/Model.php
  4. 4 1
      src/Dever/Route.php
  5. 1 1
      src/Dever/Sql.php

+ 4 - 1
boot.php

@@ -1,5 +1,4 @@
 <?php
-ini_set('display_errors', true);
 header('Content-Type: text/html; charset=utf-8');date_default_timezone_set("PRC");define('DEVER_TIME', $_SERVER['REQUEST_TIME']);define('DEVER_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
 if (defined('DEVER_SERVER')) {
     Dever::server();
@@ -282,6 +281,10 @@ class Dever
     {
         return self::out()->error(...$args);
     }
+    public static function success(...$args)
+    {
+        return self::out()->success(...$args);
+    }
     public static function apply($file)
     {
         [$app, $file] = explode('/', $file, 2);

+ 1 - 3
src/Dever/Helper/Curl.php

@@ -60,9 +60,7 @@ class Curl
     }
     private function init()
     {
-        if (!$this->handle) {
-            $this->handle = curl_init();
-        }
+        $this->handle = curl_init();
     }
     private function param(&$param)
     {

+ 2 - 1
src/Dever/Model.php

@@ -11,6 +11,7 @@ class Model
         [$app, $table] = explode('/', $table, 2);
         $project = Dever::project($app);
         if ($table) {
+            $app = strtolower($app);
             $base = $project['path'] . $path . DIRECTORY_SEPARATOR . $table . '.php';
             if (is_file($base)) {
                 $this->config = include $base;
@@ -20,7 +21,7 @@ class Model
                 if (isset($this->config['store']) && $store == 'default') {
                     $store = $this->config['store'];
                 }
-                $file = $app . DIRECTORY_SEPARATOR . $table . '.php';
+                $file = $app. DIRECTORY_SEPARATOR . $table . '.php';
                 $this->config['app'] = $app;
                 $this->config['table'] = DEVER_PROJECT . '_' . $app . '_' . $table;
                 $this->config['load'] = $app . '/' . $table;

+ 4 - 1
src/Dever/Route.php

@@ -62,7 +62,10 @@ class Route
             $temp = explode('/', $uri, 2);
             $app = $temp[0];
             $uri = $temp[1];
-            if (strpos($uri, 'Api') === 0) {
+            if (strpos($uri, 'Manage/Api') === 0) {
+                $uri = str_replace('Manage/Api/', '', $uri);
+                $uri = 'manage/' . lcfirst($uri);
+            } elseif (strpos($uri, 'Api') === 0) {
                 $uri = str_replace('Api/', '', $uri);
                 $uri = lcfirst($uri);
             }

+ 1 - 1
src/Dever/Sql.php

@@ -194,7 +194,7 @@ class Sql
     }
     public function where($param, &$bind, $field = [], $type = '')
     {
-        if ($param) {
+        if ($param || is_numeric($param)) {
             $first = $second = '';
             if (is_array($param)) {
                 $i = 0;