@@ -21,11 +21,11 @@ |
||
21 | 21 | $path = str_replace("\\", DIRECTORY_SEPARATOR, $class); |
22 | 22 | |
23 | 23 | // filepath |
24 | - $abs_path = SOURCE_DIR . DIRECTORY_SEPARATOR . $path . ".php"; |
|
24 | + $abs_path = SOURCE_DIR.DIRECTORY_SEPARATOR.$path.".php"; |
|
25 | 25 | if (!file_exists($abs_path)) { |
26 | - pre('→ ' . $class); |
|
27 | - pre('→ ' . $path); |
|
28 | - pre('→ ' . $abs_path); |
|
26 | + pre('→ '.$class); |
|
27 | + pre('→ '.$path); |
|
28 | + pre('→ '.$abs_path); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // require the file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | if (preg_match('/^asc$/i', $direction)) { |
64 | 64 | return Order::ASC; |
65 | - } else { |
|
65 | + }else { |
|
66 | 66 | return Order::DESC; |
67 | 67 | } |
68 | 68 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | { |
27 | 27 | $namespace = explode('\\', $this->getModelTableMap()); |
28 | 28 | $module = strtolower($namespace[0]); |
29 | - $secret = Config::getInstance()->get($module . '.api.secret'); |
|
29 | + $secret = Config::getInstance()->get($module.'.api.secret'); |
|
30 | 30 | if (NULL === $secret) { |
31 | 31 | $secret = Config::getInstance()->get("api.secret"); |
32 | 32 | } |
33 | 33 | if (NULL === $secret) { |
34 | 34 | $auth = TRUE; |
35 | - } else { |
|
35 | + }else { |
|
36 | 36 | $token = Request::getInstance()->getHeader('X-API-SEC-TOKEN'); |
37 | 37 | if (array_key_exists('API_TOKEN', $this->query)) { |
38 | 38 | $token = $this->query['API_TOKEN']; |
@@ -30,16 +30,16 @@ |
||
30 | 30 | $scripts = $this->getNode("scripts"); |
31 | 31 | |
32 | 32 | //Creamos el parser |
33 | - $compiler->addDebugInfo($scripts)->write('$parser = new \\PSFS\\base\\extension\\AssetsParser(\'' . $this->type . '\')') |
|
33 | + $compiler->addDebugInfo($scripts)->write('$parser = new \\PSFS\\base\\extension\\AssetsParser(\''.$this->type.'\')') |
|
34 | 34 | ->raw(";\n"); |
35 | 35 | |
36 | 36 | //Asociamos el hash |
37 | - $compiler->write('$parser->setHash(\'' . $this->hash . '\')') |
|
37 | + $compiler->write('$parser->setHash(\''.$this->hash.'\')') |
|
38 | 38 | ->raw(";\n"); |
39 | 39 | |
40 | 40 | //Asociamos los ficheros |
41 | 41 | foreach ($scripts->getAttribute("value") as $value) { |
42 | - $compiler->write('$parser->addFile(\'' . $value . '\')')->raw(";\n"); |
|
42 | + $compiler->write('$parser->addFile(\''.$value.'\')')->raw(";\n"); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | //Procesamos los ficheros |
@@ -7,4 +7,4 @@ |
||
7 | 7 | */ |
8 | 8 | Trait BoostrapTrait {} |
9 | 9 | |
10 | -require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php'; |
|
11 | 10 | \ No newline at end of file |
11 | +require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'bootstrap.php'; |
|
12 | 12 | \ No newline at end of file |
@@ -48,7 +48,7 @@ |
||
48 | 48 | return ($aOrder < $bOrder) ? -1 : 1; |
49 | 49 | }); |
50 | 50 | $array['actions'] = []; |
51 | - foreach($this->actions as $action) { |
|
51 | + foreach ($this->actions as $action) { |
|
52 | 52 | $array['actions'][] = $action->__toArray(); |
53 | 53 | } |
54 | 54 | return $array; |
@@ -39,8 +39,8 @@ |
||
39 | 39 | "domain" => $this->getDomain(), |
40 | 40 | "listLabel" => Api::API_LIST_NAME_FIELD, |
41 | 41 | 'modelId' => Api::API_MODEL_KEY_FIELD, |
42 | - 'formUrl' => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('admin-api-form-' . $this->getDomain() . '-' . $this->getApi()), TRUE)), |
|
43 | - "url" => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower($this->getDomain() . '-' . 'api-' . $this->getApi() . "-pk"), TRUE)), |
|
42 | + 'formUrl' => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('admin-api-form-'.$this->getDomain().'-'.$this->getApi()), TRUE)), |
|
43 | + "url" => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower($this->getDomain().'-'.'api-'.$this->getApi()."-pk"), TRUE)), |
|
44 | 44 | ), [], ''); |
45 | 45 | } |
46 | 46 |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | public function render($template, array $vars = array(), $cookies = array(), $domain = null) |
42 | 42 | { |
43 | 43 | $vars['__menu__'] = $this->getMenu(); |
44 | - if(Config::getParam('profiling.enable')) { |
|
44 | + if (Config::getParam('profiling.enable')) { |
|
45 | 45 | $vars['__profiling__'] = Inspector::getStats(); |
46 | 46 | } |
47 | 47 | $domain = (null === $domain) ? $this->getDomain() : $domain; |
48 | - return $this->tpl->render($domain . $template, $vars, $cookies); |
|
48 | + return $this->tpl->render($domain.$template, $vars, $cookies); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $vars['__menu__'] = $this->getMenu(); |
78 | 78 | $domain = $domain ?: $this->getDomain(); |
79 | - return $this->tpl->dump($domain . $template, $vars); |
|
79 | + return $this->tpl->dump($domain.$template, $vars); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | protected static function calculateStats(array $stats, $ts, $mem = 0, $files = 0) { |
29 | 29 | return [ |
30 | 30 | 'ts' => round($stats['ts'] - $ts, 4), |
31 | - 'mem' => round(($stats['mem'] - $mem) / 1024 / 1024, 4), |
|
31 | + 'mem' => round(($stats['mem'] - $mem)/1024/1024, 4), |
|
32 | 32 | 'files' => $stats['files'] - $files, |
33 | 33 | 'name' => $stats['name'], |
34 | 34 | ]; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $ts = defined('PSFS_START_TS') ? PSFS_START_TS : 0; |
43 | 43 | $mem = defined('PSFS_START_MEM') ? PSFS_START_MEM : 0; |
44 | 44 | $files = 0; |
45 | - foreach(self::$profiling as $key => &$value) { |
|
45 | + foreach (self::$profiling as $key => &$value) { |
|
46 | 46 | $value = self::calculateStats($value, $ts, $mem, $files); |
47 | 47 | } |
48 | 48 | self::$profiling[] = self::calculateStats(self::collect('Profiling collect ends'), $ts, $mem, $files); |