]> Kevux Git Server - koopa/commitdiff
Update: Use PHP namespaces
authorKevin Day <thekevinday@gmail.com>
Fri, 22 Sep 2017 01:21:33 +0000 (20:21 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 22 Sep 2017 01:21:33 +0000 (20:21 -0500)
This enables the use of PHP namespaces.
The namespaces must be prefixed with 'n_'.
The parent namespace for koopa is 'n_koopa'.

I intend to only use a single depth namespace of n_koopa to keep it simple.
All other names remain unchanged.

This introduces a few problems/caveats:
1) Functions being stored as strings to be called dynamically now need to have '/n_koopa/' in front of them.
2) The standard index file in implementing projects, such as reservations, must still use namespace 'n_koopa' even if their project is different.
- This is because the base classes will call the c_base_defaults_global class.
- All other implementing project files can have their own namespace.
3) Core PHP classes very likely need to have '\' prefixed to them (will update as I encounter them).

This introduced new resolutions:
1) Using namespaces revealed a bug in my code where a class function get_roles() is called on an object that may potentially be a c_base_return_false object.
- I have to review the code and confirm whether or not the code should always be returning the appropriate class or allow other returns.
- For now, I am just adding a quick instance check.

128 files changed:
common/base/classes/base_access.php
common/base/classes/base_address.php
common/base/classes/base_ajax.php
common/base/classes/base_array.php
common/base/classes/base_ascii.php
common/base/classes/base_charset.php
common/base/classes/base_cml.php
common/base/classes/base_cookie.php
common/base/classes/base_database.php
common/base/classes/base_debug.php
common/base/classes/base_defaults_global.php
common/base/classes/base_email.php
common/base/classes/base_error.php
common/base/classes/base_error_messages_english.php
common/base/classes/base_error_messages_japanese.php
common/base/classes/base_file.php
common/base/classes/base_form.php
common/base/classes/base_html.php
common/base/classes/base_http.php
common/base/classes/base_http_status.php
common/base/classes/base_languages.php
common/base/classes/base_ldap.php
common/base/classes/base_log.php
common/base/classes/base_markup.php
common/base/classes/base_menu.php
common/base/classes/base_mime.php
common/base/classes/base_path.php
common/base/classes/base_paths.php
common/base/classes/base_return.php
common/base/classes/base_rfc_char.php
common/base/classes/base_rfc_string.php
common/base/classes/base_roles.php
common/base/classes/base_session.php
common/base/classes/base_users.php
common/base/classes/base_utf8.php
common/base/classes/base_view.php
common/base/classes/base_warning.php
common/standard/classes/standard_database.php
common/standard/classes/standard_index.php
common/standard/classes/standard_menu.php
common/standard/classes/standard_path.php
common/standard/classes/standard_path_exception.php
common/standard/classes/standard_path_user.php
common/standard/classes/standard_paths.php
common/standard/classes/standard_users.php
common/standard/internal/access_denied.php
common/standard/internal/bad_method.php
common/standard/internal/index.php
common/standard/internal/ja/access_denied.php
common/standard/internal/ja/bad_method.php
common/standard/internal/ja/index.php
common/standard/internal/ja/not_found.php
common/standard/internal/ja/server_error.php
common/standard/internal/not_found.php
common/standard/internal/options.php
common/standard/internal/server_error.php
common/standard/menus/ja/menu_breadcrumbs.php
common/standard/menus/ja/menu_content.php
common/standard/menus/ja/menu_content_user_view.php
common/standard/menus/ja/menu_footer.php
common/standard/menus/ja/menu_header.php
common/standard/menus/ja/menu_utility.php
common/standard/menus/menu_breadcrumbs.php
common/standard/menus/menu_content.php
common/standard/menus/menu_content_user_view.php
common/standard/menus/menu_footer.php
common/standard/menus/menu_header.php
common/standard/menus/menu_utility.php
common/standard/paths/a/administer_content.php
common/standard/paths/a/administer_dashboard.php
common/standard/paths/a/administer_logs.php
common/standard/paths/a/ja/administer_content.php
common/standard/paths/a/ja/administer_dashboard.php
common/standard/paths/a/ja/administer_logs.php
common/standard/paths/c/cache_error.php
common/standard/paths/c/cache_static.php
common/standard/paths/c/ja/cache_error.php
common/standard/paths/c/ja/cache_static.php
common/standard/paths/f/file_by_checksum.php
common/standard/paths/f/file_by_id.php
common/standard/paths/f/file_checksum_by_checksum.php
common/standard/paths/f/file_checksum_by_id.php
common/standard/paths/f/ja/file_by_checksum.php
common/standard/paths/f/ja/file_by_id.php
common/standard/paths/f/ja/file_checksum_by_checksum.php
common/standard/paths/f/ja/file_checksum_by_id.php
common/standard/paths/m/ja/management_content.php
common/standard/paths/m/ja/management_dashboard.php
common/standard/paths/m/ja/management_logs.php
common/standard/paths/m/management_content.php
common/standard/paths/m/management_dashboard.php
common/standard/paths/m/management_logs.php
common/standard/paths/s/ja/submit_form_id.php
common/standard/paths/s/submit_form_id.php
common/standard/paths/u/ja/user_check.php
common/standard/paths/u/ja/user_dashboard.php
common/standard/paths/u/ja/user_delete.php
common/standard/paths/u/ja/user_edit.php
common/standard/paths/u/ja/user_lock.php
common/standard/paths/u/ja/user_login.php
common/standard/paths/u/ja/user_logout.php
common/standard/paths/u/ja/user_refresh.php
common/standard/paths/u/ja/user_session.php
common/standard/paths/u/ja/user_settings.php
common/standard/paths/u/ja/user_unlock.php
common/standard/paths/u/ja/user_view.php
common/standard/paths/u/user_check.php
common/standard/paths/u/user_create.php
common/standard/paths/u/user_dashboard.php
common/standard/paths/u/user_delete.php
common/standard/paths/u/user_edit.php
common/standard/paths/u/user_lock.php
common/standard/paths/u/user_login.php
common/standard/paths/u/user_logout.php
common/standard/paths/u/user_refresh.php
common/standard/paths/u/user_session.php
common/standard/paths/u/user_settings.php
common/standard/paths/u/user_unlock.php
common/standard/paths/u/user_view.php
common/theme/classes/theme_dom.php
common/theme/classes/theme_form.php
common/theme/classes/theme_html.php
common/theme/classes/theme_markup.php
common/view/classes/view_log_users_self.php
documentation/naming.txt
examples/test.php
program/reservation/index.php
program/reservation/reservation_defaults_global.php

index ef47c10a8c3908f5a27ff858f2176a3a7befaef7..067685677c48caf4892b9af66a987fe4f08a5f50 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a class for managing system access.
  */
+namespace n_koopa;
 
 // include required files.
 require_once('common/base/classes/base_error.php');
index 291fea3548f7b53ad27016d6262cbb2ca1765c04..b856419b5dc62811b42bcae2941035f87b426215 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing addresses.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 0aecb97bbb1c80bc39e3c9d9a0d2691e4d2aba49..0acf835667591ea858fc50e2fdf5fd5140af1cb9 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing AJAX responses.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_array.php');
index dfbd8a8a6bea0917b64e873f9b3f9352cb34dac4..645cc27a255eae6edf91990378cf0a7afa686948 100644 (file)
@@ -8,6 +8,8 @@
  * - Only the return values of the core c_base_return_* functions return direct/raw values.
  * - All other functions are expected to return some class or sub-class of c_base_return.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_rfc_string.php');
index e926520ca40dc7e00cb789c418af4bb650f1c195..a6cf3a9a09ea322051c6b5d64ff82aef3636a192 100644 (file)
@@ -4,6 +4,8 @@
  * Provides a class for managing ASCII.
  */
 
+namespace n_koopa;
+
 /**
  * A class for managing ASCII.
  */
index 256130f10bc6836455b773d2fc23f491023cccdb..767752ce27b884178f5fe5a4beb7d41d36b7083b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a class for managing common charsets.
  */
+namespace n_koopa;
 
 /**
  * A class for managing common rfc character sets.
index c3e9c7b65fd4fea824cae446a84dedb8decd29fb..671daef81660f57f32de6c9e145061b154ff9ef9 100644 (file)
@@ -10,3 +10,4 @@
  *
  * @see: https://www.w3.org/TR/html5/
  */
+namespace n_koopa;
index 4d733890b77cc1885e791556f4755132edbdcd4e..bf001942a20a6e45366fa9752abd6a0e2b30e434 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing cookies.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 45a65d53cb8cd48e8442d2f80485f9fbf3745d04..b7c83ca4e0aefee82a1d5718815257c70a2cac4d 100644 (file)
@@ -29,6 +29,8 @@
  *
  * @see: http://php.net/manual/en/features.persistent-connections.php
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_warning.php');
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index a29e99094dfd78dc206511c6983bd766a3f904d0..692ae32092465a9705fbb4b342073191935c8ed2 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for performing debugging.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 54b75ef3cbf8375cd1d7f046c84e4b82d98d7e07..a4c693f6e0eb97e643d34a3a580c2b5a108ac3d4 100644 (file)
@@ -14,6 +14,7 @@
  *
  * It is recommended to set PHP precision setting to at least 16 for microtime values.
  */
+namespace n_koopa;
 
 
 /**
@@ -173,7 +174,7 @@ class c_base_defaults_global {
       $now = self::s_get_timestamp_session()->get_value_exact();
       $microseconds = (int) (($now - ((int) $now)) * 1000000);
 
-      $date = new DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now));
+      $date = new \DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now));
       unset($now);
     }
     else {
@@ -184,18 +185,18 @@ class c_base_defaults_global {
         $microseconds = 0;
       }
 
-      $date = new DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp));
+      $date = new \DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp));
     }
     unset($microseconds);
 
-    if (!($date instanceof DateTime)) {
+    if (!($date instanceof \DateTime)) {
       $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE);
       return c_base_return_error::s_value('', 'c_base_return_string', $error);
     }
 
     if (!is_null(self::$s_timezone)) {
       date_default_timezone_set(self::$s_timezone);
-      $date->setTimeZone(new DateTimeZone(self::$s_timezone));
+      $date->setTimeZone(new \DateTimeZone(self::$s_timezone));
     }
 
     $formatted = $date->format($string);
@@ -235,9 +236,9 @@ class c_base_defaults_global {
     }
 
     // To ensure support for microseconds (and milliseconds), datetime must be initialized woth microseconds.
-    $date = DateTime::createFromFormat($format, $string);
+    $date = \DateTime::createFromFormat($format, $string);
 
-    if (!($date instanceof DateTime)) {
+    if (!($date instanceof \DateTime)) {
       $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE);
       return c_base_return_error::s_value(0.0, 'c_base_return_float', $error);
     }
index 6f228161b9f2c3e24018194fad45fdcbd3fa30d9..27b3cd6578f9cc84a5efbb457c532827dbab4b61 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing e-mail related functionality.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_ascii.php');
index e00dc4c48c21278234c6bd39756bde01d46d0a86..e756ff10ae8ee2b42c1819294f36458676df9dcc 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a class for managing return values.
  */
+namespace n_koopa;
 
 /**
  * A generic class for managing errors.
index 17a7a6d03b344fd1bc0fb4246daee0adbc96f691..33fd0909b3f31fd67853afdb59865806158d4b0a 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Implements english language support for common error messages.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_languages.php');
index 933a45eeb95fc618f5bc051c3784665f60b19e7d..db9403ebbd4353b07d76720bb54c1d7df2e9fe18 100644 (file)
@@ -8,6 +8,8 @@
  *             I have also noticed that the presence of a period '.' at the end of the string changes translation.
  *             This may require a completely different approach to generating than what works with english.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_languages.php');
index e72e24ff0861e3d744c643f9acffdfefcd242396..72e46da67c3b6dd76286532125a4e3aa811828fc 100644 (file)
@@ -5,6 +5,8 @@
  *
  * This is primarily intended to be used to store file data (of any format) prior to theme output.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_mime.php');
index d305ef9fb2c8eed1218c6dc62964a02727fc509e..95ed2f45f2d57869369a356b34947cd00770db6b 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing forms.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index cdb883bba5f93a9ba99bab88ef9ee360f7c5dd0d..95fe6046e4c67fc1ff0ee5372cf29b4b6bcd9375 100644 (file)
@@ -7,6 +7,8 @@
  *
  * @see: https://www.w3.org/TR/html5/
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_markup.php');
index aabcd9f768ec44b2416c43d88ce58e557952070e..381a05226d5e6456e1f12df4ce1a655c0bbb6284 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the HTTP protocol.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_charset.php');
index 5432d132b7f2e3fb20f0c32592cd023bbae74d58..6dbafcc5b0021ecee378e8af78909adb6dd30d6d 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the HTTP protocol status codes.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index ee2ffb18ccde991a236c97c90fca144eb9b89319..d0b8ace90e448ec55a9e27b8d76c1d14a9cfb1f6 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the different supported languages.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 55462c86aa2e57872ecf77a33d6433696701b70e..d3f33d575f39157d137cea606fa783e02d4bd063 100644 (file)
@@ -5,6 +5,8 @@
  *
  * This is initially designed just to select/read from the ldap and not meant to modify or manage ldap databases.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 6a783f34f30c79ead6d4f37c61aa4eb9aa4bd558..f4bc9866863ce50db805c3f0165399283a5fe7b5 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the logs.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index ae3510b9a6debcfd8068a3652fe6a9fe93921427..93b4e421dd3265fb24e5243a9b5f3e579429eb89 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for html markup.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_mime.php');
index 099c3ac8ad046356cedac3d523047c7998a110a6..9e3a18379f1c7dd476a622f4e8d755fe32d85ffd 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the menus.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_rfc_string.php');
index 1c0254726ef15b4c33776d3f2f85e337a0fa7647..8de2e4c4528173f182da98767ee31832f9273fd4 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing mime-type information.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index a9cb7813278bb4352c27a6e5e9f2f80b76ed7afa..fa4c708139c77ecff32f8d96f05976bde08e984a 100644 (file)
@@ -15,6 +15,8 @@
  * Then, for very specific cases, users should then be granted the ability to create path aliases.
  * However, aliases should not be able to override pre-define paths or the performance gains are lost by requiring loading of the aliases before each static path.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_utf8.php');
index 80b930b207a6599a308871b22047cffcec07b2c9..657849f274edcb109de7370336c8b18636a6b7fb 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing hard coded and dynamic paths.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_http.php');
index 70554b5b37b128484e2dc7a2ed1ea9c98a6b2f3a..d39965ab6114b41cd93c66f9c4e47a975d72b8e4 100644 (file)
@@ -17,6 +17,8 @@
  * Functions defined in this class will return the normal TRUE/FALSE and not the class-based TRUE/FALSE as an exception to this rule.
  * - This is done because this class defines those objects.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 
 /**
index df672dbdecd98a9ef8b198f9cb9f52c35d53ad32..bc62980f5d6c7232af1cfba6608d39e1c3248a75 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing common rfc character testing cases.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_ascii.php');
 require_once('common/base/classes/base_utf8.php');
index 5333f1f7aa7b0fb682e9f925161da1ba1ca5aa8b..6472b31f14e037f5e7d0fb635177e2c1d6fdb14b 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing common rfc string testing cases.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_ascii.php');
 require_once('common/base/classes/base_utf8.php');
index 9dde111cca994913c989acb179bef7c4d0d89f80..fa08d48c3fb565064b2a8ab7df80394768ef53f5 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing system roles.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index 66d151bc19c24cfcc0eb81efa7e1e943c6f32bca..5677cbd6398b1ef8d334885370a272f3f7fe2640 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing sessions.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_form.php');
index 31d9bc76bc8bab6105fd6a3fb5281545f56e4350..a17a96ddb0346aab7cf02f010b80c6a864beb5f4 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing system roles.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_address.php');
index 165f35aee72d460307c600a375a2b661a45aae75..3b79b150a02700f8b3ce29dcb33b832b8d155a08 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides UTF-8 support.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 
index a6395d78508e4d2d5b015ac6124f4f772d8d7528..1e62487ffb7e083022efb01edcb3275e7e7cca63 100644 (file)
@@ -5,6 +5,8 @@
  *
  * This is for providing a common api for loading views from the database.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_database.php');
index e851d914bffc1514347571bb053767b14bd112f7..e635f503fe3ec5af9d970391b95db121b06adf97 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing PHP warnings.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_return.php');
 
 /**
index a72bb669e509a6e9d0bbcb09f2f8ae521e7451e7..c5172546d7e054ab4848b075d5c9d896cdb1f5ef 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides the standard database class.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_database.php');
index 310f981f404a42610c3ac911e6c44c4854b78207..de90c26e26ffc1819697a565634128ddd29ba2c6 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides the standard site index class.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_users.php');
index ef997dfd281095d2cbb68533501a599db82f6ead..b6224a6bc8a6275ddef515d90b011582c674ef4c 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing the menus.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_menu.php');
 
 /**
index cd9683d453094020f426674cdac155eb218c05fe..389feb267ee253a3f205a4d314d45e6e46d099b8 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides the standard path handling class.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_menu.php');
@@ -84,11 +86,11 @@ class c_standard_path extends c_base_path {
   protected const NAME_MENU_CONTENT     = 'menu_content';
   protected const NAME_MENU_FOOTER      = 'menu_footer';
 
-  protected const HANDLER_MENU_HEADER      = 'c_standard_menu_header';
-  protected const HANDLER_MENU_UTILITY     = 'c_standard_menu_utility';
-  protected const HANDLER_MENU_BREADCRUMBS = 'c_standard_menu_breadcrumbs';
-  protected const HANDLER_MENU_CONTENT     = 'c_standard_menu_content';
-  protected const HANDLER_MENU_FOOTER      = 'c_standard_menu_footer';
+  protected const HANDLER_MENU_HEADER      = '\n_koopa\c_standard_menu_header';
+  protected const HANDLER_MENU_UTILITY     = '\n_koopa\c_standard_menu_utility';
+  protected const HANDLER_MENU_BREADCRUMBS = '\n_koopa\c_standard_menu_breadcrumbs';
+  protected const HANDLER_MENU_CONTENT     = '\n_koopa\c_standard_menu_content';
+  protected const HANDLER_MENU_FOOTER      = '\n_koopa\c_standard_menu_footer';
 
   protected const SCRIPT_EXTENSION = '.php';
 
index ebed379ee6b0d1cd0fbe9b2e85425fdc4f012083..80be32854269cc2a6849050e037e392028cb97b4 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides the standard path handling for exceptional cases.
  */
+namespace n_koopa;
+
 require_once('common/standard/classes/standard_path.php');
 
 /**
index 4598ef589a872ba8f33e8aa7aa93683be21a59d1..f84cbfa8e36c92b3d44d029ee470653e9beb37d6 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides the standard path handling class with user-path specific parts.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 6d0340212a8af4b88c53e00f8f2bc271807576be..fb275ddd1f2d2dde63977e157c3c1eea54b81b3c 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides the standard site index class.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_paths.php');
@@ -114,53 +116,53 @@ class c_standard_paths extends c_base_return {
   protected const NAME_USER_UNLOCK    = 'user_unlock';
   protected const NAME_USER_VIEW      = 'user_view';
 
-  protected const HANDLER_ACCESS_DENIED  = 'c_standard_path_access_denied';
-  protected const HANDLER_BAD_METHOD     = 'c_standard_path_bad_method';
-  protected const HANDLER_INDEX          = 'c_standard_path_index';
-  protected const HANDLER_NOT_FOUND      = 'c_standard_path_not_found';
-  protected const HANDLER_OPTIONS_METHOD = 'c_standard_path_options_method';
-  protected const HANDLER_SERVER_ERROR   = 'c_standard_path_server_error';
-
-  protected const HANDLER_ADMINISTER_DASHBOARD = 'c_standard_administer_dashboard';
-  protected const HANDLER_ADMINISTER_CONTENT   = 'c_standard_administer_content';
-  protected const HANDLER_ADMINISTER_LOGS      = 'c_standard_administer_logs';
-
-  #protected const HANDLER_AJAX = 'c_standard_ajax';
-
-  protected const HANDLER_CACHE_STATIC = 'c_standard_cache_static';
-  protected const HANDLER_CACHE_ERROR  = 'c_standard_cache_error';
-
-  protected const HANDLER_FILE_BY_ID       = 'c_standard_file_by_id';
-  protected const HANDLER_FILE_BY_CHECKSUM = 'c_standard_file_by_checksum';
-
-  protected const HANDLER_FILE_CHECKSUM_BY_ID       = 'c_standard_file_checksum_by_id';
-  protected const HANDLER_FILE_CHECKSUM_BY_CHECKSUM = 'c_standard_file_checksum_by_checksum';
-
-  protected const HANDLER_MANAGEMENT_DASHBOARD = 'c_standard_management_dashboard';
-  protected const HANDLER_MANAGEMENT_CONTENT   = 'c_standard_management_content';
-  protected const HANDLER_MANAGEMENT_LOGS      = 'c_standard_management_logs';
-
-  protected const HANDLER_SUBMIT_FORM_ID = 'c_standard_submit_form_id';
-
-  #protected const HANDLER_THEME = 'c_standard_theme';
-
-  protected const HANDLER_USER_CHECK     = 'c_standard_path_user_check';
-  protected const HANDLER_USER_CONTACT   = 'c_standard_path_user_contact';
-  protected const HANDLER_USER_CONTENT   = 'c_standard_path_user_content';
-  protected const HANDLER_USER_CREATE    = 'c_standard_path_user_create';
-  protected const HANDLER_USER_DASHBOARD = 'c_standard_path_user_dashboard';
-  protected const HANDLER_USER_DELETE    = 'c_standard_path_user_delete';
-  protected const HANDLER_USER_EDIT      = 'c_standard_path_user_edit';
-  protected const HANDLER_USER_LOCK      = 'c_standard_path_user_lock';
-  protected const HANDLER_USER_LOGIN     = 'c_standard_path_user_login';
-  protected const HANDLER_USER_LOGOUT    = 'c_standard_path_user_logout';
-  protected const HANDLER_USER_LOGS      = 'c_standard_path_user_logs';
-  protected const HANDLER_USER_REFRESH   = 'c_standard_path_user_refresh';
-  protected const HANDLER_USER_RESET     = 'c_standard_path_user_reset';
-  protected const HANDLER_USER_SESSION   = 'c_standard_path_user_session';
-  protected const HANDLER_USER_SETTINGS  = 'c_standard_path_user_settings';
-  protected const HANDLER_USER_UNLOCK    = 'c_standard_path_user_unlock';
-  protected const HANDLER_USER_VIEW      = 'c_standard_path_user_view';
+  protected const HANDLER_ACCESS_DENIED  = '\n_koopa\c_standard_path_access_denied';
+  protected const HANDLER_BAD_METHOD     = '\n_koopa\c_standard_path_bad_method';
+  protected const HANDLER_INDEX          = '\n_koopa\c_standard_path_index';
+  protected const HANDLER_NOT_FOUND      = '\n_koopa\c_standard_path_not_found';
+  protected const HANDLER_OPTIONS_METHOD = '\n_koopa\c_standard_path_options_method';
+  protected const HANDLER_SERVER_ERROR   = '\n_koopa\c_standard_path_server_error';
+
+  protected const HANDLER_ADMINISTER_DASHBOARD = '\n_koopa\c_standard_administer_dashboard';
+  protected const HANDLER_ADMINISTER_CONTENT   = '\n_koopa\c_standard_administer_content';
+  protected const HANDLER_ADMINISTER_LOGS      = '\n_koopa\c_standard_administer_logs';
+
+  #protected const HANDLER_AJAX = '\n_koopa\c_standard_ajax';
+
+  protected const HANDLER_CACHE_STATIC = '\n_koopa\c_standard_cache_static';
+  protected const HANDLER_CACHE_ERROR  = '\n_koopa\c_standard_cache_error';
+
+  protected const HANDLER_FILE_BY_ID       = '\n_koopa\c_standard_file_by_id';
+  protected const HANDLER_FILE_BY_CHECKSUM = '\n_koopa\c_standard_file_by_checksum';
+
+  protected const HANDLER_FILE_CHECKSUM_BY_ID       = '\n_koopa\c_standard_file_checksum_by_id';
+  protected const HANDLER_FILE_CHECKSUM_BY_CHECKSUM = '\n_koopa\c_standard_file_checksum_by_checksum';
+
+  protected const HANDLER_MANAGEMENT_DASHBOARD = '\n_koopa\c_standard_management_dashboard';
+  protected const HANDLER_MANAGEMENT_CONTENT   = '\n_koopa\c_standard_management_content';
+  protected const HANDLER_MANAGEMENT_LOGS      = '\n_koopa\c_standard_management_logs';
+
+  protected const HANDLER_SUBMIT_FORM_ID = '\n_koopa\c_standard_submit_form_id';
+
+  #protected const HANDLER_THEME = '\n_koopa\c_standard_theme';
+
+  protected const HANDLER_USER_CHECK     = '\n_koopa\c_standard_path_user_check';
+  protected const HANDLER_USER_CONTACT   = '\n_koopa\c_standard_path_user_contact';
+  protected const HANDLER_USER_CONTENT   = '\n_koopa\c_standard_path_user_content';
+  protected const HANDLER_USER_CREATE    = '\n_koopa\c_standard_path_user_create';
+  protected const HANDLER_USER_DASHBOARD = '\n_koopa\c_standard_path_user_dashboard';
+  protected const HANDLER_USER_DELETE    = '\n_koopa\c_standard_path_user_delete';
+  protected const HANDLER_USER_EDIT      = '\n_koopa\c_standard_path_user_edit';
+  protected const HANDLER_USER_LOCK      = '\n_koopa\c_standard_path_user_lock';
+  protected const HANDLER_USER_LOGIN     = '\n_koopa\c_standard_path_user_login';
+  protected const HANDLER_USER_LOGOUT    = '\n_koopa\c_standard_path_user_logout';
+  protected const HANDLER_USER_LOGS      = '\n_koopa\c_standard_path_user_logs';
+  protected const HANDLER_USER_REFRESH   = '\n_koopa\c_standard_path_user_refresh';
+  protected const HANDLER_USER_RESET     = '\n_koopa\c_standard_path_user_reset';
+  protected const HANDLER_USER_SESSION   = '\n_koopa\c_standard_path_user_session';
+  protected const HANDLER_USER_SETTINGS  = '\n_koopa\c_standard_path_user_settings';
+  protected const HANDLER_USER_UNLOCK    = '\n_koopa\c_standard_path_user_unlock';
+  protected const HANDLER_USER_VIEW      = '\n_koopa\c_standard_path_user_view';
 
   protected const SCRIPT_EXTENSION = '.php';
   protected const WILDCARD_PATH    = '/%';
index e4d549daac383e460f57dfd9aee0f678c72a5db9..73ccc80e47c64683aac0aacaaf42246c1516ec48 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for managing system roles.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_roles.php');
index b358e1292ebe17854a507244c23ab5af7b2a52bf..ce65bc6153af19b739752df7056231274b995b4a 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the access denied pages.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_http_status.php');
index 8b2c946d5b4b8b37c895c7c9a4a36057e808175e..9676af81d7cf2031702a2efb51466b4bdd43fbd3 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the not found pages.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_http_status.php');
index 0d0e512ba606f2f94e8ced3359d5c35125abe523..6ec93c603dd84cdc82f45626dc340f7194339af2 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the site index.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index c8b3eb95f1746bea8b932856031d64cf692b0061..34fb8b47521ed4fa5dab7254a7877d38d1ad960d 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the access denied pages.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_access_denied().
index 3cb3abbfa91403ca6b13c441d168f8fe7cb92e23..5b29328a7161f396602bb385e210cb06a457255b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the not found pages.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_bad_method().
index 4f50656eb20469d0fd44bee224c09e83ed688e6a..fac2b1e46a7e30ed6cf679a237fa9783e26ebe09 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the index page.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_index().
index b3a776ca411165ec70220a8be6b0abb19160e093..d81a271366e653df30f85d8460fae3da46eb9988 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the not found pages.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_not_found().
index 97f5fe94af9ad03d786776e8bd6cc2aa11de8464..51fab4454d4a736579d8c5554c6f1ca8d5a3a8bf 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the server error pages.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_server_error().
index 91dc434f4a6f8e606ee54935d134aef8e3c8a775..8c10cdd784219cce3944e30039924a5c38109f0b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the not found pages.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_http_status.php');
index b8985ef40e499cab3b5943769293cc313467fcab..25b18b5cbfded10e5cd88d007d6d20127ae11bea 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the server rror pages.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_return.php');
 
index 3d9b4888ca80aa313fc020d31093bb7310f21405..5c49f96bf91ca218fb69a1c9337790977bebb17c 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the server rror pages.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_http_status.php');
index 60726b1e18de5bd9a55f7115bb2824aefa9daf47..64d7e31a48651f58559e8c91d11cf521120e3be1 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_breadcrumbs.php');
 
 /**
index 8c77554b1c50633151d6e44cd710e9301c6b7671..778f2325532b7bca8565529764e28f1853ea5f75 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_content.php');
 
 /**
index dcd4da66b7dc3c40458342c43fd5a8c9172c2dd6..a18079ed4ffb71710410aafb83993029f43d9e8a 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_content.php');
 
 /**
index ce1c3c93cadd33b8bdff04d5dcc8e2ee3a68ffb9..d3a353b8c2a9c3208aabf138aefa6d37ece59f08 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_footer.php');
 
 /**
index 18446d8525ee7b9bff7e3ec75385d3352182b2c4..e96681a0fddd1264dc5f97fbb33d154a69e90ca7 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_header.php');
 
 /**
index 8f06519766b482a837bef0ea7b2a77236bd6f58f..0e1a5714a933382bd945bd207e793851bd973106 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
+
 require_once('common/standard/menus/menu_utility.php');
 
 /**
index 99928fdaa5a3c2162dac4339a4505367af6ad991..374360ef093d70d07ade7f524ac1b3d955417b9b 100644 (file)
@@ -6,6 +6,8 @@
  * This is a menu that shows a navigation history on how to get to the current page via links.
  * This does not have to be a link to every path in the current url.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
index d5e3eec7a052a7ea8af8e4c03848f8ce27fc6471..4a183ffc1e41f0040799121d242b9e44583058f6 100644 (file)
@@ -6,6 +6,8 @@
  * This is the navigation menu that is intended to be used for navigating the site.
  * This is (generally) specific to each page or url path.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
index 43cd84726cc0cf782f766596161ecd0ee7ac70fa..c160bbc76baa25ff40c92623d9c6a3c34e2f9353 100644 (file)
@@ -3,6 +3,8 @@
  * @file
  * Provides a class for a path-specific content menu.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
@@ -75,7 +77,13 @@ class c_standard_menu_content_user_view extends c_standard_menu_content {
     $menu->set_tag($item);
     unset($item);
 
-    $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    if ($session->get_user_current() instanceof c_base_users_user) {
+      $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    }
+    else {
+      $roles = new c_base_users_user();
+    }
+
     if (array_key_exists(c_base_roles::MANAGER, $roles) || array_key_exists(c_base_roles::ADMINISTER, $roles)) {
       // @todo: only show lock user if account is unlocked.
       $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(7), $settings['base_path'] . c_standard_paths::URI_USER_LOCK . $path_id_user);
index 0d92d38390c64e340d59c7d848cbd5e151d19246..069e61fa91fcccdcd2d10fef76c7bcc763d29189 100644 (file)
@@ -6,6 +6,8 @@
  * A footer menu is a menu that is intended to be displayed in the footer of a page.
  * This is (generally) a global menu that is displayed on most pages.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
index 43765503fcb1a6cf8b88ac86f4814592bea65378..104c471452d1da790687b6d176745246212bd410 100644 (file)
@@ -6,6 +6,8 @@
  * A header menu is a menu that is intended to be displayed in the header of a page.
  * This is (generally) a global menu that is displayed on most pages.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
index 0bc4f8ea03000e66d1e6d3f193b3c8fdf1dd373b..4a92a9b30fa481999557ef087719b6e5e8ba6777 100644 (file)
@@ -7,6 +7,8 @@
  * This includes dashboard links, profile, links, etc..
  * This is not intended for site navigation.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_markup.php');
 
 require_once('common/standard/classes/standard_menu.php');
@@ -36,7 +38,12 @@ class c_standard_menu_utility extends c_standard_menu {
     }
     unset($result);
 
-    $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    if ($session->get_user_current() instanceof c_base_users_user) {
+      $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    }
+    else {
+      $roles = new c_base_users_user();
+    }
 
     $menu = $this->pr_create_html_create_menu($settings['base_css'] . static::CLASS_NAME, $this->pr_get_text(0));
 
index 500423a675ea54afb50570ed25ab72dbe3de614a..343f810285bd83f21ee152ff40f3a60f669402c7 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the administer content.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -22,7 +23,7 @@ class c_standard_path_administer_content extends c_standard_path {
   public const PATH_SELF = 'a/content';
 
   #protected const NAME_MENU_CONTENT    = 'menu_content_administer_content';
-  #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_administer_content';
+  #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_administer_content';
 
   /**
    * Implements do_execute().
index 7f1a08df4e3aef46748ec168b7554e563677b7e2..8b2dd0a23eae6bb28e625bfec063c3d80cf86129 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the administer dashboard.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 6231e9a4d0cdf055a995d00262951163cc581826..dd798fec6ab16f2e99b155167eacc948626a67f1 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the administer logs.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -22,7 +23,7 @@ class c_standard_path_administer_logs extends c_standard_path {
   public const PATH_SELF = 'a/logs';
 
   #protected const NAME_MENU_CONTENT    = 'menu_content_administer_logs';
-  #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_administer_logs';
+  #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_administer_logs';
 
   /**
    * Implements do_execute().
index f2b7feb9aeea88b020fdb6b734855ea73a6c9fd6..47c87df46483b95eb6a0141992ee1081da9bf186 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_administer_content().
index f55d94c243adeb0854823f0e8152309a72988ece..ee7aec85b5020212b71d28517f7cf6e62d5b16ef 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_administer_dashboard().
index 05a286cc206a6b2571e25e34356cd16473281d06..5158d7d834b41fa3b5e9b5e4ddf058180c04f403 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_administer_logs().
index 0c9d1fc2f608814c01082b49f1a2e8d30e0f27db..5bfb6b0919c735d31d7dd08b48a737a77c92fbfb 100644 (file)
@@ -6,6 +6,7 @@
  * This could be used to load, alter, and sign (such as via PGP/GPG) a static file before output.
  * Such a use is not truly static, but it can be used for some amount of optimization.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 0fd89dcadf065af24cf652c73679ea3daa8827fe..2d590ce640e94aa9ff21b54d37f3b9fe13f85499 100644 (file)
@@ -7,6 +7,7 @@
  * Such a use is not truly static, but it can be used for some amount of optimization.
  * This could also be used for dynamicly generated CSS and JS aggregation static files (as is done in Drupal).
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 69aa1f1106be9fe6c66e724473299ff28b68715d..70dcc3bc4dc31c56ccf6932a293c7c424d4d1f8c 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_cache_error().
index 0c846a961ba6e351928a67bf4611e5fcfb79d4d2..4db490e051a3e7ecc96ca1bf716fb8bdd5a5f81c 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_cache_static().
index c3cc9d670662de94ed8cb051afe6379eb544672e..24cfe2a112a840e78f7496b0a1f733b5397886aa 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the files by checksum.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 3ca25e8750561a4658e439edc436915e0c930fdc..eed1cc414d7256ac2f27ca3c047c6ac6c534d470 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the files by id.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 37fe3aef64d41da57ed000d1be0fc03f3927b6cf..1ebce3acd43fe79619e8e2a7ca10fd4d81746947 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the file checksums by checksum.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index ae28e73a747ebf06730deacdf063adecd3a9196c..c576de258c0b7f54a66f23249d2d98ca33f5f90e 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the file checksums by file id.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 02eaa01b3b0648e97f3012b8653cdf827c1d2e54..7b914617fb12c9a4c2fc80c41d8808cb5d19393a 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_file_by_checksum().
index 414056dcfc9e56addbf8caec8426d128bfdcdd1f..6f03d0d6e0a81e45056b433869aedf44a714733a 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_file_by_id().
index 2263aa34c59757f1088e5804b6c24fc874d51bca..202093f85029ccdd45d41ce33a7fed98363609b0 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_file_by_checksum_by_checksum().
index 6bf73b858a23f5ee313528773119c9e7ae934396..36d29cdbe66a1b04cac9399bd73a66cb65ac7942 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_file_by_checksum_by_id().
index 38ac6c1699143187cf35e5f15c48c879791de973..233959a0de398dba77c64f4c712687e5fc17fc0d 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_management_content().
index 4629465759d2abc5b048deb418310e8894bbbbe7..b3cac4828db09b14430182db2436bdff13bc32d4 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_management_dashboard().
index f133056c56c9a2120ae5c96cf4b95487128ca65c..5ed6c1708ddc354922aa57d6252eda44fcaf3a9b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_management_logs().
index 543bfda06f2f08f1a5eed25d1b023ab709fe21ae..1308fdb0ba1654aea5bb2f11d7992763245845d3 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the management content.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -22,7 +23,7 @@ class c_standard_path_management_content extends c_standard_path {
   public const PATH_SELF = 'm/content';
 
   #protected const NAME_MENU_CONTENT    = 'menu_content_management_content';
-  #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_management_content';
+  #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_management_content';
 
   /**
    * Implements do_execute().
index f361b8eb90479d95c8d0fcf7f8c19bb25161d72e..7e2c34eb6953cf3416099979d169090b698e6a39 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the manager dashboard.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index b52bed17b2af99af586982ce8e768d47f8c7e03a..e2ae6030665a5a762b769dee4cce81164fa0bad1 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the management logs.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -22,7 +23,7 @@ class c_standard_path_management_logs extends c_standard_path {
   public const PATH_SELF = 'm/logs';
 
   #protected const NAME_MENU_CONTENT    = 'menu_content_management_logs';
-  #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_management_logs';
+  #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_management_logs';
 
   /**
    * Implements do_execute().
index 517a7fc68c0a22a3b510f57d2111e037e20229cd..7dcf8d81a6f96c503ed66a0e1036ff3b2104b913 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides a language specific class.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_submit_form_id().
index c5003d1fe2113464f77122fea2b83dfb60e2dff8..a443e5c86576d2c15f93aa030fda24c3c1377b64 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for submit forms.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index d3d66432d4f6b823f6b5200cf937fd92c1038109..673a6bd0293991d1cbdaf88e90c396ee7c9d7d3f 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user checks.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_check().
index 27c6f9c9edaf3444dfa916e0ee6d1d3c815d0dad..7025ccc9a4ee17bf7878e6e3480c981bea9e3ce9 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user dashboard.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_dashboard().
index 15c135fa997793250f6421906b71da2b56fc27a5..607474b9c8695fea5c68f1f048bbbd6f32661208 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user dashboard.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_delete().
index 0866841c75fa8adcac8c5b052f8753d4e31b2e33..79e74c8da97132cfb1458b9ca0ecda6db5f57933 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user edit.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_edit().
index a8a36f5a2811579a5e607a810852c7f219966245..f84ec99003e4c924a6f3e530b97bb80307d05b8f 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user dashboard.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_lock().
index a9afc91d983c89aa5388894e03eab2ae18438623..689ef3b7a9daec20e4326271c39bb0f80abc235c 100644 (file)
@@ -3,7 +3,7 @@
  * @file
  * Provides path handler for the login process.
  */
-
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_login().
index 79adb2ccdf32026678876cd071766397e226bfba..57ad387dcd50b80d7f16c5a39bc6bd4aba8fd1e2 100644 (file)
@@ -3,7 +3,7 @@
  * @file
  * Provides path handler for the logout process.
  */
-
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_logout().
index e0b7ced237386dd8d05bb045b3a19472b672a07e..0617c58b37ca5de0f10ce0fc42c9503bbcd83620 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user refreshes.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_refresh().
index c45cfb9bfb9f9f410d4a2df28e4c3ef526ee3ed2..52511729873b85cf98791870a95b9c249b32e35d 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user session actions.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_session().
index 5d161e23953776e7de86e5d235142e7ed484f1f4..0147aab9b1513723265f9f73e3db28d2068dab5e 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user dashboard.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_dashboard().
index 83123283cdef6b542f0c1d8e07e2bfc0d906839f..7591066cf8a6dcfa7e1ff145e55cad7cc02f43fe 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user unlock.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_unlock().
index c28f6b9b94b099cecd860c6c4b7f95c77e72147b..9dd5f01e3d644d3ab0b5a39c94c9491e71498dce 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user view.
  */
+namespace n_koopa;
 
 /**
  * Implements c_standard_path_user_dashboard().
index 19367836619d75d314ca0800cd6bac6c1fd013bf..9d08ea0cf209826d107ccc543538f23ce52247f9 100644 (file)
@@ -6,6 +6,7 @@
  * This is generally intended to be used to trigger one or more checks against a user account or related data.
  * This could be a simple reaction as is common with ajax but could also be a page containing forms.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -26,7 +27,7 @@ class c_standard_path_user_check extends c_standard_path_user {
   public const PATH_SELF = 'u/check';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   /**
    * Implements do_execute().
index 0852d9b03a883eb1950cb1bf0a8e450818ddae80..ef29942314e9f30db307f360d285f520cdaba275 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user create/copy.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index ec71568c2d8f03c580c88eed4be26d05dc1167fd..524203e5da5184c4f075d19db0960398df551b67 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user dashboard.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -74,7 +75,12 @@ class c_standard_path_user_dashboard extends c_standard_path_user {
     $wrapper = $this->pr_create_tag_section(array(1 => 0));
     $wrapper->set_tag($this->pr_create_tag_text_block(1));
 
-    $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    if ($session->get_user_current() instanceof c_base_users_user) {
+      $roles = $session->get_user_current()->get_roles()->get_value_exact();
+    }
+    else {
+      $roles = new c_base_users_user();
+    }
 
     $wrapper->set_tag($this->pr_create_tag_text_block($this->pr_get_text(2, array('@{user}' => $session->get_name()->get_value_exact()))));
 
index 6c561b887b22bec587b1529fae7c62dece5fcc8b..e8b25a4d9468c44efe6d7561a63e840106bf0995 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user delete.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -23,7 +24,7 @@ class c_standard_path_user_delete extends c_standard_path_user {
   public const PATH_SELF = 'u/delete';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   /**
    * Implements do_execute().
index 0955f280fc02df02feb2187396990543a9f814aa..1c11952713d36541dd7e163a07e93eb03d36fb1c 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user edit.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -23,7 +24,7 @@ class c_standard_path_user_edit extends c_standard_path_user {
   public const PATH_SELF = 'u/edit';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   protected const CLASS_USER_EDIT_ACCOUNT  = 'user_settings-account';
   protected const CLASS_USER_EDIT_PERSONAL = 'user_settings-personal';
index d0b509563cb95290f3991969589e07d3cd192a64..2fadf91fb4d92cb81614330173d324fb34cf89bf 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user lock.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -23,7 +24,7 @@ class c_standard_path_user_lock extends c_standard_path_user {
   public const PATH_SELF = 'u/lock';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   /**
    * Implements do_execute().
index ca6603b0d69cdb18a492d5ba1c958939be7cc8e8..8eeac636e50435f031321b61f8ae9b3b76d097aa 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the login process.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index 4a775a51b67b8650efdccd2f1ba19872e62abd3f..1c924b274735ce684b5a71a7fd2be3606c4598d7 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user logout process.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index d2d9d337bc3c61faf9306b8ff471e4f80eab580b..7ca3c96043382493c5c3e89ab126a2d62d75f339 100644 (file)
@@ -6,6 +6,7 @@
  * This is generally intended to be used to trigger one or more refreshes against a user account or related data.
  * This could be a simple reaction as is common with ajax but could also be a page containing forms.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -26,7 +27,7 @@ class c_standard_path_user_refresh extends c_standard_path_user {
   public const PATH_SELF = 'u/refresh';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   /**
    * Implements do_execute().
index 7a0760b142e875f49e55f31aa5f3025bf501799f..ec088d7439408aa43e13a965ca58e55506d71ed5 100644 (file)
@@ -6,6 +6,7 @@
  * This is generally intended to be used to trigger one or more session actions against a user account or related data.
  * This could be a simple reaction as is common with ajax but could also be a page containing forms.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
index ffd98e54789f59c6d4a965c63d560f9764103a6d..02c391bfdb99525e8c2a49262996df1d69d9069b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user settings.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -24,7 +25,7 @@ class c_standard_path_user_settings extends c_standard_path_user {
   public const PATH_SELF = 'u/settings';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   protected const CLASS_USER_SETTINGS_ACCOUNT  = 'user_settings-account';
   protected const CLASS_USER_SETTINGS_PERSONAL = 'user_settings-personal';
index 56c9d9ffb555306d23ca32e29b8836d159affdf0..8609b8f63d99bb73828652f9af2b94536c4ae41b 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user unlock.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -23,7 +24,7 @@ class c_standard_path_user_unlock extends c_standard_path_user {
   public const PATH_SELF = 'u/unlock';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   /**
    * Implements do_execute().
index ffb5a0a75ba1bfd29721c454d92ab055de4bb9ac..1348b2d8c43a8f7183c61b70c74745672a3a9752 100644 (file)
@@ -3,6 +3,7 @@
  * @file
  * Provides path handler for the user view.
  */
+namespace n_koopa;
 
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
@@ -23,7 +24,7 @@ class c_standard_path_user_view extends c_standard_path_user {
   public const PATH_SELF = 'u/view';
 
   protected const NAME_MENU_CONTENT    = 'menu_content_user_view';
-  protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+  protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view';
 
   protected const CLASS_USER_VIEW_IMAGE       = 'user_view-image';
   protected const CLASS_USER_VIEW_INFORMATION = 'user_view-information';
index f995d5ba0105ee7fb02070951b0212eb971f490a..2f05296f9bb0dadceee5eb25c3eadfebdd4faeb6 100644 (file)
@@ -5,6 +5,7 @@
  *
  * This is currently a draft/brainstorm and is subject to be completely rewritten/redesigned.
  */
+namespace n_koopa;
 
 // include required files.
 require_once('common/base/classes/base_error.php');
index c90e18f92c4e1f7196c3443230ea5711fffa259c..dea3f44081a65aa39662fe0c563cec979c83373c 100644 (file)
@@ -7,6 +7,7 @@
  *
  * @see: https://www.w3.org/TR/html5/
  */
+namespace n_koopa;
 
 // include required files.
 require_once('common/base/classes/base_error.php');
index 21f1d7fe43ece385a424ea97b4146380c4f05690..08fb6769ba2e5bc4c391063b879cb08bef0696d0 100644 (file)
@@ -5,6 +5,7 @@
  *
  * @see: https://www.w3.org/TR/html5/
  */
+namespace n_koopa;
 
 // include required files.
 require_once('common/base/classes/base_error.php');
index 1d7d26d03c9b6b3b12be59069b3a4a670c4b06d8..de847a2749430037f77e16de02319bed0f139374 100644 (file)
@@ -78,6 +78,7 @@
  *     - May only contain the following tags: <tag>.
  *     - example:
  */
+namespace n_koopa;
 
 // include required files.
 require_once('common/base/classes/base_error.php');
index 9917c42bc2f984647b595e691dd5635fe9487181..e299e21e5051c524f70769ad4276e3a0f1456635 100644 (file)
@@ -5,6 +5,8 @@
  *
  * This is for providing a common api for loading views from the database.
  */
+namespace n_koopa;
+
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_view.php');
index 387b99d7cfe49e2d13e0746fdacdfb022d1ac808..7dbe6a00169fa2de1ea072498ba7ed33385209d3 100644 (file)
@@ -8,6 +8,7 @@ The following is the naming scheme used to communicate what a particular name is
   - f_: This represent a function.
   - c_: This represents a class name.
   - t_: This represents a class trait.
+  - n_: This represents a namespace name.
 
 Within a class object, special rules apply:
   1) f_ is not prefixed on function names.
index d359d6d1788375fd9ffa7060b086ecac8c8e5411..941aef2ac15ecd80a5729ce793962cde9b1e974b 100755 (executable)
@@ -1,4 +1,6 @@
 <?php
+  namespace n_koopa;
+
   // make sure the class files can be loaded (be sure to customize this as necessary).
   set_include_path('/var/www/koopa');
 
@@ -30,9 +32,9 @@
 
     // test error message handling using english or japanese.
     $supported_languages = array(
-      i_base_languages::ENGLISH_US => 'c_base_error_messages_english',
-      i_base_languages::ENGLISH => 'c_base_error_messages_english',
-      i_base_languages::JAPANESE => 'c_base_error_messages_japanese',
+      i_base_languages::ENGLISH_US => '\n_koopa\c_base_error_messages_english',
+      i_base_languages::ENGLISH => '\n_koopa\c_base_error_messages_english',
+      i_base_languages::JAPANESE => '\n_koopa\c_base_error_messages_japanese',
     );
 
     $stuff['http']->set_response_content_language(i_base_languages::ENGLISH_US);
index 98a65c3b06c9fb848b28d3b12f1e45108a24aff0..ec9853770b6ffe31a3dda175bfcaacad6044725b 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+namespace n_reservation;
+use n_koopa;
+
 // assign custom include path.
 set_include_path('/var/git/koopa');
 
@@ -11,7 +14,7 @@ require_once('common/standard/classes/standard_index.php');
 /**
  * The standard class for use in index.php or equivalent.
  */
-class c_reservation_index extends c_standard_index {
+class c_reservation_index extends \n_koopa\c_standard_index {
 
   /**
    * Class constructor.
index 1d04db11e59c2489ce0b598f8805b745843e8898..8c7028f91581bda2c188f12fbecb1d27a3ea1517 100644 (file)
@@ -14,6 +14,7 @@
  *
  * It is recommended to set PHP precision setting to at least 16 for microtime values.
  */
+namespace n_koopa;
 
 
 /**
@@ -34,7 +35,7 @@ class c_base_defaults_global {
   const ERROR_BACKTRACE_ARGUMENTS = FALSE;
 
   // provide a language to fallback to if none is set.
-  const LANGUAGE_CLASS_DEFAULT = 'c_base_languages_limited';
+  const LANGUAGE_CLASS_DEFAULT = '\n_koopa\c_base_languages_limited';
 
   // reserved path groups: array(97, 99, 100, 102, 109, 115, 116, 120, 121).
   const RESERVED_PATH_GROUP = array(c_base_ascii::LOWER_A, c_base_ascii::LOWER_C, c_base_ascii::LOWER_D, c_base_ascii::LOWER_F, c_base_ascii::LOWER_M, c_base_ascii::LOWER_S, c_base_ascii::LOWER_T, c_base_ascii::LOWER_U, c_base_ascii::LOWER_X);
@@ -173,7 +174,7 @@ class c_base_defaults_global {
       $now = self::s_get_timestamp_session()->get_value_exact();
       $microseconds = (int) (($now - ((int) $now)) * 1000000);
 
-      $date = new DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now));
+      $date = new \DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now));
       unset($now);
     }
     else {
@@ -184,18 +185,18 @@ class c_base_defaults_global {
         $microseconds = 0;
       }
 
-      $date = new DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp));
+      $date = new \DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp));
     }
     unset($microseconds);
 
-    if (!($date instanceof DateTime)) {
+    if (!($date instanceof \DateTime)) {
       $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE);
       return c_base_return_error::s_value('', 'c_base_return_string', $error);
     }
 
     if (!is_null(self::$s_timezone)) {
       date_default_timezone_set(self::$s_timezone);
-      $date->setTimeZone(new DateTimeZone(self::$s_timezone));
+      $date->setTimeZone(new \DateTimeZone(self::$s_timezone));
     }
 
     $formatted = $date->format($string);
@@ -235,9 +236,9 @@ class c_base_defaults_global {
     }
 
     // To ensure support for microseconds (and milliseconds), datetime must be initialized woth microseconds.
-    $date = DateTime::createFromFormat($format, $string);
+    $date = \DateTime::createFromFormat($format, $string);
 
-    if (!($date instanceof DateTime)) {
+    if (!($date instanceof \DateTime)) {
       $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE);
       return c_base_return_error::s_value(0.0, 'c_base_return_float', $error);
     }