Skip to content

Commit

Permalink
Include is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasReker committed Dec 11, 2018
1 parent a6c8cc2 commit 3431e89
Show file tree
Hide file tree
Showing 98 changed files with 209 additions and 209 deletions.
2 changes: 1 addition & 1 deletion admin-dev/ajax-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
define('_PS_ADMIN_DIR_', getcwd());
}

require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require _PS_ADMIN_DIR_.'/../config/config.inc.php';

// For retrocompatibility with "tab" parameter
if (!isset($_GET['controller']) && isset($_GET['tab'])) {
Expand Down
6 changes: 3 additions & 3 deletions admin-dev/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';

/* Getting cookie or logout */
require_once(_PS_ADMIN_DIR_.'/init.php');
require_once _PS_ADMIN_DIR_.'/init.php';

$context = Context::getContext();

if (Tools::isSubmit('ajaxReferrers')) {
require(_PS_CONTROLLER_DIR_.'admin/AdminReferrersController.php');
require _PS_CONTROLLER_DIR_.'admin/AdminReferrersController.php';
}

if (Tools::getValue('page') == 'prestastore' && @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) {
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/ajax_products_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';
/* Getting cookie or logout */
require_once(_PS_ADMIN_DIR_.'/init.php');
require_once _PS_ADMIN_DIR_.'/init.php';

$query = Tools::getValue('q', false);
if (!$query || $query == '' || strlen($query) < 1) {
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';

if (!Context::getContext()->employee->isLoggedBack()) {
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminLogin'));
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_);
}

require_once(dirname(__FILE__).'/../config/config.inc.php');
require_once dirname(__FILE__).'/../config/config.inc.php';
2 changes: 1 addition & 1 deletion admin-dev/cron_currency_rates.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';

if (isset($_GET['secure_key'])) {
$secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME'));
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/displayImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require_once(_PS_ADMIN_DIR_.'/init.php');
require_once _PS_ADMIN_DIR_.'/../config/config.inc.php';
require_once _PS_ADMIN_DIR_.'/init.php';

if (isset($_GET['img']) && Validate::isMd5($_GET['img']) && isset($_GET['name']) && Validate::isGenericName($_GET['name']) && file_exists(_PS_UPLOAD_DIR_.$_GET['img'])) {
header('Content-type: image/jpeg');
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/drawer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include_once _PS_ADMIN_DIR_.'/../config/config.inc.php';

$module = Tools::getValue('module');
$render = Tools::getValue('render');
Expand Down Expand Up @@ -90,7 +90,7 @@
Context::getContext()->shop = new Shop($shop_id);
}

require_once($module_path);
require_once $module_path;

$graph = new $module();
$graph->setEmployee($id_employee);
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/filemanager/ajax_calls.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

include('config/config.php');
include 'config/config.php';

if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('Forbidden');
}

include('include/utils.php');
include 'include/utils.php';

if (isset($_GET['action'])) {
switch ($_GET['action']) {
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/filemanager/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
define('_PS_ADMIN_DIR_', dirname(__FILE__).'/../../');
}

require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require_once(_PS_ADMIN_DIR_.'/init.php');
require_once _PS_ADMIN_DIR_.'/../config/config.inc.php';
require_once _PS_ADMIN_DIR_.'/init.php';

if (function_exists('mb_internal_encoding')) {
mb_internal_encoding('UTF-8');
Expand Down
8 changes: 4 additions & 4 deletions admin-dev/filemanager/dialog.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
include('config/config.php');
include 'config/config.php';

$_SESSION["verify"] = "RESPONSIVEfilemanager";

if (isset($_POST['submit'])) {
include('upload.php');
include 'upload.php';
} else {
include('include/utils.php');
include 'include/utils.php';



Expand Down Expand Up @@ -81,7 +81,7 @@
$parent = '';
}
if (file_exists($current_path.$parent.'config.php')) {
require_once($current_path.$parent.'config.php');
require_once $current_path.$parent.'config.php';
$cycle = false;
}

Expand Down
6 changes: 3 additions & 3 deletions admin-dev/filemanager/execute.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include('config/config.php');
include 'config/config.php';
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('forbiden');
}
include('include/utils.php');
include 'include/utils.php';

$_POST['path_thumb'] = $thumbs_base_path.$_POST['path_thumb'];
if (!isset($_POST['path_thumb']) && trim($_POST['path_thumb']) == '') {
Expand Down Expand Up @@ -48,7 +48,7 @@
}

if (file_exists($path.'config.php')) {
require_once($path.'config.php');
require_once $path.'config.php';
$cycle = false;
}
$path = fix_dirname($path).'/';
Expand Down
4 changes: 2 additions & 2 deletions admin-dev/filemanager/force_download.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include('config/config.php');
include 'config/config.php';
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('Forbidden');
}
include('include/utils.php');
include 'include/utils.php';

if (preg_match('/\.{1,2}[\/|\\\]/', $_POST['path']) !== 0) {
die('wrong path');
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/filemanager/include/php_image_magician.php
Original file line number Diff line number Diff line change
Expand Up @@ -3301,7 +3301,7 @@ private function imagecreatefrompsd($fileName)
#
{
if (file_exists($this->psdReaderPath)) {
include_once($this->psdReaderPath);
include_once $this->psdReaderPath;

$psdReader = new PhpPsdReader($fileName);

Expand Down
6 changes: 3 additions & 3 deletions admin-dev/filemanager/include/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function rename_folder($old_path, $name, $transliteration)
function create_img_gd($imgfile, $imgthumb, $newwidth, $newheight="")
{
if (image_check_memory_usage($imgfile, $newwidth, $newheight)) {
require_once('php_image_magician.php');
require_once 'php_image_magician.php';
$magicianObj = new imageLib($imgfile);
$magicianObj -> resizeImage($newwidth, $newheight, 'crop');
$magicianObj -> saveImage($imgthumb, 80);
Expand All @@ -75,7 +75,7 @@ function create_img_gd($imgfile, $imgthumb, $newwidth, $newheight="")
function create_img($imgfile, $imgthumb, $newwidth, $newheight="")
{
if (image_check_memory_usage($imgfile, $newwidth, $newheight)) {
require_once('php_image_magician.php');
require_once 'php_image_magician.php';
$magicianObj = new imageLib($imgfile);
$magicianObj -> resizeImage($newwidth, $newheight, 'auto');
$magicianObj -> saveImage($imgthumb, 80);
Expand Down Expand Up @@ -248,7 +248,7 @@ function base_url()
function config_loading($current_path, $fld)
{
if (file_exists($current_path.$fld.".config")) {
require_once($current_path.$fld.".config");
require_once $current_path.$fld.".config";
return true;
}
echo "!!!!".$parent=fix_dirname($fld);
Expand Down
6 changes: 3 additions & 3 deletions admin-dev/filemanager/upload.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include('config/config.php');
include 'config/config.php';
if ($_SESSION['verify'] != 'RESPONSIVEfilemanager') {
die('Forbidden');
}
include('include/utils.php');
include 'include/utils.php';

$_POST['path'] = $current_path.str_replace('\0', '', $_POST['path']);
$_POST['path_thumb'] = $thumbs_base_path.str_replace("\0", '', $_POST['path_thumb']);
Expand All @@ -30,7 +30,7 @@
$cycle = false;
}
if (file_exists($path.'config.php')) {
require_once($path.'config.php');
require_once $path.'config.php';
$cycle = false;
}
$path = fix_dirname($path).'/';
Expand Down
8 changes: 4 additions & 4 deletions admin-dev/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
require_once(_PS_ADMIN_DIR_.'/../images.inc.php');
require_once _PS_ADMIN_DIR_.'/../images.inc.php';
function bindDatepicker($id, $time)
{
if ($time) {
Expand Down Expand Up @@ -412,7 +412,7 @@ function runAdminTab($tab, $ajax_mode = false)
{
$ajax_mode = (bool)$ajax_mode;

require_once(_PS_ADMIN_DIR_.'/init.php');
require_once _PS_ADMIN_DIR_.'/init.php';
$cookie = Context::getContext()->cookie;
if (empty($tab) && !count($_POST)) {
$tab = 'AdminDashboard';
Expand All @@ -431,7 +431,7 @@ function runAdminTab($tab, $ajax_mode = false)
$admin_obj->run();
} else {
if (!$ajax_mode) {
require_once(_PS_ADMIN_DIR_.'/header.inc.php');
require_once _PS_ADMIN_DIR_.'/header.inc.php';
}
$iso_user = Context::getContext()->language->id;
$tabs = array();
Expand Down Expand Up @@ -514,7 +514,7 @@ function runAdminTab($tab, $ajax_mode = false)
$admin_obj->postProcess();
$admin_obj->displayErrors();
$admin_obj->display();
include(_PS_ADMIN_DIR_.'/footer.inc.php');
include _PS_ADMIN_DIR_.'/footer.inc.php';
}
} else {
if ($ajax_mode) {
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/get-file-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require _PS_ADMIN_DIR_.'/../config/config.inc.php';
Controller::getController('GetFileController')->run();
4 changes: 2 additions & 2 deletions admin-dev/grider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include_once _PS_ADMIN_DIR_.'/../config/config.inc.php';

$module = Tools::getValue('module');
$render = Tools::getValue('render');
Expand Down Expand Up @@ -96,7 +96,7 @@
}


require_once($module_path);
require_once $module_path;

$grid = new $module();
$grid->setEmployee($id_employee);
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_);
}

require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require _PS_ADMIN_DIR_.'/../config/config.inc.php';

//small test to clear cache after upgrade
if (Configuration::get('PS_UPGRADE_CLEAR_CACHE')) {
Expand Down
6 changes: 3 additions & 3 deletions admin-dev/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@

$iso = $context->language->iso_code;
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php')) {
include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
include _PS_TRANSLATIONS_DIR_.$iso.'/errors.php';
}
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php')) {
include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php');
include _PS_TRANSLATIONS_DIR_.$iso.'/fields.php';
}
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php')) {
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
include _PS_TRANSLATIONS_DIR_.$iso.'/admin.php';
}

/* Server Params */
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';

/**
* @deprecated 1.5.0
Expand Down
2 changes: 1 addition & 1 deletion admin-dev/searchcron.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include _PS_ADMIN_DIR_.'/../config/config.inc.php';

if (!Tools::getValue('id_shop')) {
Context::getContext()->shop->setContext(Shop::CONTEXT_ALL);
Expand Down
2 changes: 1 addition & 1 deletion app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private function getActiveModules()
private function getParameters()
{
if ($this->parametersFileExists()) {
$config = require($this->getParametersFile());
$config = require $this->getParametersFile();

return $config['parameters'];
}
Expand Down
2 changes: 1 addition & 1 deletion app/config/set_parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
}

$parameters = require($parametersFilepath);
$parameters = require $parametersFilepath;

if (!array_key_exists('parameters', $parameters)) {
throw new \Exception('Missing "parameters" key in "parameters.php" configuration file');
Expand Down
4 changes: 2 additions & 2 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
* Allow call of Legacy classes from classes in /src and /tests
* @see composer.json "files" property for custom autoloading
*/
require_once(__DIR__.'/config/defines.inc.php');
require_once(__DIR__.'/classes/PrestaShopAutoload.php');
require_once __DIR__.'/config/defines.inc.php';
require_once __DIR__.'/classes/PrestaShopAutoload.php';
4 changes: 2 additions & 2 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
if (!$lastParametersCacheModificationTime || $lastParametersCacheModificationTime < $lastParametersModificationTime) {
// When parameters file is available, update its cache if it is stale.
if (file_exists($phpParametersFilepath)) {
$config = require($phpParametersFilepath);
$config = require $phpParametersFilepath;
$exportPhpConfigFile($config, $cachedParameters);
} elseif (file_exists($yamlParametersFilepath)) {
$config = Yaml::parse($yamlParametersFilepath);
Expand Down Expand Up @@ -144,5 +144,5 @@
define('_RIJNDAEL_IV_', $config['parameters']['_rijndael_iv']);
}
} else if (file_exists(_PS_ROOT_DIR_.'/config/settings.inc.php')) {
require_once(_PS_ROOT_DIR_.'/config/settings.inc.php');
require_once _PS_ROOT_DIR_.'/config/settings.inc.php';
}
Loading

0 comments on commit 3431e89

Please sign in to comment.