Example #1
0
 public static function fromFile($path, $name)
 {
     $path = rtrim($path, '/');
     $ymlPath = "{$path}/{$name}.yml";
     // Make paths to the local install relative
     $tikiRoot = realpath(__DIR__ . '/../../../') . '/';
     if (strpos($path, $tikiRoot) === 0) {
         $path = substr($path, strlen($tikiRoot));
     }
     $profile = new self();
     $profile->domain = "file://{$path}";
     $profile->profile = $name;
     $profile->pageUrl = $name;
     $profile->transport = new Tiki_Profile_Transport_File($path, $name);
     if (file_exists($ymlPath)) {
         $profile->data = Horde_Yaml::load(file_get_contents($ymlPath));
         $profile->fetchExternals();
         $profile->getObjects();
         return $profile;
     }
     return false;
 }
Example #2
0
 public static function fromFile($path, $name)
 {
     $path = rtrim($path, '/');
     $ymlPath = "{$path}/{$name}.yml";
     $profile = new self();
     $profile->domain = "file://{$path}";
     $profile->profile = $name;
     $profile->pageUrl = $name;
     $profile->transport = new Tiki_Profile_Transport_File($path, $name);
     if (file_exists($ymlPath)) {
         $profile->data = Horde_Yaml::load(file_get_contents($ymlPath));
         $profile->fetchExternals();
         $profile->getObjects();
         return $profile;
     }
     return false;
 }