LukeCarrier / moodle-local_cpd

A replacement for Kineo Open Source's legacy report_cpd plugin
2 stars 0 forks source link

Course restores fail due to missing class #22

Open supton-overtsoftware opened 9 years ago

supton-overtsoftware commented 9 years ago

Error message:

Strict Standards: Declaration of decaf_expand_navigation::add_category() should be compatible with that of global_navigation::add_category() in /var/www/html/moodle/lib/outputlib.php on line 448 
Warning: include(/var/www/html/moodle/local/cpd/classes): failed to open stream: No such file or directory in /var/www/html/moodle/local/cpd/lib.php on line 51
Warning: include(): Failed opening '/var/www/html/moodle/local/cpd/classes/' for inclusion (include_path='/var/www/html/moodle/lib/zend:/var/www/html/moodle/lib/pear:.:/usr/share/pear:/usr/share/php') in /var/www/html/moodle/local/cpd/lib.php on line 51
Fatal error: Class 'local_cpd\util' not found in /var/www/html/moodle/local/cpd/lib.php on line 73

Had to add the following require in lib.php to fix:

require_once(dirname(__FILE__). '/classes/util.php');
use local_cpd\util;
LukeCarrier commented 9 years ago

Hi Steve,

Could I confirm your Moodle version please? This looks as though Moodle isn't correctly autoloading classes, which is something that didn't come in until Moodle 2.6 if I recall correctly.

Thanks for the report! On 5 May 2015 14:50, "Steve" notifications@github.com wrote:

Error message:

Strict Standards: Declaration of decaf_expand_navigation::add_category() should be compatible with that of global_navigation::add_category() in /var/www/html/moodle/lib/outputlib.php on line 448 Warning: include(/var/www/html/moodle/local/cpd/classes): failed to open stream: No such file or directory in /var/www/html/moodle/local/cpd/lib.php on line 51 Warning: include(): Failed opening '/var/www/html/moodle/local/cpd/classes/' for inclusion (include_path='/var/www/html/moodle/lib/zend:/var/www/html/moodle/lib/pear:.:/usr/share/pear:/usr/share/php') in /var/www/html/moodle/local/cpd/lib.php on line 51 Fatal error: Class 'local_cpd\util' not found in /var/www/html/moodle/local/cpd/lib.php on line 73

Had to add the following require in lib.php to fix:

require_once(dirname(FILE). '/classes/util.php');use local_cpd\util;

— Reply to this email directly or view it on GitHub https://github.com/LukeCarrier/moodle-local_cpd/issues/22.

supton-overtsoftware commented 9 years ago

Hi Luke

Yes it is 2.5.4 that it's running on - so that would explain it.

Thanks

Steve

LukeCarrier commented 9 years ago

Hi Steve,

Thanks for clarifying. I'll grab a copy of 2.5 later this week and get a fix out soon. Just out of interest, what's the output of the following commands?

# PHP version
php -v

# Build information
php -i | head -n6

# Whether or not the maintainer built SPL support in, required for autoloading
php -i | grep -i 'spl support'

Thanks again :)

supton-overtsoftware commented 9 years ago

Hi Luke

It's running on CentOS 6 standard PHP package with the following output for the commands

PHP Version => 5.3.3

Build Date => Jul  3 2012 16:50:56
Configure Command =>  './configure'  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'

SPL support => enabled

Cheers

Steve