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

namespace #1

Closed
sarjo opened this issue Sep 18, 2016 · 9 comments
Closed

namespace #1

sarjo opened this issue Sep 18, 2016 · 9 comments

Comments

@sarjo
Copy link

sarjo commented Sep 18, 2016

PHP Parse error: syntax error, unexpected 'namespace' (T_NAMESPACE) in /public_html/inc/vendor/jaxon-php/jaxon-core/src/Request/Plugin/BrowserEvent.php on line 1

This error occurs , I think it is the version of php so change 5.4 to 5.6 and continues to error.

@feuzeu
Copy link
Member

feuzeu commented Sep 20, 2016

Hi, can you please show the code that generated this error?

@feuzeu
Copy link
Member

feuzeu commented Sep 20, 2016

Also, make sure you don't have a class in your application named "Namespace".

@sarjo
Copy link
Author

sarjo commented Sep 20, 2016

<?php
@session_start();
require ('../inc/vendor/autoload.php');
include_once "../inc/model/user.php";
include_once '../inc/adminActions.php';
if (!isset($_SESSION['xx']))
{
  header("Location: ../#!/login");
}else{
    $user=new user($_SESSION['xx']);
    if ($user->usertype != 3) {
        die('You do not have permission');
    }
}
use Jaxon\Jaxon;
$jaxon = jaxon();
$jaxon->register(Jaxon::CALLABLE_OBJECT, new adminAction());
$jaxon->setOption('js.lib.uri', '../js/jaxon-js/src');
$jaxon->setOption('js.app.minify', true);
$jaxon->processRequest();
?>

this code on my pc works , but production is not the only difference is that my pc using php 7 and production php 5.4

@feuzeu
Copy link
Member

feuzeu commented Sep 20, 2016

The above code doesn't call the BrowserEvent class. The error may be in the adminAction class or in when you link javascript events to your UI elements.

@sarjo
Copy link
Author

sarjo commented Sep 20, 2016

adminActions.php
`

destroy()) { $xResponse->toastr->success("User deleted"); $xResponse->script('$("#content").load("../views/adminUsers.php");'); }else{ $xResponse->toastr->error("User has not deleted"); } return $xResponse; } } ?>

@sarjo
Copy link
Author

sarjo commented Sep 20, 2016

the strange thing is that in my computer run but on the server check that error.
Sorry for my english.

@sarjo
Copy link
Author

sarjo commented Sep 22, 2016

same problem with xajax

https://openclassrooms.com/forum/sujet/xajax-erreur-a-la-creation-d-une-instance-xajax-81341

solution detail in this post is use another version.

@feuzeu
Copy link
Member

feuzeu commented Sep 22, 2016

The solution is to use another version of what? PHP or Xajax?

It seems to me that this issue is related to PHP rather than Jaxon. I see no reason why the BrowserEvent class is called in your code.

If you're using a caching system such as Xcache, try flushing or disabling it.

@feuzeu feuzeu closed this as completed Oct 16, 2016
@sarjo
Copy link
Author

sarjo commented Nov 14, 2016

Solution is upload file in binary mode not in ASCII.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants