Project

General

Profile

Feature #4784

api_session_register

Added by Laurent Opprecht over 8 years ago. Updated about 8 years ago.

Status:
Feature implemented
Priority:
Normal
Assignee:
Laurent Opprecht
Category:
-
Target version:
Start date:
21/05/2012
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

This function only works with global variables which makes it pretty dangerous to use inside other functions.

A better scheme would be

api_session_register('name', $name);

or even better

Session::register('name', $name);


Related issues

Related to Chamilo LMS - Bug #4787: my files doesnt run in social network (chamilodev)Bug resolved21/05/2012

Actions
Related to Chamilo LMS - Bug #4802: Unable to upload imagesRejected - Abandoned25/05/2012

Actions

History

#1

Updated by Laurent Opprecht over 8 years ago

  • Assignee set to Laurent Opprecht
#2

Updated by Laurent Opprecht over 8 years ago

  • % Done changed from 0 to 40

Moved api_session_xxx to the session class.
Move api_session_start to ChamiloSession to leave Session independent of Chamilo specific code
Renamed function names to match Symphony (read, write, etc) - not sure if its really worth it but this is easy to change.
Added typed properties (user/group/course) to make attributes explicit.

Could do:

add session() function to provide a shortcut
add namespace to Session, move ChamiloSession to Chamilo/Session
move login logic from local - not too happy about doing that as it is a bit risky, will try to keep that for later if I can, but I am a bit stuck with the redirect logic.

#3

Updated by Laurent Opprecht over 8 years ago

Unfortunately FCK editor already define a Session class which clashes with session

moved Session to system/session and into namespace System\Session
added use Chamilo/Session as Session

could be worth to move chamilo classes under it own namespace - chamilo - but would generate a bit of work.

#4

Updated by Yannick Warnier over 8 years ago

Laurent Opprecht wrote:

could be worth to move chamilo classes under it own namespace - chamilo - but would generate a bit of work.

Due to previous history, I would prefer avoiding trademark-specific code. I prefer using "main" or "general" or "core" or anything else than specifically "chamilo". I want the whole package to remain as free as possible to re-use and extend.

#5

Updated by Julio Montoya over 8 years ago

Laurent Opprecht wrote:

Unfortunately FCK editor already define a Session class which clashes with session

moved Session to system/session and into namespace System\Session
added use Chamilo/Session as Session

could be worth to move chamilo classes under it own namespace - chamilo - but would generate a bit of work.

the session.class.php blocks fckeditor see #4802 #4787

#6

Updated by Julio Montoya over 8 years ago

  • Priority changed from Normal to High
#7

Updated by Laurent Opprecht over 8 years ago

Now that I am thinking about it I don't believe I pushed the new code to the repo. Will do it.

#8

Updated by Laurent Opprecht over 8 years ago

  • Priority changed from High to Normal

I just uploaded the patch.

I would agree that selecting a "neutral" name would be better. I was wondering about the following:

lms
connect (but that would be subject to rebranding)
(e)learning
core

I have a few classes under system but they are generic - i.e. not related to the application.

#9

Updated by Julio Montoya over 8 years ago

when entering to the document tool in a course I found this error:

Fatal error: require_once() [function.require]: Failed opening required '/var/www/chamilonet/main/inc/lib/../../..//main/inc/lib/portfolio.class.php' (include_path='.:/var/www/chamilonet/main/inc/lib/pear:/usr/share/php:/usr/share/pear') in /var/www/chamilonet/main/inc/lib/autoload.class.php on line 493

I supposed you're still working on it and some files are missing ...

#10

Updated by Laurent Opprecht over 8 years ago

Ah so much for pushing code too fast. The portfolio/mahara change will come later on.

#11

Updated by Juan Carlos RaƱa Trabado over 8 years ago

In a new installation after push install chamilo

Warning: require_once(C:/xampp/htdocs/Chamilo/main/inc/lib/session.class.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\Chamilo\main\install\index.php on line 41

Fatal error: require_once() [function.require]: Failed opening required 'C:/xampp/htdocs/Chamilo/main/inc/lib/session.class.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\Chamilo\main\install\index.php on line 41

#12

Updated by Laurent Opprecht over 8 years ago

Corrected

#13

Updated by Laurent Opprecht over 8 years ago

  • % Done changed from 40 to 90
#14

Updated by Yannick Warnier over 8 years ago

  • Target version set to 1.9 RC1
#15

Updated by Laurent Opprecht about 8 years ago

  • Status changed from New to Needs testing
  • % Done changed from 90 to 100

At this point it is good for me. Note that it may be worth to rename when we introduce a common namespace.

#16

Updated by Yannick Warnier about 8 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Needs testing to Feature implemented

Good for me too

Also available in: Atom PDF