developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 12 years ago

Closed 12 years ago

#776 closed bug (fixed)

scripts: createapp -wwwpath "somepath" doesn't work under windows

Reported by: bibo Owned by: bibo
Priority: normal Milestone: jelix 1.1
Component: jelix-scripts Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

the culprit is realpath which is called to obtain a canonical absolute path. Under windows, it returns an empty string if the path does not exist...

So we should implement our own version, instead.

Attachments (2)

#776-trunk-createapp-wwwpath.patch (7.2 KB) - added by bibo 12 years ago.
implement our own version of realpath
#776-trunk-createapp-wwwpath.2.patch (33.8 KB) - added by bibo 12 years ago.
take two, include lib.files.php in Jelix and expose its api through jFile

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by bibo

implement our own version of realpath

comment:1 Changed 12 years ago by bibo

  • Owner set to bibo
  • Status changed from new to assigned

my patch adds a getCanonicalPath to the base command class. this fixes the problem under windows and still work well under linux/unix.

note: this patch solves also #775

comment:2 Changed 12 years ago by laurentj

  • review set to review-

If the function is imported from clearbricks, then you forgot to include the copyright, authors, licence in the header of the function.

However, perhaps it could be better to include the original file in lib/clearbricks/ if there isn't too much dependencies with other files of clearbricks, and if we can call this methods without instancying thousand of classes :-)

comment:3 Changed 12 years ago by bibo

  • review review- deleted

I hadn't already asked review but lucky luke laurentj fires faster than his svn tool :)

Now, I've look more thoroughly into lib.files.php of clearbricks. This brings a lot of methods Jelix doesn't have. It seems to have no dependance at all. I suggest to inherit from it and expose those methods through jFile API.

thoughts ?

comment:4 Changed 12 years ago by bibo

Well, files class has one dependance. Also, some of its methods intersects with jFile methods.

We have to patch lib.files.php to add it to Jelix. I will post a patch that :

  • get rid of the dependance
  • hide methods in files class already implemented by jFile

Changed 12 years ago by bibo

take two, include lib.files.php in Jelix and expose its api through jFile

comment:5 Changed 12 years ago by bibo

take two, include lib.files.php in Jelix and expose its api through jFile.

I had to patch lib.files.php a bit since some methods are redundant with existing one in jFile. I also commented tidyFilename method which induced a dependance.

In jFile, I've added a wrapper around path::real method. I didn't want to bother creating another utility say jDir. Maybe on a future spin....

patch still solves #775.

comment:6 Changed 12 years ago by bibo

  • review set to review?

comment:7 Changed 12 years ago by laurentj

  • Resolution set to fixed
  • review review? deleted
  • Status changed from assigned to closed

fixed in the trunk+1.1.x. r1237.

I didn't extends jFile from the file class, since it includes many methods which isn't used by the core (jFile is used in the core).

Note: See TracTickets for help on using tickets.