Skip to content

Commit

Permalink
Code fix, convention and refactorization
Browse files Browse the repository at this point in the history
  • Loading branch information
mondayrris committed Feb 9, 2022
1 parent 1bb4e9a commit 94df5ee
Show file tree
Hide file tree
Showing 184 changed files with 1,586 additions and 1,626 deletions.
8 changes: 4 additions & 4 deletions app/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| URL to your CodeIgniter root. Typically, this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
Expand Down Expand Up @@ -148,7 +148,7 @@
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
| as few characters as possible. By default, only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
Expand Down Expand Up @@ -180,7 +180,7 @@
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| Please note that some helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
Expand Down Expand Up @@ -386,7 +386,7 @@
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| Note: These settings (except 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
Expand Down
24 changes: 12 additions & 12 deletions app/config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
const FILE_READ_MODE = 0644;
const FILE_WRITE_MODE = 0666;
const DIR_READ_MODE = 0755;
const DIR_WRITE_MODE = 0777;

/*
|--------------------------------------------------------------------------
Expand All @@ -27,14 +27,14 @@
|
*/

define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
const FOPEN_READ = 'rb';
const FOPEN_READ_WRITE = 'r+b';
const FOPEN_WRITE_CREATE_DESTRUCTIVE = 'wb'; // truncates existing file data, use with care
const FOPEN_READ_WRITE_CREATE_DESTRUCTIVE = 'w+b'; // truncates existing file data, use with care
const FOPEN_WRITE_CREATE = 'ab';
const FOPEN_READ_WRITE_CREATE = 'a+b';
const FOPEN_WRITE_CREATE_STRICT = 'xb';
const FOPEN_READ_WRITE_CREATE_STRICT = 'x+b';


/* End of file constants.php */
Expand Down
4 changes: 2 additions & 2 deletions app/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| When migrations run it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
Expand Down Expand Up @@ -78,7 +78,7 @@
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
| Also, writing permission is required within the migrations' path.
|
*/
$config['migration_path'] = APPPATH.'database/migrations/';
2 changes: 1 addition & 1 deletion app/config/profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| This file lets you determine whether various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
Expand Down
6 changes: 4 additions & 2 deletions app/config/user_agents.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php /** @noinspection PhpDuplicateArrayKeysInspection */
/** @noinspection PhpDuplicateArrayKeysInspection */
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
Expand Down Expand Up @@ -46,7 +48,7 @@


// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
// multiple browser types, so we want to identify the sub-type first.
$browsers = array(
'Flock' => 'Flock',
'Chrome' => 'Chrome',
Expand Down
13 changes: 8 additions & 5 deletions app/controllers/Main.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php /** @noinspection PhpMultipleClassDeclarationsInspection */

/**
* @copyright Eliel de Paula <[email protected]>
Expand All @@ -12,6 +12,8 @@
*
* Contém os métodos básicos do site.
*
* @property int $wpn_cols_mosaic
* @property string $wpn_posts_view
* @author Eliel de Paula <[email protected]>
*/
class Main extends MY_Controller
Expand All @@ -25,7 +27,7 @@ class Main extends MY_Controller
*/
public $post;
/**
* @var Categorytegory
* @var Category
*/
public $category;
/**
Expand Down Expand Up @@ -142,6 +144,7 @@ public function posts($category_id = null)
*
* @param $var mixed Link ou ID da postagem.
* @param $use_id boolean Indica que $var é um Id.
* @noinspection PhpParamsInspection
*/
public function post($var = null, $use_id = false)
{
Expand Down Expand Up @@ -350,7 +353,7 @@ public function video($code = null)
$this->wpanel->set_meta_description($query_video->titulo);
$this->wpanel->set_meta_keywords('videos, filmes');
$this->wpanel->set_meta_title($query_video->titulo);
$this->wpanel->set_meta_image('http://img.youtube.com/vi/' . $code . '/0.jpg');
$this->wpanel->set_meta_image('https://img.youtube.com/vi/' . $code . '/0.jpg');
$this->render();
}

Expand All @@ -368,15 +371,15 @@ public function contact()
$this->wpanel->set_meta_keywords(' Contato, Fale Conosco');
$this->wpanel->set_meta_title('Contato');
$this->set_var('contact_content', wpn_config('texto_contato'));
// FIXME
$this->set_var('captcha', $this->form_validation->get_captcha());
$this->render();
} else {
$nome = $this->input->post('nome');
$email = $this->input->post('email');
$telefone = $this->input->post('telefone');
$mensagem = $this->input->post('mensagem');
$msg = "";
$msg .= "Mensagem enviada pelo site.\n\n";
$msg = "Mensagem enviada pelo site.\n\n";
$msg .= "Nome: $nome\n";
$msg .= "Email: $email\n";
$msg .= "Telefone: $telefone\n";
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/Migrate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php /** @noinspection PhpUnused */

class Migrate extends CI_Controller
{
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/Users.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php /** @noinspection PhpUnused */

/**
* @copyright Eliel de Paula <[email protected]>
Expand All @@ -21,10 +21,6 @@ class Users extends MY_Controller
* @var Wpanel
*/
public $wpanel;
/**
* @var Auth
*/
public $auth;

/**
* Constructor da classe.
Expand Down
Loading

0 comments on commit 94df5ee

Please sign in to comment.