Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include is not a function #11710

Merged
merged 2 commits into from Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin-dev/ajax-tab.php
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
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
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
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
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
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
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
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
@@ -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
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
@@ -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
@@ -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'] = isset($_POST['path']) ? str_replace("\0", '', $_POST['path']) : null;
$_POST['path_thumb'] = isset($_POST['path_thumb']) ? $thumbs_base_path . str_replace("\0", '', $_POST['path_thumb']) : null;
Expand Down Expand Up @@ -45,7 +45,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
@@ -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
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
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
@@ -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
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
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
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
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
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
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
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
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
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
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
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']);
}
} elseif (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';
}