Giter Club home page Giter Club logo

Comments (2)

davarravad avatar davarravad commented on September 24, 2024

I am aware of this issue and will be pushing a fix with the new update soon.

As PHP progresses in versions we have to take extra steps to prevent these errors.

What is your server's setup? OS, Apache, PHP, version etc...

The code related to this error is as follows:

        /** Check the following Directory for classes and methods **/
        $directory = APPDIR.'Controllers';
        $scanned_directory = array_diff(scandir($directory), array('..', '.'));

        /** Extract the methods from the classes **/
        foreach ($scanned_directory as $filename) {
            /** Remove the .php from the files names to get Class Names **/
            $class = str_replace('.php', '', str_replace('-', ' ', $filename));
            /** Get array of class methods **/
            $class_methods = get_class_methods('App\\Controllers\\'.$class);
            /** Remove blank and __construct methods from array **/
            if($class_methods[0] == ""){
                unset($class_methods[0]);
            }
            if($class_methods[0] == "__construct"){
                unset($class_methods[0]);
            }
            if($class_methods[1] == "__construct"){
                unset($class_methods[1]);
            }

            foreach ($class_methods as $method) {
                if(checkCoreRoutes($class, $method)){
                    $routes[] = array(
                        "controller" => $class,
                        "method" => $method
                    );
                }
            }
        }

Try the following and let me know what the result is:

        /** Check the following Directory for classes and methods **/
        $directory = APPDIR.'Controllers';
        $scanned_directory = array_diff(scandir($directory), array('..', '.'));

        /** Extract the methods from the classes **/
		if(isset($scanned_directory)){
			foreach ($scanned_directory as $filename) {
				/** Remove the .php from the files names to get Class Names **/
				$class = str_replace('.php', '', str_replace('-', ' ', $filename));
				/** Get array of class methods **/
				$class_methods = get_class_methods('App\\Controllers\\'.$class);
				/** Remove blank and __construct methods from array **/
				if($class_methods[0] == ""){
					unset($class_methods[0]);
				}
				if($class_methods[0] == "__construct"){
					unset($class_methods[0]);
				}
				if($class_methods[1] == "__construct"){
					unset($class_methods[1]);
				}

				foreach ($class_methods as $method) {
					if(checkCoreRoutes($class, $method)){
						$routes[] = array(
							"controller" => $class,
							"method" => $method
						);
					}
				}
			}
		}

from userapplepie-v4.

EddyBeaupre avatar EddyBeaupre commented on September 24, 2024

Ubuntu 16.04.4 LTS
Apache/2.4.18 (Ubuntu)
PHP 7.0.28-0ubuntu0.16.04.1

For an unknown reason it work not and i didn't change anything to the setup.... Weird

from userapplepie-v4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.