Installed idiorm and paris, but paris.php gives me a HTTP 500 error.
soodarvind opened this issue · comments
I installed as per your instructions, and while idiorm.php returns HTTP 200 OK, Paris.php bungs an error every time I try to test with it.
When I run my php, it also responds with a HTTP 200 message, but no data populates.
When i try to run idiorm.php direct, it responds ok HTTP 200.
When I try to run paris.php direct, it gives me a HTTP 500 error.
I am trying to run the demo php's provided, but again, after configuring the ORM as per instructions there, I get http 200 errors.
What am I doing wrong?
- You cannot test Idiorm and Paris by accesing their files directly
through a web browser. - Paris depends upon Idiorm so that is probably why you're getting an
error accessing it's file directly. - Your line requiring Paris into your project has a dot/period (.) where
there should be a slash (/). - You need to turn on display_errors and set error_reporting to it's
highest level to debug PHP. You cannot debug via HTTP response headers from
the web server. - You should install xdebug to help you debug your project more easily.
- How are we meant to help you further if you leave out all your DB
functions? - For more information please see the documentation rather than the
demo.php file.
Here's all my source, masking my authentication data.
My relative path actually requires the dot/period. Running in xdebug without, it fails to find the file(s) paris.php or idiorm.php - which have been installed into the relative subdirectories.
am trying to use xdebug but it isn't showing me any errors.
login( 'xyz@xyz.com', 'abcd' )->selectWorld( 232 ); function getRankList( $type ) { global $lou; $type = ucfirst( strtolower( $type ) ); $count = $lou->get( $type . 'GetCount', array( "continent" => -1,"sort" => 0,"ascending" => true,"type" => 0 ) ); $iter = intval( $count / 400 ); $left = intval( $count % 400 ); $start = 0; $end = 399; $send = array(); for ($x = 0; $x < $iter; $x++) { $send[] = array( 'start' => $start, 'end' => $end ); $start += 400; $end += 400; } if( $left > 0 ) { $send[] = array( 'start' => ( $count - $left ), 'end' => ( $count - 1 ) ); } $data = array(); foreach( $send as $s ) { $s = array_merge( $s, array( "continent" => -1,"sort" => 0,"ascending" => true,"type" => 0 ) ); $res = $lou->get( $type . 'GetRange', $s ); $data = array_merge( $data, $res ); } return $data; } $alliance_name = 'Scrubber Duckies'; $alliance_id = 0; // Our function at work! $alliance_list = getRankList( 'alliance' ); foreach( $alliance_list as $alliance ) { if( strtolower( $alliance_name ) == strtolower( $alliance->n ) ) { $alliance_id = $alliance->i; } } $members = $lou->get( 'GetPublicAllianceMemberList', array( 'id' => $alliance_id ) ); foreach( $members as $member ) { // Store player info $player_db = Model::factory( 'Player' )->find_one( $member->i ); // Record not found, create it if( !$player_db instanceof Player ) { $player_db = Model::factory( 'Player' )->create(); $player_db->id = $member->i; $player_db->alliance_id = $alliance_id; $player_db->name = $member->n; } $player_db->updatedAt = date( 'Y-m-d H:i:s' ); $player_db->save(); // Store player score $player_score_db = Model::factory( 'PlayerScore' )->where( 'player_id', $member->i )->where( 'day', date( 'Y-m-d' ) )->find_one(); // Record not found create a new entry if( !$player_score_db instanceof PlayerScore ) { $player_score_db = Model::factory( 'PlayerScore' )->create(); $player_score_db->player_id = $member->i; $player_score_db->day = date( 'Y-m-d' ); } $player_score_db->alliance_id = $alliance_id; $player_score_db->score = $member->p; $player_score_db->rank = $member->r; $player_score_db->city_count = $member->c; $player_score_db->updatedAt = date( 'Y-m-d H:i:s' ); $player_score_db->save();} ``` ?>What are your table names in the database?
player and player_score.
i am going to go back and exclude all other codes and make sure the basic paris and idiorm modules work on my environment, then go from there.
I have not had a chance to read your code. I am not sure why your installation is not throwing any errors. Is it writing to an error log rather than displaying errors?
Have you made any progress on this issue? Anything further I can do to help?