diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e4d02b17 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +code/log/app.log diff --git a/code/.htaccess b/code/.htaccess index a9de8afb..436f9b31 100644 --- a/code/.htaccess +++ b/code/.htaccess @@ -1,15 +1,7 @@ -php_flag zend.ze1_compatibility_mode On -php_flag magic_quotes_gpc Off -php_flag magic_quotes_runtime Off -php_flag allow_call_time_pass_reference On -php_value error_reporting "E_ALL ^ E_DEPRECATED" +php_value error_reporting "E_ALL" DirectoryIndex index.php Options -Indexes - - Deny from all - - RewriteEngine On RewriteRule ^(it|en)\/?$ index.php?_current_lang=$1 [L,QSA] diff --git a/code/config/app.cfg b/code/config/app.cfg index c3e1b0c9..031cbfbd 100644 --- a/code/config/app.cfg +++ b/code/config/app.cfg @@ -142,7 +142,7 @@ newsletter_files_max_total_size = 104857600 # Debug ######## -log.debug_level = DL_ERROR +log.debug_level = DL_INFO log.max_filesize = 1048576 log.truncate_always = 0 diff --git a/code/include/__sample_app.php b/code/include/__sample_app.php index 1364c756..0d1f5fcc 100644 --- a/code/include/__sample_app.php +++ b/code/include/__sample_app.php @@ -2,8 +2,8 @@ class SampleApp extends CustomApp { - function SampleApp() { - parent::CustomApp("SampleApp", "_sample_app"); + function __construct() { + parent::__construct("SampleApp", "_sample_app"); $e = array("roles" => array("guest")); diff --git a/code/include/custom_app.php b/code/include/custom_app.php index 9e07fdd4..561510ad 100644 --- a/code/include/custom_app.php +++ b/code/include/custom_app.php @@ -2,8 +2,8 @@ class CustomApp extends App { - function CustomApp($app_class_name, $app_name) { - parent::App($app_class_name, $app_name); + function __construct($app_class_name, $app_name) { + parent::__construct($app_class_name, $app_name); } // function action_get_security_image() { diff --git a/code/include/lib/app.php b/code/include/lib/app.php index 8ee004b3..8fbc0b00 100644 --- a/code/include/lib/app.php +++ b/code/include/lib/app.php @@ -37,7 +37,7 @@ class App extends AppObject { var $action_params; function App($app_class_name, $app_name) { - parent::AppObject(); + parent::__construct(); $this->set_class_name($app_class_name); $this->app_name = $app_name; @@ -67,7 +67,7 @@ function create_core_objects() { } function create_config() { - $this->config =& new Config(); + $this->config = new Config(); $this->config->read("config/app.cfg"); } @@ -80,7 +80,7 @@ function create_session() { } function create_db() { - $sql_config =& new Config(); + $sql_config = new Config(); $sql_config->read("config/sql.cfg"); $this->db =& $this->create_object( @@ -123,7 +123,7 @@ function init_lang_vars() { // Sentry redirect if ($this->use_cur_lang_from_cgi) { if (is_null($this->get_current_lang_from_cgi())) { - $redirect_response =& new RedirectResponse( + $redirect_response = new RedirectResponse( create_self_full_url( array(), $this->lang @@ -207,8 +207,8 @@ function &_create_object( } } - $obj =& new $class_name(); - if (is_subclass_of($obj, "Object")) { + $obj = new $class_name(); + if (is_subclass_of($obj, "BaseAppObject")) { $obj->set_class_name($class_name_without_suffix, $class_name_suffix); $init_obj_params = get_param_value($class_info, "params", null); if (!is_null($init_obj_params)) { @@ -271,7 +271,7 @@ function run() { $this->create_current_user(); // Read action name - $this->action = trim(param("action")); + $this->action = trim((string) param("action")); if ($this->action == "") { $this->action = $this->get_default_action_name(); } diff --git a/code/include/lib/app_object.php b/code/include/lib/app_object.php index 5ecb333f..79bfd105 100644 --- a/code/include/lib/app_object.php +++ b/code/include/lib/app_object.php @@ -1,11 +1,11 @@ charset); - xml_set_object($parser, &$this); + xml_set_object($parser, $this); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($parser, "tag_open", "tag_close"); xml_set_character_data_handler($parser, "cdata"); diff --git a/code/include/lib/global.php b/code/include/lib/global.php index 73203a8f..6998c990 100644 --- a/code/include/lib/global.php +++ b/code/include/lib/global.php @@ -10,7 +10,7 @@ function v($var, $dump_all = false) { $var_to_dump = array(); foreach ($var->_fields as $field_name => $field_info) { if ($field_info["create"]) { - $var_to_dump[$field_name] = $var->{$field_name}; + $var_to_dump[$field_name] = $var->$field_name; } } } @@ -575,7 +575,7 @@ function parse_date_by_format($format, $value) { $p = 1; $format_len = strlen($format); for ($i = 0; $i < $format_len; $i++) { - $format_char = $format{$i}; + $format_char = $format[$i]; switch ($format_char) { case "Y": $date_parts["year"] = (int) $date_parts_unordered[$p++]; @@ -655,7 +655,7 @@ function create_date_regexp_by_format($format) { $res = "/"; $format_len = strlen($format); for ($i = 0; $i < $format_len; $i++) { - $format_char = $format{$i}; + $format_char = $format[$i]; switch ($format_char) { case "Y": $res .= '(\d{1,4})'; @@ -718,7 +718,7 @@ function create_date_by_format($format, $date_parts, $date_if_unknown) { $res = ""; $format_len = strlen($format); for ($i = 0; $i < $format_len; $i++) { - $format_char = $format{$i}; + $format_char = $format[$i]; switch ($format_char) { case "Y": $res .= sprintf("%04d", $date_parts["year"]); diff --git a/code/include/lib/http_response.php b/code/include/lib/http_response.php index 1ca3dbcd..f8976a67 100644 --- a/code/include/lib/http_response.php +++ b/code/include/lib/http_response.php @@ -62,7 +62,7 @@ class HttpResponse { var $headers; var $cookies; - function HttpResponse() { + function __construct() { $this->headers = array(); $this->cookies = array(); } @@ -82,7 +82,7 @@ function push_header($header) { } function push_headers($headers) { - $this->headers = array_merge($headers, $this->headers); + $this->headers = array_merge($headers, (array) $this->headers); } function add_no_cache_headers() { diff --git a/code/include/setup_app.php b/code/include/setup_app.php index 4e2bed6b..fff9dfcc 100644 --- a/code/include/setup_app.php +++ b/code/include/setup_app.php @@ -2,8 +2,8 @@ class SetupApp extends CustomApp { - function SetupApp() { - parent::CustomApp("SetupApp", "setup_app"); + function __construct() { + parent::__construct("SetupApp", "setup_app"); $a = array("roles" => array("admin")); diff --git a/code/include/user_app.php b/code/include/user_app.php index 69d80081..5c627133 100644 --- a/code/include/user_app.php +++ b/code/include/user_app.php @@ -5,8 +5,8 @@ class UserApp extends CustomApp { // Current logged in user var $user; - function UserApp() { - parent::CustomApp("UserApp", "user_app"); + function __construct() { + parent::__construct("UserApp", "user_app"); $this->use_cur_lang_from_cgi = true; diff --git a/code/index.php b/code/index.php index a07f67b1..52d7943b 100644 --- a/code/index.php +++ b/code/index.php @@ -3,7 +3,7 @@ require_once("include/_init.php"); require_once("include/user_app.php"); -$app =& new UserApp(); +$app = new UserApp(); $app->init(); $app->run(); diff --git a/code/log/make_log.sh b/code/log/make_log.sh old mode 100644 new mode 100755 diff --git a/code/sample.php b/code/sample.php index cf43e77c..f4454d1f 100644 --- a/code/sample.php +++ b/code/sample.php @@ -3,7 +3,7 @@ require_once("include/_init.php"); require_once("include/__sample_app.php"); -$app =& new SampleApp(); +$app = new SampleApp(); $app->init(); $app->run(); diff --git a/code/setup.php b/code/setup.php index 2873d6d5..983ebf6a 100644 --- a/code/setup.php +++ b/code/setup.php @@ -3,7 +3,7 @@ require_once("include/_init.php"); require_once("include/setup_app.php"); -$app =& new SetupApp(); +$app = new SetupApp(); $app->init(); $app->run();