Ejemplo n.º 1
0
 /**
  * Returns the toolkit for this date/time.
  * This basic date/time class uses the {@link global_date_time_toolkit()},
  * which is fine for most applications. Applications which need specialized
  * toolkits can define a descendant and redefine this function.
  * @see formatter()
  * @see use_toolkit()
  * @return DATE_TIME_TOOLKIT
  */
 public function toolkit()
 {
     if (isset($this->_toolkit)) {
         $Result = $this->_toolkit;
     } else {
         $Result = global_date_time_toolkit();
     }
     return $Result;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->date_time_toolkit = global_date_time_toolkit();
     $this->file_options = global_file_options();
     $this->url_options = global_url_options();
     $this->logs = new LOGGER_CONTAINER();
     parent::__construct();
     $this->auto_detect_os();
     /* server-local paths */
     $this->set_path(Folder_name_system_temp, temp_folder());
     $this->set_forced_root(Folder_name_system_temp, false);
     $this->set_path(Folder_name_logs, '/var/log');
     $this->set_forced_root(Folder_name_logs, false);
     /* URLs */
     $this->set_path(Folder_name_root, '/');
     $this->set_path(Folder_name_resources, '{' . Folder_name_root . '}');
     $this->set_path(Folder_name_apps, '{' . Folder_name_root . '}');
     $this->set_path(Folder_name_data, '{' . Folder_name_root . '}data');
     $this->set_path(Folder_name_pages, '{' . Folder_name_resources . '}');
     $this->set_path(Folder_name_functions, '{' . Folder_name_pages . '}');
     $this->set_path(Folder_name_icons, '{' . Folder_name_resources . '}icons');
     $this->set_path(Folder_name_styles, '{' . Folder_name_resources . '}styles');
     $this->set_path(Folder_name_themes, '{' . Folder_name_styles . '}themes');
     $this->set_path(Folder_name_scripts, '{' . Folder_name_resources . '}scripts');
     $this->set_extension(Folder_name_themes, 'css');
     $this->set_extension(Folder_name_styles, 'css');
     $this->set_extension(Folder_name_scripts, 'js');
     $this->set_extension(Folder_name_icons, 'png');
     /* Set up the path to the library. */
     $url = new FILE_URL(realpath(__FILE__));
     $url->strip_name();
     $url->go_back();
     $url->go_back();
     $this->library_path = $url->as_text();
 }