Post by mrfifagamer » Wed Aug 30, 2017 1:59 am

Hey,

I got this error on my log and I do not know how to fix it. Hopefully someone can help me out.

2017-08-29 3:48:29 - PHP Warning: is_dir() expects parameter 1 to be a valid path, string given in /home/fifafi1q/public_html/vqmod/vqcache/vq2-system_engine_action.php on line 17
2017-08-29 3:48:29 - PHP Warning: is_file() expects parameter 1 to be a valid path, string given in /home/fifafi1q/public_html/vqmod/vqcache/vq2-system_engine_action.php on line 27


This is my vq2-system_engine_action.php code:

Code: Select all

<?php
final class Action {
	private $file;
	private $class;
	private $method;
	private $args = array();

	public function __construct($route, $args = array()) {
		$path = '';

		// Break apart the route
		$parts = explode('/', str_replace('../', '', (string)$route));

		foreach ($parts as $part) {
			$path .= $part;

			if (is_dir(DIR_APPLICATION . 'controller/' . $path)) {
				$path .= '/';

				array_shift($parts);

				continue;
			}

			$file = DIR_APPLICATION . 'controller/' . str_replace(array('../', '..\\', '..'), '', $path) . '.php';

			if (is_file($file)) {
				$this->file = $file;

				$this->class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $path);

				array_shift($parts);

				break;
			}
		}

		if ($args) {
			$this->args = $args;
		}

		$method = array_shift($parts);

		if ($method) {
			$this->method = $method;
		} else {
			$this->method = 'index';
		}
	}

	public function execute($registry) {
		// Stop any magical methods being called
		if (substr($this->method, 0, 2) == '__') {
			return false;
		}

		if (is_file($this->file)) {
			include_once(VQMod::modCheck($this->file));

			$class = $this->class;

			$controller = new $class($registry);

			if (is_callable(array($controller, $this->method))) {
				return call_user_func(array($controller, $this->method), $this->args);
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
}
Thanks in advance! :)

New member

Posts

Joined
Sun Aug 23, 2015 6:34 pm

Post by yodapt » Wed Aug 30, 2017 2:17 am

What have you changed recently?

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by mrfifagamer » Fri Sep 01, 2017 9:48 pm

yodapt wrote:
Wed Aug 30, 2017 2:17 am
What have you changed recently?
I have not touched my code at all.

New member

Posts

Joined
Sun Aug 23, 2015 6:34 pm

Post by yodapt » Fri Sep 01, 2017 10:14 pm

Well the error isnt on that file for sure, it is just triggered at the point a function in that file is needed.

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by MrPhil » Sat Sep 02, 2017 2:28 am

Before the is_dir() call, print out DIR_APPLICATION and $path and see if they have any odd characters in them (both should be proper paths for your server's operating system). Maybe there's something bad about either or both of them. If they're empty or null, I don't think you'll get this error message.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by cssjunkie » Thu Sep 14, 2017 6:35 pm

Im getting this same problem now. I never had this error before. Today it started showing.

Newbie

Posts

Joined
Mon Feb 01, 2016 3:55 am

Post by MrPhil » Thu Sep 14, 2017 9:55 pm

If neither you nor a hacker changed the code, most likely your host just upgraded to a new PHP version. How old a version of OC are you running? Maybe it's not compatible with your new PHP version.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by somjai007 » Wed Sep 20, 2017 10:36 am

Thanks for the info


gclub

Newbie

Posts

Joined
Sun Sep 10, 2017 3:06 pm
Who is online

Users browsing this forum: geel and 52 guests