Skip to content

Commit

Permalink
Fix coding style issue + import classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Jul 9, 2017
1 parent b43d3db commit c3387d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

defined('PH7') or exit('Restricted access');

use PH7\Framework\Date\CDateTime;
use PH7\Framework\Http\Http;
use PH7\Framework\Mvc\Model\DbConfig;
use PH7\Framework\Mvc\Model\Engine\Db;
use PH7\Framework\Mvc\Model\Engine\Util\Backup;
use PH7\Framework\Mvc\Model\Engine\Util\Various as DbVarious;

class DatabaseCoreCron extends Cron
{
Expand Down Expand Up @@ -48,7 +51,7 @@ public function __construct()
break;

default:
Framework\Http\Http::setHeadersByCode(400);
Http::setHeadersByCode(400);
exit('Bad Request Error!');
}
}
Expand Down Expand Up @@ -112,7 +115,7 @@ protected function stat()

protected function backup()
{
(new Backup(PH7_PATH_BACKUP_SQL . 'Periodic-database-update.' . (new Framework\Date\CDateTime)->get()->date() . '.sql.gz'))->back()->saveArchive();
(new Backup(PH7_PATH_BACKUP_SQL . 'Periodic-database-update.' . (new CDateTime)->get()->date() . '.sql.gz'))->back()->saveArchive();

echo t('Backup of the Database... Ok!') . '<br />';
}
Expand Down Expand Up @@ -204,7 +207,7 @@ protected function cleanData()
protected function pruningDb($iOlderThanXDay, $sTable, $sDateColumn)
{
if (strstr($sTable, 'Comments') === false && $sTable !== 'Messages' && $sTable !== 'Messenger') {
Framework\Mvc\Model\Engine\Util\Various::launchErr($sTable);
DbVarious::launchErr($sTable);
}

$rStmt = Db::getInstance()->prepare('DELETE FROM' . Db::prefix($sTable) . 'WHERE (' . $sDateColumn . ' < NOW() - INTERVAL :dayNumber DAY)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / User / Controller
*/

namespace PH7;

use PH7\Framework\Module\Various as SysMod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / User / Controller
*/

namespace PH7;

use PH7\Framework\Geo\Map\Map;
Expand Down Expand Up @@ -60,9 +61,7 @@ public function index()
$sMemberTxt = nt('%n% member', '%n% members', $iTotalUsers);
$this->view->h3_title = t('%0% lives near %1% %2%', $sMemberTxt, $this->registry->country, $this->registry->city);

}
else
{
} else {
// Not found page
Framework\Http\Http::setHeadersByCode(404);
$this->view->error = t('Error, country is empty.');
Expand All @@ -76,5 +75,4 @@ private function getCountryCode()
$sCountryCode = Framework\CArray\CArray::getKeyByValIgnoreCase($this->registry->country, $this->registry->lang);
return (strlen($sCountryCode) == 2) ? $sCountryCode : substr($this->registry->country, 0, 2);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ private function _getPageForced()
switch ($this->httpRequest->get('force')) {
case 'classic':
$sPage = static::GUEST_FILE;
break;
break;

case 'splash':
$sPage = static::GUEST_SPLASH_FILE;
break;
break;

default:
throw new PH7InvalidArgumentException('You can only choose between "classic" or "splash"');
Expand Down

0 comments on commit c3387d7

Please sign in to comment.