예제 #1
0
 public static function get($value_DGFSrtfg5, $data_kGdfgdf = null)
 {
     $name_fgdfgdf = str_replace('.', '/', $value_DGFSrtfg5);
     if (!is_null($data_kGdfgdf)) {
         foreach ($data_kGdfgdf as $key => $value2) {
             ${$key} = $value2;
         }
     }
     //
     ob_start();
     // start output buffering
     //get File
     //
     $name_fgdfgdf = str_replace('.', '/', $value_DGFSrtfg5);
     //
     $link1 = Application::$root . 'app/views/' . $name_fgdfgdf . '.php';
     $link2 = Application::$root . 'app/views/' . $name_fgdfgdf . '.tpl.php';
     $link3 = '';
     //
     $tpl = false;
     //
     if (file_exists($link1)) {
         $link3 = $link1;
         $tpl = false;
     } else {
         if (file_exists($link2)) {
             $link3 = $link2;
             $tpl = true;
         } else {
             $link3 = $name_fgdfgdf;
             $tpl = false;
         }
     }
     //
     //Show the output
     if ($tpl) {
         self::$showed = "tpl";
         Template::show($link3, $data_kGdfgdf);
     } else {
         self::$showed = "smpl";
         include $link3;
     }
     //
     $returned_value = ob_get_contents();
     // get contents from the buffer
     ob_end_clean();
     //
     return $returned_value;
 }
예제 #2
0
 public static function run($root = "../", $routes = true, $session = true)
 {
     ob_start();
     //
     self::$root = $root;
     //
     require self::$root . 'vendor/fiesta/kernel/Logging/Handler.php';
     require self::$root . 'vendor/fiesta/kernel/Logging/Log.php';
     // Config
     require self::$root . 'vendor/fiesta/kernel/Config/Config.php';
     require self::$root . 'vendor/fiesta/kernel/Config/Exceptions/ConfigException.php';
     Config::load();
     // Set Timezone
     self::timeCall();
     // Set the error log
     Log::ini();
     // Set Whoops error handler
     Handler::run();
     //session
     require self::$root . 'vendor/fiesta/kernel/Storage/Session.php';
     if ($session) {
         Session::start(self::$root . 'app/storage/session');
     }
     //Maintenance
     require self::$root . 'vendor/fiesta/kernel/Maintenance/Maintenance.php';
     //Objects
     require self::$root . 'vendor/fiesta/kernel/Objects/Vars.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Strings/Strings.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Strings/Exceptions/StringOutIndexException.php';
     // Access
     require self::$root . 'vendor/fiesta/kernel/Access/Path.php';
     //Alias
     require self::$root . 'vendor/fiesta/kernel/Config/Alias.php';
     //
     //require self::$root.'vendor/fiesta/kernel/MVC/Templete.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Exception.php';
     require self::$root . 'vendor/fiesta/kernel/Resources/Faker.php';
     require self::$root . 'vendor/fiesta/kernel/Storage/Cookie.php';
     // Routes
     require self::$root . 'vendor/fiesta/kernel/Router/Routes.php';
     require self::$root . 'vendor/fiesta/kernel/Router/Route.php';
     require self::$root . 'vendor/fiesta/kernel/Router/Exceptions/NotFoundHttpException.php';
     // Caches
     require self::$root . 'vendor/fiesta/kernel/Caches/Caches.php';
     require self::$root . 'vendor/fiesta/kernel/Caches/Cache.php';
     require self::$root . 'vendor/fiesta/kernel/Caches/FileCache.php';
     require self::$root . 'vendor/fiesta/kernel/Caches/DatabaseCache.php';
     require self::$root . 'vendor/fiesta/kernel/Caches/Exceptions/DriverNotFoundException.php';
     require self::$root . 'vendor/fiesta/kernel/Storage/Storage.php';
     require self::$root . 'vendor/fiesta/kernel/Security/Auth.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Table.php';
     // Database
     require self::$root . 'vendor/fiesta/kernel/Database/Schema.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Migration.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Seeder.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Database.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Drivers/MySql.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Exceptions/DatabaseArgumentsException.php';
     require self::$root . 'vendor/fiesta/kernel/Database/Exceptions/DatabaseConnectionException.php';
     require self::$root . 'vendor/fiesta/kernel/Access/Url.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Sys.php';
     require self::$root . 'vendor/fiesta/kernel/Http/Links.php';
     require self::$root . 'vendor/fiesta/kernel/Http/Http.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/Base.php';
     require self::$root . 'vendor/fiesta/kernel/Resources/Libs.php';
     require self::$root . 'vendor/fiesta/kernel/Hypertext/Res.php';
     require self::$root . 'vendor/fiesta/kernel/Hypertext/Input.php';
     require self::$root . 'vendor/fiesta/kernel/Security/License.php';
     self::translatorCalls();
     self::modelsCalls();
     self::relationsCalls();
     self::mediaCalls();
     // MVC - View
     require self::$root . 'vendor/fiesta/kernel/MVC/View/View.php';
     require self::$root . 'vendor/fiesta/kernel/MVC/View/Libs/Template.php';
     require self::$root . 'vendor/fiesta/kernel/MVC/View/Libs/Views.php';
     require self::$root . 'vendor/fiesta/kernel/MVC/View/Exceptions/ViewNotFoundException.php';
     require self::$root . 'vendor/fiesta/kernel/Hypertext/HTML.php';
     require self::$root . 'vendor/fiesta/kernel/Security/Encrypt.php';
     require self::$root . 'vendor/fiesta/kernel/Security/Security.php';
     require self::$root . 'vendor/fiesta/kernel/MVC/Controller.php';
     require self::$root . 'vendor/fiesta/kernel/Http/Error.php';
     require self::$root . 'vendor/fiesta/kernel/Http/Root.php';
     require self::$root . 'vendor/fiesta/kernel/Mailing/Mail.php';
     require self::$root . 'vendor/fiesta/kernel/Objects/DataCollection.php';
     require self::$root . 'vendor/fiesta/kernel/Maintenance/Debug.php';
     // Filesystem
     require self::$root . 'vendor/fiesta/kernel/Filesystem/Exceptions/FileNotFoundException.php';
     require self::$root . 'vendor/fiesta/kernel/Filesystem/Exceptions/DirectoryNotFoundException.php';
     require self::$root . 'vendor/fiesta/kernel/Filesystem/Filesystem.php';
     // Database files
     require self::$root . 'vendor/fiesta/kernel/Database/DBTable.php';
     //
     Alias::ini(self::$root);
     Sys::ini();
     Url::ini();
     Path::ini();
     Template::run();
     Faker::ini();
     Links::ini();
     Errors::ini(self::$root);
     License::ini(self::$page);
     Lang::ini();
     Database::ini();
     Auth::ini();
     Panel::run();
     self::scoopCall();
     //
     if (self::$root != null) {
         // include models
         foreach (glob(self::$root . "app/models/*.php") as $file) {
             include_once $file;
         }
         //include the controllers files
         foreach (glob(self::$root . "app/controllers/*.php") as $file) {
             include_once $file;
         }
         //include the link files
         foreach (glob(self::$root . "app/paths/*.php") as $file) {
             include_once $file;
         }
         //include the seeders files
         foreach (glob(self::$root . "app/seeds/*.php") as $file) {
             include_once $file;
         }
         //
         //include filters
         include_once self::$root . "app/http/Filters.php";
         //include for routes
         if ($routes) {
             include_once self::$root . "app/http/Routes.php";
             Routes::run();
         }
     } else {
         // include models
         foreach (glob("app/models/*.php") as $file) {
             include_once $file;
         }
         //include the controllers files
         foreach (glob("app/controllers/*.php") as $file) {
             include_once $file;
         }
         //include the seeders files
         foreach (glob("app/seeds/*.php") as $file) {
             include_once $file;
         }
         //include filters
         include_once "app/http/Filters.php";
         //include for routes
         if ($routes) {
             include_once "app/http/Routes.php";
             Routes::run();
         }
     }
     return true;
 }