SolarPHP on Mosso

posted by agentile on May 18, 2009, 7:47pm
0 comments


I use mosso for this site as well as a couple others and recently I wanted to use SolarPHP for one of them. Solar uses some symlinks near the base to reach deeper into the directory structure of Solar and your app to make things a little easier. Since mosso doesn't support symlinks I had to tweak Solar a bit. Here is what I did.

copy the main solar directories to web/ except for the docroot directory.

put solar/docroot contents in web/content

modify the .htaccess file in the web/content directory and add RewriteBase /  (needed for mod-rewrite with mosso)

make sure to chmod 777 -R on web/sqlite and web/tmp

in web/content/index.php change

set_include_path("$system/include");

TO

set_include_path($system);

AND

require_once "Solar.php";

TO

require_once "$system/source/solar/Solar.php";

change web/source/solar/Solar/Class/Stack.php _run() method from

include func_get_arg(0);

TO

$file = Solar_File::exists(func_get_arg(0)); include $file;

in web/source/solar/Solar/Path/Stack.php find() method

add

$spec = Solar_File::exists($spec);

BEFORE

return $spec;

In web/source/solar/Solar/File exists() method

add

if ($file[0] !== '/') {
    $first = strtolower(substr($file, 0, strpos($file, '/')));
    $file = 'source' . DIRECTORY_SEPARATOR . $first . DIRECTORY_SEPARATOR .  $file;
} else {
    $file = str_ireplace(Solar_Config::get('Solar', 'system') . '/source/', 'source/', $file);
}

AFTER

// no file requested?
$file = trim($file);
if (! $file) {
    return false;
}

Then for web/content/public instead of having the Solar and/or whatever
your vendor name is be a symlink to web/source/solar/Solar/App/Public

delete it and create a folder named Solar (or whatever your vendor name is) and put your images, scripts, etc folders within it.

That's it. You should now have a working Solar setup in mosso.


Tags: PHP, SolarPHP


Post a Comment



Calendar

July 2010
SuMTWThFSa
« Jun Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

Tags

Foresmo  (1) 
PHP  (2) 
Security  (1) 
SolarPHP  (1) 

Twitter

  • First run in the aqua vivos...It felt easier to run and gave my foot a workout. I think I'm going to like these shoes. #Terra_Plana

    July 12, 2010, 9:36am
  • @funkatron I'd stick to the spec.

    January 30, 2010, 11:14am
  • @UrbanAJ I have a triple boot...and ended up switching to Windows ...just that I shouldn't have to.

    January 24, 2010, 4:09pm
  • #boingo airport wifi...what awfulness. Can't login to the site in linux and loving the giant image as a registration confirmation email.

    January 23, 2010, 1:20pm
  • very jealous of @shiflett 's trek to Grimaldi's and Bierkraft

    January 5, 2010, 5:43pm