@@ -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 |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | Logger::log('Configuration saved successful'); |
| 64 | 64 | Security::getInstance()->setFlash("callback_message", _("Usuario agregado correctamente")); |
| 65 | 65 | Security::getInstance()->setFlash("callback_route", Router::getInstance()->getRoute("admin", true)); |
| 66 | - } else { |
|
| 66 | + }else { |
|
| 67 | 67 | throw new ConfigException(_('Error al guardar los administradores, prueba a cambiar los permisos')); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | if ($this->isAdmin()) { |
| 101 | 101 | return $this->redirect('admin'); |
| 102 | - } else { |
|
| 102 | + }else { |
|
| 103 | 103 | return Admin::staticAdminLogon($route); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $cookies = array( |
| 132 | 132 | array( |
| 133 | 133 | "name" => Security::getInstance()->getHash(), |
| 134 | - "value" => base64_encode($form->getFieldValue("user") . ":" . $form->getFieldValue("pass")), |
|
| 134 | + "value" => base64_encode($form->getFieldValue("user").":".$form->getFieldValue("pass")), |
|
| 135 | 135 | "expire" => time() + 3600, |
| 136 | 136 | "http" => true, |
| 137 | 137 | ) |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'status_message' => _("Acceso permitido... redirigiendo!!"), |
| 143 | 143 | 'delay' => 1, |
| 144 | 144 | ); |
| 145 | - } else { |
|
| 145 | + }else { |
|
| 146 | 146 | $form->setError("user", _("El usuario no tiene acceso a la web")); |
| 147 | 147 | } |
| 148 | 148 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | )) |
| 38 | 38 | ->addButton('submit', _("Acceder como {{username}}")) |
| 39 | 39 | ->addButton("cancel", _("Cancelar"), "button", array( |
| 40 | - "onclick" => "javacript:location.href = \"" . Router::getInstance()->getRoute('') . "\";", |
|
| 40 | + "onclick" => "javacript:location.href = \"".Router::getInstance()->getRoute('')."\";", |
|
| 41 | 41 | "class" => "btn-link", |
| 42 | 42 | )); |
| 43 | 43 | } |
@@ -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 |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $router->simpatize(); |
| 56 | 56 | Security::getInstance()->setFlash("callback_message", _("Rutas generadas correctamente")); |
| 57 | 57 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-routes", true)); |
| 58 | - } catch (\Exception $e) { |
|
| 58 | + }catch (\Exception $e) { |
|
| 59 | 59 | Logger::log($e->getMessage(), LOG_ERR); |
| 60 | 60 | Security::getInstance()->setFlash("callback_message", _("Algo no ha salido bien, revisa los logs")); |
| 61 | 61 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-routes", true)); |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | $objects = scandir($dir); |
| 20 | 20 | foreach ($objects as $object) { |
| 21 | 21 | if ($object != "." && $object != "..") { |
| 22 | - if (filetype($dir . "/" . $object) == "dir") { |
|
| 23 | - self::deleteDir($dir . "/" . $object); |
|
| 24 | - } else { |
|
| 25 | - unlink($dir . "/" . $object); |
|
| 22 | + if (filetype($dir."/".$object) == "dir") { |
|
| 23 | + self::deleteDir($dir."/".$object); |
|
| 24 | + }else { |
|
| 25 | + unlink($dir."/".$object); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $rootDirs = array("css", "js", "media", "font"); |
| 40 | 40 | foreach ($rootDirs as $dir) { |
| 41 | - if (file_exists(WEB_DIR . DIRECTORY_SEPARATOR . $dir)) { |
|
| 41 | + if (file_exists(WEB_DIR.DIRECTORY_SEPARATOR.$dir)) { |
|
| 42 | 42 | try { |
| 43 | - self::deleteDir(WEB_DIR . DIRECTORY_SEPARATOR . $dir); |
|
| 44 | - } catch (\Exception $e) { |
|
| 43 | + self::deleteDir(WEB_DIR.DIRECTORY_SEPARATOR.$dir); |
|
| 44 | + }catch (\Exception $e) { |
|
| 45 | 45 | Logger::log($e->getMessage()); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | try { |
| 59 | 59 | if (!is_dir($dir) && @mkdir($dir, 0775, true) === false) { |
| 60 | - throw new \Exception(_('Can\'t create directory ') . $dir); |
|
| 60 | + throw new \Exception(_('Can\'t create directory ').$dir); |
|
| 61 | 61 | } |
| 62 | - } catch (\Exception $e) { |
|
| 62 | + }catch (\Exception $e) { |
|
| 63 | 63 | Logger::log($e->getMessage(), LOG_WARNING); |
| 64 | 64 | if (!file_exists(dirname($dir))) { |
| 65 | - throw new GeneratorException($e->getMessage() . $dir); |
|
| 65 | + throw new GeneratorException($e->getMessage().$dir); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public static function getTemplatePath() |
| 75 | 75 | { |
| 76 | - $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR; |
|
| 76 | + $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR; |
|
| 77 | 77 | return realpath($path); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | * @throws GeneratorException |
| 92 | 92 | */ |
| 93 | 93 | public static function checkCustomNamespaceApi($namespace) { |
| 94 | - if(!empty($namespace)) { |
|
| 95 | - if(class_exists($namespace)) { |
|
| 94 | + if (!empty($namespace)) { |
|
| 95 | + if (class_exists($namespace)) { |
|
| 96 | 96 | $reflector = new \ReflectionClass($namespace); |
| 97 | - if(!$reflector->isSubclassOf(\PSFS\base\types\Api::class)) { |
|
| 97 | + if (!$reflector->isSubclassOf(\PSFS\base\types\Api::class)) { |
|
| 98 | 98 | throw new GeneratorException(_('La clase definida debe extender de PSFS\\\base\\\types\\\Api'), 501); |
| 99 | - } elseif(!$reflector->isAbstract()) { |
|
| 99 | + } elseif (!$reflector->isAbstract()) { |
|
| 100 | 100 | throw new GeneratorException(_('La clase definida debe ser abstracta'), 501); |
| 101 | 101 | } |
| 102 | - } else { |
|
| 102 | + }else { |
|
| 103 | 103 | throw new GeneratorException(_('La clase definida para extender la API no existe'), 501); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -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 |