TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Phar as ruby's gem equivalent?
  • Hello everyone. What about using phar as ruby's gem equivalent, so Kohana modules could be easily versioned and deployed? We could also make an elegant CLI with module packaging and something like ruby's bundler.
  • What about it? I'm actually not very familiar with phar. What does it offer that git doesn't?
  • Phar is way to distribute PHP code as a single file. PECL (and PEAR) are more similar to Ruby gems than phar. We could consider distributing Kohana releases as phar archives as well as zip, but I think using git with submodules is a more effective development and deployment strategy.
  • (apologies for digging up an old thread)

    What I currently notice is that when I do work for clients and they only have simple shared hosting available with FTP access, that it always takes such a long time to upload a new version of a site. Not because of the size in bytes but of the number of small files. Often there is only something like a 150kb to an application but it takes like 2 min to upload it. The ability to compile everything into separate (or a single) phar would really be a nice feature since uploading would be a lot faster.

  • @pan69

    Can't you just archive it, upload, then extract it?

    Also is phar so complicated that it needs to be directly supported by kohana to work? I'm not familiar with it.

  • If you're talking about apps as well, and you don't have SSH, I think it would be much easier to just gzip the whole thing on your side as part of build and then all you have to upload is the gzip and a little php script (or whatever) to unpack it (and do any other post-deployment activity required). Call that script from a browser, and probably have it delete itself once it runs successfully.

    I haven't really used phar, but wouldn't it interfere with the CFS?

  • Yeah I think it would get in the way of the CFS, unless there are ways for autoloaders to look inside? Not super familiar with them either

  • Aren't all classes inside a phar already available? The autoloader would be meaningless at that point. The CFS would will work, as the phar wouldn't include index.php, which defines APPPATH, MODPATH, SYSPATH.

  • @zombor, had a quick look and it seems you can include whole phar which would define all the classes or use the phar streak wrapper to load individual files within it. So maybe you could define SYSPATH = phar://kohana.phar/ etc bit don't know whether it would actually work and don't think its a good idea...

  • That's why we don't distribute a phar :)

    Not much point with kohana.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion