• Resolved rypher21

    (@rypher21)


    Hi,

    Im having an issue with the wordpress migration in dot.ph – “Parse error: syntax error, unexpected T_STRING in /home/incorporatio/incorporation.ph/wp-content/themes/konstruct/libraries/options-plus/loader.php on line 6”

    Im using the same template on our other websites and haven’t encountered any errors. Any input would be greatly appreciated.

    Below is the loader.php

    <?php
    /**
    * WARNING: This file is part of the OptionsPlus library. DO NOT edit
    * this file under any circumstances.
    */
    namespace OptionsPlus;

    // Prevent direct access to this file
    defined( ‘ABSPATH’ ) or die();

    require_once __DIR__ . ‘/assets.php’;
    require_once __DIR__ . ‘/helper.php’;
    require_once __DIR__ . ‘/fonts.php’;

    /**
    * Register auto loader
    */
    spl_autoload_register( __NAMESPACE__ . ‘\Loader::load’ );

    /**
    * Class loader for OptionsPlus library
    *
    * @package OptionsPlus
    * @category Library
    */
    final class Loader
    {
    public static function load( $class ) {
    // Has namespace
    if ( strpos( $class, ‘OptionsPlus\\’ ) === 0 ) {
    $segments = array_slice( explode( ‘\\’, $class ), 1 );
    $classname = array_pop( $segments );
    $filename = preg_replace( ‘/([A-Z])/’, ‘-\\1’, $classname );
    $filename = trim( strtolower( $filename ), ‘-‘ );
    $path = strtolower( implode( ‘/’, $segments ) );
    $file = op_directory_path() . ‘/’ . $path . ‘/’ . $filename . ‘.php’;

    if ( is_file( $file ) ) {
    require_once $file;
    }
    }
    }
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • jack randall

    (@theotherlebowski)

    the error message is telling you that the problem is on line 6 of the file, what’s actually on line 6 of the file? (there are no line numbers in the code you pasted…)

    What version of PHP are you running on the site that’s having this problem? IIRC, that’s the error you receive if you’re trying to use namespacing on a version of PHP older than 5.3.

    Thread Starter rypher21

    (@rypher21)

    Hi thank you for the response:

    the PHP Version of the site is PHP Version 5.2.17

    line 6: namespace OptionsPlus;

    Namespacing isn’t available on PHP 5.2, so you aren’t going to be able to use that plugin as is. You’ll need to either upgrade PHP on the server or ask if the plugin authors have a version that doesn’t use namespacing.

    Thread Starter rypher21

    (@rypher21)

    Thank you very much!! I will contact them and ask to upgrade the PHP version that’s installed in the server…:)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Parse error: syntax error, unexpected T_STRING’ is closed to new replies.