first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# default values
#all:

View File

@@ -0,0 +1,4 @@
default:
enabled: off
with_layout: false
lifetime: 86400

View File

@@ -0,0 +1,8 @@
<?php
// include project configuration
include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
// symfony bootstraping
require_once(dirname(__FILE__). DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'stCore.class.php');
stCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);

View File

@@ -0,0 +1,74 @@
config/autoload.yml:
class: sfAutoloadConfigHandler
config/php.yml:
class: sfPhpConfigHandler
config/databases.yml:
class: sfDatabaseConfigHandler
config/settings.yml:
class: sfDefineEnvironmentConfigHandler
param:
prefix: sf_
config/app.yml:
class: sfDefineEnvironmentConfigHandler
param:
prefix: app_
config/factories.yml:
class: sfFactoryConfigHandler
config/core_compile.yml:
class: sfCompileConfigHandler
config/bootstrap_compile.yml:
class: stCompileConfigHandler
config/filters.yml:
class: sfFilterConfigHandler
config/logging.yml:
class: sfLoggingConfigHandler
param:
prefix: sf_logging_
config/routing.yml:
class: sfRoutingConfigHandler
config/i18n.yml:
class: sfDefineEnvironmentConfigHandler
param:
prefix: sf_i18n_
apps/*/modules/*/config/generator.yml:
class: sfGeneratorConfigHandler
apps/*/modules/*/config/view.yml:
class: sfViewConfigHandler
apps/*/modules/*/config/mailer.yml:
class: sfDefineEnvironmentConfigHandler
param:
prefix: sf_mailer_
module: yes
modules/*/config/security.yml:
class: sfSecurityConfigHandler
apps/*/modules/*/config/security.yml:
class: sfSecurityConfigHandler
apps/*/modules/*/config/cache.yml:
class: sfCacheConfigHandler
apps/*/modules/*/validate/*.yml:
class: sfValidatorConfigHandler
apps/*/modules/*/config/module.yml:
class: sfDefineEnvironmentConfigHandler
param:
prefix: mod_
module: yes

View File

@@ -0,0 +1,35 @@
cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse
test:
storage:
class: sfSessionTestStorage
all:
controller:
class: sfFrontWebController
#
request:
class: sfWebRequest
#
response:
class: sfWebResponse
#
user:
class: myUser
#
storage:
class: sfSessionStorage
param:
session_name: symfony
#
# view_cache:
# class: sfFileCache
# param:
# automaticCleaningFactor: 0
# cacheDir: %SF_TEMPLATE_CACHE_DIR%

View File

@@ -0,0 +1,10 @@
rendering: ~
web_debug: ~
security: ~
# generally, you will want to insert your own filters here
cache: ~
common: ~
flash: ~
execution: ~

View File

@@ -0,0 +1,7 @@
all:
default_culture: pl_PL
source: XLIFF
debug: off
cache: on
untranslated_prefix: "[T]"
untranslated_suffix: "[/T]"

View File

@@ -0,0 +1,22 @@
prod:
enabled: off
level: err
rotate: on
purge: off
#all:
# enabled: on
# level: debug
# rotate: off
# period: 7
# history: 10
# purge: on
# loggers:
# sf_web_debug:
# class: sfWebDebugLogger
# param:
# condition: %SF_WEB_DEBUG%
# sf_file_debug:
# class: sfFileLogger
# param:
# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log

View File

@@ -0,0 +1,42 @@
homepage:
url: /
param: { module: stInstallerWeb, action: index }
installerweb:
url: /installerweb/:action/*
param: { module: stInstallerWeb, action: news }
devel:
url: /devel/:action/*
param: { module: stDevel, action: devel }
lock:
url: /lock/:action/*
param: { module: stLock, action: index }
webstore:
url: /webstore/:action/*
param: { module: stWebStore, action: index }
communication:
url: /communication/soap
param: { module: stCommunication, action: soap }
communication_check:
url: /communication/check
param: { module: stCommunication, action: check }
communication_check_version:
url: /communication/check_version
param: { module: stCommunication, action: checkVersion }
default_symfony:
url: /symfony/:action/*
param: { module: default }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*

View File

@@ -0,0 +1,2 @@
default:
is_secure: off

View File

@@ -0,0 +1,117 @@
all:
.settings:
use_database: off
standard_helpers: [Partial, Cache, Form, I18N, Javascript, stProgressBar, stUpdate]
enabled_modules: [stProgressBar, default]
i18n: on
login_module: stAuth
login_action: index
use_security: on
.actions:
secure_module: stAuth
secure_action: index
error_404_module: stInstallerWeb
error_404_action: pageNotFound
prod:
.settings:
no_script_name: off
dev:
.settings:
error_reporting: <?php echo (E_ALL)."\n" ?>
web_debug: on
cache: off
no_script_name: off
etag: off
test:
.settings:
error_reporting: <?php echo (E_ALL)."\n" ?>
cache: off
web_debug: off
no_script_name: off
etag: off
#all:
# .actions:
# default_module: default # Default module and action to be called when
# default_action: index # A routing rule doesn't set it
#
# error_404_module: default # To be called when a 404 error is raised
# error_404_action: error404 # Or when the requested URL doesn't match any route
#
# login_module: default # To be called when a non-authenticated user
# login_action: login # Tries to access a secure page
#
# secure_module: stAuth # To be called when a user doesn't have
# secure_action: index # The credentials required for an action
#
# module_disabled_module: default # To be called when a user requests
# module_disabled_action: disabled # A module disabled in the module.yml
#
# unavailable_module: default # To be called when a user requests a page
# unavailable_action: unavailable # From an application disabled via the available setting below
#
# .settings:
# available: on # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action.
#
# # Optional features. Deactivating unused features boots performance a bit.
# use_database: on # Enable database manager. Set to off if you don't use a database.
# use_flash: on # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions.
# i18n: off # Enable interface translation. Set to off if your application should not be translated.
# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
# use_process_cache: on # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally.
# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
# check_lock: off # Enable the application lock system triggered by the clear-cache task. Set to on to have all requests redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page during the clear-cache process.
#
# # Output escaping settings
# escaping_strategy: bc # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost.
# escaping_method: ESC_ENTITIES # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES.
#
# # Routing settings
# relative_url_root: # Default URL prefix. Use this when your symfony project is installed in a sub directory of the apache document root.
# suffix: . # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on.
# no_script_name: off # Enable the front controller name in generated URLs
#
# # Validation settings, used for error generation by the Validation helper
# validation_error_prefix: ' &darr;&nbsp;'
# validation_error_suffix: ' &nbsp;&darr;'
# validation_error_class: form_error
# validation_error_id_prefix: error_for_
#
# # Cache settings
# cache: off # Enable the template cache
# etag: on # Enable etag handling
#
# # Logging and debugging settings
# web_debug: off # Enable the web debug toolbar
# error_reporting: <?php echo (E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR)."\n" ?> # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341
#
# # Assets paths
# rich_text_js_dir: js/tiny_mce
# prototype_web_dir: /sf/prototype
# admin_web_dir: /sf/sf_admin
# web_debug_web_dir: /sf/sf_web_debug
#
# # Helpers included in all templates by default
# standard_helpers: [Partial, Cache, Form]
#
# # Activated modules from plugins or from the symfony core
# enabled_modules: [default]
#
# # Charset used for the response
# charset: utf-8
#
# # Miscellaneous
# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml
# autoloading_functions: ~ # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges.
# timeout: 1800 # Session timeout, in seconds
# max_forwards: 5
# path_info_array: SERVER
# path_info_key: PATH_INFO
# url_format: PATH
#
# # ORM
# orm: propel

View File

@@ -0,0 +1,155 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage configs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: symfony.php 3160 2010-01-26 13:30:27Z marek $
*/
/**
* Pre-initialization script.
*
* @package symfony
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
*/
$sf_symfony_lib_dir = sfConfig::get('sf_symfony_lib_dir');
if (!sfConfig::get('sf_in_bootstrap'))
{
// YAML support
require_once($sf_symfony_lib_dir.'/util/sfYaml.class.php');
// cache support
require_once($sf_symfony_lib_dir.'/cache/sfCache.class.php');
require_once($sf_symfony_lib_dir.'/cache/sfFileCache.class.php');
// config support
require_once($sf_symfony_lib_dir.'/config/sfConfigCache.class.php');
require_once($sf_symfony_lib_dir.'/config/sfConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfYamlConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfAutoloadConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfRootConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfLoader.class.php');
// basic exception classes
require_once($sf_symfony_lib_dir.'/exception/sfException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfAutoloadException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfCacheException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfConfigurationException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfParseException.class.php');
// utils
require_once($sf_symfony_lib_dir.'/util/sfParameterHolder.class.php');
}
else
{
require_once($sf_symfony_lib_dir.'/config/sfConfigCache.class.php');
}
// autoloading
sfCore::initAutoload();
try
{
$configCache = sfConfigCache::getInstance();
// force setting default timezone if not set
if (function_exists('date_default_timezone_get'))
{
if ($default_timezone = sfConfig::get('sf_default_timezone'))
{
date_default_timezone_set($default_timezone);
}
else if (sfConfig::get('sf_force_default_timezone', true))
{
date_default_timezone_set(@date_default_timezone_get());
}
}
// get config instance
$sf_app_config_dir_name = sfConfig::get('sf_app_config_dir_name');
$sf_debug = sfConfig::get('sf_debug');
// load timer classes if in debug mode
if ($sf_debug)
{
require_once($sf_symfony_lib_dir.'/debug/sfTimerManager.class.php');
require_once($sf_symfony_lib_dir.'/debug/sfTimer.class.php');
}
// load base settings
include($configCache->checkConfig($sf_app_config_dir_name.'/settings.yml'));
if (sfConfig::get('sf_logging_enabled', true))
{
include($configCache->checkConfig($sf_app_config_dir_name.'/logging.yml'));
}
if ($file = $configCache->checkConfig($sf_app_config_dir_name.'/app.yml', true))
{
include($file);
}
if (sfConfig::get('sf_i18n'))
{
include($configCache->checkConfig($sf_app_config_dir_name.'/i18n.yml'));
}
// add autoloading callables
foreach ((array) sfConfig::get('sf_autoloading_functions', array()) as $callable)
{
sfCore::addAutoloadCallable($callable);
}
// error settings
ini_set('display_errors', $sf_debug ? 'on' : 'off');
error_reporting(sfConfig::get('sf_error_reporting'));
// create bootstrap file for next time
if (!sfConfig::get('sf_in_bootstrap') && !$sf_debug && !sfConfig::get('sf_test'))
{
$configCache->checkConfig($sf_app_config_dir_name.'/bootstrap_compile.yml');
}
// required core classes for the framework
// create a temp var to avoid substitution during compilation
if (!$sf_debug && !sfConfig::get('sf_test'))
{
$core_classes = $sf_app_config_dir_name.'/core_compile.yml';
$configCache->import($core_classes, false);
}
$configCache->import($sf_app_config_dir_name.'/php.yml', false);
$configCache->import($sf_app_config_dir_name.'/routing.yml', false);
// compress output
ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
}
catch (sfException $e)
{
$e->printStackTrace();
}
catch (Exception $e)
{
if (sfConfig::get('sf_test'))
{
throw $e;
}
try
{
// wrap non symfony exceptions
$sfException = new sfException();
$sfException->printStackTrace($e);
}
catch (Exception $e)
{
header('HTTP/1.0 500 Internal Server Error');
}
}

View File

@@ -0,0 +1,18 @@
default:
http_metas:
content-type: text/html
metas:
title: SOTESHOP - panel aktualizacji
robots: index, follow
description: symfony project
keywords: symfony, project
language: en
stylesheets: []
javascripts: []
has_layout: on
layout: layout

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Logowanie do panelu aktualizacji</source>
<target>Login to the update panel</target>
</trans-unit>
<trans-unit id="2">
<source>Użytkownik:</source>
<target>User:</target>
</trans-unit>
<trans-unit id="3">
<source>Hasło:</source>
<target>Password:</target>
</trans-unit>
<trans-unit id="4">
<source>Zaloguj</source>
<target>Login</target>
</trans-unit>
<trans-unit id="5">
<source>Zły login lub hasło.</source>
<target>Invalid username or password.</target>
</trans-unit>
<trans-unit id="6">
<source>Nie podałeś hasła.</source>
<target>Enter the password.</target>
</trans-unit>
<trans-unit id="7">
<source>Nie podałeś adresu email.</source>
<target>Enter an e-mail address.</target>
</trans-unit>
<trans-unit id="8">
<source>Nieprawidłowy format adresu e-mail.</source>
<target>Invalid e-mail address format.</target>
</trans-unit>
<trans-unit id="9">
<source>Przekroczono dozwoloną liczbę znaków.</source>
<target>The maximum number of characters has been exceeded.</target>
</trans-unit>
<trans-unit id="10">
<source>Podane hasło jest za krótkie min. 6 znaków.</source>
<target>The password is too short. It must be at least 6 characters long.</target>
</trans-unit>
<trans-unit id="11">
<source>Przekroczono dozwoloną długość hasła, maksimum 20 znaków.</source>
<target>The password is too long. It must not exceed 20 characters.</target>
</trans-unit>
<trans-unit id="12">
<source>Hasła nie są takie same.</source>
<target>Passwords do not match.</target>
</trans-unit>
<trans-unit id="13">
<source>Zaloguj się</source>
<target>Login</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Ustawienia trybu developerskiego</source>
<target>Developer mode settings</target>
</trans-unit>
<trans-unit id="2">
<source>Adres IP</source>
<target>IP address</target>
</trans-unit>
<trans-unit id="3">
<source>Włącz tryb developerski</source>
<target>Enable a developer mode</target>
</trans-unit>
<trans-unit id="4">
<source>Zapisz</source>
<target>Save</target>
</trans-unit>
<trans-unit id="5">
<source>Panel sklepu:</source>
<target>Administrative panel:</target>
</trans-unit>
<trans-unit id="6">
<source>Linki do stron w trybie developerskim dostępne tylko dla wskazanego IP:</source>
<target>Links to the pages with enabled developer mode. Available only for an indicated IP:</target>
</trans-unit>
<trans-unit id="7">
<source>Sklep:</source>
<target>Shop:</target>
</trans-unit>
<trans-unit id="8">
<source>SOTESHOP - panel aktualizacji</source>
<target>SOTESHOP - the update panel</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,891 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Pobierz aktualizacje</source>
<target>Download the updates</target>
</trans-unit>
<trans-unit id="2">
<source>Instaluj</source>
<target>Install</target>
</trans-unit>
<trans-unit id="3">
<source>Twoja Historia</source>
<target>History</target>
</trans-unit>
<trans-unit id="4">
<source>RSS Aktualizacji</source>
<target>RSS</target>
</trans-unit>
<trans-unit id="5">
<source>Narzędzia eksperta</source>
<target>Expert's tools</target>
</trans-unit>
<trans-unit id="6">
<source>Nie ma dostępnych aktualizacji.</source>
<target>There are no updates available.</target>
</trans-unit>
<trans-unit id="7">
<source>Wróć do panelu sklepu</source>
<target>Go to administrative panel</target>
</trans-unit>
<trans-unit id="8">
<source>Wyloguj</source>
<target>Logout</target>
</trans-unit>
<trans-unit id="9">
<source>Dostępne aktualizacje:</source>
<target>Available updates:</target>
</trans-unit>
<trans-unit id="10">
<source>Pobierz wszystkie</source>
<target>Download all</target>
</trans-unit>
<trans-unit id="11">
<source>Pobierz</source>
<target>Download</target>
</trans-unit>
<trans-unit id="12">
<source>Aplikacje pobrane i niezainstalowane. Kliknij "Instaluj".</source>
<target>Applications downloaded and not installed. Click "Install".</target>
</trans-unit>
<trans-unit id="13">
<source>Aplikacje zostały poprawnie zweryfikowane. Nie ma modyfikacji plików systemowych.</source>
<target>Applications have been properly verified. There is no modification of the system files.</target>
</trans-unit>
<trans-unit id="14">
<source>Konfiguracja bazy danych</source>
<target>Database configuration</target>
</trans-unit>
<trans-unit id="15">
<source>Uaktualnienia</source>
<target>Updates</target>
</trans-unit>
<trans-unit id="16">
<source>Uaktualnij aplikacje w sklepie</source>
<target>Update the applications in the shop</target>
</trans-unit>
<trans-unit id="17">
<source>Raport instalacji</source>
<target>Installation report</target>
</trans-unit>
<trans-unit id="18">
<source>Pobieram</source>
<target>Downloading</target>
</trans-unit>
<trans-unit id="19">
<source>Aplikacje pobrane.</source>
<target>Applications downloaded.</target>
</trans-unit>
<trans-unit id="20">
<source>Nie ma aplikacji do aktualizacji.</source>
<target>There are no applications to update.</target>
</trans-unit>
<trans-unit id="21">
<source>Pobierz następną</source>
<target>Download the next one</target>
</trans-unit>
<trans-unit id="22">
<source>Instalacja pakietów</source>
<target>Installing the packages</target>
</trans-unit>
<trans-unit id="23">
<source>Aplikacja SOTESHOP</source>
<target>SOTESHOP application</target>
</trans-unit>
<trans-unit id="24">
<source>Instaluj bez zależności (nodeps)</source>
<target>Install without the dependencies (nodeps)</target>
</trans-unit>
<trans-unit id="25">
<source>Wymuś instalację (force)</source>
<target>Force the installation (force)</target>
</trans-unit>
<trans-unit id="26">
<source>Weryfikacja wszystkich aplikacji</source>
<target>Verifying all of the applications</target>
</trans-unit>
<trans-unit id="27">
<source>Pobieranie aktualizacji zostało przerwane i nie możliwa jest instalacja aktualizacji.</source>
<target>Downloading the update was interrupted and it's impossible to install the update.</target>
</trans-unit>
<trans-unit id="28">
<source>Ponów pobieranie aktualizacji</source>
<target>Repeat the download of the updates</target>
</trans-unit>
<trans-unit id="29">
<source>Weryfikacja i instalacja aktualizacji</source>
<target>Verify and install the updates</target>
</trans-unit>
<trans-unit id="30">
<source>Instaluj wszystkie</source>
<target>Install all</target>
</trans-unit>
<trans-unit id="31">
<source>Pobieranie aktualizacji</source>
<target>Downloading the updates</target>
</trans-unit>
<trans-unit id="32">
<source>Blokowanie sklepu</source>
<target>Lock the shop</target>
</trans-unit>
<trans-unit id="33">
<source>Weryfikacja instalacji</source>
<target>Verify the installation</target>
</trans-unit>
<trans-unit id="34">
<source>Zainstalowane aplikacje</source>
<target>Installed applications</target>
</trans-unit>
<trans-unit id="35">
<source>Tryb developerski</source>
<target>Developer mode</target>
</trans-unit>
<trans-unit id="36">
<source>Optymalizacja</source>
<target>Optimization</target>
</trans-unit>
<trans-unit id="37">
<source>Naprawa aktualizacji</source>
<target>Repair the update</target>
</trans-unit>
<trans-unit id="38">
<source>Zsynchronizowane aplikacje</source>
<target>Synchronized applications</target>
</trans-unit>
<trans-unit id="39">
<source>Instaluj aktualizacje</source>
<target>Install the updates</target>
</trans-unit>
<trans-unit id="40">
<source>Nowe:</source>
<target>New applications:</target>
</trans-unit>
<trans-unit id="41">
<source>Aktualizowane:</source>
<target>Applications to update:</target>
</trans-unit>
<trans-unit id="42">
<source>Usunięte:</source>
<target>Deleted:</target>
</trans-unit>
<trans-unit id="43">
<source>Nie ma pobranych aplikacji do aktualizacji.</source>
<target>There are no downloaded applications to update.</target>
</trans-unit>
<trans-unit id="44">
<source>RSS Wiadomości z najnowszymi aktualizacjami.</source>
<target>RSS of the latest updates.</target>
</trans-unit>
<trans-unit id="45">
<source>Dodaj kanał RSS do swojego programu pocztowego, będziesz otrzymywać wiadomości o aktualizacjach w programie.</source>
<target>Add a RSS feed to your email program. You will receive the news about the updates.</target>
</trans-unit>
<trans-unit id="46">
<source>Kanał RSS z najnowszymi aktualizacjami</source>
<target>RSS feed of the latest updates</target>
</trans-unit>
<trans-unit id="47">
<source>Wykryto błędne zakończenie aktualizacji. Wywołaj automatyczną naprawę aktualizacji.</source>
<target>The update wasn't properly completed. Start an automatic repair of the update.</target>
</trans-unit>
<trans-unit id="48">
<source>Serwer nie spełnia wymagań technicznych, aktualizacja nie jest możliwa.</source>
<target>The server does not meet the technical requirements, the update is not possible.</target>
</trans-unit>
<trans-unit id="49">
<source>Brak biblioteki cURL</source>
<target>No cURL library</target>
</trans-unit>
<trans-unit id="50">
<source>Sklep nie jest uruchomiony z prawami użytkownika</source>
<target>The shop is not being run with the user's permissions.</target>
</trans-unit>
<trans-unit id="51">
<source>Sklep jest uruchomiony w trybie safe_mode</source>
<target>The shop is running in the safe_mode</target>
</trans-unit>
<trans-unit id="52">
<source>Brak biblioteki JSON</source>
<target>No JSON library</target>
</trans-unit>
<trans-unit id="53">
<source>Nie można wykonać instalacji, gdyż czas wykonania skryptu na serwerze jest zbyt krótki.</source>
<target>Unable to execute the installation, the time of executing the script on the server (max_execution_time) is too short.</target>
</trans-unit>
<trans-unit id="54">
<source>Minimalny czas jaki jest wymagany do poprawnego wykonania instalacji to</source>
<target>The minimum execution time required for the correct installation is</target>
</trans-unit>
<trans-unit id="55">
<source>sekund</source>
<target>seconds</target>
</trans-unit>
<trans-unit id="56">
<source>Maksymalny czas wykonania skryptu PHP na serwerze to</source>
<target>The maximum execution time of a PHP script on the server is</target>
</trans-unit>
<trans-unit id="57">
<source>Jak zmienić czas wykonywania na serwerze:</source>
<target>How to change the execution time on the server:</target>
</trans-unit>
<trans-unit id="58">
<source>Wyczyszczenie pamięci podręcznej PEAR: symfony pear clear-cache</source>
<target>Command for clearing the PEAR cache: symfony pear clear-cache</target>
</trans-unit>
<trans-unit id="59">
<source>Strona o podanym adresie nie istnieje.</source>
<target>The requested page does not exist.</target>
</trans-unit>
<trans-unit id="60">
<source>Optymalizacja i czyszczenie instalacji</source>
<target>Optimization and cleaning the installation</target>
</trans-unit>
<trans-unit id="61">
<source>Lista aplikacji do aktualizacji:</source>
<target>List of the applications to update:</target>
</trans-unit>
<trans-unit id="62">
<source>Lista zainstalowanych aplikacji:</source>
<target>List of the installed applications:</target>
</trans-unit>
<trans-unit id="63">
<source>Lista pobranych aplikacji:</source>
<target>List of the downloaded applications:</target>
</trans-unit>
<trans-unit id="64">
<source>Historia instalacji/aktualizacji</source>
<target>History of the installation/update</target>
</trans-unit>
<trans-unit id="65">
<source>Wyczyszczenie cache</source>
<target>Clearing the cache</target>
</trans-unit>
<trans-unit id="66">
<source>Nie można zainstalować aktualizacji. System wykrył modyfikację kodu.</source>
<target>Unable to install the update. The system detected a modification of the code.</target>
</trans-unit>
<trans-unit id="67">
<source>Przeczytaj jak zainstalować aktualizacje do programu z modyfikacjami.</source>
<target>Read how to install the updates if the code has been modified.</target>
</trans-unit>
<trans-unit id="68">
<source>Zmodyfikowane pliki:</source>
<target>The modified files:</target>
</trans-unit>
<trans-unit id="69">
<source>Instalacja aplikacji (Uwaga! Nie zamykaj okna przeglądarki, aż instalacja się nie skończy):</source>
<target>Installing the application (Notice! Don't close your browser window until the installation is finished):</target>
</trans-unit>
<trans-unit id="70">
<source>Instalacja aktualizacji zakończona.</source>
<target>Installing the update is completed.</target>
</trans-unit>
<trans-unit id="71">
<source>Czyszczę:</source>
<target>Removing:</target>
</trans-unit>
<trans-unit id="72">
<source>Czyszczenie poprzedniej aktualizacji</source>
<target>Cleaning the previous update</target>
</trans-unit>
<trans-unit id="73">
<source>Optymalizacja ilości plików</source>
<target>Optimizing the number of files</target>
</trans-unit>
<trans-unit id="74">
<source>Optymalizuje</source>
<target>Optimizing</target>
</trans-unit>
<trans-unit id="75">
<source>Konfiguracja i optymalizacja systemu.</source>
<target>Configuration and optimization of the system.</target>
</trans-unit>
<trans-unit id="76">
<source>Weryfikacja</source>
<target>Verification</target>
</trans-unit>
<trans-unit id="77">
<source>SOTESHOP - panel aktualizacji</source>
<target>SOTESHOP - the update panel</target>
</trans-unit>
<trans-unit id="78">
<source>Pobieranie aplikacji:</source>
<target>Downloading the applications:</target>
</trans-unit>
<trans-unit id="79">
<source>Pobieranie aktualizacji</source>
<target>Downloading the updates</target>
</trans-unit>
<trans-unit id="80">
<source>System wykrył zmianę serwera.</source>
<target>System has detected a change of the server.</target>
</trans-unit>
<trans-unit id="81">
<source>Program został dostosowany do nowej lokalizacji.</source>
<target>Program was adapted to the new location.</target>
</trans-unit>
<trans-unit id="82">
<source>Uaktualnij dostęp do bazy danych</source>
<target>Update the access data to the database</target>
</trans-unit>
<trans-unit id="83">
<source>Nie można utworzyć pliku ticketa</source>
<target>Unable to create the ticket file</target>
</trans-unit>
<trans-unit id="84">
<source>Instalacja aktualizacji (Uwaga! Nie zamykaj okna przeglądarki, aż instalacja się nie skończy):</source>
<target>Installing the update (Notice! Don't close your browser window until the installation is finished):</target>
</trans-unit>
<trans-unit id="85">
<source>Zakończono pobieranie pakietów</source>
<target>Downloading the packages is completed</target>
</trans-unit>
<trans-unit id="86">
<source>Pobieranie</source>
<target>Downloading</target>
</trans-unit>
<trans-unit id="87">
<source>Pobieranie aplikacji</source>
<target>Downloading the applications</target>
</trans-unit>
<trans-unit id="89">
<source>Czyszczenie plików tymczasowych</source>
<target>Cleaning the temporary files</target>
</trans-unit>
<trans-unit id="90">
<source>Kopiowanie plików</source>
<target>Copying the files</target>
</trans-unit>
<trans-unit id="91">
<source>Konfiguracja instalacji</source>
<target>Configuration of the installation</target>
</trans-unit>
<trans-unit id="92">
<source>Tworzenie struktury bazy danych</source>
<target>Creating the database structure</target>
</trans-unit>
<trans-unit id="93">
<source>Tworzenie modelu bazy danych</source>
<target>Creating the database model</target>
</trans-unit>
<trans-unit id="94">
<source>Zamów wersję komercyjną</source>
<target>Order a commercial version</target>
</trans-unit>
<trans-unit id="95">
<source>Wczytywanie danych</source>
<target>Uploading the data</target>
</trans-unit>
<trans-unit id="96">
<source>Ładowanie domyślnych danych. Uruchomienie sklepu.</source>
<target>Loading the default data. Running the shop</target>
</trans-unit>
<trans-unit id="97">
<source>Czyszczę</source>
<target>Removing</target>
</trans-unit>
<trans-unit id="98">
<source>Wersja</source>
<target>Version</target>
</trans-unit>
<trans-unit id="99">
<source>Konfiguracja i optymalizacja systemu</source>
<target>Configuration and optimization of the system</target>
</trans-unit>
<trans-unit id="100">
<source>Aktualizacje</source>
<target>Updates</target>
</trans-unit>
<trans-unit id="101">
<source>Nowości</source>
<target>News</target>
</trans-unit>
<trans-unit id="102">
<source>Pobierz</source>
<target>Download</target>
</trans-unit>
<trans-unit id="103">
<source>Aktywuj</source>
<target>Activate</target>
</trans-unit>
<trans-unit id="104">
<source>Konfiguracja MySQL</source>
<target>MySQL configuration</target>
</trans-unit>
<trans-unit id="105">
<source>Historia aktualizacji</source>
<target>History of the updates</target>
</trans-unit>
<trans-unit id="106">
<source>Weryfikacja systemu</source>
<target>Verification of the system</target>
</trans-unit>
<trans-unit id="107">
<source>Nie można zainstalować aktualizacji. System wykrył modyfikację kodu. Twoj system może nie działać poprawnie.</source>
<target>Unable to install the update. The system detected a modification of the code. Your system may not work correctly.</target>
</trans-unit>
<trans-unit id="108">
<source>Data modyfikacji</source>
<target>Date of modification</target>
</trans-unit>
<trans-unit id="109">
<source>Nr</source>
<target>No.</target>
</trans-unit>
<trans-unit id="110">
<source>Ikonka</source>
<target>Icon</target>
</trans-unit>
<trans-unit id="111">
<source>Nazwa</source>
<target>Name</target>
</trans-unit>
<trans-unit id="112">
<source>Opis</source>
<target>Description</target>
</trans-unit>
<trans-unit id="113">
<source>Status</source>
<target>Status</target>
</trans-unit>
<trans-unit id="114">
<source>Dodaj</source>
<target>Add</target>
</trans-unit>
<trans-unit id="115">
<source>Aktualizuj</source>
<target>Update</target>
</trans-unit>
<trans-unit id="116">
<source>Usuń</source>
<target>Delete</target>
</trans-unit>
<trans-unit id="117">
<source>Nie znaleziono archiwum.</source>
<target>There is no archive found.</target>
</trans-unit>
<trans-unit id="118">
<source>Opis zmian aktualizacji</source>
<target>Description of the update changes</target>
</trans-unit>
<trans-unit id="119">
<source>W Twoim sklepie wykryto indywidualny temat graficzny:</source>
<target>Individual graphics was detected in your shop:</target>
</trans-unit>
<trans-unit id="120">
<source>Poniżej przedstawione pliki zostaną zarchiwizowane i napisane. Przeczytaj opis zmian.</source>
<target>The following files will be archived and overwritten. Read the description of the changes.</target>
</trans-unit>
<trans-unit id="121">
<source>Aktualizuj wszystkie</source>
<target>Update all</target>
</trans-unit>
<trans-unit id="122">
<source>Proszę zaakceptować zmiany</source>
<target>Accept the changes</target>
</trans-unit>
<trans-unit id="123">
<source>Subskrybuj RSS</source>
<target>Subscribe RSS</target>
</trans-unit>
<trans-unit id="124">
<source>Aktywacja aktualizacji</source>
<target>Activation of update</target>
</trans-unit>
<trans-unit id="125">
<source>Załącz pakiet</source>
<target>Attach a package</target>
</trans-unit>
<trans-unit id="126">
<source>Ignoruj zależności (nodeps)</source>
<target>Ignore the dependencies (nodeps)</target>
</trans-unit>
<trans-unit id="127">
<source>Rekonfiguracja bazy danych</source>
<target>Database reconfiguration</target>
</trans-unit>
<trans-unit id="128">
<source>Wszystkie aktualizacje są aktywne.</source>
<target>All updates are active.</target>
</trans-unit>
<trans-unit id="129">
<source>Dostępne aktualizacje</source>
<target>Available updates</target>
</trans-unit>
<trans-unit id="130">
<source>Nie ma nowych aktualizacji.</source>
<target>There are no new updates.</target>
</trans-unit>
<trans-unit id="131">
<source>Aplikacje pobrane i niezainstalowane. Kliknij: Instaluj</source>
<target>Applications downloaded and not installed. Click: Install</target>
</trans-unit>
<trans-unit id="132">
<source>Załączanie pakietów aktualizacji</source>
<target>Attaching the update packages</target>
</trans-unit>
<trans-unit id="133">
<source>Home Aktualizacje</source>
<target>Home - Update</target>
</trans-unit>
<trans-unit id="134">
<source>Panel sklepu</source>
<target>Administrative panel</target>
</trans-unit>
<trans-unit id="135">
<source>Strona sklepu</source>
<target>Shop's site</target>
</trans-unit>
<trans-unit id="136">
<source>Nie ma pobranych aktualizacji do instalacji.</source>
<target>There are no downloaded applications to install.</target>
</trans-unit>
<trans-unit id="137">
<source>Aktualizaje zostały pobrane</source>
<target>Updates have been downloaded</target>
</trans-unit>
<trans-unit id="138">
<source>Instaluj pobrane aktualizacje</source>
<target>Install the downloaded updates</target>
</trans-unit>
<trans-unit id="139">
<source>Instalacja aktualizacji</source>
<target>Install the updates</target>
</trans-unit>
<trans-unit id="140">
<source>Odświeżenie pamięci podręcznej aplikacji</source>
<target>Refreshing the applications cache</target>
</trans-unit>
<trans-unit id="141">
<source>Tworzenie modelu bazy danych - Weryfikacja</source>
<target>Creating the database model - Verifying</target>
</trans-unit>
<trans-unit id="142">
<source>Tworzenie modelu bazy danych - Usuwanie starych plików</source>
<target>Creating the database model - Deleting old files</target>
</trans-unit>
<trans-unit id="143">
<source>Tworzenie modelu bazy danych - Generowanie schematów XML</source>
<target>Creating the database model - Generating XML schemas</target>
</trans-unit>
<trans-unit id="144">
<source>Tworzenie modelu bazy danych - Generowanie klas modeli</source>
<target>Creating the database model - Generating classes of models</target>
</trans-unit>
<trans-unit id="145">
<source>Tworzenie modelu bazy danych - Generowanie zapytań SQL</source>
<target>Creating the database model - Generating SQL queries</target>
</trans-unit>
<trans-unit id="146">
<source>Tworzenie modelu bazy danych - Aktualizacja struktury bazy danych</source>
<target>Creating the database model - Updating the database structure</target>
</trans-unit>
<trans-unit id="147">
<source>Załącz</source>
<target>Attach</target>
</trans-unit>
<trans-unit id="148">
<source>Budowanie bazy danych</source>
<target>Building database</target>
</trans-unit>
<trans-unit id="149">
<source>Pasek postępu</source>
<target>Progress bar</target>
</trans-unit>
<trans-unit id="150">
<source>Ładowanie domyślnych danych. Uruchomienie sklepu</source>
<target>Loading the default data. Running the shop</target>
</trans-unit>
<trans-unit id="151">
<source>Dalej: Budowanie bazy danych</source>
<target>Next: Building database</target>
</trans-unit>
<trans-unit id="152">
<source>Kończenie pobierania plików</source>
<target>Finishing file download</target>
</trans-unit>
<trans-unit id="153">
<source>Kod aktywacji</source>
<target>Activation code</target>
</trans-unit>
<trans-unit id="154">
<source>Brak pakietu do instalacji.</source>
<target>No package to install.</target>
</trans-unit>
<trans-unit id="155">
<source>Brak połączenia z serwerem sote.pl.</source>
<target>No connection to the server sote.pl.</target>
</trans-unit>
<trans-unit id="156">
<source>Nieprawidłowy kod aktywacji.</source>
<target>Invalid activation code.</target>
</trans-unit>
<trans-unit id="157">
<source>Kod aktywacji został już wykorzystany.</source>
<target>The activation code has been already used.</target>
</trans-unit>
<trans-unit id="158">
<source>Niepoprawny format pliku.</source>
<target>Invalid file format.</target>
</trans-unit>
<trans-unit id="159">
<source>Błąd podczas wgrywania pliku.</source>
<target>An error occured while uploading the file.</target>
</trans-unit>
<trans-unit id="160">
<source>Plik został wgrany.</source>
<target>File was uploaded.</target>
</trans-unit>
<trans-unit id="161">
<source>Test wymagań technicznych serwera</source>
<target>Server's technical requirements test</target>
</trans-unit>
<trans-unit id="162">
<source>Wersja PHP (7.1.x - 7.4.x)</source>
<target>PHP version (7.1.x - 7.4.x)</target>
</trans-unit>
<trans-unit id="163">
<source>Skrypty uruchamiane z uprawnieniami użytkownika</source>
<target>Scripts are being run with the user's permissions</target>
</trans-unit>
<trans-unit id="164">
<source>Tryb safe_mode off</source>
<target>Safe_mode off</target>
</trans-unit>
<trans-unit id="165">
<source>Biblioteka cURL</source>
<target>cURL library</target>
</trans-unit>
<trans-unit id="166">
<source>Biblioteka JSON</source>
<target>JSON library</target>
</trans-unit>
<trans-unit id="167">
<source>Biblioteka XSL</source>
<target>XSL library</target>
</trans-unit>
<trans-unit id="168">
<source>Biblioteka GD2</source>
<target>GD2 library</target>
</trans-unit>
<trans-unit id="169">
<source>Obsługa Soap</source>
<target>Soap enabled</target>
</trans-unit>
<trans-unit id="170">
<source>Obsługa Multibyte String</source>
<target>Multibyte String enabled</target>
</trans-unit>
<trans-unit id="171">
<source>Obsługa MySQL</source>
<target>MySQL Support enabled</target>
</trans-unit>
<trans-unit id="172">
<source>Obsługa simpleXML</source>
<target>SimpleXML enabled</target>
</trans-unit>
<trans-unit id="173">
<source>Limit pamięci dla skryptu (64MB)</source>
<target>Memory limit (64MB)</target>
</trans-unit>
<trans-unit id="174">
<source>Czas wykonywania skryptu (30s)</source>
<target>Script execution time (30s)</target>
</trans-unit>
<trans-unit id="175">
<source>Biblioteka Mcrypt</source>
<target>Mcrypt library</target>
</trans-unit>
<trans-unit id="176">
<source>Wyłączony session.use_trans_sid</source>
<target>session.use_trans_sid off</target>
</trans-unit>
<trans-unit id="177">
<source>Biblioteka Zlib</source>
<target>Zlib library</target>
</trans-unit>
<trans-unit id="178">
<source>Lokalna instalacja Symfony</source>
<target>Local Symfony library</target>
</trans-unit>
<trans-unit id="179">
<source>Lokalna instalacja Pear</source>
<target>Local Pear library</target>
</trans-unit>
<trans-unit id="180">
<source>Weryfikacja tematu graficznego sklepu</source>
<target>Shop's graphic theme verification</target>
</trans-unit>
<trans-unit id="181">
<source>Weryfikacja została zakończona pomyślnie.</source>
<target>Verification successfully completed.</target>
</trans-unit>
<trans-unit id="182">
<source>Dostępna jest nowa wersja SOTESHOP 6:</source>
<target>New version SOTESHOP 6 is available:</target>
</trans-unit>
<trans-unit id="183">
<source>więcej</source>
<target>more</target>
</trans-unit>
<trans-unit id="184">
<source>Jeśli chcesz pobrać aktualizacje do wersji 6, musisz zaktualizować grafikę do nowszej wersji:</source>
<target>If you want to download updates to version 6, you have to first update your graphics to newer version:</target>
</trans-unit>
<trans-unit id="185">
<source>Nie można połączyć sie z bazą danych w celu wykonania weryfikacji.</source>
<target>Unable to connect to the database in order to make verification.</target>
</trans-unit>
<trans-unit id="186">
<source>Prosze o kontakt z serwisem oprogramowania www.serwis.sote.pl.</source>
<target>Contact your software service at www.serwis.sote.pl.</target>
</trans-unit>
<trans-unit id="187">
<source>Wystąpił błąd podczas weryfikacja tematu graficznego.</source>
<target>Error occurred during graphic theme's verification.</target>
</trans-unit>
<trans-unit id="188">
<source>http://www.sote.pl/soteshop6</source>
<target>http://www.soteshop.com/soteshop6</target>
</trans-unit>
<trans-unit id="189">
<source>http://www.sote.pl/soteshop6/update</source>
<target>http://www.soteshop.com/soteshop6/update</target>
</trans-unit>
<trans-unit id="190">
<source>Korzystasz z przeglądarki Internet Explorer 7 lub niższej.</source>
<target>You're using Internet Explorer 7 browser or even lower version.</target>
</trans-unit>
<trans-unit id="191">
<source>Do poprawnego działania panelu aktualizacji oraz sklepu zalecamy skorzystanie z nowszej wersji przeglądarki lub innej zgodnej ze standardem W3C.</source>
<target>For proper work of the update panel and your shop, we recommend using a newer version of your browser or other browser which is up to W3C standard.</target>
</trans-unit>
<trans-unit id="192">
<source>Poniżej lista przeglądarek zalecanych do obsługi panelu administracyjnego:</source>
<target>Here is the list of recommended browsers to operate the administrative panel</target>
</trans-unit>
<trans-unit id="193">
<source>Więcej informacji na temat instalacji przeglądarek znajdziecie Państwo</source>
<target>You can find more information about browsers' installation</target>
</trans-unit>
<trans-unit id="194">
<source>UWAGA: Instalujesz aktualizację do wersji SOTESHOP 6.</source>
<target>NOTICE: You're installing SOTESHOP 6</target>
</trans-unit>
<trans-unit id="195">
<source>Program różni się od wersji 5 procesem zamówienia i panelem administracyjnym.</source>
<target>The program differs from your current version 5 in the order process and the administrative panel.</target>
</trans-unit>
<trans-unit id="196">
<source>Więcej informacji o zmianach:</source>
<target>Find out more about the changes at:</target>
</trans-unit>
<trans-unit id="197">
<source>http://www.sote.pl</source>
<target>http://www.soteshop.com</target>
</trans-unit>
<trans-unit id="198">
<source>Możesz zainstalować aktualizację automatycznie (wymagane zrobienie archiwizacji sklepu przed instalacją) lub możesz zlecić aktualizację pod nadzorem serwisu, więcej informacji:</source>
<target>You can install the update automatically (making the backup is required before installation) or you can have the update done under supervision of our service, for more information go to:</target>
</trans-unit>
<trans-unit id="199">
<source>http://www.sote.pl/update6.html</source>
<target>http://www.soteshop.com/update6.html</target>
</trans-unit>
<trans-unit id="200">
<source>Nie można wykonać automatycznej aktualizacji do wersji SOTESHOP 6, gdyż w Twoim sklepie są indywidualne modyfikacje.</source>
<target>You can't automatically update to SOTESHOP 6, because there are the individual modifications in your shop.</target>
</trans-unit>
<trans-unit id="201">
<source>Skontaktuj się z nami</source>
<target>Contact us</target>
</trans-unit>
<trans-unit id="202">
<source>http://www.sote.pl/page/contact</source>
<target>http://www.soteshop.com/page/contact</target>
</trans-unit>
<trans-unit id="203">
<source>Dalej</source>
<target>Next</target>
</trans-unit>
<trans-unit id="204">
<source>tutaj</source>
<target>here</target>
</trans-unit>
<trans-unit id="205">
<source>Panel aktualizacji</source>
<target>Update panel</target>
</trans-unit>
<trans-unit id="206">
<source>Sklep aktualny</source>
<target>Your shop is fully updated</target>
</trans-unit>
<trans-unit id="207">
<source>Sklep nieaktualny</source>
<target>Your shop is not up to date</target>
</trans-unit>
<trans-unit id="209">
<source>Zaktualizuj swój sklep do najnowszej wersji.</source>
<target>Update your shop to the newest version.</target>
</trans-unit>
<trans-unit id="210">
<source>Twój sklep jest zaktualizowany do najnowszej wersji.</source>
<target>Your shop is updated to the newest version.</target>
</trans-unit>
<trans-unit id="211">
<source>Darmowy sklep internetowy SOTESHOP Open</source>
<target>Free online shop SOTESHOP Open</target>
</trans-unit>
<trans-unit id="212">
<source>Zamów wersję komercyjną</source>
<target>Order commercial version</target>
</trans-unit>
<trans-unit id="213">
<source>Dostępna jest nowa wersja sklepu.</source>
<target>There is a new version of the shop.</target>
</trans-unit>
<trans-unit id="214">
<source>Zamów aktualizację do wersji 7.</source>
<target>Order shop updare to version 7.</target>
</trans-unit>
<trans-unit id="215">
<source>http://www.sote.pl/aktualizacja-soteshop-z-wersji-6-do-7.html</source>
<target>http://www.soteshop.com/soteshop-update-from-version-6-to-7.html</target>
</trans-unit>
<trans-unit id="216">
<source>Zamów wersję komercyjną.</source>
<target>Order a commercial version.</target>
</trans-unit>
<trans-unit id="217">
<source>http://www.sote.pl/licencja-soteshop.html</source>
<target>http://www.soteshop.com/soteshop-license.html</target>
</trans-unit>
<trans-unit id="218">
<source>Wersja OPEN nie posiada dostępu do aktualizacji. </source>
<target>OPEN version does not have an access to the update.</target>
</trans-unit>
<trans-unit id="219">
<source>Dostęp do aktualizacji wygasł dnia</source>
<target>Access to update expired on</target>
</trans-unit>
<trans-unit id="220">
<source>Aplikacje zostały pobrane</source>
<target>Applications were downloaded</target>
</trans-unit>
<trans-unit id="221">
<source>Przedłuż usługę korzystania z SOTESHOP. Twój sklep będzie zablokowany za %days% dni</source>
<target>Extend the service of using SOTESHOP. Your store will be blocked in %days% days</target>
</trans-unit>
<trans-unit id="222">
<source>Przedłuż usługę korzystania z SOTESHOP</source>
<target>Extend the service of using SOTESHOP</target>
</trans-unit>
<trans-unit id="223">
<source>Tu pojawią się dostępne aktualizacje.</source>
<target>Available updates will appear here.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Włączanie i wyłączanie sklepu</source>
<target>Enable or disable your shop</target>
</trans-unit>
<trans-unit id="2">
<source>Wyłącz sklep</source>
<target>Lock your shop</target>
</trans-unit>
<trans-unit id="3">
<source>Zapisz</source>
<target>Save</target>
</trans-unit>
<trans-unit id="4">
<source>Twoje zmiany zostały zapisane</source>
<target>Your changes were saved</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Pasek postępu:</source>
<target>Progress bar:</target>
</trans-unit>
<trans-unit id="2">
<source>Nie można połączyć sie z serwerem w celu wykonania procesu. Prosze o kontakt z serwisem oprogramowania www.serwis.sote.pl.</source>
<target>Unable to connect to the server in order to execute the process. Contact the software service at www.serwis.sote.pl.</target>
</trans-unit>
<trans-unit id="3">
<source>Nie można połączyć sie z serwerem w celu wykonania procesu. Prosze o kontakt z administratorem serwera.</source>
<target>Unable to connect to the server in order to execute the process. Contact the server's administrator.</target>
</trans-unit>
<trans-unit id="4">
<source>Aktualizacja została przerwana ze względu na duże obciążenie serwera. Proszę spróbować ponownie za kilka minut.</source>
<target>The update has been aborted due to the high server's load. Please try again in a few minutes.</target>
</trans-unit>
<trans-unit id="5">
<source>Wystąpił problem podczas wykonywania operacji, ponowna próba za</source>
<target>The problem has occured during the operation, retry in</target>
</trans-unit>
<trans-unit id="6">
<source>sekund</source>
<target>seconds</target>
</trans-unit>
<trans-unit id="7">
<source>Wystąpił problem podczas wykonywania zadania</source>
<target>The problem occurred while performing the task</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,419 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>Informacje ogólne</source>
<target>General information</target>
</trans-unit>
<trans-unit id="2">
<source>Licencja</source>
<target>Licence</target>
</trans-unit>
<trans-unit id="3">
<source>Wymagania techniczne</source>
<target>Technical requirements</target>
</trans-unit>
<trans-unit id="4">
<source>Konfiguracja bazy danych</source>
<target>Database configuration</target>
</trans-unit>
<trans-unit id="5">
<source>Pobieranie plików</source>
<target>Download the files</target>
</trans-unit>
<trans-unit id="6">
<source>Instalacja</source>
<target>Installation</target>
</trans-unit>
<trans-unit id="7">
<source>Konfiguracja</source>
<target>Configuration</target>
</trans-unit>
<trans-unit id="8">
<source>Informacje końcowe</source>
<target>Final information</target>
</trans-unit>
<trans-unit id="9">
<source>Baza danych nie jest pusta.</source>
<target>The database is not empty.</target>
</trans-unit>
<trans-unit id="10">
<source>Witamy w programie instalacyjnym</source>
<target>Welcome to the installation of</target>
</trans-unit>
<trans-unit id="11">
<source>Dalej: Licencja</source>
<target>Next: Licence</target>
</trans-unit>
<trans-unit id="12">
<source>Popraw dane w formularzu</source>
<target>Correct the data in the form</target>
</trans-unit>
<trans-unit id="13">
<source>Problem:</source>
<target>Notice:</target>
</trans-unit>
<trans-unit id="14">
<source>Aby kontynuować musisz zaakceptować licencje.</source>
<target>Accept the license in order to continue.</target>
</trans-unit>
<trans-unit id="15">
<source>Treść licencji:</source>
<target>The license content:</target>
</trans-unit>
<trans-unit id="16">
<source>Akceptuje licencje</source>
<target>I accept the license</target>
</trans-unit>
<trans-unit id="17">
<source>Wstecz: Informacje ogólne</source>
<target>Back: General information</target>
</trans-unit>
<trans-unit id="18">
<source>Dalej: Wymagania techniczne</source>
<target>Next: Technical requirements</target>
</trans-unit>
<trans-unit id="19">
<source>Adres serwera bazy danych</source>
<target>Database host</target>
</trans-unit>
<trans-unit id="20">
<source>Skrypty uruchamiane z uprawnieniami użytkownika</source>
<target>Scripts are being run with the user's permissions</target>
</trans-unit>
<trans-unit id="21">
<source>Tryb safe_mode off</source>
<target>Safe_mode off</target>
</trans-unit>
<trans-unit id="22">
<source>Biblioteka cURL</source>
<target>cURL library</target>
</trans-unit>
<trans-unit id="23">
<source>Biblioteka JSON</source>
<target>JSON library</target>
</trans-unit>
<trans-unit id="24">
<source>Biblioteka XSL</source>
<target>XSL library</target>
</trans-unit>
<trans-unit id="25">
<source>Biblioteka GD2</source>
<target>GD2 library</target>
</trans-unit>
<trans-unit id="26">
<source>Obsługa Soap</source>
<target>Soap enabled</target>
</trans-unit>
<trans-unit id="27">
<source>Obsługa Multibyte String</source>
<target>Multibyte String enabled</target>
</trans-unit>
<trans-unit id="28">
<source>Obsługa MySQL</source>
<target>MySQL Support enabled</target>
</trans-unit>
<trans-unit id="29">
<source>Obsługa simpleXML</source>
<target>SimpleXML enabled</target>
</trans-unit>
<trans-unit id="30">
<source>Limit pamięci dla skryptu (64MB)</source>
<target>Memory limit (64MB)</target>
</trans-unit>
<trans-unit id="31">
<source>Czas wykonywania skryptu (30s)</source>
<target>Script execution time (30s)</target>
</trans-unit>
<trans-unit id="32">
<source>Biblioteka Mcrypt</source>
<target>Mcrypt library</target>
</trans-unit>
<trans-unit id="33">
<source>Wstecz: Licencja</source>
<target>Back: License</target>
</trans-unit>
<trans-unit id="34">
<source>Dalej: Konfiguracja bazy danych</source>
<target>Next: Database configuration</target>
</trans-unit>
<trans-unit id="35">
<source>Nazwa bazy danych</source>
<target>Database name</target>
</trans-unit>
<trans-unit id="36">
<source>Nazwa użytkownika bazy danych</source>
<target>User login</target>
</trans-unit>
<trans-unit id="37">
<source>Hasło</source>
<target>Password</target>
</trans-unit>
<trans-unit id="38">
<source>Wstecz: Wymagania techniczne</source>
<target>Back: Technical requirements</target>
</trans-unit>
<trans-unit id="39">
<source>Dalej: Pobieranie plików</source>
<target>Next: Download the files</target>
</trans-unit>
<trans-unit id="40">
<source>Nie można połączyć się z bazą danych, sprawdz dane i spróbuj ponownie.</source>
<target>Unable to connect to the database, check the data and try again.</target>
</trans-unit>
<trans-unit id="41">
<source>Nie można połączyć sie z serwerem w celu wykonania procesu. Prosze o kontakt z administratorem serwera.</source>
<target>Unable to connect to the server in order to execute the process. Contact the server's administrator.</target>
</trans-unit>
<trans-unit id="42">
<source>Wstecz: Konfiguracja bazy danych</source>
<target>Back: Database configuration</target>
</trans-unit>
<trans-unit id="43">
<source>Dalej: Instalacja</source>
<target>Next: Installation</target>
</trans-unit>
<trans-unit id="44">
<source>Wersja PHP</source>
<target>PHP version</target>
</trans-unit>
<trans-unit id="45">
<source>Przejdź do konfiguracji</source>
<target>Go to the configuration</target>
</trans-unit>
<trans-unit id="46">
<source>Dalej: Informacje końcowe</source>
<target>Next: Final information</target>
</trans-unit>
<trans-unit id="47">
<source>Sklep został pomyślnie zainstalowany</source>
<target>The shop is successfully installed</target>
</trans-unit>
<trans-unit id="48">
<source>Adres sklepu</source>
<target>Your shop</target>
</trans-unit>
<trans-unit id="49">
<source>Panel administracyjny</source>
<target>Administration panel</target>
</trans-unit>
<trans-unit id="50">
<source>Panel aktualizacji</source>
<target>Update panel</target>
</trans-unit>
<trans-unit id="51">
<source>Dalej: Przejdź do rejestracji</source>
<target>Next: Go to the registration</target>
</trans-unit>
<trans-unit id="52">
<source>Rekonfiguracja bazy danych</source>
<target>Database reconfiguration</target>
</trans-unit>
<trans-unit id="53">
<source>Zapisz</source>
<target>Save</target>
</trans-unit>
<trans-unit id="54">
<source>Przejdź do panelu administracyjnego</source>
<target>Go to administrative panel</target>
</trans-unit>
<trans-unit id="55">
<source>Dane zostały zmienione</source>
<target>Data has been changed</target>
</trans-unit>
<trans-unit id="57">
<source>Numer licencji jest nieprawidłowy.</source>
<target>The license number is incorrect.</target>
</trans-unit>
<trans-unit id="58">
<source>Proszę podać numer licencji.</source>
<target>Enter the license number.</target>
</trans-unit>
<trans-unit id="59">
<source>Numer licencji</source>
<target>License number</target>
</trans-unit>
<trans-unit id="60">
<source>Przed przystąpieniem do instalacji oprogramowania</source>
<target>Before you start installing</target>
</trans-unit>
<trans-unit id="61">
<source>podręcznikiem instalacji</source>
<target>the installation guide</target>
</trans-unit>
<trans-unit id="62">
<source>Wyłączony session.use_trans_sid</source>
<target>session.use_trans_sid off</target>
</trans-unit>
<trans-unit id="63">
<source>Biblioteka Zlib</source>
<target>Zlib library</target>
</trans-unit>
<trans-unit id="64">
<source>Wymagania instalacji nie są spełnione, proszę o kontakt z administratorem serwera.</source>
<target>The installation requirements are not met, contact the server's administrator.</target>
</trans-unit>
<trans-unit id="65">
<source>, zalecane <strong>128MB</strong></source>
<target>, recommended <strong>128MB</strong></target>
</trans-unit>
<trans-unit id="66">
<source>s, zalecane <strong>60s</strong></source>
<target>s, recommended <strong>60s</strong></target>
</trans-unit>
<trans-unit id="67">
<source>Tryb safe_mode wyłączony</source>
<target>Safe_mode off</target>
</trans-unit>
<trans-unit id="68">
<source>Obsługa Mutlibyte String</source>
<target>Mutlibyte String enabled</target>
</trans-unit>
<trans-unit id="69">
<source>Nie mogę zapisać pliku konfiguracyjnego.</source>
<target>Unable to save the configuration file.</target>
</trans-unit>
<trans-unit id="70">
<source>Złe kodowanie bazy danych, proszę zmienić na utf8_unicode_ci.</source>
<target>Invalid database encoding, change the encoding to utf8_unicode_ci.</target>
</trans-unit>
<trans-unit id="71">
<source>Wystąpił błąd podczas pobierania oprogramowania</source>
<target>An error occurred while downloading</target>
</trans-unit>
<trans-unit id="72">
<source>podręcznika instalacji</source>
<target>the installation guide</target>
</trans-unit>
<trans-unit id="73">
<source>Wystąpił błąd podczas instalacji oprogramowania</source>
<target>An error occurred while installing</target>
</trans-unit>
<trans-unit id="74">
<source>Konfiguracja systemu</source>
<target>System configuration</target>
</trans-unit>
<trans-unit id="75">
<source>Domyślne ustawienia</source>
<target>Default settings</target>
</trans-unit>
<trans-unit id="76">
<source>Dalej: Domyślne ustawienia</source>
<target>Next: Default settings</target>
</trans-unit>
<trans-unit id="77">
<source>Waluta</source>
<target>Currency</target>
</trans-unit>
<trans-unit id="78">
<source>Wersja językowa sklepu</source>
<target>Language version of the shop</target>
</trans-unit>
<trans-unit id="79">
<source>Wersja językowa panelu sklepu</source>
<target>Language version of the administrative panel</target>
</trans-unit>
<trans-unit id="80">
<source>SOTESHOP - instalacja</source>
<target>SOTESHOP - installation</target>
</trans-unit>
<trans-unit id="81">
<source>proponujemy zapoznanie się z</source>
<target>read</target>
</trans-unit>
<trans-unit id="82">
<source>SOTESHOP - panel aktualizacji</source>
<target>SOTESHOP - the update panel</target>
</trans-unit>
<trans-unit id="83">
<source>większość problemów można rozwiązać korzystając z</source>
<target>most problems can be solved using</target>
</trans-unit>
<trans-unit id="84">
<source>Wystąpił błąd podczas aktualizacji oprogramowania</source>
<target>An error occurred while updating</target>
</trans-unit>
<trans-unit id="85">
<source>ponowna próba aktualizacji nastąpi za 30 sekund</source>
<target>retry in 30 seconds</target>
</trans-unit>
<trans-unit id="86">
<source>http://www.sote.pl/docs/instalacja</source>
<target>http://www.soteshop.com/docs/instalacja</target>
</trans-unit>
<trans-unit id="87">
<source>Kończenie pobierania plików</source>
<target>Finishing file download</target>
</trans-unit>
<trans-unit id="88">
<source>Budowanie bazy danych</source>
<target>Building database</target>
</trans-unit>
<trans-unit id="89">
<source>Pasek postępu</source>
<target>Progress bar</target>
</trans-unit>
<trans-unit id="90">
<source>Dalej: Budowanie bazy danych</source>
<target>Next: Building database</target>
</trans-unit>
<trans-unit id="91">
<source>Domyślny temat graficzny</source>
<target>Default theme</target>
</trans-unit>
<trans-unit id="92">
<source>Przykładowe dane</source>
<target>Example data</target>
</trans-unit>
<trans-unit id="93">
<source>Zapisywanie domyślnych ustawień:</source>
<target>Save default settings:</target>
</trans-unit>
<trans-unit id="94">
<source>Domyślny kraj</source>
<target>Default country</target>
</trans-unit>
<trans-unit id="95">
<source>Załaduj przykładowe dane</source>
<target>Load example data</target>
</trans-unit>
<trans-unit id="96">
<source>Numer licencji</source>
<target>License number</target>
</trans-unit>
<trans-unit id="97">
<source>Wystąpił problem z weryfikacją licencji. Skontaktuj się z office@sote.pl</source>
<target>There was a problem with the license verification. Please contact office@sote.pl</target>
</trans-unit>
<trans-unit id="98">
<source>Wstecz</source>
<target>Back</target>
</trans-unit>
<trans-unit id="99">
<source>Podana wartość jest nieprawidłowa. Proszę podać numer licencji.</source>
<target>Invalid value. Enter the license number.</target>
</trans-unit>
<trans-unit id="100">
<source>Hasło nie może zawierać znaków #, @, /.</source>
<target>Password can't contain the characters #, @, /.</target>
</trans-unit>
<trans-unit id="101">
<source>instalacja sklepu</source>
<target>installation</target>
</trans-unit>
<trans-unit id="102">
<source>Dalej</source>
<target>Next</target>
</trans-unit>
<trans-unit id="103">
<source>Limit pamięci dla skryptu (128MB)</source>
<target>Memory limit (128MB)</target>
</trans-unit>
<trans-unit id="104">
<source>Obsługa baz danych PDO (MySQL, SQLite)</source>
<target>PDO (MySQL, SQLite) databases support enabled</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file orginal="global" source-language="pl_PL" target-language="en_US" datatype="plaintext" date="2008-11-05T12:10:49Z">
<body>
<trans-unit id="1">
<source>WebStore</source>
<target>WebStore</target>
</trans-unit>
<trans-unit id="2">
<source>Zainstalowane dodatkowe aplikacje</source>
<target>Installed additional applications</target>
</trans-unit>
<trans-unit id="3">
<source>Nazwa</source>
<target>Name</target>
</trans-unit>
<trans-unit id="4">
<source>Opis</source>
<target>Description</target>
</trans-unit>
<trans-unit id="5">
<source>Wersja</source>
<target>Version</target>
</trans-unit>
<trans-unit id="6">
<source>Darmowe aplikacje do pobrania</source>
<target>Free downloadable applications</target>
</trans-unit>
<trans-unit id="7">
<source>Aktywuj</source>
<target>Activate</target>
</trans-unit>
<trans-unit id="8">
<source>Kup</source>
<target>Buy</target>
</trans-unit>
<trans-unit id="9">
<source>Pobierz</source>
<target>Download</target>
</trans-unit>
<trans-unit id="10">
<source>Brak połączenia z serwerem sote.pl.</source>
<target>No connection to the server sote.pl.</target>
</trans-unit>
<trans-unit id="11">
<source>Nieprawidłowy kod aktywacji.</source>
<target>Invalid activation code.</target>
</trans-unit>
<trans-unit id="12">
<source>Kod aktywacji został już wykorzystany.</source>
<target>The activation code has been already used.</target>
</trans-unit>
<trans-unit id="13">
<source>Pakiet został aktywowany.</source>
<target>Package was activate.</target>
</trans-unit>
<trans-unit id="14">
<source>Pakiet został pobrany.</source>
<target>Package was downloaded.</target>
</trans-unit>
<trans-unit id="15">
<source>Aktywacja pakietu</source>
<target>Activate package</target>
</trans-unit>
<trans-unit id="16">
<source>Kod aktywacji</source>
<target>Activation code</target>
</trans-unit>
<trans-unit id="17">
<source>Informacje o pakiecie</source>
<target>Package information</target>
</trans-unit>
<trans-unit id="18">
<source>Tematy graficzne do pobrania</source>
<target>Available graphic themes for download</target>
</trans-unit>
<trans-unit id="19">
<source>Sprawdź nasze dodatkowe aplikacje</source>
<target>Check out our additional applications</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,231 @@
<?php
class stUpdatePositioningPlugin
{
protected $msg = '';
protected $title = '';
protected $langs = array();
public function __construct()
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$this->langs = LanguagePeer::doSelectLanguages();
}
public function productUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(20);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$objects = ProductPeer::doSelect($c);
foreach ($objects as $object) {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
try {
$object->save();
} catch (Exception $e) {
}
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja produktów', array(), 'stPositioningBackend');
return ($step+count($objects));
}
public function categoryUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(20);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$objects = CategoryPeer::doSelect($c);
foreach ($objects as $object) {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
try {
$object->save();
} catch (Exception $e) {
}
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja kategorii', array(), 'stPositioningBackend');
return ($step+count($objects));
}
public function productGroupUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(1);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$object = ProductGroupPeer::doSelectOne($c);
if (is_object($object)) {
try {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
$object->save();
}
} catch (Exception $e) {
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja grup produktów', array(), 'stPositioningBackend');
return $step+1;
}
public function webpageUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(1);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$object = WebpagePeer::doSelectOne($c);
if (is_object($object)) {
try {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
$object->save();
}
} catch (Exception $e) {
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja stron www', array(), 'stPositioningBackend');
return $step+1;
}
/**
* Generowanie linków dla producenta po aktualizacji
*/
public function producerUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(20);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$objects = ProducerPeer::doSelect($c);
foreach ($objects as $object) {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
try {
$object->save();
} catch (Exception $e) {
}
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja producentów', array(), 'stPositioningBackend');
return ($step+count($objects));
}
/**
* Generowanie linków dla bloga po aktualizacji
*/
public function blogUpdate($step)
{
sfLoader::loadPluginConfig();
$c = new Criteria();
$c->setOffset($step);
$c->setLimit(20);
stPropelSeoUrlBehavior::configuration(array('auto_generate_url'=>true));
$objects = BlogrPeer::doSelect($c);
foreach ($objects as $object) {
foreach ($this->langs as $lang) {
$object->setCulture($lang->getOriginalLanguage());
try {
$object->save();
} catch (Exception $e) {
}
}
}
$this->title = sfContext::getInstance()->getI18N()->__('Aktualizacja bloga', array(), 'stPositioningBackend');
return ($step+count($objects));
}
public function getMessage()
{
return $this->msg;
}
public function getTitle()
{
return $this->title;
}
public function init()
{
$i18n = sfContext::getInstance()->getI18N();
switch (sfContext::getInstance()->getRequest()->getParameterHolder()->get('name')) {
case "stPositioning_ProductUpdate" :
$this->title = $i18n->__('Aktualizacja produktów', array(), 'stPositioningBackend');
break;
case "stPositioning_CategoryUpdate" :
$this->title = $i18n->__('Aktualizacja kategorii', array(), 'stPositioningBackend');
break;
case "stPositioning_ProductGroupUpdate" :
$this->title = $i18n->__('Aktualizacja grup produktów', array(), 'stPositioningBackend');
break;
case "stPositioning_WebpageUpdate" :
$this->title = $i18n->__('Aktualizacja stron www', array(), 'stPositioningBackend');
break;
case "stPositioning_BlogUpdate" :
$this->title = $i18n->__('Aktualizacja bloga', array(), 'stPositioningBackend');
break;
}
}
public function close()
{
$i18n = sfContext::getInstance()->getI18N();
switch (sfContext::getInstance()->getRequest()->getParameterHolder()->get('name')) {
case "stPositioning_ProductUpdate" :
$this->title = $i18n->__('Aktualizacja produktów', array(), 'stPositioningBackend');
touch(sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'stPositioning_ProductUpdate.log');
break;
case "stPositioning_CategoryUpdate" :
$this->title = $i18n->__('Aktualizacja kategorii', array(), 'stPositioningBackend');
touch(sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'stPositioning_CategoryUpdate.log');
break;
case "stPositioning_ProductGroupUpdate" :
$this->title = $i18n->__('Aktualizacja grup produktów', array(), 'stPositioningBackend');
touch(sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'stPositioning_ProductGroupUpdate.log');
break;
case "stPositioning_WebpageUpdate" :
$this->title = $i18n->__('Aktualizacja stron www', array(), 'stPositioningBackend');
touch(sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'stPositioning_WebpageUpdate.log');
break;
case "stPositioning_BlogUpdate" :
$this->title = $i18n->__('Aktualizacja bloga', array(), 'stPositioningBackend');
touch(sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'stPositioning_BlogUpdate.log');
break;
}
}
public static function postInstall(sfEvent $event) {
sfLoader::loadHelpers('stProgressBar');
sfLoader::loadHelpers('Partial');
$event->getSubject()->msg .= progress_bar('stPositioning_ProductUpdate', 'stUpdatePositioningPlugin', 'productUpdate', ProductPeer::doCount(new Criteria()));
$event->getSubject()->msg .= progress_bar('stPositioning_CategoryUpdate', 'stUpdatePositioningPlugin', 'categoryUpdate', CategoryPeer::doCount(new Criteria()));
$event->getSubject()->msg .= progress_bar('stPositioning_ProductGroupUpdate', 'stUpdatePositioningPlugin', 'productGroupUpdate', ProductGroupPeer::doCount(new Criteria()));
$event->getSubject()->msg .= progress_bar('stPositioning_WebpageUpdate', 'stUpdatePositioningPlugin', 'webpageUpdate', WebpagePeer::doCount(new Criteria()));
$event->getSubject()->msg .= progress_bar('stPositioning_BlogUpdate', 'stUpdatePositioningPlugin', 'blogUpdate', BlogPeer::doCount(new Criteria()));
}
public static function postInstallProducer(sfEvent $event) {
sfLoader::loadHelpers('stProgressBar');
sfLoader::loadHelpers('Partial');
$event->getSubject()->msg .= progress_bar('stPositioning_ProducerUpdate', 'stUpdatePositioningPlugin', 'producerUpdate', ProducerPeer::doCount(new Criteria()));
}
}

View File

@@ -0,0 +1,87 @@
<?php
class stUserFixUpdate
{
public function fixTable($step)
{
return $step + $this->executeFixUser($step);
}
public static function postInstall(sfEvent $event)
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
sfLoader::loadHelpers('stProgressBar');
sfLoader::loadHelpers('Partial');
$event->getSubject()->msg .= progress_bar('stUserFixData', 'stUserFixUpdate', 'fixTable', sfGuardUserPeer::doCount(new Criteria()));
}
public function executeFixUser($step)
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$c = new Criteria();
$c->setLimit(10);
$c->setOffset($step);
$users = sfGuardUserPeer::doSelect($c);
foreach ($users as $user)
{
if($user->getHashCode()=="")
{
$HashCode = md5(microtime().$user->getUsername());
$user->setHashCode($HashCode);
$user->save();
}
$c = new Criteria();
$c->add(UserDataPeer::SF_GUARD_USER_ID, $user->getId());
$c->add(UserDataPeer::IS_BILLING, null);
UserDataPeer::doDelete($c);
$c = new Criteria();
$c->add(UserDataPeer::SF_GUARD_USER_ID, $user->getId());
$c->add(UserDataPeer::IS_BILLING, 1);
$userDataBilling = UserDataPeer::doSelectOne($c);
if($userDataBilling)
{
$c = new Criteria();
$c->add(UserDataPeer::SF_GUARD_USER_ID, $user->getId());
$c->add(UserDataPeer::IS_BILLING, "");
$userDataDelivery = UserDataPeer::doSelectOne($c);
if(!$userDataDelivery)
{
$userData = new UserData();
$userData->setSfGuardUserId($user->getId());
$userData->setIsBilling(0);
$userData->setIsDefault(1);
$userData->setName($userDataBilling->getName());
$userData->setSurname($userDataBilling->getSurname());
$userData->setStreet($userDataBilling->getStreet());
$userData->setHouse($userDataBilling->getHouse());
$userData->setFlat($userDataBilling->getFlat());
$userData->setCode($userDataBilling->getCode());
$userData->setTown($userDataBilling->getTown());
$userData->setCountriesId($userDataBilling->getCountriesId());
$userData->setPhone($userDataBilling->getPhone());
$userData->setCompany($userDataBilling->getCompany());
$userData->save();
}
}
}
return count($users);
}
}
?>

View File

@@ -0,0 +1,136 @@
<?php
/**
* Zwraca HTML przycisku dla danej akcji
*
* @param string $type Typ akcji (dostepne: save, save_and_add, save_and_list, delete, list, edit)
* @param string $label Etykieta przycisku
* @param string $action Akcja przycisku (np. category/index)
* @param mixed $html_options opcje HTML
* @return string HTML
*/
function st_get_update_action($type, $label, $action = null, $html_options = array())
{
$html_options = _parse_attributes($html_options);
if ($type == 'create' || $type == 'add')
{
$type = 'add';
}
elseif ($type == 'save_and_list' || $type == 'save_and_add' || $type == 'save')
{
$type = 'save';
}
if (!isset($html_options['style']))
{
$html_options['style'] = '';
}
if ($type)
{
$html_options['style'] .= '; background-image: url(/images/update/red/icons/' . $type . '.png?v=3)';
}
else
{
$html_options['style'] .= '; padding-left: 17px';
}
if (is_null($action))
{
$action_content = submit_tag($label, $html_options);
}
else
{
$action_content = button_to($label, $action, $html_options);
}
return content_tag('li', content_tag('div', content_tag('div', $action_content)), array('class' => 'st_admin-action-' . $type));
}
/**
* Zwraca HTML otwierający definiowanie akcji
*
* @param string $html_options opcje HTML
* @return string HTML
*/
function st_get_update_actions_head($html_options = array())
{
$html_options = _parse_attributes($html_options);
if (isset($html_options['class']))
{
$html_options['class'] = 'st_admin-actions ' . $html_options['class'];
}
else
{
$html_options['class'] = 'st_admin-actions';
}
return tag('ul', $html_options, true);
}
/**
* Zwraca HTML zamykający definiowanie akcji
*
* @return string HTML
*/
function st_get_update_actions_foot()
{
return '</ul>' . tag('br', array('class' => 'st_clear_all'));
}
function st_external_link_to($name = '', $internal_uri = '', $options = array())
{
$options = _parse_attributes($options);
$options['class'] = 'st_admin_external_link';
return link_to($name, $internal_uri, $options);
}
function st_program_name()
{
return 'SOTESHOP';
}
function get_shop_version()
{
$version = (stRegisterSync::getPackageVersion('soteshop') != '') ? stRegisterSync::getPackageVersion('soteshop') : stRegisterSync::getPackageVersion('soteshop_base');
if (stCommunication::getIsSeven())
{
list($x, $y, $z) = explode('.', $version, 3);
if ($y >= 3)
{
$y -= 3;
}
$x += 1;
$version = $x . '.' . $y . '.' . $z;
}
return $version;
}
function st_update_get_app_icon($appName)
{
$sf_web_dir = sfConfig::get('sf_web_dir');
if (is_file($sf_web_dir . '/images/backend/applications/'.$appName.'.svg'))
{
return '/images/backend/applications/'.$appName.'.svg?v1';
}
elseif (is_file($sf_web_dir . '/plugins/' . $appName . '/images/backend/' . $appName . '.svg'))
{
return '/plugins/' . $appName . '/images/backend/' . $appName . '.svg';
}
elseif (is_file($sf_web_dir . '/images/backend/main/icons/red/' . $appName . '.png'))
{
return '/images/backend/main/icons/red/' . $appName . '.png';
}
return \st_update_get_app_icon('stDefaultApp');
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: myUser.class.php 3160 2010-01-26 13:30:27Z marek $
*/
/**
* Extention of system user class. Required by symfony application.
*
* @package stUpdate
* @subpackage libs
*/
class myUser extends sfBasicSecurityUser
{
}

View File

@@ -0,0 +1 @@
PEAR Repository

View File

@@ -0,0 +1,154 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stActionsFinder.class.php 11065 2011-02-16 10:38:27Z marek $
*/
/**
* Symfony actions finder.
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stActionsFinder
{
/**
* Get all actions
*
* @return array
*/
public function getAllActions()
{
$frontend = $this->getActions('frontend');
$backend = $this->getActions('backend');
$plugins = $this->getPluginsActions(array('frontend','backend'));
return array(
'frontend'=> array_merge($frontend,$plugins['frontend']),
'backend' => array_merge($backend, $plugins['backend']),
);
}
/**
* Get URL for provided application.
*
* @param string $app
* @param string $unique NULL - all actions, 'unique' - only 1 action for module
* @return array
*/
public function getActionsURL($app,$unique=NULL)
{
$urls=array();$set=array();
$hostname=sfContext::getInstance()->getRequest()->getHost();
$protocol='http';
if ($app=='frontend') $index='index.php';
else $index=$app.'.php';
if (empty($this->actions)) $this->actions = $this->getAllActions();
foreach ($this->actions[$app] as $module=>$actions)
{
foreach ($actions as $action)
{
if ($unique=='unique')
{
if (! isset($set[$module]))
{
$urls[]=$protocol.'://'.$hostname.'/'.$index.'/'.$module.'/'.$action;
$set[$module]=1;
}
} else $urls[]=$protocol.'://'.$hostname.'/'.$index.'/'.$module.'/'.$action;
}
}
return $urls;
}
/**
* Get application actions.
*/
private function getActions($app)
{
$app_dir = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.sfConfig::get('sf_apps_dir_name').DIRECTORY_SEPARATOR.$app;
$app_modules_dir = $app_dir.DIRECTORY_SEPARATOR.sfConfig::get('sf_app_module_dir_name');
$a=$this->getModuleActions($app_modules_dir);
return $a;
}
/**
* Get plugins actions.
*
* @return array
*/
private function getPluginsActions($apps)
{
$plugins = sfFinder::type('dir')->name("*")->relative()->maxdepth(0)->in(sfConfig::get('sf_plugins_dir'));
$result=array();
foreach ($plugins as $plugin)
{
$app_modules_dir = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.$plugin.DIRECTORY_SEPARATOR.sfConfig::get('sf_app_module_dir_name');
$a=$this->getModuleActions($app_modules_dir);
foreach ($a as $module=>$data)
{
foreach ($apps as $app)
{
preg_match("/(".$app.")/i",$module,$matches);
if (! empty($matches[1])) $result[$app][$module]=$data;
}
}
}
return $result;
}
/**
* Get actions in module.
*
* @param string $module
* @return array actions
*/
private function getModuleActions($app_modules_dir)
{
$modules = sfFinder::type('dir')->name('*')->maxdepth(0)->relative()->in($app_modules_dir);
$a=array();
foreach ($modules as $module)
{
$action_file = $app_modules_dir.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'actions'.DIRECTORY_SEPARATOR.'actions.class.php';
if (file_exists($action_file))
{
$actions=$this->getActionsName($action_file);
if (! empty($actions)) $a[$module]=$actions;
}
}
return $a;
}
/**
* Get actions name.
*
* @param string $file action file
* @return array actions names
*/
private function getActionsName($file)
{
$data=file_get_contents($file);
$lines=preg_split("/\n/",$data);
$a=array();
foreach ($lines as $line)
{
preg_match("/function[\s]+execute([a-z0-9_-]+)/i",$line,$matches);
if (! empty($matches[1])) $a[]=$matches[1];
}
return $a;
}
}

View File

@@ -0,0 +1,540 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stAppVerify.class.php 13828 2011-06-29 08:03:01Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Database verification file.
*/
define ("ST_VERIFY_FILE",sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.verify.reg');
/**
* Configuration
*/
define ("ST_VERIFY_CONFIG",sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'stInstallerWeb'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'verify.yml');
/**
* stInstallerIgnore class
*
* @package stUpdate
* @subpackage libs
*/
require_once (sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.'stInstallerPlugin'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stInstallerIgnore.class.php');
if (! defined("ST_INSTALLER_LOG_PAGE")) define("ST_INSTALLER_LOG_PAGE",sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'webinstaller.log');
sfLoader::loadHelpers('Helper');
use_helper('I18N','Url', 'Tag');
use_helper('stProgressBar','Partial');
/**
* Code veryfication. Modification detector.
*
* @package stUpdate
* @subpackage libs
*/
class stAppVerify
{
/**
* Step in progress bar.
*
* @param integer $count
* @return integer next count
*/
function step($count)
{
if ($count==0)
{
// delete verification file
if (file_exists(ST_VERIFY_FILE)) unlink(ST_VERIFY_FILE);
}
$apps=$this->getApps();
$this->owner = $this->getHttpOwner();
$i=0; reset($apps);
foreach ($apps as $app)
{
if ($count==$i)
{
// verify sf_root_dir
$result=$this->verify($app);
$this->app=$app;
// check verification
if (! empty($result))
{
// add app modifications for report
$this->register($app,$result);
}
// verify install/src
// this verification throw exception if something is wrong
$result_install=$this->verifyPearInstall($app);
}
$i++;
}
$this->count=$count;
$this->apps=$apps;
sleep(1); // reduce cpu limit/time
return $count+1;
}
/**
* Return http owner.
* @return string
*/
private function getHttpOwner()
{
$file = sfConfig::get('sf_cache_dir').DIRECTORY_SEPARATOR.'php_http_owner_test.tmp';
file_put_contents($file,'test');
$owner=fileowner($file);
unlink($file);
return $owner;
}
/**
* Get apps list to verification. Application which will be installed/upgraded.
*
* @return array array('stOrder','stCategory',...)
*/
protected function getApps()
{
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
$apps=$apps_sync['all'];
return $apps;
}
/**
* Get progress bar step message.
*
* @return string
*/
public function getMessage()
{
if (isset($this->count))
{
return __('Weryfikacja', null, 'stInstallerWeb').': '.$this->app;
}
else {
// last step
if ($this->checkModifications())
{
// wykryto modyfikacje
return $this->modificationReport();
} else
{
// wykonaj instalacje/synchronizacje
return $this->reboot();
}
}
}
/**
* Get progress bar title.
*
* @return string
*/
public function getTitle()
{
return __('Weryfikacja', null, 'stInstallerWeb').': ';
}
/**
* Reboot action
*
* @return string
*/
protected function reboot()
{
return progress_bar('Installer', 'stInstallerTasks', 'step', 15);
}
/**
* Modification report.
* Show files modified by user.
*
* @return string
*/
private function modificationReport()
{
$data=unserialize(file_get_contents(ST_VERIFY_FILE));
return get_partial('stInstallerWeb/report',array("data"=>$data));
}
/**
* Check verification result.
*
* @return bool true - code was modified, false - code is ok
*/
private function checkModifications()
{
if (file_exists(ST_VERIFY_FILE))
{
$data=unserialize(file_get_contents(ST_VERIFY_FILE));
if (is_array($data))
{
foreach ($data as $app=>$files)
{
if (! empty($files)) return true;
}
}
}
return false;
}
/**
* Verify application.
*
* @param $app application name
* @return array
*/
public function verify($app)
{
$result=array();
$peari = stPearInfo::getInstance('verify');
$files=$peari->getFiles($app);
if (! empty($files))
{
foreach ($files as $file)
{
if (! empty($file['attribs']))
{
$name = $file['attribs']['name'];
$md5sum = $file['attribs']['md5sum'];
$md5sum_current = $this->md5Sum($this->getPath($name));
if (is_readable($this->getPath($name)))
$owner_current = fileowner($this->getPath($name));
else
$owner_current = null;
// moved to $this->isFileModified()
// old code
//
// if ((($md5sum!=$md5sum_current) && (! empty($md5sum_current))) || ($owner_current != $this->owner))
// {
// // if file exists verify it
// if ((file_exists($this->getPath($name))) && (! empty($name)))
// {
// if (! $this->ignore($this->getPath($name,true),$app))
// {
// $result[$this->getPath($name,true)]=array('md5sum'=>$md5sum,'current'=>$md5sum_current,'modified'=>$this->getModTime($this->getPath($name)),'owner'=>$owner_current);
// }
// }
// }
//
// end
// new code
if ($this->isFileModified($app,$name,$md5sum,$md5sum_current,$owner_current))
{
$result[$this->getPath($name,true)]=array('md5sum'=>$md5sum,'current'=>$md5sum_current,'modified'=>$this->getModTime($this->getPath($name)),'owner'=>$owner_current);
}
// end
}
}
unset($peari);
return $result;
}
}
/**
* File verification.
*
* @param string $app application (PEAR package name)
* @param string $name relative file name
* @param string $md5sum md5 in PEAR database
* @param string $md5sum_current md5 in filesystem
* @param string $owner_current owner of the verified file
* @return bool true - file is modified, false - file is not modified, is OK
*/
protected function isFileModified($app, $name,$md5sum,$md5sum_current,$owner_current)
{
if ((($md5sum!=$md5sum_current) && (! empty($md5sum_current))) || ($owner_current != $this->owner))
{
// if file exists verify it
if ((file_exists($this->getPath($name))) && (! empty($name)))
{
if (! $this->ignore($this->getPath($name,true),$app))
{
return true;
}
}
}
return false;
}
/**
* Verify pear installer application. (Downloaded in install/src/stAppName)
*
* @param $app application name
* @return NULL|Exception
*/
public function verifyPearInstall($app)
{
$result=array();
$peari = stPearInfo::getInstance();
$install_src_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src';
$files=$peari->getFiles($app);
if (! empty($files))
{
foreach ($files as $file)
{
if (! empty($file['attribs']))
{
$name = $file['attribs']['name'];
$md5sum = $file['attribs']['md5sum'];
$install_file_1=$install_src_dir.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.$this->getPath($name,true,false);
$install_file_2=$install_src_dir.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.$this->getPath($name,true,false);
if (file_exists($install_file_1))
{
$md5sum_current = $this->md5Sum($install_file_1);
$install_file=$install_file_1;
}
elseif (file_exists($install_file_2))
{
$md5sum_current = $this->md5Sum($install_file_2);
$install_file=$install_file_2;
}
else
{
throw new Exception("PEAR installation error. File $install_file_1 or $install_file_2 not found in $install_src_dir.");
}
if ((file_exists($install_file)) && (is_file($install_file)))
{
if (($md5sum!=$md5sum_current))
{
throw new Exception("PEAR installation error. File $install_file has wrong md5 sum.");
}
}
}
}
} else
{
throw new Exception ("PEAR installation error. Empty pear package xml database for app $app");
}
unset($peari);
}
/**
* Check if file needs verification.
* System does not check md5 sum for files listed in ignore group.
*
* @param string $file
* @param string $app application name
* @return bool true - do not verify this file, file is ignored, false - file has to be verified
*/
protected function ignore($file,$app)
{
$config = $this->getConfig();
$peari = stPearInfo::getInstance('verify');
if (! empty($config['ignore']))
{
foreach ($config['ignore'] as $ereg)
{
if (strpos($file, $ereg) !== false) {
$this->log('md5sum verification '.$file.': false'."\n");
return true;
}
}
}
if (! empty($config['fix']))
{
foreach ($config['fix'] as $application=>$data)
{
foreach ($data as $version=>$files)
{
$version_installed=$peari->getPackageVersion($application);
if ($version==$version_installed)
{
foreach ($files as $ereg)
{
if (strpos($file, $ereg) !== false) {
$this->log('md5sum verification '.$file.': false'."\n");
return true;
}
}
}
}
}
}
unset($peari);
// Get filed from install/config/ignore/stAppName.yml
$ignore=$this->getIgnore($app);
$this->log("ignore: ".print_r($ignore,true)."\n");
if (! empty($ignore))
{
foreach ($ignore as $disereg)
{
$this->log("ereg($disereg,$file);\n");
if (strpos($file, $disereg) !== false)
return true;
}
}
$ignoreReplace = stInstallerIgnore::getIgnoreReplace($app);
if (! empty($ignoreReplace))
{
foreach ($ignoreReplace as $pattern)
{
$this->log("preg_match($pattern,$file);\n");
if (preg_match($pattern, $file)) return true;
}
}
return false;
}
/**
* Get file modification date.
*
* @param string $file
* @return string
*/
private function getModTime($file)
{
if (file_exists($file)) {
return date ("Y-m-d H:i:s", filemtime($file));
}
}
/**
* Get full path to file.
*
* @param string $path stProduct/apps/backend/modules/stProduct/config/config.php
* @param bool $relative relative path (true) or full path (false)
* @param string $sf_root_dir true - add sf_root_dir , false without sf_root_dir (for $relative=true)
* @return string /path/soteshop/apps/backend/modules/stProduct/config/config.php
*/
protected function getPath($file,$relative=false,$sf_root_dir=true)
{
// $dat=preg_split(DIRECTORY_SEPARATOR,$file);
$dat=preg_split("/\\".DIRECTORY_SEPARATOR."/",$file);
if (! $relative) $path=sfConfig::get('sf_root_dir');
else
{
if ($sf_root_dir)
{
$path=basename(sfConfig::get('sf_root_dir'));
} else
{
$path='';
}
}
$i=0;
foreach ($dat as $item)
{
if ($i>0) $path.=DIRECTORY_SEPARATOR.$item;
$i++;
}
return $path;
}
/**
* Get file md5 sum.
*
* @param string $file full path to file
* @return string md5
*/
private function md5Sum($file)
{
if (file_exists($file))
{
$data=file_get_contents($file);
return md5($data);
}
}
/**
* Save verification result in file.
*
* @param string $app application
* @param array $result modified files
*/
private function register($app,$result)
{
if (file_exists(ST_VERIFY_FILE))
{
$data=unserialize(file_get_contents(ST_VERIFY_FILE));
} else $data=array();
$data[$app]=$result;
$data2=serialize($data);
file_put_contents(ST_VERIFY_FILE,$data2);
}
/**
* Get configuration.
*
* @see config/verify.yml
*/
private function getConfig()
{
$verify=sfYaml::load(ST_VERIFY_CONFIG);
return $verify['verify'];
}
/**
* Get file ignored files with ereg expression.
*
* @param string $app application name
* @return array
*/
private function getIgnore($app)
{
return stInstallerIgnore::getIgnore($app);
}
/**
* Write to logs.
*
* @param string $message
*/
protected function log($message)
{
if (sfConfig::get('sf_logging_enabled'))
{
$fd=fopen(ST_INSTALLER_LOG_PAGE,"a+");
fwrite($fd,$message);
fclose($fd);
}
}
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stAppVerifyall.class.php 13528 2011-06-08 09:57:46Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* stAppVerify class
*
* @package stUpdate
* @subpackage libs
*/
require_once (sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stAppVerify.class.php');
/**
* Code verification for all packages.
*
* @package stUpdate
* @subpackage libs
*/
class stAppVerifyall extends stAppVerify
{
protected function getApps()
{
$peari = stPearInfo::getInstance();
$packages = $peari->getPackages();
$i=0;
foreach ($packages as $package=>$data)
{
$apps[]=$package;
$i++;
}
return $apps;
}
/**
* Reboot action
*
* @return string
*/
protected function reboot()
{
return __('Aplikacje zostały poprawnie zweryfikowane. Nie ma modyfikacji plików systemowych.', null, 'stInstallerWeb');
}
/**
* Get number of installed applications.
*/
static public function getCount()
{
$peari = stPearInfo::getInstance();
$packages = $peari->getPackages();
return sizeof($packages);
}
/**
* Skip PEAR install/src verification
*/
public function verifyPearInstall($app)
{
return NULL;
}
/**
* File verification.
*
* @param string $app application (PEAR package name)
* @param string $name relative file name
* @param string $md5sum md5 in PEAR database
* @param string $md5sum_current md5 in filesystem
* @param string $owner_current owner of the verified file
* @return bool true - file is modified, false - file is not modified, is OK
*/
protected function isFileModified($app, $name,$md5sum,$md5sum_current,$owner_current)
{
// if ((($md5sum!=$md5sum_current) && (! empty($md5sum_current))) || ($owner_current != $this->owner)) // allow for deleted files
if ((($md5sum!=$md5sum_current) && (! empty($md5sum))) || ($owner_current != $this->owner)) // don't allow for deleted files
{
// if file exists verify it
if ((file_exists($this->getPath($name))) && (! empty($name))) // allow for deleted files
//if (! empty($name)) // don't allow for deleted files
{
if (! $this->ignore($this->getPath($name,true),$app))
{
return true;
}
}
}
return false;
}
}

View File

@@ -0,0 +1,196 @@
<?php
/**
* Build db progress bar
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Build db
*/
class stBuildDb
{
protected $msg = '';
static public function getSteps()
{
return 4;
}
/**
* Build SQL from dump
*/
public function step($step)
{
if ($step==1)
{
// new server update config
$pakeweb = new stPakeWeb();
$pakeweb->run('setup-update');
}
if (($step==2) && (! $this->isLocked()))
{
/*
---
all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
host: localhost
database: database
username: user
encoding: utf8
password: pass
*/
// check dump
$dump = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'sql'.DIRECTORY_SEPARATOR.'soteshop.mysql';
if (file_exists($dump))
{
$dump_sql = file_get_contents($dump);
$this->sqlresult=$this->parseDump($dump_sql);
} else throw new Exception("Dump SQL $dump not found");
$data=sfYaml::load(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'databases.yml');
$this->dbHost = $data['all']['propel']['param']['host'];
$this->dbUsername = $data['all']['propel']['param']['username'];
$this->dbPassword = $data['all']['propel']['param']['password'];
$this->dbDatabase = $data['all']['propel']['param']['database'];
$this->dbError = true;
$this->reportMessage = '';
$this->dbErrorMsg = '';
$con = mysql_connect($this->dbHost,$this->dbUsername, $this->dbPassword);
if ($con && mysql_select_db($this->dbDatabase,$con))
{
foreach ($this->sqlresult as $sql)
{
$res = mysql_query($sql, $con);
if ($res)
{
// ok
} else {
throw new Exception($sql." \n ".mysql_error());
}
}
} else {
$this->dbErrorMsg = 'Nie można połączyć się z bazą danych, sprawdz dane i spróbuj ponownie.';
}
$this->dbError = false;
$this->lockDB();
}
if ($step==3)
{
// new server update config
$pakeweb = new stPakeWeb();
$pakeweb->run('cc');
}
return $step+1;
}
/**
* Lock builing db
* Protection for repeated build db request
*/
protected function lockDB()
{
$lockfile=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.dbdata.lck';
if (! file_exists($lockfile))
{
touch($lockfile);
}
sleep(2);
}
/**
* Check if db building is locked
* @return bool true - locked, false not locked
*/
public static function isLocked()
{
$lockfile=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.dbdata.lck';
if (file_exists($lockfile)) return true;
else return false;
}
/**
* Parse mysqldump file info mysql_quesry commands
* @param string $dump_sql raw sqldump:
* mysqldump --complete-insert --skip-add-drop-table --skip-add-locks --skip-comments --user soteshop --password= soteshop_pear2 > soteshop.mysql
* @return string sql from mysql_query
*/
protected function parseDump($dump_sql)
{
$lines=preg_split("/\n/",$dump_sql);
$sql='';$create=false;
foreach ($lines as $line)
{
// /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
if (preg_match("/^\/\*\!/",$line))
{
preg_match("/^\/\*\![0-9]+\s{1}(.*)\*\/\;$/",$line,$matches);
if (! empty($matches[1]))
{
$sql=$matches[1];
$allsql[]=$sql;
}
} elseif (preg_match("/^CREATE TABLE/",$line))
{
$sql=$line."\n";
$create=true;
} elseif ($create==true)
{
if (preg_match("/^\) ENGINE=MyISAM/",$line))
{
$sql.=$line."\n";
$create=false;
$allsql[]=$sql;
} else {
$sql.=$line."\n";
}
} else
{
$sql=$line;
if ((! preg_match("/^[\s]+$/",$line)) && (! empty($line)))
{
$allsql[]=$line;
}
}
}
// echo "<pre>";print_r($allsql);echo "</pre>";
return $allsql;
}
public function close()
{
sfLoader::loadHelpers('Tag');
sfLoader::loadHelpers('Javascript');
$this->msg.="<script type=\"text/javascript\">document.getElementById('stSetup-dbdata_actions').style.visibility=\"visible\";</script>";
}
/**
* Message. Step title.
*
* @return string
*/
public function getMessage()
{
return $this->msg;
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCheckRequirements.class.php 9266 2010-11-17 15:31:58Z piotr $
* @author Piotr Halas piotr.halas@sote.pl
*/
/**
* PHP verification.
*
* @author Piotr Halas piotr.halas@sote.pl
* @package stUpdate
* @subpackage libs
*/
class stCheckRequirements extends stSetupRequirements {
public function __construct()
{
parent::__construct();
$this->tests['testSymfony'] = "Lokalna instalacja Symfony";
$this->tests['testPear'] = "Lokalna instalacja Pear";
}
public function testAll($class = __CLASS__)
{
return parent::testAll($class);
}
public static function testSymfony()
{
$symfony_file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'symfony'.DIRECTORY_SEPARATOR.'VERSION';
if (!file_exists($symfony_file)) return false;
$version = file_get_contents($symfony_file);
if (trim($version)!='1.0.19') return false;
return true;
}
public static function testPear()
{
$pear_file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'pear'.DIRECTORY_SEPARATOR.'php'.DIRECTORY_SEPARATOR.'PEAR.php';
if (!file_exists($pear_file)) return false;
return true;
}
}

View File

@@ -0,0 +1,187 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stChiaraPearServer.class.php 13528 2011-06-08 09:57:46Z michal $
*/
/**
* Chiara PEAR server API.
*
* @author Marek jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stChiaraPearServer
{
/**
* @var string $channel
*/
var $channel;
/**
* @var array $deps packages dependencies
*/
var $deps=array();
/**
* List of already read packages.
*/
var $readed=array();
/**
* Options: dependency min|latest
*/
var $options=array('dependency'=>'min');
/**
* Construct
*/
public function __construct($channel)
{
$this->channel=$channel;
}
/**
* Get all dependencies for provided package (recursive).
*
* @param string $package
* @param string $version
* @see $this->deps
*/
public function getDeps($package,$version,$count=0)
{
if (empty($this->readed[$package][$version]))
{
$data=$this->getPackageInfo($package,$version);
$this->readed[$package][$version]=1;
$this->setVersion($package,$data['version']);
}
if (isset($data['deps']['required']['package'][0]) && is_array($data['deps']['required']['package'][0]))
{
// >1 dependecies
$deps=$data['deps']['required']['package'];
}
elseif (isset($data['deps']['required']['package']))
{
// 1 dependency
$deps=array(0=>$data['deps']['required']['package']);
}
else return;
foreach ($deps as $id=>$dep)
{
$name=$dep['name'];
$version=$dep['min'];
if (empty($this->readed[$name][$version])) $this->getDeps($name,$version);
}
return $this->deps;
}
/**
* Set option.
*
* @param string $option
* @param mixed $value
*/
public function setOption($option,$value)
{
$this->options[$option]=$value;
}
/**
* Get option.
*
* @param string $option
* @return mixed
*/
private function getOption($option)
{
if (! empty($this->options[$option])) return $this->options[$option];
else return NULL;
}
/**
* Get latest package version.
*
* @param string $package
* @param string $version
*/
private function setVersion($package,$version)
{
if (! empty($this->deps[$package]))
{
$version_1=intval(str_replace('.','',$version));
$version_2=intval(str_replace('.','',$this->deps[$package]));
if ($version_1 > $version_2) $this->deps[$package]=$version;
} else
{
$this->deps[$package]=$version;
}
}
/**
* Get package information from PEAR server.
*
* @param string $package package name
* @param string $version 1.0.2
* @return array
*/
private function getPackageInfo($package,$version)
{
$result=array();
$url_base = $this->getPackageURL($package);
// latest
$url_latest = $url_base.'latest.txt';
$result['latest']=$this->getUrlResponse($url_latest);
if ($this->getOption('dependency')=='latest') $version=$result['latest'];
$result['version']=$version;
// deps
$url_deps = $url_base."deps.$version.txt";
$result['deps']=unserialize($this->getUrlResponse($url_deps));
return $result;
}
/**
* Get base URL for package.
*
* @param string $package
* @return string http://pear.sote.pl/Chiara_PEAR_Server_REST/r/stuser
*/
private function getPackageURL($package)
{
return 'http://'.$this->channel.'/Chiara_PEAR_Server_REST/r/'.strtolower($package).'/';
}
/**
* Get URL response.
*
* @param string $url URL np. http://pear.sote.pl/channel.xml
* @return string zawartość strony URL
*/
private function getUrlResponse($url)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$ret = curl_exec($c);
curl_close($c);
return $ret;
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCleanInstallerCache.class.php 10048 2010-12-29 16:37:55Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
sfLoader::loadHelpers('Helper');
use_helper('I18N', 'Url', 'Tag');
use_helper('stProgressBar', 'Partial');
/**
* After installation configuragtion system. Progress bar class.
*
* @package stUpdate
* @subpackage libs
* @deprecated
*/
class stCleanInstallerCache {
protected $msg = '';
public function step($step) {
sleep(1);
$this->msg = __('Optymalizuje', null, 'stInstallerWeb').':';
return $step + 1;
}
public function getMessage() {
return $this->msg;
}
public function getTitle() {
return __('Konfiguracja i optymalizacja systemu', null, 'stInstallerWeb');
}
public function close() {
sfLoader::loadHelpers('Tag');
sfLoader::loadHelpers('Javascript');
$this->msg .= "<script type=\"text/javascript\">document.getElementById('stSetup-install_actions').style.visibility=\"visible\";</script>";
}
static public function getSteps() {
return 7; // lucky number :)
}
}

View File

@@ -0,0 +1,107 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCleanInstallerDownload.class.php 10048 2010-12-29 16:37:55Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
sfLoader::loadHelpers('Helper');
use_helper('I18N','Url', 'Tag');
use_helper('stProgressBar','Partial');
define ("ST_CLEAN_INSTALLER_DB",sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.cleaninstaller.reg');
/**
* stPearDownload class (stInstallerPlugin)
*
* @package stUpdate
* @subpackage libs
*/
require_once (sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.'stInstallerPlugin'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stPearDownload.class.php');
/**
* Delete PEAR download packages.
*
* @package stUpdate
* @subpackage libs
*/
class stCleanInstallerDownload
{
public $count = null;
public $msg = '';
public function step($step)
{
$this->packages = $this->getPackages();
$this->max = sizeof($this->packages);
if (! empty($this->packages[$step]))
{
$pkg_name = $this->packages[$step];
$this->msg=__('Czyszczę', null, 'stInstallerWeb').': '.$pkg_name;
$pd = new stPearDownload();
$pd->deletePackage($pkg_name);
// $pd_src = new stPearDownload('src');
// $pd_src->deletePackage($pkg_name);
}
return $step+1;
}
public function getMessage()
{
return $this->msg;
}
public function getTitle()
{
return __('Czyszczenie poprzedniej aktualizacji', null, 'stInstallerWeb');
}
static public function getSteps()
{
$pd = new stPearDownload();
$packages_download = $pd->getPackages();
// $pd_src = new stPearDownload('src');
// $packages_src = $pd_src->getPackages();
// $packages = intval($packages_download)+intval($packages_src);
$packages = $packages_download;
if (sizeof($packages)>0) return sizeof($packages);
else return 1;
}
public function close()
{
unlink(ST_CLEAN_INSTALLER_DB);
}
protected function getPackages()
{
if (! file_exists(ST_CLEAN_INSTALLER_DB))
{
$pd = new stPearDownload();
$packages = $pd->getPackages();
$data = serialize($packages);
file_put_contents(ST_CLEAN_INSTALLER_DB,$data);
return $packages;
} else {
$datareg = file_get_contents(ST_CLEAN_INSTALLER_DB);
return unserialize($datareg);
}
}
}

View File

@@ -0,0 +1,105 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCleanInstallerSrc.php 10048 2010-12-29 16:37:55Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
sfLoader::loadHelpers('Helper');
use_helper('I18N','Url', 'Tag');
use_helper('stProgressBar','Partial');
define ("ST_CLEAN_INSTALLER_DB_SRC",sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.cleaninstaller_src.reg');
/**
* stPearDownload class (stInstallerPlugin)
*
* @package stUpdate
* @subpackage libs
*/
require_once (sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.'stInstallerPlugin'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stPearDownload.class.php');
/**
* Delete install/src files.
*
* @package stUpdate
* @subpackage libs
*/
class stCleanInstallerSrc
{
public $count = null;
public $msg = '';
public function step($step)
{
$this->packages = $this->getPackages();
$this->max = sizeof($this->packages);
if (! empty($this->packages[$step]))
{
$pkg_name = $this->packages[$step];
$this->msg=__('Czyszczę', null, 'stInstallerWeb').': '.$pkg_name;
$pd = new stPearDownload('src');
$pd->deletePackage($pkg_name);
}
return $step+1;
}
public function getMessage()
{
return $this->msg;
}
public function getTitle()
{
return __('Optymalizacja ilości plików', null, 'stInstallerWeb');
}
static public function getSteps()
{
$pd = new stPearDownload('src');
$packages_src = $pd->getPackages();
$packages = $packages_src;
if (sizeof($packages)>0) return sizeof($packages);
else return 1;
}
public function close()
{
unlink(ST_CLEAN_INSTALLER_DB_SRC);
sfLoader::loadHelpers('Tag');
sfLoader::loadHelpers('Javascript');
$this->msg.="<script type=\"text/javascript\">document.getElementById('stSetup-install_actions').style.visibility=\"visible\";</script>";
}
protected function getPackages()
{
if (! file_exists(ST_CLEAN_INSTALLER_DB_SRC))
{
$pd = new stPearDownload('src');
$packages = $pd->getPackages();
$data = serialize($packages);
file_put_contents(ST_CLEAN_INSTALLER_DB_SRC,$data);
} else {
$datareg = file_get_contents(ST_CLEAN_INSTALLER_DB_SRC);
$packages=unserialize($datareg);
}
return $packages;
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCompileConfigHandler.php 3160 2010-01-26 13:30:27Z marek $
* @author Marcin Butlak <marcin.butlak@sote.pl>
*/
/**
* Overload config file generator.
* Skip config.php files loading from plugins.
*
* @author Marcin Butlak <marcin.butlak@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stCompileConfigHandler extends sfCompileConfigHandler
{
/**
* Overload config generator.
*
* @param array An array of absolute filesystem path to a configuration file
* @return string Data to be written to a cache file
* @throws sfConfigurationException If a requested configuration file does not exist or is not readable
* @throws sfParseException If a requested configuration file is improperly formatted
*/
public function execute($configFiles)
{
$retval = parent::execute($configFiles);
$retval = str_replace("sfLoader::loadPluginConfig();", "", $retval);
return $retval;
}
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stCore.class.php 3160 2010-01-26 13:30:27Z marek $
* @author Marcin Butlak <marcin.butlak@sote.pl>
*/
require_once ($sf_symfony_lib_dir . DIRECTORY_SEPARATOR . 'util' . DIRECTORY_SEPARATOR . 'sfCore.class.php');
/**
* Extended symfony kernel.
*
* @author Marcin Butlak <marcin.butlak@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stCore extends sfCore
{
/**
* Overload bootstrap.
* New config loader. Skip config.php files loading from plugins.
*
* @param string $sf_symfony_lib_dir symfony lub dir
* @param string $sf_symfony_data_dir symfony data dir
*/
static public function bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir)
{
require_once ($sf_symfony_lib_dir . '/util/sfToolkit.class.php');
require_once ($sf_symfony_lib_dir . '/config/sfConfig.class.php');
sfCore::initConfiguration($sf_symfony_lib_dir, $sf_symfony_data_dir);
sfCore::initIncludePath();
stCore::callBootstrap();
if (sfConfig::get('sf_check_lock'))
{
sfCore::checkLock();
}
if (sfConfig::get('sf_check_symfony_version'))
{
sfCore::checkSymfonyVersion();
}
}
/**
* Overload callBootstrap.
* New config loader. Skip config.php files loading from plugins.
*/
static public function callBootstrap()
{
$bootstrap = sfConfig::get('sf_config_cache_dir') . DIRECTORY_SEPARATOR . 'config_bootstrap_compile.yml.php';
if (is_readable($bootstrap))
{
sfConfig::set('sf_in_bootstrap', true);
require ($bootstrap);
}
else
{
require (sfConfig::get('sf_app_dir') . DIRECTORY_SEPARATOR . 'symfony.php');
}
}
}
?>

View File

@@ -0,0 +1,91 @@
<?php
/**
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Fix cache. Repair cache structure.
*/
class stFixCache
{
/**
* Run all repair method for cache.
* @return true
*/
public function fixAll()
{
$this->fixSyncLocationPath();
$this->deleteUneccessaryCacheFiles();
return true;
}
/**
* Move sync file from cache/*.sync to install/sync/*.sync
* @return true
*/
function fixSyncLocationPath()
{
$cache_files=sfFinder::type('file')->name("*.sync")->in(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'cache');
$new_sync_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'sync';
if (! is_dir($new_sync_dir))
{
if (! mkdir($new_sync_dir)) throw new Exception('Unable mkdir $new_sync_dir');
}
foreach ($cache_files as $cfile)
{
if (copy($cfile,$new_sync_dir.DIRECTORY_SEPARATOR.basename($cfile)))
{
unlink ($cfile);
}
else
{
throw new Exception ("Unable copy sync file $cfile");
}
}
return true;
}
/**
* Delete unnecesary files from cache.
* List of deleted files and dirs:
* drwxrwxrwx 3 marek staff 102 Mar 9 13:01 backend
* -rw-r--r--@ 1 marek staff 612 Feb 16 13:56 channel.xml ->delete
* drwxrwxrwx 3 marek staff 102 Mar 19 10:38 config
* drwxr-xr-x 3 marek staff 102 Mar 18 11:23 fastcache
* drwxrwxrwx 5 marek staff 170 Mar 18 11:47 frontend
* -rw-r--r--@ 1 marek staff 4073 Feb 16 13:56 package.xml ->delete
* -rw-r--r--@ 1 marek staff 5611 Feb 16 13:56 package2.xml ->delete
* drwxr-xr-x@ 101 marek staff 3434 Mar 19 10:29 smarty_c
* drwxr-xr-x@ 2 marek staff 68 Feb 16 13:56 src ->delete
* drwxrwxrwx 3 marek staff 102 Mar 9 12:59 stFunctionCache
* drwxr-xr-x@ 3 marek staff 102 Mar 10 16:49 stInstallerPlugin-1.0.7.1 ->delete
* drwxr-xr-x@ 3 marek staff 102 Mar 10 16:49 stInstallerPlugin-1.0.7.1.tgz ->delete
* drwxrwxrwx 28 marek staff 952 Mar 18 11:47 st_config
* drwxrwxrwx 4 marek staff 136 Mar 9 13:19 update
*
* @return true
*/
function deleteUneccessaryCacheFiles()
{
$stfile = new stFile();
$cache_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'cache';
if (file_exists($cache_dir.DIRECTORY_SEPARATOR.'channel.xml')) unlink($cache_dir.DIRECTORY_SEPARATOR.'channel.xml');
if (file_exists($cache_dir.DIRECTORY_SEPARATOR.'package.xml')) unlink($cache_dir.DIRECTORY_SEPARATOR.'package.xml');
if (file_exists($cache_dir.DIRECTORY_SEPARATOR.'package2.xml')) unlink($cache_dir.DIRECTORY_SEPARATOR.'package2.xml');
$stfile->rmdir($cache_dir.DIRECTORY_SEPARATOR.'src');
$dirs_installers=sfFinder::type('dir')->name("stInstallerPlugin*")->in($cache_dir);
foreach ($dirs_installers as $installer)
{
if (file_exists($installer.'.tgz')) unlink($installer.'.tgz');
$stfile->rmdir($installer);
}
if (is_dir($cache_dir.DIRECTORY_SEPARATOR.'stFunctionCache'))
{
$stfile->copy($cache_dir.DIRECTORY_SEPARATOR.'stFunctionCache',$cache_dir.DIRECTORY_SEPARATOR.'functions');
$stfile->rm($cache_dir.DIRECTORY_SEPARATOR.'stFunctionCache');
}
return true;
}
}

View File

@@ -0,0 +1 @@
<?php // moved to soteshop/libs

View File

@@ -0,0 +1,22 @@
<?php
/**
* Install method recognition
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Install method
*/
class stInstallMethod
{
public static function getWebInstall()
{
///install/src/.registry/.channel.pear.sote.pl
$reg_file = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.webinstall';
if (file_exists($reg_file))
{
return true;
} else return false;
}
}

View File

@@ -0,0 +1,772 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stInstallerTasks.class.php 16203 2011-11-23 14:13:24Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
// temporary test function
// function convert_memory($size)
// {
// $unit=array('b','kb','mb','gb','tb','pb');
// return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
// }
/**
* Token keys.
*/
require_once (sfConfig::get('sf_app_lib_dir').'/stToken.php');
/**
* Update Backup class
*/
require_once (sfConfig::get('sf_root_dir').'/apps/update/modules/stInstallerWeb/lib/stUpdateBackup.class.php');
require_once sfConfig::get('sf_symfony_lib_dir').'/vendor/pake/pakeGetopt.class.php';
require_once sfConfig::get('sf_symfony_lib_dir').'/vendor/pake/pakeApp.class.php';
/**
* Logs
*/
if (!defined('ST_INSTALLER_LOG_PAGE'))
define("ST_INSTALLER_LOG_PAGE", sfConfig::get('sf_log_dir').'/webinstaller.log');
/**
* Temporary list of synchronized applications.
*/
if (!defined('ST_APPSTOSYNC_FILE'))
define("ST_APPSTOSYNC_FILE", sfConfig::get('sf_root_dir').'/install/db/.appstosync.reg');
/**
* Temporary list of applications installed before synchonization.
*/
if (!defined('ST_REGSYNC_PRE_INSTALL_FILE'))
define("ST_REGSYNC_PRE_INSTALL_FILE", sfConfig::get('sf_root_dir').'/install/db/.regsync.reg');
sfLoader::loadHelpers('Helper');
use_helper('I18N', 'Url', 'Tag');
use_helper('stProgressBar', 'Partial');
/**
* Installer WWW. Progress bar steps.
*
* @package stUpdate
* @subpackage libs
*/
class stInstallerTasks
{
/**
*
*
* @var stProgressBarTaskInterface[]
*/
private $progressBarTask = [];
/**
* Message (step)
* @var string
*/
public $msg = '';
/**
* Temporary fixture dir
*/
private $temporary_fixture_dir = NULL;
/**
* Step
*
* @param integer $step count step
* @return integer new step number (default should be $step+1)
*/
public function step($step)
{
$pakeweb = new stPakeWeb();
$task = '';
$offset = 1;
$i18n = sfContext::getInstance()->getI18N();
pakeApp::get_instance()->handle_options(SF_ENVIRONMENT == 'prod' ? '--quiet' : '--verbose');
switch ($step)
{
case 0:
$this->msg = $i18n->__('Blokowanie sklepu', null, 'stInstallerWeb'); // opis krok do przodu
if (stLockUpdate::isLocked())
{
$locked_before_run = true;
}
else
{
$locked_before_run = false;
}
stLockUpdate::lock();
$this->_secureStSetup();
// save apps if instalation wasn't stoped wrongly
if (!$locked_before_run)
{
$this->_saveAppsToSync();
$this->_saveRegSync();
}
$this->_preExecute($this->_loadAppsToSync('all')); // pre execute scripts
break;
case 1:
$this->msg = $i18n->__('Odświeżenie pamięci podręcznej aplikacji', null, 'stInstallerWeb'); // opis krok do przodu
$this->clearFastCache();
$task = 'cc --lock=false';
break;
case 2:
$this->msg = $i18n->__('Kopiowanie plików', null, 'stInstallerWeb'); // opis krok do przodu
break;
case 3:
$this->msg = $i18n->__('Konfiguracja instalacji', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-sync';
break;
case 4:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Weryfikacja', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'setup-update';
break; // database update
case 5:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Usuwanie starych plików', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-schema-diff';
$user = sfContext::getInstance()->getUser();
$data = $user->getAttribute('Installer', array(), 'soteshop/stProgressBarPlugin');
$data['steps'] = 15;
$user->setAttribute('Installer', $data, 'soteshop/stProgressBarPlugin');
break;
case 6:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie schematów XML', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-clean-model forced';
break;
case 7:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie klas modeli', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-convert-schema forced';
break;
case 8:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie zapytań SQL', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-build-model forced';
break;
case 9:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Aktualizacja struktury bazy danych', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-build-sql forced';
break;
case 10:
$this->msg = $i18n->__('Czyszczenie plików tymczasowych', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-insert-sql forced';
break;
case 11:
$this->msg = $i18n->__('Odświeżenie pamięci podręcznej aplikacji', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'cc --lock=false';
break;
case 12:
$this->msg = $i18n->__('Wczytywanie danych', null, 'stInstallerWeb');
break;
case 13:
$this->msg = $i18n->__('Tworzenie plików pamięci podręcznej', null, 'stInstallerWeb');
$this->_propelLoadData($this->_loadAppsToSync('added'));
break; // load fixtures only for new applications
case 14:
$this->generateCache();
break;
}
if (!empty($task))
{
if ($pakeweb->run($task))
{
if (!empty($pakeweb->content))
{
$this->log("\n".date('Y-m-d G:i:s')."\n".'symfony '.$task."\n".$pakeweb->content);
}
}
else
{
throw new Exception($pakeweb->error);
}
}
if ($task == 'installer-sync')
{
$this->_htaccess();
}
elseif ($task == 'setup-update')
{
$this->fixSync();
}
elseif ($task == 'installer-schema-diff' && !stPropelGeneratorController::isDatabaseRebuildNeeded())
{
$offset = 6;
$this->msg = $i18n->__('Czyszczenie plików tymczasowych', null, 'stInstallerWeb');
}
$this->delay($step == 0 ? 0 : 10);
return $step + $offset;
}
/**
* Get message.
*
* @return string
*/
public function getMessage()
{
return $this->msg;
}
/**
* Last progress bar step.
*
* @param int $opt 0 - means don't execute optimization after installation
* @return string
*/
public function close($opt = true, $update = true)
{
$i18n = sfContext::getInstance()->getI18N();
if ($update)
{
stAppStats::activate('Update');
}
if ($this->_installVerification())
{
stUpdateBackup::cleanBackup(); // clean last backup (eg. deprecated smarty files in user theme etc).
sfLoader::loadPluginConfig();
$this->_postExecute($this->_loadAppsToSync('all'));
$config = stConfig::getInstance('stUpdate');
$config->set('package_version', stApplication::getApplicationVersion('stUpdate'));
$config->save();
stLockUpdate::unlock();
}
$this->msg = $i18n->__('Instalacja aktualizacji zakończona.', null, 'stInstallerWeb');
// cancel optimization (in stSetup for example)
stEventDispatcher::getInstance()->notify(new sfEvent($this, 'stInstallerTaks.onClose', array()));
stEventDispatcher::getInstance()->notify(new sfEvent($this, 'stInstallerTasks.onClose', array()));
foreach ($this->progressBarTask as $task)
{
if ($task->count() > 0)
{
$this->msg .= st_progress_bar($task);
}
}
if ($opt == 1)
{
$this->addOptimization();
}
$this->_cleanAppsToSync();
$this->_cleanRegSync();
}
/**
* Dodaje nowe zadanie paska postępu do wykonania po zakończeniu instalacji
*
* @param stProgressBarTaskInterface $task
* @return void
*/
public function addProgressBarTask(stProgressBarTaskInterface $task)
{
$this->progressBarTask[] = $task;
}
/**
* Optimization and caching pages.
* Delete download PEAR files. Optimize & cache actions.
*/
private function addOptimization()
{
$this->msg .= progress_bar('stCleanInstallerDownload', 'stCleanInstallerDownload', 'step', stCleanInstallerDownload::getSteps());
$this->msg .= progress_bar('stCleanInstallerSrc', 'stCleanInstallerSrc', 'step', stCleanInstallerSrc::getSteps());
}
/**
* Set progress bar title.
*
* @return string
*/
public function getTitle()
{
$i18n = sfContext::getInstance()->getI18N();
return $i18n->__('Instalacja aktualizacji (Uwaga! Nie zamykaj okna przeglądarki, aż instalacja się nie skończy):', null, 'stInstallerWeb');
}
/**
* Verify instllation.
* @todo
*
* @return bool
*/
protected function _installVerification()
{
return true;
}
/**
* Get host.
*
* @return string
*/
protected function _getHost()
{
$context = sfContext::getInstance();
$request = $context->getRequest();
return $request->getHost();
}
/**
* Get application list for synchronization.
*
* @param string $mode (added|changed|deleted|all|apps)
* @return array
*/
protected function _appsToSync($mode='all')
{
$regsync = new stRegisterSync();
$apps = $regsync->getAppsToSync();
if ($mode == 'apps')
{
return $apps;
} else
return $apps[$mode];
}
/**
* Save log.
*
* @param string $message
*/
protected function log($message)
{
if (sfConfig::get('sf_logging_enabled'))
{
$fd = fopen(ST_INSTALLER_LOG_PAGE, "a+");
fwrite($fd, $message);
fclose($fd);
}
}
/**
* Remember application list for synchronization.
* Needed for steps after synchronization.
*
* @see ST_APPSTOSYNC_FILE
* @return bool
*/
private function _saveAppsToSync()
{
$apps = $this->_appsToSync('apps');
$data = serialize($apps);
if (file_put_contents(ST_APPSTOSYNC_FILE, $data))
return true;
else
{
throw new Exception('Unable to save data to file '.ST_APPSTOSYNC_FILE);
}
return false;
}
/**
* Remember application list before upgrade.
* Needed for steps afte upgrade.
*
* @return bool
*/
private function _saveRegSync()
{
$reg = new stRegisterSync();
$apps = $reg->getSynchronizedApps();
$data = serialize($apps);
if (file_put_contents(ST_REGSYNC_PRE_INSTALL_FILE, $data))
return true;
else
{
throw new Exception('Unable to save data to file '.ST_REGSYNC_PRE_INSTALL_FILE);
}
return false;
}
private function _cleanRegSync()
{
if (file_exists(ST_REGSYNC_PRE_INSTALL_FILE))
unlink(ST_REGSYNC_PRE_INSTALL_FILE);
}
/**
* Odczytuje zapamiętane aplikacje przed synchronizacją
* Get applications before upgrade.
*
* @see $this->_saveRegSync()
* @return array
*/
private function _loadRegSync()
{
if (file_exists(ST_REGSYNC_PRE_INSTALL_FILE))
{
$data = file_get_contents(ST_REGSYNC_PRE_INSTALL_FILE);
$apps = unserialize($data);
} else
$apps=array();
return $apps;
}
/**
* Create and get temporary update directory with unique key
* $this->temporary_fixture_dir - unique key for object request
* @return string
*/
private function _getUpdateFixtureDirKey()
{
if (!empty($this->temporary_fixture_dir))
return $this->temporary_fixture_dir;
// build dir structure
$cdir = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install';
$dir_fixtures = array('data', 'fixtures', time());
foreach ($dir_fixtures as $dir)
{
$cdir = $cdir.DIRECTORY_SEPARATOR.$dir;
if (!is_dir($cdir))
{
if (!mkdir($cdir))
throw new Exception("Unable mkdir $cdir");
}
}
// set value for object
$this->temporary_fixture_dir = $cdir;
return $this->temporary_fixture_dir;
}
/**
* Load fixtures for provided applications.
*
* @param array $apps application list
*/
private function _propelLoadData($apps)
{
$locks = array(); // list of locked files
foreach ($apps as $app)
{
$fixtures = $this->_getFixturePath($app);
foreach ($fixtures as $fixture)
{
if (file_exists($fixture))
{
$update_fixture_dir = $this->_getUpdateFixtureDirKey();
$task = "propel-load-data ../update $fixture append"; // this is required for lock comaptibility for previous versions
$md5_task_lock_file_name = md5($task).'_'.basename($fixture).'.lck'; // this file lock duplicate data loading
if (!stLockUpdate::isLockedKey($md5_task_lock_file_name))
{
stLockUpdate::lockKey($md5_task_lock_file_name); // lock data loading for the same app
$locks[] = $md5_task_lock_file_name;
if (!copy($fixture, $update_fixture_dir.DIRECTORY_SEPARATOR.basename($fixture)))
{
throw new Exception("Unable copy $fixture ->".$update_fixture_dir.DIRECTORY_SEPARATOR.basename($fixture));
}
}
else
{
// data for this app was loaded
}
}
}
}
// Only 1 task can be executed during 1 request (because of symfony pakeApp).
// That's way fixtures are copied to 1 directory and executed in 1 task.
if (!empty($update_fixture_dir))
{
$pakeweb = new stPakeWeb();
$task = "propel-load-data ../update $update_fixture_dir append";
if ($pakeweb->run($task))
{
$pakeweb->content = $this->_fixcontent($pakeweb->content);
if (!empty($pakeweb->content))
$this->log("\n".date('Y-m-d G:i:s')."\n".'symfony '.$task."\n".$pakeweb->content);
} else
{
$this->log($pakeweb->error);
// unlock app fixtures because fixtures are rollbacked
foreach ($locks as $lock)
unlink($lock);
}
unset($pakeweb); // memory optimization
}
return NULL;
}
/**
* Delete unimportant warning from logs.
* Task propel-load-data return some warning which are ok, and should be savd in logs.
* (warning about duplicated constat definitions)
*
* @param string $content
* @return string
*/
private function _fixcontent($content)
{
$lines = split("\n", $content);
$o = '';
foreach ($lines as $line)
{
if (ereg('already defined', $line))
continue;
if (ereg('\<br \/\>', $line))
continue;
$o.=$line."\n";
}
return $o;
}
/**
* Get fixture path in install/src/$app
*
* @param string $app
* @param array array(/path/to/soteshop/data/fixtrures/stAppName.yml lub /path/to/soteshop/plugins/stAppNamePlugin/data/fixtures/stAppNamePlugin.yml)
*/
private function _getFixturePath($app)
{
$dir = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.$app;
$fixture_dirs = sfFinder::type('dir')->name('fixtures')->in($dir);
$data = array();
foreach ($fixture_dirs as $fd)
{
$files = sfFinder::type('file')->name($app.'.yml')->in($fd);
foreach ($files as $file)
{
$d = split('install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR, $file, 2);
if (!empty($d[1]))
$data[] = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$d[1];
}
}
return $data;
}
/**
* Get applications before synchronization.
*
* @see $this->_saveAppsToSync
* @see ST_APPSTOSYNC_FILE
* @param string $mode type (added|changed|deleted)
* @return array lista aplikacji
*/
private function _loadAppsToSync($mode) {
if (file_exists(ST_APPSTOSYNC_FILE)) {
$data = file_get_contents(ST_APPSTOSYNC_FILE);
$apps = unserialize($data);
return $apps[$mode];
} else {
return array();
}
}
private function _cleanAppsToSync() {
if (file_exists(ST_APPSTOSYNC_FILE)) unlink(ST_APPSTOSYNC_FILE);
}
/**
* Execute pre install script.
*
* @param string $apps array()
*/
private function _preExecute($apps)
{
$peari = stPearInfo::getInstance();
$regsync = $this->_loadRegSync();
foreach ($apps as $app)
{
$script = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'update-pre'.DIRECTORY_SEPARATOR.$app.'.php';
if (file_exists($script))
{
$version_new = $peari->getPackageVersion($app);
;
if (!empty($regsync[$app]))
$version_old = $regsync[$app];
else
$version_old=NULL;
file_put_contents(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'log'.DIRECTORY_SEPARATOR.'version.tmp', "$version_old -> $version_new");
// lock another executing for the same app and version
$md5_script_lock_file = md5($script).'_'.$app.'-'.$version_new.'-pre.lck';
if (!stLockUpdate::isLockedKey($md5_script_lock_file))
{
include_once($script);
stLockUpdate::lockKey($md5_script_lock_file); // lock execution for app and version
}
}
}
}
/**
* Execute post install scripts.
*
* @param array $apps array('stAppName1','stAppName2',...)
*/
private function _postExecute($apps)
{
$peari = stPearInfo::getInstance();
$regsync = $this->_loadRegSync();
foreach ($apps as $app)
{
$script = sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.'update'.DIRECTORY_SEPARATOR.$app.'.php';
if (file_exists($script))
{
$version_new = $peari->getPackageVersion($app);
if (!empty($regsync[$app]))
$version_old = $regsync[$app];
else
$version_old=NULL;
// lock another executing for the same app and version
$md5_script_lock_file = md5($script).'_'.$app.'-'.$version_new.'.lck';
if (!stLockUpdate::isLockedKey($md5_script_lock_file))
{
include_once($script);
stLockUpdate::lockKey($md5_script_lock_file); // lock execution for app and version
}
}
}
}
/**
* Lock stSetup
*/
private function _secureStSetup()
{
$file = sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'stSetup'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'security.yml';
// all:
// is_secure: on
$data = array();
$data['all']['is_secure'] = 'on';
file_put_contents($file, sfYaml::dump($data));
}
/**
* Rebuild .htaccess file.
*
* @param bool $force true - always overwrite, false - only when stBase is upgraded
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
protected function _htaccess($force = false) {
$apps = $this->_loadAppsToSync('changed');
if (in_array('stBase', $apps) || $force) {
$htaccessInstallPath = sfConfig::get('sf_root_dir').'/install/src/stBase/stBase/web/.htaccess';
if(file_exists($htaccessInstallPath)) {
copy($htaccessInstallPath, stHtaccess::getBaseFilePath());
stHtaccess::rebuild($htaccessInstallPath);
}
}
}
/**
* Fix upgrade previou known error.
* 1. Error stNewsPlugin - delete old files stNewsPlugin/config/*
*/
protected function fixSync()
{
// fix cache structore
$fixcache = new stFixCache();
$fixcache->fixAll();
$src = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR.'src';
$src_stNewsPlugin = $src.DIRECTORY_SEPARATOR.'stNewsPlugin'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'stNewsPlugin';
$st_stNewsPlugin = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.'stNewsPlugin';
// pliki do usuniecia
$delete = array(
$src_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin_stNewsPlugin-schema.custom.yml',
$src_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin-schema.yml',
$src_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin-schema.dbd.xml',
$st_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin_stNewsPlugin-schema.custom.yml',
$st_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin-schema.yml',
$st_stNewsPlugin.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'stNewsPlugin-schema.dbd.xml',
);
foreach ($delete as $file)
{
if (file_exists($file))
unlink($file);
}
}
/**
* Clear FastCache if needed
*/
protected function clearFastCache()
{
if (class_exists('stFastCacheManager'))
{
stFastCacheManager::clearCache();
}
}
protected function delay($sec = 10)
{
if ($sec > 0 && ($_SERVER['REMOTE_ADDR'] != '127.0.0.1' || sfconfig::get('sf_update_delay')))
{
sleep($sec);
}
}
public function getFatalMessage()
{
sfLoader::loadHelpers('I18N');
sfLoader::loadHelpers('Url');
sfLoader::loadHelpers('stUpdate');
$refresh_link = url_for('stInstallerWeb/rescueReboot', true);
return __('Wystąpił błąd podczas aktualizacji oprogramowania', null, 'stSetup').' '.', '.__('ponowna próba aktualizacji nastąpi za 30 sekund', null, 'stSetup').'.';
}
public function generateCache() {
$path = array('/', '/backend.php');
$openKey = md5_file(SF_ROOT_DIR.'/config/databases.yml');
foreach($path as $v) {
$cUrl = curl_init();
curl_setopt($cUrl, CURLOPT_URL, 'http://'.sfContext::getInstance()->getRequest()->getHost().$v.'?open-key='.$openKey);
curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($cUrl);
curl_close($cUrl);
}
return true;
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stInstallerTasksRescue.class.php 11221 2011-02-22 13:05:58Z marcin $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Token keys.
*/
require_once (sfConfig::get('sf_app_lib_dir').DIRECTORY_SEPARATOR.'stToken.php');
/**
* Logs
*/
if (!defined('ST_INSTALLER_LOG_PAGE'))
define("ST_INSTALLER_LOG_PAGE", sfConfig::get('sf_log_dir').DIRECTORY_SEPARATOR.'webinstaller.log');
/**
* Temporary list of synchronized applications.
*/
define("ST_APPSTOSYNC_FILE", sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.appstosync.reg');
/**
* Temporary list of applications installed before synchonization.
*/
define("ST_REGSYNC_PRE_INSTALL_FILE", sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.regsync.reg');
sfLoader::loadHelpers('Helper');
use_helper('I18N', 'Url', 'Tag');
use_helper('stProgressBar', 'Partial');
/**
* Installer WWW. Progress bar steps.
*
* @package stUpdate
* @subpackage libs
*/
class stInstallerTasksRescue extends stInstallerTasks
{
public function step($step)
{
stPropelGeneratorController::forceRebuild();
return parent::step($step);
}
}

View File

@@ -0,0 +1,93 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stLockUpdate.php 4319 2010-03-30 12:29:41Z marek $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
define ("ST_LOCK_UPDATE",sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.lockupdate');
/**
* Locking system for upgrade process.
*
* @package stUpdate
* @subpackage libs
*/
class stLockUpdate
{
/**
* Upgrade started.
*/
static public function lock()
{
$data=date('Y/m/d H:i:s');
file_put_contents(ST_LOCK_UPDATE,$data);
if (class_exists('stLock'))
{
stLock::lock('frontend', stLock::MAINTENANCE_LOCK);
stLock::lock('backend', stLock::MAINTENANCE_LOCK);
}
}
/**
* Upgrade finished.
*/
static public function unlock()
{
if (file_exists(ST_LOCK_UPDATE)) unlink(ST_LOCK_UPDATE);
if (class_exists('stLock'))
{
stLock::unlock('frontend');
stLock::unlock('backend');
stLock::unlock('frontend', stLock::MAINTENANCE_LOCK);
stLock::unlock('backend', stLock::MAINTENANCE_LOCK);
}
}
/**
* Check if upgrade system is locked.
*
* @return bool
*/
static public function isLocked()
{
if (file_exists(ST_LOCK_UPDATE)) return true;
else return false;
}
/**
* Check if provided key is locked
* @param string $key
* @return bool true - keyy is locked, false - not locked
*/
static public function isLockedKey($key)
{
$lock_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'lock'.DIRECTORY_SEPARATOR;
if (file_exists($lock_dir.$key)) return true;
else return false;
}
/**
* Add lock for provided key
* @param string $key
* @return true
*/
static public function lockKey($key)
{
$lock_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'lock'.DIRECTORY_SEPARATOR;
if (! is_dir($lock_dir)) mkdir ($lock_dir);
$src=date('Y/m/d H:i:s');
file_put_contents($lock_dir.$key,$src);
return true;
}
}

View File

@@ -0,0 +1,250 @@
<?php
class stPackageDownloader
{
protected $message = "";
/**
* Wersje jezykowe
*
* @var sfI18N
*/
protected $i18n;
/**
* Kontekst aplikacji
*
* @var sfContext
*/
protected $context;
public function __construct()
{
$this->context = sfContext::getInstance();
$this->i18n = $this->context->getI18N();
}
public function getMessage()
{
return $this->message;
}
public function close()
{
$this->removePackages();
$action = $this->context->getController()->genUrl('stInstallerWeb/syncList');
ob_start();
echo '<div style="clear: both">' . $this->i18n->__('Aktualizaje zostały pobrane', null, 'stInstallerWeb') . '</div>';
echo '<ul style="float:right" class="st_admin-actions">';
echo ' <li class="st_admin-action-add">';
echo ' <form method="post" class="button_to" action="' . $action . '">';
echo ' <input style="background-image: url(/images/update/red/icons/download.png)" value="' . $this->i18n->__('Instaluj pobrane aktualizacje', null, 'stInstallerWeb') . '" type="submit" />';
echo ' </form>';
echo ' </li>';
echo '</ul>';
echo '<br class="st_clear_all" />';
$this->message = ob_get_clean();
}
public static function getPackages()
{
$file = sfConfig::get('sf_root_dir') . '/install/db/.download-packages.reg';
if (file_exists($file))
{
return json_decode(file_get_contents($file), true);
}
else
return null;
}
public static function setPackages($packages)
{
file_put_contents(sfConfig::get('sf_root_dir') . '/install/db/.download-packages.reg', json_encode($packages));
}
public static function removePackages()
{
$file = sfConfig::get('sf_root_dir') . '/install/db/.download-packages.reg';
if (file_exists($file))
unlink($file);
}
public function initialize()
{
if ($this->getPackages() === null)
{
$upgradeType = $this->getUpgradeType();
if (isset($upgradeType['type']) && $upgradeType['type'] == 'package')
$dependencies = stPear::getDependencies(array($upgradeType['package'] => $upgradeType['version']));
else
$dependencies = stPear::getDependencies(stPear::getPackagesToUpgrade());
if (!empty($dependencies))
$this->setPackages($dependencies);
}
}
public static function getSteps()
{
if (self::getPackages() === null)
{
$instance = new stPackageDownloader();
$instance->initialize();
}
$packages = self::getPackages();
if (is_array($packages))
return count($packages) + 1;
return 0;
}
public function step($step = 0)
{
$package = $this->getPackageForStep();
if ($package !== null)
{
list($package, $version) = $package;
if ($step == 0)
{
$this->message = $this->i18n->__('Pobieranie', null, 'stInstallerWeb') . ': ' . $package . ' ' . $version;
return $step + 1;
}
stPear::runPearCommand(array('command' => 'upgrade', 'parameters' => array(stPearInfo::getInstance()->getDefaultChannel() . '/' . $package . '-' . $version), 'options' => array('nodeps' => true)), 'raw', true);
if ($this->getNextPackage() !== null)
{
list($nextPackage, $nextVersion) = $this->getNextPackage();
$this->message = $this->i18n->__('Pobieranie', null, 'stInstallerWeb') . ': ' . $nextPackage . ' ' . $nextVersion;
}
else
$this->message = $this->i18n->__('Kończenie pobierania plików', null, 'stInstallerWeb');
$this->setInstalled($package);
return $step + 1;
}
else
{
return $this->getSteps();
}
}
private function getPackageForStep()
{
foreach ($this->getPackages() as $package => $version)
if ($version != "installed")
return array($package, $version);
return null;
}
private function getNextPackage()
{
$packageList = $this->getPackages();
$next = false;
foreach ($packageList as $package => $version)
{
if ($version != 'installed')
{
if ($next == true)
return array($package, $version);
$next = true;
}
}
return null;
}
public function setInstalled($package)
{
$packages = $this->getPackages();
$packages[$package] = 'installed';
$this->setPackages($packages);
}
public static function getUpgradeTypeFilePath()
{
return sfConfig::get('sf_root_dir') . '/install/db/.upgrade-type.reg';
}
public static function setUpgradeType($type, $package = null, $version = null)
{
$file = self::getUpgradeTypeFilePath();
if ($type == 'package' && ($package == null || $version == null))
throw new Exception('Package and version must be set.');
file_put_contents($file, json_encode(array('type' => $type, 'package' => $package, 'version' => $version)));
}
public static function getUpgradeType()
{
$file = self::getUpgradeTypeFilePath();
if (file_exists($file))
{
$content = json_decode(file_get_contents($file), true);
unlink($file);
return $content;
}
return null;
}
static public function unlockPackagesList()
{
$remove = true;
$packages = self::getPackages();
if (is_array($packages))
{
foreach ($packages as $package => $version)
{
if ($version != 'installed')
$remove = false;
}
if ($remove)
self::removePackages();
}
return null;
}
}
class stSetupPackageDownloader extends stPackageDownloader
{
public function close()
{
$this->removePackages();
$this->message = $this->i18n->__('Aplikacje zostały pobrane', null, 'stInstallerWeb') . "<script type=\"text/javascript\">document.getElementById('stSetup-download_actions').style.visibility=\"visible\";</script>";
}
public function getTitle()
{
return $this->i18n->__('Pobieranie aplikacji', null, 'stInstallerWeb') . ': ';
}
public function getFatalMessage()
{
sfLoader::loadHelpers(array('Tag', 'Url', 'stUpdate'));
return $this->i18n->__('Wystąpił błąd podczas pobierania oprogramowania', null, 'stSetup') . ' ' .
st_program_name() . ', ' .
$this->i18n->__('większość problemów można rozwiązać korzystając z', null, 'stSetup') .
' <strong>' .
link_to($this->i18n->__('podręcznika instalacji', null, 'stSetup'), $this->i18n->__('http://www.sote.pl/trac/wiki/doc/soteshop_installation', null, 'stSetup'), array('target' => '_blank')) .
'</strong>';
}
}

179
apps/update/lib/stPake.php Normal file
View File

@@ -0,0 +1,179 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stPake.php 8731 2010-10-12 10:32:32Z piotr $
*/
//error_reporting(E_ALL);
// set magic_quotes_runtime to off
ini_set('magic_quotes_runtime', 'Off');
// force populating $argc and $argv in the case PHP does not automatically create them (fixes #2943)
/**
*/
// zaladuj konfiguracje
if (empty($sf_root_dir))
$sf_root_dir = dirname(dirname(__FILE__) . DIRECTORY_SEPARATOR); // +sote
require_once("config/config.php");
// STD definitions for CLI
define('STDOUT', fopen('php://stdout', 'w'));
define('STDERR', fopen('php://stderr', 'w'));
// end
require_once($sf_symfony_lib_dir . '/vendor/pake/pakeFunction.php');
require_once($sf_symfony_lib_dir . '/vendor/pake/pakeGetopt.class.php');
// autoloading for pake tasks
class simpleAutoloader
{
static public
$class_paths = array(),
$autoload_callables = array(),
$initialized = false;
static public function initialize($sf_symfony_lib_dir)
{
self::$class_paths = array();
self::register($sf_symfony_lib_dir, '.class.php');
self::register($sf_symfony_lib_dir . '/vendor/propel', '.php');
self::register($sf_symfony_lib_dir . '/vendor/creole', '.php');
self::register('lib/model', '.php');
// self::register('plugins', '.php'); // - sote
self::register('../plugins', '.php'); // + sote
}
static public function __autoload($class)
{
if (!self::$initialized)
{
self::$initialized = true;
self::initialize(sfConfig::get('sf_symfony_lib_dir'));
}
if (!isset(self::$class_paths[$class]))
{
foreach ((array)self::$autoload_callables as $callable)
{
if (call_user_func($callable, $class))
{
return true;
}
}
return false;
}
require_once(self::$class_paths[$class]);
return true;
}
static public function register($dir, $ext)
{
if (!is_dir($dir))
{
return;
}
foreach (pakeFinder::type('file')->name('*' . $ext)->ignore_version_control()->follow_link()->in($dir) as $file)
{
self::$class_paths[str_replace($ext, '', str_replace('.class', '', basename($file, $ext)))] = $file;
}
}
static public function add($class, $file)
{
if (!is_file($file))
{
return;
}
self::$class_paths[$class] = $file;
}
static public function registerCallable($callable)
{
if (!is_callable($callable))
{
throw new Exception('Autoload callable does not exist');
}
self::$autoload_callables[] = $callable;
}
}
spl_autoload_register(array('simpleAutoloader', '__autoload'));
// trap -V before pake
if (in_array('-V', $argv) || in_array('--version', $argv))
{
printf("symfony version %s\n", trim(file_get_contents($sf_symfony_lib_dir . '/VERSION'), 'INFO'));
exit(0);
}
if (count($argv) <= 1)
{
$argv[] = '-T';
}
// @todo przeciazyc ta klase zmienic odczytywanie konfigow
require_once($sf_symfony_lib_dir . '/config/sfConfig.class.php');
sfConfig::add(array(
'sf_root_dir' => $sf_root_dir, // +- sote
'sf_symfony_lib_dir' => $sf_symfony_lib_dir,
'sf_symfony_data_dir' => $sf_symfony_data_dir,
));
// directory layout
// @todo dodac przeciazenie tego wywolania
include($sf_symfony_data_dir . '/config/constants.php');
#include(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'stInstallerWebPlugin'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'constants.php');
// include path
set_include_path(
sfConfig::get('sf_lib_dir') . PATH_SEPARATOR .
sfConfig::get('sf_app_lib_dir') . PATH_SEPARATOR .
sfConfig::get('sf_model_dir') . PATH_SEPARATOR .
sfConfig::get('sf_symfony_lib_dir') . DIRECTORY_SEPARATOR . 'vendor' . PATH_SEPARATOR .
get_include_path()
);
// register tasks
$dirs = array(
sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'tasks' => 'myPake*.php', // project tasks
sfConfig::get('sf_symfony_data_dir') . DIRECTORY_SEPARATOR . 'tasks' => 'sfPake*.php', // symfony tasks
sfConfig::get('sf_root_dir') . '/plugins/*/data/tasks' => '*.php', // plugin tasks // +- sote
);
foreach ($dirs as $globDir => $name)
{
if ($dirs = glob($globDir))
{
$tasks = pakeFinder::type('file')->ignore_version_control()->name($name)->in($dirs);
foreach ($tasks as $task)
{
// echo "inclue task: $task \n";
include_once($task);
}
}
}
// run task
// pakeApp::get_instance()->run(null, null, false);

View File

@@ -0,0 +1,92 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stPakeWeb.class.php 9614 2010-11-29 11:31:27Z marek $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Web Symfony tasks.
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stPakeWeb
{
/**
* @var string $content task result STDUOT
*/
var $content='';
/**
* @var string $error error message
*/
var $error='';
/**
* @var string path to symfony - has to be set but system doesn't use it
*/
var $symfony='/usr/bin/symfony';
/**
* Execute task
*
* @param string np. propel-build-model, cc
* @return bool
*/
public function run($webtask)
{
if (empty($webtask)) {
$this->error='Empty parameter task';
return false;
}
// clean Fast Cache
if ($webtask=='cc')
{
if (class_exists('stFastCacheManager'))
{
stFastCacheManager::clearCache();
}
}
// symfony directories
$sf_symfony_lib_dir = sfConfig::get('sf_symfony_lib_dir');
$sf_symfony_data_dir = sfConfig::get('sf_symfony_data_dir');
$sf_root_dir=sfConfig::get('sf_root_dir');
chdir($sf_root_dir);
// force populating $argc and $argv in the case PHP does not automatically create them (fixes #2943)
$argc=array();
$argv=array($this->symfony,$webtask);
$pakelib=$sf_root_dir.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.'update'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stPake.php';
require_once($pakelib);
$pake = pakeApp::get_instance();
try
{
ob_start();
$ret = $pake->run(null, $webtask, false); // execute task
$content = ob_get_clean();
$this->content = $content;
return true;
}
catch (Exception $ret)
{
$this->error = $ret->getMessage();
return false;
}
}
}

View File

@@ -0,0 +1,268 @@
<?php
class stRepairKitProgressBar
{
protected $context = null;
const PROCESS_CATEGORY_COUNT = 40;
const PROCESS_ASSET_FOLDER_COUNT = 40;
const CATEGORY_NAMESPACE = 'soteshop/stRepairKit/repairCategories';
const ASSET_FOLDER_NAMESPACE = 'soteshop/stRepairKit/repairAssetFolders';
public static function cleanSession($namespace)
{
$user = sfContext::getInstance()->getUser();
$user->getAttributeHolder()->removeNamespace($namespace);
}
public static function getSessionVar($name, $default = null, $namespace)
{
$user = sfContext::getInstance()->getUser();
return $user->getAttribute($name, $default, $namespace);
}
public static function setSessionVar($name, $value, $namespace)
{
$user = sfContext::getInstance()->getUser();
$user->setAttribute($name, $value, $namespace);
}
public function __construct()
{
$this->context = sfContext::getInstance();
}
public function init()
{
stLock::lock('backend');
stLock::lock('frontend');
}
public function close()
{
stLock::unlock('backend');
stLock::unlock('frontend');
$this->setMessage('Naprawa została zakończona pomyślnie');
}
public function repairAssetFolders($offset)
{
$this->initialize();
$c = new Criteria();
$c->addAscendingOrderByColumn(sfAssetFolderPeer::ID);
$c->setOffset($offset);
$c->setLimit(self::PROCESS_ASSET_FOLDER_COUNT);
$parents = sfAssetFolderPeer::doSelect($c);
foreach ($parents as $parent)
{
$process_info = $this->assetFolderFixHelper($parent);
if ($process_info !== null)
{
$this->setMessage(sprintf('Naprawa katalogów (%s z %s)', $process_info['processed'], $process_info['to_process']));
return $offset;
}
$offset++;
}
$this->setMessage('Naprawa zdjęć w toku');
return $offset;
}
public function repairCategories($offset)
{
$this->initialize();
$c = new Criteria();
$c->addAscendingOrderByColumn(CategoryPeer::ID);
$c->setOffset($offset);
$c->setLimit(self::PROCESS_CATEGORY_COUNT);
$parents = CategoryPeer::doSelect($c);
foreach ($parents as $parent)
{
$process_info = $this->categoryFixHelper($parent);
if ($process_info !== null)
{
$this->setMessage(sprintf('Naprawa podkategorii (%s z %s)', $process_info['processed'], $process_info['to_process']));
return $offset;
}
$offset++;
}
$this->setMessage('Naprawa kategorii w toku...');
return $offset;
}
/**
*
* Metoda pomocnicza naprawiająca zagnieżdżenia kategorii
*
* @param Category $parent Rodzic
*/
protected function categoryFixHelper($parent)
{
$offset = self::getSessionVar('child-offset', 0, self::CATEGORY_NAMESPACE);
$c = new Criteria();
$c->add(CategoryPeer::PARENT_ID, $parent->getId());
$c->addAscendingOrderByColumn(CategoryPeer::ID);
$c->setOffset($offset);
$c->setLimit(self::PROCESS_CATEGORY_COUNT);
$categories = CategoryPeer::doSelect($c);
$processed = count($categories);
if (!$processed)
{
return null;
}
foreach ($categories as $category)
{
$category->setCulture('pl_PL');
$parent = $parent->reload();
$parent->setCulture('pl_PL');
$category->insertAsLastChildOf($parent);
$category->save();
}
$offset += $processed;
$c = new Criteria();
$c->add(CategoryPeer::PARENT_ID, $parent->getId());
$to_process = CategoryPeer::doCount($c);
if ($offset >= $to_process)
{
self::setSessionVar('child-offset', 0 , self::CATEGORY_NAMESPACE);
return null;
}
else
{
self::setSessionVar('child-offset', $offset , self::CATEGORY_NAMESPACE);
}
return array('processed' => $offset, 'to_process' => $to_process);
}
/**
*
* Metoda pomocnicza naprawiająca zagnieżdżenia katalogów zdjęć
*
* @param sfAssetFolder $parent Rodzic
*/
protected function assetFolderFixHelper($parent)
{
$offset = self::getSessionVar('child-offset', 0, self::ASSET_FOLDER_NAMESPACE);
$c = new Criteria();
$c->add(sfAssetFolderPeer::TREE_PARENT, $parent->getId());
$c->addAscendingOrderByColumn(sfAssetFolderPeer::ID);
$c->setOffset($offset);
$c->setLimit(self::PROCESS_ASSET_FOLDER_COUNT);
$asset_folders = sfAssetFolderPeer::doSelect($c);
$processed = count($asset_folders);
if (!$processed)
{
return null;
}
foreach ($asset_folders as $asset_folder)
{
$parent = $parent->reload();
$asset_folder->insertAsLastChildOf($parent);
$asset_folder->save();
}
$offset += $processed;
$c = new Criteria();
$c->add(sfAssetFolderPeer::TREE_PARENT, $parent->getId());
$to_process = sfAssetFolderPeer::doCount($c);
if ($offset >= $to_process)
{
self::setSessionVar('child-offset', 0 , self::ASSET_FOLDER_NAMESPACE);
return null;
}
else
{
self::setSessionVar('child-offset', $offset , self::ASSET_FOLDER_NAMESPACE);
}
return array('processed' => $offset, 'to_process' => $to_process);
}
protected function setMessage($message)
{
$user = $this->context->getUser();
$user->setAttribute('stProgressBar-stRepairKit', $message, 'symfony/flash');
}
protected function initialize()
{
sfLoader::loadPluginConfig();
$dbm = new sfDatabaseManager();
$dbm->initialize();
}
}
?>

View File

@@ -0,0 +1,44 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stServerSettings.class.php 3160 2010-01-26 13:30:27Z marek $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* System settings verification.
*
* @package stUpdate
* @subpackage libs
*/
class stServerSettings
{
/**
* Check if php include path contain path to PEAR,
*
* @param string $file
* @return bool
*/
public function isPEAR($file='PEAR.php')
{
$include_path=ini_get('include_path');
$paths=split(':',$include_path);
foreach ($apths as $path)
{
$pearFile=$path.DIRECTORY_SEPARATOR.$file;
if (file_exists($pearFile)) return true;
else return false;
}
}
}

View File

@@ -0,0 +1,405 @@
<?php
class stSetupDefaultData
{
const STEPS = [
0 => 'loadFixtures',
1 => 'changeTheme',
2 => 'changeCurrency',
3 => 'changeLanguage',
4 => 'changeTax',
5 => 'postInstall',
6 => 'clearCache',
];
protected $message;
public function getTitle()
{
return sfContext::getInstance()->getI18N()->__('Zapisywanie domyślnych ustawień:', null, 'stSetup');
}
public static function getSteps()
{
return count(self::STEPS);
}
public function step($step)
{
$settings = $this->loadSettings();
$this->callStep($step, $settings);
return $step + 1;
}
public function close()
{
sfLoader::loadHelpers(['Helper', 'stProgressBar']);
$this->message = progress_bar('stCleanInstallerDownload', 'stCleanInstallerDownload', 'step', stCleanInstallerDownload::getSteps());
$this->message .= progress_bar('stCleanInstallerSrc', 'stCleanInstallerSrc', 'step', stCleanInstallerSrc::getSteps());
}
public function getMessage()
{
return $this->message;
}
protected function callStep(int $step, array $settings)
{
$method = self::STEPS[$step];
call_user_func([$this, $method], $settings);
}
protected function loadSettings(): array
{
$settingsFile = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . 'db' . DIRECTORY_SEPARATOR . '.settings.reg';
$settings = sfYaml::load($settingsFile);
if ($settings['language'] === false)
{
$settings['language'] = 'no';
}
return $settings;
}
protected function loadFixtures(array $settings)
{
$this->setDefaultOptLanguage('pl_PL');
sfLoader::loadPluginConfig();
if (stInstallMethod::getWebInstall())
{
if (!$this->loadSqlFixtures($settings['fixtures_name']))
{
$this->runTask('installer-load-data ' . SF_ENVIRONMENT);
}
}
else
{
$task = $settings['load_fixtures'] ? 'st-propel-load-default-data ' . $settings['fixtures_name'] : 'installer-load-data ' . SF_ENVIRONMENT;
$this->runTask($task);
}
}
protected function changeTheme(array $settings)
{
$this->initializeDatabase();
stTheme::setActiveTheme($settings['theme']);
}
protected function changeCurrency(array $settings)
{
$this->initializeDatabase();
$c = new Criteria();
$c->add(CurrencyPeer::SHORTCUT, $settings['currency']);
$currency = CurrencyPeer::doSelectOne($c);
if (is_object($currency))
{
$config = stConfig::getInstance(sfContext::getInstance(), 'stCurrencyPlugin');
$config->set('default_currency', $currency->getShortcut());
$config->save(true);
$exchange = $currency->getExchange();
$currency->setActive(1);
$currency->setMain(1);
$currency->setExchange(1);
$currency->save();
}
$c = new Criteria();
$criterion = $c->getNewCriterion(CurrencyPeer::MAIN, 0);
$criterion1 = $c->getNewCriterion(CurrencyPeer::MAIN, null, Criteria::ISNULL);
$criterion->addOr($criterion1);
$c->add($criterion);
$currencies = CurrencyPeer::doSelect($c);
foreach ($currencies as $currency)
{
$currency->setExchange($currency->getExchange() / $exchange);
$currency->save();
}
}
protected function changeCountry(array $settings)
{
$this->initializeDatabase();
$c = new Criteria();
$c->add(CountriesPeer::ISO_A2, $settings['delivery_country']);
$country = CountriesPeer::doSelectOne($c);
if (is_object($country))
{
$country->setIsDefault(1);
$country->save();
}
$connection = Propel::getConnection();
$statementTable = $connection->prepareStatement('TRUNCATE `st_countries_area`');
$statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
$statementTable = $connection->prepareStatement('TRUNCATE `st_countries_area_has_countries`');
$statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
$area = new CountriesArea();
$area->setName($country->getName());
$area->setIsActive(1);
$area->save();
$areaHasCountry = new CountriesAreaHasCountries();
$areaHasCountry->setCountriesId($country->getId());
$areaHasCountry->setCountriesAreaId($area->getId());
$areaHasCountry->save();
}
protected function changePanelLanguage(array $settings)
{
$c = new Criteria();
$c->add(LanguagePeer::LANGUAGE, $settings['language_panel']);
$language = LanguagePeer::doSelectOne($c);
if (null !== $language)
{
$language->setIsDefaultPanel(true);
$language->save();
$config = stConfig::getInstance(sfContext::getInstance(), 'stLanguagePlugin');
$config->set('admin_language', $language->getOriginalLanguage());
$config->save(true);
$this->setDefaultOptLanguage($language->getOriginalLanguage());
$this->updateOptI18nFields($language->getOriginalLanguage());
}
if (stSoteshopVersion::getVersion() == stSoteshopVersion::ST_SOTESHOP_VERSION_INTERNATIONAL)
{
$c = new Criteria();
$c->add(LanguagePeer::LANGUAGE, 'pl_PL');
$language = LanguagePeer::doSelectOne($c);
if (is_object($language))
{
$language->setIsTranslatePanel(false);
$language->save();
}
}
}
protected function changeLanguage(array $settings)
{
$this->initializeDatabase();
$this->changePanelLanguage($settings);
$c = new Criteria();
$c->add(LanguagePeer::LANGUAGE, $settings['language']);
$language = LanguagePeer::doSelectOne($c);
if (is_object($language))
{
$sc = new Criteria();
$sc->add(LanguagePeer::ACTIVE, true);
$uc = new Criteria();
$uc->add(LanguagePeer::ACTIVE, false);
BasePeer::doUpdate($sc, $uc, Propel::getConnection());
$language->setIsDefault(true);
$language->setActive(true);
$language->save();
stLockSimpleCache::updateLockCache();
}
}
protected function changeTax(array $settings)
{
$country = $settings['delivery_country'];
if ($country == 'PL')
{
return true;
}
$taxFile = sfConfig::get('sf_plugins_dir') . DIRECTORY_SEPARATOR . 'stTaxPlugin' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'countries_tax_list.yml';
if (file_exists($taxFile))
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$connection = Propel::getConnection();
$statementTable = $connection->prepareStatement('TRUNCATE `st_tax`');
$statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
$taxes = sfYaml::load($taxFile);
if (!isset($taxes[$country]))
{
$country = 'default';
}
foreach ($taxes[$country] as $name => $params)
{
$tax = new Tax();
$tax->setVat($params['vat']);
$tax->setVatName($params['vat_name']);
if ($name == 'Tax_1')
{
$tax->setIsDefault(true);
}
$tax->save();
}
$statementTable = $connection->prepareStatement('UPDATE st_product SET `tax_id` = 1, `opt_vat` = ' . $taxes[$country]['Tax_1']['vat'] . ', `price` = (`opt_price_brutto`/(1+(' . $taxes[$country]['Tax_1']['vat'] . '/100)))');
$statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
$statementTable = $connection->prepareStatement('UPDATE st_delivery SET `tax_id` = 1');
$statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
unset($taxes);
$databaseManager->shutdown();
}
}
protected function postInstall(array $settings)
{
$shopInfoConfig = stConfig::getInstance('stShopInfoBackend');
$shopInfoConfig->set('country', $settings['company_country']);
$shopInfoConfig->save();
$files = glob(sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'install-post' . DIRECTORY_SEPARATOR . '*');
foreach ($files as $file)
{
file_put_contents(sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'post-install.log', 'Load script file: ' . basename($file) . "\n", FILE_APPEND);
include_once($file);
}
}
protected function loadSqlFixtures($fixturesName)
{
$sqlFile = sfConfig::get('sf_root_dir') . '/install/sql/' . $fixturesName . '.sql';
if (file_exists($sqlFile))
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$con = Propel::getConnection();
$queries = preg_split('/\n/', file_get_contents($sqlFile));
foreach ($queries as $query)
{
if (empty($query)) continue;
if (preg_match('/^\/\*\!/', $query))
{
preg_match('/^\/\*\![0-9]+\s{1}(.*)\*\/\;$/', $query, $matches);
if (isset($matches[1]) && !empty($matches[1]))
{
$query = trim($matches[1]) . ';';
}
}
$con->executeQuery($query);
}
return true;
}
return false;
}
protected function updateOptI18nFields(string $culture)
{
$con = Propel::getConnection();
$statement = $con->prepareStatement('SHOW TABLES LIKE "%_i18n"');
$resultset = $statement->executeQuery(ResultSet::FETCHMODE_NUM);
while ($resultset->next())
{
$i18nFields = [];
$optFields = [];
$setOptFieldStatements = [];
$tableNameI18n = $resultset->getString(1);
$tableName = substr($tableNameI18n, 0, -5);
$statementTable = $con->prepareStatement("SHOW COLUMNS FROM $tableNameI18n WHERE Field <> 'id' AND Field <> 'culture'");
$resultsetTable = $statementTable->executeQuery(ResultSet::FETCHMODE_NUM);
while ($resultsetTable->next())
{
$i18nFields[] = $resultsetTable->getString(1);
}
$query = "UPDATE $tableName, $tableNameI18n SET ";
$updateI18FieldList = 'opt_' . implode("', 'opt_", $i18nFields);
$ps = $con->prepareStatement("SHOW COLUMNS FROM $tableName WHERE Field IN ('$updateI18FieldList')");
$result = $ps->executeQuery(ResultSet::FETCHMODE_NUM);
while ($result->next())
{
$optFields[] = $result->getString(1);
}
if (!empty($optFields))
{
foreach ($optFields as $optField)
{
$i18nField = substr($optField, 4);
$setOptFieldStatements[] = "$tableName.$optField = $tableNameI18n.$i18nField";
}
$setOptFieldStatement = implode(', ', $setOptFieldStatements);
$query = "UPDATE $tableName, $tableNameI18n SET $setOptFieldStatement WHERE {$tableName}.id = {$tableNameI18n}.id AND {$tableNameI18n}.culture = '$culture'";
$statementUpdate = $con->prepareStatement($query);
$statementUpdate->executeQuery(ResultSet::FETCHMODE_NUM);
}
}
}
protected function setDefaultOptLanguage(string $language)
{
$config = stConfig::getInstance(sfContext::getInstance(), 'stLanguagePlugin');
$config->set('default_opt_language', $language);
$config->save(true);
}
protected function clearCache()
{
$this->runTask('cc');
}
protected function runTask(string $task)
{
$pakeweb = new stPakeWeb();
if (!$pakeweb->run($task))
{
throw new Exception($pakeweb->error);
}
}
protected function initializeDatabase()
{
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
}
}

View File

@@ -0,0 +1,342 @@
<?php
/**
* SOTESHOP/stUpdate
*
* Ten plik należy do aplikacji stUpdate opartej na licencji (Open License SOTE) Otwarta Licencja SOTE.
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stUpdate
* @subpackage lib
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: stSetupRequirements.class.php 9100 2010-11-05 11:43:30Z piotr $
* @author Piotr Halas <piotr.halas@sote.pl>
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Klasa stSetupRequirements do weryfikacji serwera i jego ustawień.
*
* @package stUpdate
* @subpackage lib
*/
class stSetupRequirements
{
/**
* Lista testów do wykonania
*
* @var array
*/
protected $tests;
/**
* Statusy wykonanych testów
*
* @var array
*/
protected $testStatus = array();
protected $testWarnings = array();
public function __construct()
{
$this->tests = array(
'testPHP' => 'Wersja PHP (7.1.x - 7.4.x)',
'testOpenSSL' => 'Wersja OpenSSL 1.0.1 lub nowsza',
'testSuPHP' => 'Skrypty uruchamiane z uprawnieniami użytkownika',
'testSafeMode' => 'Tryb safe_mode wyłączony',
'testCurl' => 'Biblioteka cURL',
'testJsonEncode' => 'Biblioteka JSON',
'testXsl' => 'Biblioteka XSL',
'testGd' => 'Biblioteka GD2',
'testSoap' => 'Obsługa Soap',
'testMbstring' => 'Obsługa Mutlibyte String',
'testMysql' => 'Obsługa MySQL',
'testPdo' => 'Obsługa baz danych PDO (MySQL, SQLite)',
'testSimpleXml' => 'Obsługa simpleXML',
'testMemory' => 'Limit pamięci dla skryptu (128MB)',
'testTime' => 'Czas wykonywania skryptu (30s)',
'testTransSid' => 'Wyłączony session.use_trans_sid',
'testZlib' => 'Biblioteka Zlib'
);
$phpVersion = floatval(phpversion());
if ($phpVersion < 7.2)
{
$this->tests['testMcrypt'] = 'Biblioteka Mcrypt';
}
}
/**
* Wykonanie wszyskich testów
*
* @return boolean
*/
public function testAll($class = __CLASS__)
{
$this->testStatus = array();
$allPass = true;
foreach ($this->tests as $test => $name)
{
if (is_callable(array($class,$test)))
{
$value = call_user_func($class.'::'.$test);
if (!$value) $allPass = false;
} else {
$value = false;
$allPass = false;
}
$this->testStatus[$test] = $value;
if (is_callable(array('stSetupRequirements',$test."Warning"))) $this->testWarnings[$test] = call_user_func('stSetupRequirements::'.$test."Warning");
}
return $allPass;
}
public static function testOpenSSL()
{
return OPENSSL_VERSION_NUMBER >= 0x10001000;
}
/**
* Pobieranie statusów testów
*
* @return array
*/
public function getTest()
{
if (count($this->testStatus) == 0) $this->testAll();
return $this->testStatus;
}
/**
* Pobieranie nazw testów
*
* @param string $name
* @return boolean
*/
public function getTestName($name = '') {
if (isset($this->tests[$name])) return $this->tests[$name];
return '';
}
/**
* Sprawdzianie wersji PHP, dozwolne wersje to min 5.2.3 z wyłączeniem 5.2.4
*
* @return boolean
*/
public static function testPHP()
{
$version = floatval(phpversion());
return $version >= 7.1 && $version < 7.5;
}
/**
* Sprawdzianie czy jest obsługiwane SuPHP, czyli PHP z prawami użytkownika
*
* @return boolean
*/
public static function testSuPHP()
{
$filename = sfConfig::get('sf_cache_dir').DIRECTORY_SEPARATOR.'file.test';
touch($filename);
$apache_uid = fileowner($filename);
$index_uid = fileowner(sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.'update.php');
unlink($filename);
if ($apache_uid != $index_uid) return false;
return true;
}
/**
* Sprawdzanie biblioteki cURL
*
* @return boolean
*/
public static function testCurl()
{
return function_exists('curl_init');
}
/**
* Sprawdzanie czy jest wyłączony safe_mode
*
* @return boolean
*/
public static function testSafeMode()
{
return !ini_get('safe_mode');
}
/**
* Sprawdzanie biblioteki JSON
*
* @return boolean
*/
public static function testJsonEncode()
{
return function_exists('json_encode');
}
/**
* Sprawdzanie biblioteki SOAP
*
* @return boolean
*/
public static function testSoap()
{
return class_exists('SoapClient');
}
/**
* Sprawdzanie biblioteki GD
*
* @return boolean
*/
public static function testGd()
{
if (!function_exists('gd_info')) return false;
$support = gd_info();
if (version_compare(PHP_VERSION, '5.3', '>='))
{
if (!$support['JPEG Support']) return false;
} else {
if (!$support['JPG Support']) return false;
}
if (!$support['PNG Support']) return false;
if (!$support['FreeType Support']) return false;
return true;
}
/**
* Sprawdzanie biblioteki Mbstring - Mutlibyte String
*
* @return boolean
*/
public static function testMbstring()
{
return function_exists('mb_check_encoding');
}
/**
* Sprawdzanie biblioteki XSL
*
* @return boolean
*/
public static function testXsl()
{
return class_exists('XSLTProcessor');
}
/**
* Sprawdzanie biblioteki MySQL
*
* @return boolean
*/
public static function testMysql() {
return function_exists('mysqli_connect');
}
public static function testPdo() {
if (class_exists('PDO')) {
$drivers = PDO::getAvailableDrivers();
if (in_array('mysql', $drivers) && in_array('sqlite', $drivers))
return true;
}
return false;
}
/**
* Sprawdzanie biblioteki SimpleXml
*
* @return boolean
*/
public static function testSimpleXml() {
return function_exists('simplexml_load_file');
}
/**
* Sprawdzanie dostępnej pamięci, minimum 64MB
*
* @return boolean
*/
public static function testMemory()
{
$memory = trim(ini_get('memory_limit'));
$last = strtolower($memory[strlen($memory)-1]);
$memory = intval($memory);
switch ($last) {
case 'g': $memory *= 1024;
case 'm': $memory *= 1024;
case 'k': $memory *= 1024;
}
return ($memory<pow(2,27))?false:true;
}
// public static function testMemoryWarning()
// {
// $memory = trim(ini_get('memory_limit'));
// $last = strtolower($memory[strlen($memory)-1]);
// switch ($last) {
// case 'g': $memory *= 1024;
// case 'm': $memory *= 1024;
// case 'k': $memory *= 1024;
// }
// if ($memory>= pow(2,27) && $memory < pow(2,27)) return ini_get('memory_limit').'B'.sfContext::getInstance()->getI18n()->__(', zalecane <strong>128MB</strong>');
// return false;
// }
/**
* Sprawdzanie czasu wykonywania skryptu, minimum 30 sekund
*
* @return boolean
*/
public static function testTime()
{
return ini_get('max_execution_time') >= 30 || !ini_get('max_execution_time');
}
public static function testTimeWarning()
{
if(ini_get('max_execution_time')>=30 && ini_get('max_execution_time')<60)return ini_get('max_execution_time').sfContext::getInstance()->getI18n()->__('s, zalecane <strong>60s</strong>');
return false;
}
/**
* Sprawdzanie biblioteki Mcyprt
*
* @return boolean
*/
public static function testMcrypt()
{
return function_exists('mcrypt_module_open');
}
/**
* Sprawdzania session.use_trans_sid
*/
public static function testTransSid()
{
return (ini_get('session.use_trans_sid')==0 || ini_get('session.use_trans_sid')=='Off')?true:false;
}
public static function testZlib()
{
return function_exists('gzopen');
}
public function getWarning($name)
{
if (!isset($this->testWarnings[$name])) return false;
return $this->testWarnings[$name];
}
}

View File

@@ -0,0 +1,204 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stSetupTasks.class.php 13528 2011-06-08 09:57:46Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
require_once sfConfig::get('sf_symfony_lib_dir').'/vendor/pake/pakeGetopt.class.php';
require_once sfConfig::get('sf_symfony_lib_dir').'/vendor/pake/pakeApp.class.php';
/**
* Installation. Progress bar class.
*
* @package stUpdate
* @subpackage libs
*/
class stSetupTasks extends stInstallerTasks
{
/**
* Step.
*
* @param integer $step step number
* @return integer next step number (default $step+1)
*/
public function step($step)
{
$pakeweb = new stPakeWeb();
$task = '';
$i18n = sfContext::getInstance()->getI18N();
$offset = 1;
pakeApp::get_instance()->handle_options(SF_ENVIRONMENT == 'prod' ? '--quiet' : '--verbose');
switch ($step)
{
case 0:
$this->msg = $i18n->__('Czyszczenie plików tymczasowych', null, 'stInstallerWeb'); // opis krok do przodu
break;
case 1:
$this->msg = $i18n->__('Odświeżenie pamięci podręcznej aplikacji', null, 'stInstallerWeb'); // opis krok do przodu
if (class_exists('stLock'))
{
stLock::lock('frontend');
stLock::lock('backend');
}
// lock shop
$task = 'cc --lock=false';
break;
case 2:
$this->msg = $i18n->__('Kopiowanie plików', null, 'stInstallerWeb');
break;
case 3:
$this->msg = $i18n->__('Konfiguracja instalacji', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-sync';
break;
case 4:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Usuwanie starych plików', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'setup-update';
break; // database update
case 5:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie schematów XML', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-clean-model forced';
break;
case 6:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie klas modeli', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-convert-schema forced';
break;
case 7:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Generowanie zapytań SQL', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-build-model forced';
break;
case 8:
$this->msg = $i18n->__('Tworzenie modelu bazy danych - Aktualizacja struktury bazy danych', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-build-sql forced drop-tables';
break;
case 9:
$this->msg = $i18n->__('Czyszczenie plików tymczasowych', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'installer-insert-sql forced';
break;
case 10:
$this->msg = $i18n->__('Odświeżenie pamięci podręcznej aplikacji', null, 'stInstallerWeb'); // opis krok do przodu
$task = 'cc --lock=false';
break;
case 11:
$this->msg = $i18n->__('Wczytywanie danych', null, 'stInstallerWeb');
break;
case 12:
//$this->msg = $i18n->__('Ładowanie domyślnych danych. Uruchomienie sklepu', null, 'stInstallerWeb'); // opis krok do przodu
//sfLoader::loadPluginConfig();
//$task = 'installer-load-data '.SF_ENVIRONMENT;
break;
case 13:
if ($this->_installVerification())
{
// unlock shop
if (class_exists('stLock'))
{
stLock::unlock('frontend');
stLock::unlock('backend');
$this->cleanHistory();
}
}
break;
}
if (!empty($task))
{
if ($pakeweb->run($task))
{
if (!empty($pakeweb->content))
{
$this->log("\n".date('Y-m-d G:i:s')."\n".'symfony '.$task."\n".$pakeweb->content);
}
}
else
{
throw new Exception($pakeweb->error);
}
}
// // if applications didn't synchronize properly, repeat step
if ($task == 'installer-sync' && $this->_appsToSync())
{
$offset = 0;
}
if ($task == 'setup-update')
{
// rebuild robots.txt file
$this->robotsTxtUpate();
// rebuild web/.htaccess file
$this->_htaccess(true);
}
$this->delay($step == 0 ? 0 : 10);
return $step + $offset;
}
public function getTitle()
{
sfLoader::loadHelpers('I18N');
return __("Instalacja aplikacji (Uwaga! Nie zamykaj okna przeglądarki, aż instalacja się nie skończy):", null, 'stInstallerWeb');
}
public function getFatalMessage()
{
sfLoader::loadHelpers('I18N');
sfLoader::loadHelpers('Url');
sfLoader::loadHelpers('stUpdate');
return __('Wystąpił błąd podczas instalacji oprogramowania', null, 'stSetup').' '.st_program_name().', '.__('większość problemów można rozwiązać korzystając z', null, 'stSetup').
' <strong>'.link_to(__('podręcznika instalacji', null, 'stSetup'), __('http://www.sote.pl/trac/wiki/doc/soteshop_installation', null, 'stSetup'), array('target' => '_blank')).'</strong>';
}
public function close($opt=null)
{
$without_optimization = 0;
parent::close($without_optimization, false);
sfLoader::loadHelpers('Tag');
sfLoader::loadHelpers('Javascript');
$this->msg.="<script type=\"text/javascript\">document.getElementById('stSetup-install_actions').style.visibility=\"visible\";</script>";
}
/**
* Delete history files after installation.
*/
protected function cleanHistory()
{
$file = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.history.reg';
if (file_exists($file))
unlink($file);
}
/**
* Rebuild web/robots.txt
*/
protected function robotsTxtUpate()
{
$from = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'stPositioningPlugin'.DIRECTORY_SEPARATOR.
'stPositioningPlugin'.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'robots.txt';
$to = sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.'robots.txt';
copy($from, $to);
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stToken.php 3160 2010-01-26 13:30:27Z marek $
*/
/**
* Directory with tickets.
*/
if (!defined("INSTALL_CACHE_PATH")) define("INSTALL_CACHE_PATH", dirname(dirname(dirname(dirname(__FILE__)))).DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'cache');
/**
* Error message. Unable create ticket.
*/
if (!defined("CREATE_ERROR")) define("CREATE_ERROR", "Nie można utworzyć pliku ticketa");
/**
* Create hash.
*
* @return string
*/
function makeHash() {
$mt = microtime();
return md5($mt.rand(-2147483647,2147483647));
}
/**
* Create ticket file. Return file name.
*
* @return string
* @throws CREATE_ERROR
*/
function createToken() {
// if hash is duplicated create new hash
$filename = makeHash();
while (file_exists(INSTALL_CACHE_PATH.DIRECTORY_SEPARATOR.$filename)){
$filename = makeHash();
}
// create new ticket file
if (!touch(INSTALL_CACHE_PATH.DIRECTORY_SEPARATOR.$filename)) {
throw new Exception(CREATE_ERROR,1);
}else {
file_put_contents(INSTALL_CACHE_PATH.DIRECTORY_SEPARATOR.$filename,md5($filename));
}
// return ticket
return $filename;
}
/**
* Check if ticket exists.
*
* @param string $ticket
* @param boolean $unlink
* @return boolean
*/
function checkToken($ticket, $unlink = true) {
$filename = INSTALL_CACHE_PATH.DIRECTORY_SEPARATOR.$ticket;
if(file_exists($filename) && is_readable($filename)) {
$content = file_get_contents($filename);
// check ticket content
if ($content == md5($ticket)) {
if ($unlink) { return unlink($filename); }
}
}
return false;
}

View File

@@ -0,0 +1,22 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stUpdateConfig.class.php 17144 2012-02-16 13:17:40Z michal $
* @author Marcin Butlak <marcin.butlak@sote.pl>
*/
/**
* Configuration.
*
* @package stUpdate
* @subpackage libs
*/
class stUpdateConfig extends stConfig { }

View File

@@ -0,0 +1,57 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stUpdateLock.class.php 3160 2010-01-26 13:30:27Z marek $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Locking system for shop.
*
* @package stUpdate
* @subpackage libs
*/
class stUpdateLock
{
/**
* Check configuration.
*
* @return bool
*/
public static function check($app = SF_APP)
{
$file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'stLock'.ucfirst($app).'.lck';
if(file_exists($file)) return false;
return true;
}
/**
* Lock shop.
*
* @param string $app
*/
public static function lock($app = SF_APP)
{
$file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'stLock'.ucfirst($app).'.lck';
file_put_contents($file, '');
}
/**
* Unlock shop.
*
* @param string $app
*/
public static function unlock($app = SF_APP)
{
$file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'stLock'.ucfirst($app).'.lck';
@unlink($file);
}
}

View File

@@ -0,0 +1,167 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: actions.class.php 11168 2011-02-21 12:44:38Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* stInstallerWeb actions.
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage actions
*/
class stAuthActions extends sfActions
{
public function executeIndex()
{
$config = stConfig::getInstance(null, 'stLanguagePlugin');
$culture = $config->get('admin_language', null);
if (!is_null($culture)) $this->getUser()->setCulture($culture);
$config = stUpdateConfig::getInstance($this->getContext());
if($config->isEmpty())
{
try {
$db = new sfDatabaseManager();
$db->initialize();
$con = $db->getDatabase('propel')->getConnection();
$st = $con->prepareStatement("SELECT username, salt, password FROM sf_guard_user u, sf_guard_user_permission up, sf_guard_permission p WHERE u.id = up.user_id AND up.permission_id = p.id AND p.name = 'update'");
if ($st)
{
$rs = $st->executeQuery();
$users = array();
while($rs->next())
{
$row = $rs->getRow();
$users[] = $row;
}
$config->set('users', $users);
$config->save();
}
} catch (Exception $e) {
}
}
}
public function executeRegister()
{
$this->config = stUpdateConfig::getInstance($this->getContext());
$register = $this->config->load();
$this->register = $register;
}
public function executeRegisterSave()
{
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
$register = $this->getRequestParameter('register', array());
$this->config = stUpdateConfig::getInstance($this->getContext());
$this->config->set('email',$register['email']);
$this->config->set('password1',$register['password1']);
$this->config->save();
$this->redirect('stAuth/summary');
}
}
public function executeSummary()
{
$this->config = stUpdateConfig::getInstance($this->getContext());
$register = $this->config->load();
$this->register = $register;
}
public function handleErrorRegisterSave()
{
$this->forward('stAuth','register');
}
public function executeLogin()
{
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->redirect('stInstallerWeb');
}
}
public function executeLogout()
{
$this->getUser()->setAuthenticated(false);
$this->forward('stAuth','index');
}
public function handleErrorLogin()
{
$this->forward('stAuth','index');
}
public function validateLogin()
{
$error_exists = true;
$i18n = $this->getContext()->getI18N();
$register = $this->getRequestParameter('register', array());
$config = stUpdateConfig::getInstance($this->getContext());
foreach ($config->get('users') as $user)
{
if($user['password'] == $this->passwordHash(@$register['password1'], $user['salt']) && $user['username']==@$register['email'])
{
$error_exists = false;
break;
}
}
if ($error_exists)
{
$this->getRequest()->setError('register{email}', $i18n->__('Zły login lub hasło.'));
}
$this->getUser()->setAuthenticated(!$error_exists);
return !$error_exists;
}
protected function passwordHash($password, $salt)
{
return sha1($salt.$password);
}
}

View File

@@ -0,0 +1,9 @@
---
all:
.auto_generated:
config:
last_modified: 2008/12/15 17:29:55
fields:
email:
password1:
salt:

View File

@@ -0,0 +1,45 @@
<?php use_helper('Validation', 'I18N') ?>
<?php use_stylesheet('/css/update/stUpdateLogin.css?version=1'); ?>
<div id="sf_guard_container" align="center">
<img src="/images/update/layout/logo_sote.jpg" alt="">
<div id="sf_frame_login_middle">
<div id="background_frame_login">
<div id="frame_login">
<?php echo form_tag('stAuth/login', array('name'=>'register')) ?>
<fieldset>
<div class="form-row" id="sf_guard_auth_username">
<div id="sf_guard_auth_username_input">
<input type="text" name="register[email]" id="register_email" value="" placeholder="Login / e-mail">
<?php echo form_error('register[email]', array('suffix'=>'', 'prefix'=>'')); ?>
</div>
</div>
<div class="form-row" id="sf_guard_auth_password">
<div id="sf_guard_auth_username_input">
<input type="password" name="register[password1]" id="register_password1" value="" placeholder="<?php echo __('Hasło') ?>">
<?php echo form_error('register[password1]', array('suffix'=>'', 'prefix'=>'')); ?>
</div>
</div>
</fieldset>
<div id="submit_login">
<?php echo submit_tag(__('Zaloguj się'));?>
<div class="clear"></div>
</div>
</form>
</div>
</div>
</div>
<div id="sf_frame_login_bottom"></div>
<div class="clear"></div>
</div>
<div class="site_address"><?php echo __('odwiedź stronę sklepu', null, 'sfGuardUser').': ' ?><a href="http://<?php echo $sf_request->getHost() ?>" target="_blank"><?php echo $sf_request->getHost() ?></a></div>

View File

@@ -0,0 +1,18 @@
<?php use_helper('Validation') ?>
<?php echo form_tag('stAuth/registerSave', array('name'=>'register')) ?>
<?php echo "Login:" ?>
<?php echo form_error('register[email]', array('suffix'=>'', 'prefix'=>'')); ?>
<?php echo input_tag('register[email]', $sf_data->get('sf_params')->get('register[email]')) ?>
<br/>
<?php echo "Hasło:" ?>
<?php echo form_error('register[password1]', array('suffix'=>'', 'prefix'=>'')); ?>
<?php echo input_password_tag('register[password1]', $sf_data->get('sf_params')->get('register[password1]')) ?>
<br/>
<?php echo "Powtórz hasło:" ?>
<?php echo form_error('register[password2]', array('suffix'=>'', 'prefix'=>'')); ?>
<?php echo input_password_tag('register[password2]', $sf_data->get('sf_params')->get('register[password2]')) ?>
<?php echo submit_tag() ?>
</form>

View File

@@ -0,0 +1,6 @@
<?php
echo "<pre>";
print_r($register);
echo "</pre>";
?>

View File

@@ -0,0 +1,15 @@
fields:
register{email}:
required:
msg: Nie podałeś adresu email.
sfEmailValidator:
email_error: Nieprawidłowy format adresu e-mail.
register{password1}:
required:
msg: Nie podałeś hasła.
sfStringValidator:
min: 6
min_error: Podane hasło jest za krótkie min. 6 znaków.

View File

@@ -0,0 +1,35 @@
fields:
register{email}:
required:
msg: Nie podałeś adresu email.
sfEmailValidator:
email_error: Nieprawidłowy format adresu e-mail.
sfStringValidator:
max: 30
max_error: Przekroczono dozwoloną liczbę znaków.
register{password1}:
required:
msg: Nie podałeś hasła.
sfStringValidator:
min: 6
min_error: Podane hasło jest za krótkie min. 6 znaków.
max: 20
max_error: Przekroczono dozwoloną długość hasła, maksimum 20 znaków.
register{password2}:
required:
msg: Nie podałeś hasła.
sfStringValidator:
min: 6
min_error: Podane hasło jest za krótkie min. 6 znaków.
max: 20
max_error: Przekroczono dozwoloną długość hasła, maksimum 20 znaków.
sfCompareValidator:
check: register[password1]
compare_error: Hasła nie są takie same.

View File

@@ -0,0 +1,40 @@
<?php
class stCommunicationActions extends sfActions {
public function executeSoap() {
$this->setLayout(false);
$server = new stCommunicationShopSoapServer();
$s = new SoapServer(null, array('uri' => ''));
$s->setObject($server);
$s->handle();
}
public function executeCheck() {
if ($this->getRequestParameter('forced', false))
stCommunicationCache::disableCache();
if (stLicenseAbuse::checkLicenseAbuseStatus()) {
stLicenseAbuse::checkLicenseAndDomain();
}
if ($this->getRequestParameter('forced', false))
stCommunicationCache::enableCache();
file_put_contents(sfConfig::get('sf_data_dir') . '/.phpversion', phpversion());
exit('done');
}
public function executeCheckVersion() {
stCommunication::refreshLicenseInformation();
stPear::runPearCommand('clear-cache');
stPartialCache::clear('stBackend', '_updateInfo', array('app' => 'backend'));
sfLoader::loadHelpers('stUpdate');
exit(get_shop_version());
}
}

View File

@@ -0,0 +1,6 @@
soap:
is_secure: off
check:
is_secure: off
all:
is_secure: on

View File

@@ -0,0 +1,22 @@
<?php
class stCommunicationShopSoapServer {
public function getLicenseVerificationCode($shopId, $key) {
if (stLicenseExt::getShopId() != $shopId) return -100;
$code = stLicenseAbuse::getVerificationCode($key);
if ($code)
return $code;
else
return -50;
}
public function checkLicenseAbuseStatus($shopId) {
if (stLicenseExt::getShopId() != $shopId) return -100;
stCommunicationCache::disableCache();
$ret = stLicenseAbuse::checkLicenseAbuseStatus();
stCommunicationCache::enableCache();
return $ret;
}
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: actions.class.php 10660 2011-01-30 12:54:51Z marek $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* stDevelActions
*
* @package stUpdate
* @subpackage actions
*/
class stDevelActions extends sfActions
{
public function preExecute()
{
if (stConfig::getInstance('stRegister')->get('demo'))
{
return $this->forward404();
}
}
public function executePhpInfo()
{
$iframe=$this->getRequestParameter('iframe');
if (! empty($iframe))
{
$this->iframe=1;
$this->setLayout(false);
} else {
$this->iframe_uri=$this->getRequest()->getUri().'/iframe/1';
$this->iframe=0;
}
}
public function executeDevel()
{
$this->hostname = sfContext::getInstance()->getRequest()->getHost();
$apps = array('index'=>'frontend', 'backend'=>'backend', 'update'=>'update');
$this->stWebRequest = new stWebRequest();
$this->hasDevel = false;
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
if ($this->getRequest()->hasParameter('devel[devel]'))
{
if ($this->getRequest()->getParameter('devel[devel]') == 1)
{
$ip = $this->getRequest()->getParameter('devel[ip]');
$content_head = "<?php\nif(\$_SERVER['REMOTE_ADDR'] != '$ip') die();?>";
foreach($apps as $file=>$app)
{
$app_web=sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.$file.'.php';
$app_web_devel=sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.$app.'_dev.php';
$app_web_content=file_get_contents($app_web);
$content=$this->setDevel($content_head.$app_web_content);
file_put_contents($app_web_devel, $content);
}
}
} else {
foreach($apps as $file=>$app)
{
$file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.$app.'_dev.php';
@unlink($file);
}
}
}
foreach($apps as $app)
{
$file = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.$app.'_dev.php';
if (file_exists($file)) $this->hasDevel = true;
}
// @todo ass set hasBeta
}
/**
* Change files web/{$app}.php to developer mode.
*
* @param string $app
* @return string
*/
private function setDevel($content)
{
$content=str_replace("define('SF_ENVIRONMENT', 'prod')","define('SF_ENVIRONMENT', 'dev')",$content);
$content=str_replace("define('SF_DEBUG', false)","define('SF_DEBUG', true)",$content);
return $content;
}
}

View File

@@ -0,0 +1,2 @@
all:
is_secure: on

View File

@@ -0,0 +1,55 @@
<?php use_helper('stUpdate') ?>
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1'); ?>
<?php use_stylesheet('/css/update/stDevel.css?version=1'); ?>
<?php echo get_partial('stInstallerWeb/menu_top');?>
<div id="frame_update">
<?php echo get_partial('stInstallerWeb/menu_tools',array('selected'=>'devel'));?>
<div class="box_content">
<h2 class="title"><?php echo __('Tryb developerski', null, 'stInstallerWeb');?></h2>
<div class="content_update_box">
<div>
<h2 class="subhead_txt_module"><?php echo __('Ustawienia trybu developerskiego')?></h2>
</div>
<br />
<div id="stDevel_form">
<?php echo form_tag('devel/devel', array('id' => 'sf_admin_config_form', 'name' => 'sf_admin_config_form'));?>
<div class="main">
<div class="row">
<div class="column" id="txt1"><?php echo __('Adres IP');?>:</div>
<div class="column"><?php echo input_tag('devel[ip]',$stWebRequest->getRemoteAddress());?></div>
</div>
<div class="row">
<div class="column" id="txt2"><?php echo __('Włącz tryb developerski');?>:</div>
<div class="column"><?php echo checkbox_tag('devel[devel]',1,$hasDevel);?></div>
</div>
<div id="frame_buttons">
<?php echo st_get_update_actions_head('style="float:left"') ?>
<?php echo st_get_update_action('save', __('Zapisz')) ?>
<?php echo st_get_update_action('more', __('PHPINFO'), 'stDevel/phpInfo') ?>
<?php echo st_get_update_actions_foot() ?>
</div>
</div>
</form>
<br />
<?php if ($hasDevel): ?>
<?php echo __('Linki do stron w trybie developerskim dostępne tylko dla wskazanego IP:') ?>
<table style="margin-bottom: 15px;">
<tr>
<td>
<?php echo __('Sklep:')?>
</td>
<td><a href="<?php echo "http://$hostname/frontend_dev.php" ?>" target="frontend"><?php echo __('http://'.$hostname.'/frontend_dev.php')?></a></td>
</tr>
<tr>
<td><?php echo __('Panel sklepu:')?></td>
<td><a href="<?php echo "http://$hostname/backend_dev.php" ?>" target="frontend"><?php echo __('http://'.$hostname.'/backend_dev.php')?></a></td>
</tr>
</table>
<?php endif ?>
</div>
</div>
</div>
<div class="clear"></div>
</div>

View File

@@ -0,0 +1,23 @@
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1');?>
<?php if($iframe == true):?>
<html>
<body style="background-color: #fff;">
<?php phpinfo();?>
</body>
</html>
<?php else:?>
<?php echo get_partial('stInstallerWeb/menu_top');?>
<div id="frame_update">
<?php echo get_partial('stInstallerWeb/menu_tools', array('selected' => 'devel'));?>
<div class="box_content">
<h2 class="title"><?php echo __('Tryb developerski', null, 'stInstallerWeb');?></h2>
<h2 class="subhead_txt_module"><?php echo __('PHPINFO');?></h2>
<div class="content_update_box">
<iframe src="<?php echo $iframe_uri;?>" width="888" height="600" style="border: 1px solid #ddd; margin-bottom: 10px;">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
</div>
<div class="clear"></div>
</div>
<?php endif;?>

View File

@@ -0,0 +1,928 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: actions.class.php 17106 2012-02-14 15:49:20Z michal $
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
// define ("ST_MIN_EXECUTION_TIME",20); // minimalny czas potrzebny do wykonania aktualizacji
// define ("ST_MIN_EXECUTION_TIME_APP",0.1); // minimalny dodatkowy czas aktualizacji 1 pakietu
/**
* stInstallerWeb actions.
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage actions
*/
class stInstallerWebActions extends sfActions
{
public function preExecute()
{
$action = $this->getModuleName().'/'.$this->getActionName();
$checkRequirements = new stCheckRequirements();
$ignore = $this->getUser()->getAttribute('ignore', false, 'soteshop/stUpdate');
if (!$ignore && !in_array($action, array('stInstallerWeb/requirements', 'stInstallerWeb/tools', 'stInstallerWeb/history', 'stInstallerWeb/verifyall')) && !$this->getRequest()->isXmlHttpRequest() && !$checkRequirements->testAll())
{
return $this->redirect('stInstallerWeb/requirements');
}
if (!$this->getRequest()->isXmlHttpRequest() && !in_array($action, array('stInstallerWeb/news', 'stInstallerWeb/tools', 'stInstallerWeb/history', 'stInstallerWeb/verifyall')) && (!stCommunication::getUpgradeExpirationDate() || time() > stCommunication::getUpgradeExpirationDate() || stLicense::isOpen())) {
return $this->redirect('@installerweb?action=news');
}
}
public function executeAdditionalApplications()
{
$config = stConfig::getInstance('stUpdate');
$applications = stApplication::getAdditionalApplications();
$applicationNames = array_keys($applications);
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
$active = array();
if ($this->hasRequestParameter('disable_all'))
{
$active = array();
}
elseif ($this->hasRequestParameter('enable_all'))
{
$active = $applicationNames;
}
else
{
$application = $this->getRequestParameter('application');
foreach ($applicationNames as $name)
{
if (isset($application[strtolower($name)]))
{
$active[] = $name;
}
}
}
$config->set('active_applications_' . SF_ENVIRONMENT, $active);
$config->save();
file_put_contents(sfConfig::get('sf_data_dir') . '/.disabled_applications_' . SF_ENVIRONMENT, implode("\n", array_diff($applicationNames, $active)));
$pakeweb = new stPakeWeb();
$pakeweb->run('cc');
}
$this->active = $config->get('active_applications_' . SF_ENVIRONMENT, $applicationNames);
$this->applications = $applications;
}
/**
* Executes index action
*/
public function executeIndex()
{
$server = new stNewServer();
if ($server->newServer())
{
$this->redirect('installerweb/newServer');
} else
{
$this->redirect('installerweb/news');
}
}
/**
* Execute newServer action
*/
public function executeNewServer()
{
$pakeweb = new stPakeWeb();
$pakeweb->run('cc');
$server = new stNewServer();
$server->update();
}
/**
* List of installed applications.
*/
public function executeList() {
$stRegisterSync = new stRegisterSync();
$this->content = $stRegisterSync->getSynchronizedApps();
}
/**
* List of PEAR installer applications.
*/
public function executeListpear() {
$this->content = stPear::getInstalledPackages();
}
public function executeRequirements() {
if ($this->hasRequestParameter('ignore'))
{
$this->getUser()->setAttribute('ignore', true, 'soteshop/stUpdate');
return $this->redirect('@homepage');
}
$this->tests = new stCheckRequirements();
$this->testsPassed = $this->tests->testAll();
$this->testsStatus = $this->tests->getTest();
$this->hasWarning = false;
}
public function executeSoteshop6() {
$smFolders = glob(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'packages'.DIRECTORY_SEPARATOR.'sm*');
$tmp = $smFolders;
foreach($tmp as $key => $smFolder) if (preg_match('/sm[A-Za-z0-9]{0,}Theme/', $smFolder)) unset($smFolders[$key]);
$this->error = false;
if ($smFolders) $this->error = true;
}
/**
* Executes updatelist action
* If list contains stUpdate, show only stUpdate.
*/
public function executeUpgradeList() {
if ($this->getRequestParameter('ajax'))
$ajax = TRUE;
else
$ajax = FALSE;
if($ajax == FALSE && !$this->getRequest()->hasParameter('confirm')) {
$packageFile = sfConfig::get('sf_root_dir').'/packages/soteshop_base/package.yml';
if (file_exists($packageFile)) {
$package = sfYaml::load($packageFile);
if(version_compare($package['package']['version'], '6.0.0', '<'))
return $this->forward('stInstallerWeb', 'soteshop6');
} else
return $this->forward('stInstallerWeb', 'soteshop6');
}
if ($ajax == FALSE) {
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check())
$this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check())
$this->redirect('stInstallerWeb/checkTheme');
}
$this->packages = stPear::getPackagesToUpgrade();
if (is_array($this->packages) && !empty($this->packages)) {
$this->hasPackages = TRUE;
if (array_key_exists('stUpdate', $this->packages)) {
$this->hasInstaller = TRUE;
$this->installerVersion = $this->packages['stUpdate'];
$this->packages = array('stUpdate' => $this->installerVersion);
} else
$this->hasInstaller = FALSE;
} else
$this->hasPackages = FALSE;
$this->packagesCount = count($this->packages);
if($ajax) {
$this->setLayout(FALSE);
$this->setTemplate('upgradeListAjax');
}
sfLoader::loadHelpers('stArray', 'stInstallerPlugin');
$sync = st_array_diff(stRegisterSync::getSynchronizedApps(), stPear::getInstalledPackages());
if(in_array('stUpdate', $sync['all'])) {
$this->hasPackages = FALSE;
$this->packagesCount = 0;
}
}
/**
* Application list for synchronization.
*/
public function executeSyncList()
{
// check if this action is embeded
$ajax=$this->getRequestParameter('ajax');
if (! empty($ajax))
{
$this->setLayout(false);
$this->setTemplate('syncListAjax');
}
if (!$this->getRequest()->hasParameter('ajax')) {
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check()) $this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check()) $this->redirect('stInstallerWeb/checkTheme');
}
sfLoader::loadHelpers('stArray', 'stInstallerPlugin');
$apps_sync = st_array_diff(stRegisterSync::getSynchronizedApps(), stPear::getInstalledPackages());
$this->apps=$apps_sync;
$this->ajax_num=sizeof($this->apps['all']); // menu info
$this->linkToDownloadPackage = false;
if (!$this->checkPackageRegFile())
{
$this->linkToDownloadPackage = true;
$this->ajax_num=0; // menu info
}
}
public function executeAjaxCheckPackageStatus()
{
sfLoader::loadHelpers('stArray', 'stInstallerPlugin');
$packagesToUpgrade = 0;
$packagesToInstall = 0;
$applications = st_array_diff(stRegisterSync::getSynchronizedApps(), stPear::getInstalledPackages());
if ($this->checkPackageRegFile())
{
$packagesToInstall = count($applications['all']);
}
if(!in_array('stUpdate', $applications['all']))
{
$packages = stPear::getPackagesToUpgrade();
if ($packages)
{
if (array_key_exists('stUpdate', $packages))
{
$packagesToUpgrade = 1;
}
else
{
$packagesToUpgrade = count($packages);
}
}
}
$this->getResponse()->setContentType('application/json');
return $this->renderText(json_encode(array(
'packagesToInstall' => $packagesToInstall,
'packagesToUpgrade' => $packagesToUpgrade,
)));
}
/**
* Reboot.
*
* @param bool $check true - verify number packahes for upgrade, false - do not verify
*/
public function executeReboot($check=true)
{
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check()) $this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check()) $this->redirect('stInstallerWeb/checkTheme');
// Zweryfikuj czas potrezbny do wykonania akcji
// Pobierz ilosc aplikacji do instalacji
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
$npkg=sizeof($apps_sync['all']);
if ((! $npkg>0) && ($check)) $this->redirect('installerweb');
// deprecated
// $time = new stServerExecutionTime();
// $time->setMax(($npkg*ST_MIN_EXECUTION_TIME_APP)+ST_MIN_EXECUTION_TIME);
// if ($time->check())
// {
// $this->time=true;
// } else {
// $this->time=false;
// $this->time_server=$time->getServerTime();
// $this->time_min=$time->getMax();
// }
$this->time=true; // added for previous versions of template
$this->linkToDownloadPackage = false;
if (!$this->checkPackageRegFile()) $this->linkToDownloadPackage = true;
}
/**
* Rescue.
*/
public function executeRescue()
{
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check()) $this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check()) $this->redirect('stInstallerWeb/checkTheme');
// force unlock downloads
stPackageDownloader::unlockPackagesList();
if (stLockUpdate::isLocked())
{
$this->executeReboot(false);
$this->setTemplate('reboot');
} else
{
$this->redirect('stInstallerWeb/news');
}
// $this->executeReboot(false);
// $this->setTemplate('reboot');
}
/**
* Rescure Reboot.
*/
public function executeRescueReboot()
{
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check()) $this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check()) $this->redirect('stInstallerWeb/checkTheme');
// if (stLockUpdate::isLocked())
// {
$this->executeReboot(false);
$this->setTemplate('reboot');
// } else
// {
// $this->redirect('stInstallerWeb/news');
// }
}
/**
* Synchronize downloaded applications.
*/
public function executeSync()
{
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
// application list for synchronization
$this->apps=$apps_sync;
$installer = new stInstaller('web');
$ui = new stInstallerOutputWeb();
$installer->setOutputObject($ui);
if (! empty($apps_sync['all']))
{
// synchornize
$installer->sync($apps_sync['all'],'Synchronization ('.sizeof($apps_sync['all']).')');
}
else {
// nothing to do
}
}
/**
* Code verification.
* Find user unautorized modifications.
*/
public function executeVerify()
{
$this->tests = new stCheckRequirements();
if (!stCheckBrowser::check()) $this->redirect('stInstallerWeb/checkBrowser');
if (!stCheckTheme::check()) $this->redirect('stInstallerWeb/checkTheme');
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
$this->apps=array_merge($apps_sync['changed'],$apps_sync['added']);
$npkg_all=sizeof($apps_sync['all']);
$npkg_changed=sizeof($this->apps);
$npkg_del=sizeof($apps_sync['deleted']);
$this->npkg=$npkg_changed;
if (! $npkg_all>0) {
$this->redirect('installerweb');
}
$this->linkToDownloadPackage = false;
if (!$this->checkPackageRegFile()) $this->linkToDownloadPackage = true;
}
/**
* Symfony Web task execution.
*/
public function executeTask()
{
$this->task=$this->getRequestParameter('task');
$this->content='';
$this->error='';
if (! empty($this->task))
{
$pakeweb = new stPakeWeb();
$pakeweb->run($this->task);
$this->content=$pakeweb->content;
$this->error=$pakeweb->error;
if($this->task == 'pear cc')
stPearCache::removeCache();
}
}
/**
* Symfony cc
*/
public function executeCc()
{
$pakeweb = new stPakeWeb();
$pakeweb->run('cc');
$this->content=$pakeweb->content;
$this->error=$pakeweb->error;
}
/**
* Upgrade provided Applications.
*/
public function executeUpgradeBySteps()
{
if (!$this->getRequestParameter('package') || !$this->getRequestParameter('version'))
{
$this->redirect('stInstallerWeb/upgradeList');
} else {
$package = $this->getRequestParameter('package');
$version = $this->getRequestParameter('version');
stPackageDownloader::setUpgradeType('package', $package, $version);
}
}
/**
* Upgrade all applications.
*/
public function executeUpgradeAllBySteps()
{
stPackageDownloader::setUpgradeType('all');
}
public function executeListUpgrade() {
$this->packages = stPear::getPackagesToUpgrade(TRUE);
}
public function executeUploadDev()
{
}
/**
* Package upload.
*/
public function executeUpload() {
if (stConfig::getInstance('stRegister')->get('demo'))
{
return $this->forward404();
}
stRegisterSync::fixmd5sum();
$this->error = '';
$this->notice = '';
$this->content = '';
if ($this->getRequest()->getMethod() == sfRequest::POST && $this->hasRequestParameter('upload')) {
$upload = $this->getRequestParameter('upload');
$upload['file'] = $this->getRequest()->getFileName('upload[file]');
if (!isset($upload['file']) || (isset($upload['file']) && empty($upload['file']))) {
$this->error = 'Brak pakietu do instalacji.';
return sfView::SUCCESS;
}
$fileDir = sfConfig::get('sf_root_dir').'/install/cache';
$filePath = $fileDir.'/'.$upload['file'];
$this->getRequest()->moveFile('upload[file]', $filePath);
if (isset($upload['forced']) && $upload['forced'] == 1) $forced = true; else $forced = false;
if (isset($upload['nodeps']) && $upload['nodeps'] == 1) $nodeps = true; else $nodeps = false;
if(!class_exists('Archive_Tar')) {
$pearlib = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'pear'.DIRECTORY_SEPARATOR.'php';
if (is_dir($pearlib)) ini_set('include_path', '.:'.$pearlib.':'.ini_get('include_path'));
include('Archive'.DIRECTORY_SEPARATOR.'Tar.php');
}
if(file_exists($fileDir.'/package.xml'))
unlink($fileDir.'/package.xml');
$tar = new Archive_Tar($filePath, true);
$extract = $tar->extractList(array('package.xml'), $fileDir);
if (!$extract || ($extract && !file_exists($fileDir.'/package.xml'))) {
$this->error = 'Niepoprawny format pliku.';
return sfView::SUCCESS;
}
$xml = simplexml_load_file($fileDir.'/package.xml');
// Sprawdzenie czy ładowany pakiet jest w wersji beta czy stable
// Porównanie z wersją sklepu. Sklep sable przyjmuje tylkopakiety stable. Sklep beta przyjmuje i stable i beta.
// Informacja zawarta w xml
// $xml[stability] => SimpleXMLElement Object
// (
// [release] => stable
// [api] => stable
// )
$upload_file_state = $xml->stability->release;
if (($upload_file_state == "beta") && stCommunication::getVersionStability() != stCommunication::STABILITY_BETA) // pakiet beta i sklep stable
{
$this->error = 'Niepoprawna wersja pakietu'.$packageName.'.';
return sfView::SUCCESS;
}
$installed = stPear::getInstalledPackages();
if (!$nodeps)
{
foreach ($xml->dependencies->required->package as $package) {
$packageName = (string)$package->name;
$packageVersion = (string)$package->min;
if (isset($installed[$packageName])) {
if (!version_compare($installed[$packageName], $packageVersion, '>=')) {
$this->error = 'Brak zainstalowanego pakietu '.$packageName.' w wersji '.$packageVersion.'.';
return sfView::SUCCESS;
}
} else {
$this->error = 'Brak zainstalowanego pakietu '.$packageName.'.';
return sfView::SUCCESS;
}
}
}
$name = (string)$xml->name;
list($name, $versionWithExt) = explode('-', $upload['file']);
$response = stWebStore::checkPackage($name, (isset($upload['code']) ? $upload['code'] : ''));
switch ($response)
{
case 0:
if (!preg_match('/^st|sm/', $name)) {
$this->error = 'Brak połączenia z serwerem sote.pl.';
return sfView::SUCCESS;
}
case 1:
break;
case 2:
$this->error = 'Nieprawidłowy kod aktywacji.';
return sfView::SUCCESS;
case 3:
$this->error = 'Kod aktywacji został już wykorzystany.';
return sfView::SUCCESS;
case 4:
$this->error = 'Aplikacja została zakupiona dla innego sklepu.';
return sfView::SUCCESS;
}
if ($forced)
$command = 'force-install';
else
$command = 'upgrade';
$this->content = stPear::runPearCommand(array('command' => $command, 'parameters' => array($filePath), 'options' => array('forced' => $forced, 'nodeps' => $nodeps)), 'raw', true);
if (preg_match('/Invalid tgz file/', $this->content)) {
$this->error = 'Niepoprawny format pliku.';
return sfView::SUCCESS;
}
if (preg_match('/install ok/', $this->content) || preg_match('/upgrade ok/', $this->content)) {
$this->notice = 'Plik został wgrany.';
stWebStore::activatePackage($name, (isset($upload['code']) ? $upload['code'] : ''));
} else
$this->error = 'Błąd podczas wgrywania pliku.';
return sfView::SUCCESS;
}
}
/**
* Page not found message.
*/
public function executePageNotFound()
{
}
/**
* Upgrade history.
*/
public function executeHistory()
{
$history = new stInstallerHistory();
$this->history_apps = array_reverse($history->getHistory());
}
/**
* RSS upgrade.
*/
public function executeRss()
{
}
/**
* Expert tools.
*/
public function executeTools()
{
// Check if optimization can be executed
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
$this->optimization=true;
if (! empty($apps_sync['all'])) $this->optimization=false; // there are apps in install/src
if (stLockUpdate::isLocked()) $this->optimization=false; // install process is executed
}
/**
* Verify all code.
*/
public function executeVerifyall()
{
$peari = new stPearInfo();
$packages = $peari->getPackages();
$this->count=sizeof($packages);
}
public function executeOptimization()
{
$this->executeCc();
}
/**
* Symfony pear clear-cache
*/
public function executePearcc() {
stPear::runPearCommand('clear-cache');
}
/**
* Set preffered_state = beta
*/
public function executeSetbeta() {
stCommunication::refreshLicenseInformation();
if (!stCommunication::getIsDevel())
{
return $this->forward404();
}
$command = array("command"=>"config-set","parameters"=>array("preferred_state","beta"));
stPear::runPearCommand($command);
stCommunication::refreshLicenseInformation();
stPear::runPearCommand('clear-cache');
stPartialCache::clear('stBackend', '_updateInfo', array('app' => 'backend'));
}
/**
* Set preffered_state = stable
*/
public function executeSetstable() {
stCommunication::refreshLicenseInformation();
if (!stCommunication::getIsDevel())
{
return $this->forward404();
}
$command = array("command"=>"config-set","parameters"=>array("preferred_state","stable"));
stPear::runPearCommand($command);
stCommunication::refreshLicenseInformation();
stPear::runPearCommand('clear-cache');
stPartialCache::clear('stBackend', '_updateInfo', array('app' => 'backend'));
}
/**
* Symfony pear config-set preferred_state
*/
public function executePearstate() {
if (!stCommunication::getIsDevel())
{
return $this->redirect404();
}
$this->isStable = true;
if ($this->getRequest()->getMethod() == sfRequest::POST) {
if (in_array($state = $this->getRequest()->getParameter('pear[state]'), array('stable', 'beta'))) {
if ($state == 'beta')
$this->isStable = false;
stPear::runPearCommand(array('command' => 'config-set', 'parameters' => array('preferred_state', $state, 'user')), null, true);
}
} else {
$state = stPear::runPearCommand(array('command' => 'config-get', 'parameters' => array('preferred_state')) );
if (!preg_match('/stable/', $state))
$this->isStable = false;
}
stPear::runPearCommand($command);
stCommunication::refreshLicenseInformation();
stPear::runPearCommand('clear-cache');
stPartialCache::clear('stBackend', '_updateInfo', array('app' => 'backend'));
}
public function executeNews()
{
// News Action
$this->showNews = true;
if ($this->getUser()->getCulture() == 'en_US') $this->showNews = false;
}
/**
* Show information about changelog.
* If any application has important message or required confirmation this action show it.
*/
public function executeChangelog()
{
$changelog = new stChangelog();
if (! $changelog->isAnyActive())
{
$this->redirect('installerweb/verify');
$this->active="NOT ACTIVE"; // debug value
return;
} else
{
$this->active="ACTIVE"; // debug value
}
$this->files = $changelog->getAllFiles();
$this->apps = $changelog->getPearUpgrades();
$this->new = $changelog->getSyncUpgrades();
$this->active_contents = $changelog->getActiveContents();
if (empty($this->active_contents))
{
$this->redirect('installerweb/verify');
return;
}
$this->result = $changelog->getResult();
$this->smarty_changed = $changelog->isSmartyChanged();
$this->smarty_theme = $changelog->getSmartyTheme();
$this->confirmation=false;
foreach ($this->result as $priority=>$content)
{
if ($priority=="P1") $this->confirmation=true;
foreach ($content as $app=>$content2)
{
$ret[$priority][$app]=$changelog->getUpdateContent($app,$content2,$priority);
}
}
$this->output=$ret;
if ($this->smarty_changed)
{
$smarty_changelog = stChangelogSmarty::getInstance();
$this->backup_token = $smarty_changelog->doBackup();
$this->smarty_files = $smarty_changelog->getAllFiles();
}
}
/**
* Download backup
*/
public function executeBackup()
{
$token = $this->getRequestParameter('token');
$this->token=$token;
$this->raw_content=NULL;
if (! empty($token))
{
$backup = stUpdateBackup::getInstance();
$backup_file = $backup->getBackupFile($token);
if (! empty($backup_file))
{
$raw_content=file_get_contents(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$backup_file);
$this->setLayout(false);
$response = $this->getContext()->getResponse();
$response->setContentType("application/octet-stream");
$response->setHttpHeader('Content-Disposition', 'attachment; filename="'.basename($backup_file).'"');
return $this->renderText($raw_content);
}
}
}
/**
* Check .packages.reg file
*/
protected function checkPackageRegFile()
{
$file = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR."install".DIRECTORY_SEPARATOR."db".DIRECTORY_SEPARATOR.".packages.reg";
if(file_exists($file))
{
$packages = unserialize(file_get_contents($file));
if (empty($packages)) $unlink = true;
else {
$unlink = true;
foreach ($packages as $package => $status) if ($status != 'installed') $unlink = false;
}
if ($unlink) unlink($file);
return $unlink;
}
return true;
}
public function executeInstallPackage() {
if ($this->getRequest()->hasParameter('package')) {
$package = $this->getRequest()->getParameter('package');
if (stWebStore::checkPackage($package) == 1) {
stPear::runPearCommand(array('command' => 'upgrade', 'parameters' => array(stPearCurl::getChannel().'/'.$package), 'options' => array('nodeps' => true)), 'raw', true);
stWebStore::activatePackage($package);
stWebStore::increaseDownloadCount($package);
$this->setFlash('notice', 'Pakiet został pobrany.');
return $this->redirect('stWebStore/index');
} else {
return $this->redirect('@homepage');
}
} else {
return $this->redirect('@homepage');
}
}
public function executeCheckTheme() {
$this->check = stCheckTheme::check();
}
public function executeCheckBrowser() {
$this->check = stCheckBrowser::check();
}
public function executeAjaxHomepageStatus() {
$this->setLayout(FALSE);
$toDownloadApps = count(stPear::getPackagesToUpgrade());
sfLoader::loadHelpers('stArray', 'stInstallerPlugin');
$appsToSync = st_array_diff(stRegisterSync::getSynchronizedApps(), stPear::getInstalledPackages());
$toInstallApps = 0;
foreach ($appsToSync as $value)
$toInstallApps =+ count($value);
if (!$this->checkPackageRegFile()) $toInstallApps = 0;
$this->status = 'PACKAGES_FOUND';
if ($toDownloadApps == 0 && $toInstallApps == 0) $this->status = 'NOTHING_TO_UPGRADE';
$upgradeServiceTime = stCommunication::getUpgradeExpirationDate();
$this->isSeven = stCommunication::getIsSeven();
if ($upgradeServiceTime !== FALSE) {
if(time() > $upgradeServiceTime) {
$upgradeServiceTime = stCommunication::getUpgradeExpirationDate(null, 30);
if(time() > $upgradeServiceTime) {
$this->status = 'UPGRADE_SERVICE_NOT_ACTIVE';
$this->days = 14 - round((time() - $upgradeServiceTime) / 86400);
$this->upgradeServiceTime = date('d.m.Y', $upgradeServiceTime);
}
}
} else
$this->status = 'SOTE_CONNECTION_ERROR';
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage configs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: config.php 3160 2010-01-26 13:30:27Z marek $
* @author Marek Jakubowiucz <marek.jakubowicz@sote.pl>
*/
#stPluginHelper::addEnableModule('stInstallerWeb', 'update');
//stPluginHelper::addRouting('stInstallerWebPlugin', '/installerweb/:action/*','stInstallerWeb', null, 'update'); // routing przekierowujący każdą akcje
//stPluginHelper::addRouting('stInstallerWebPluginDefault', '/installerweb', 'stInstallerWeb', 'upgradelist', 'update'); // domyślny routing

View File

@@ -0,0 +1,2 @@
all:
is_secure: on

View File

@@ -0,0 +1,25 @@
verify:
ignore:
- config/propel.ini
- config/databases.yml
- lib/model/om
- lib/model/map
- web/errors
- config/verify.yml
- plugins/stInstallerPlugin
- apps/backend/modules/stOrder/lib/stModuleWebApi.class.php
- data/fixtures/sfGuardUser.yml
- ignore.yml
- StMysqlDDLBuilder.php
- pear/
- schema.xml
fix:
soteshop:
5.0.0:
- plugins/stAdminGeneratorPlugin/data/generator/sfPropelAdmin/simple/template/lib/stModuleImportExport.class.php
- plugins/stAvailabilityPlugin/modules/stAvailabilityFrontend/templates/_availability.php
- web/errors/error500.php
5.0.1:
- plugins/stAdminGeneratorPlugin/data/generator/sfPropelAdmin/simple/template/lib/stModuleImportExport.class.php

View File

@@ -0,0 +1,358 @@
<?php
/**
* Changelog class
* Checking system befora installation
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Changlog
*/
class stChangelog
{
/**
* @var bool List of changelog.yml files in install/src
*/
var $changelog_files=NULL;
/**
* @var bool true if templates smarty are changed
* Method smartyTemplatesChanged is defined in changelog.yml
*/
var $smarty_changed=false;
/**
* Constructor
*/
function __construct()
{
$this->apps_new = $this->readSyncUpgrades();
$this->apps_pear = $this->readPearUpgrades();
$this->files = $this->readAllFiles();
$this->active_contents = $this->readActiveContents();
}
/**
* get all changelog files
*/
protected function readAllFiles()
{
$install_dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src';
$apps=$this->getSyncUpgrades();
$files=array();
foreach ($apps as $app)
{
$file = $install_dir.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'packages'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'changelog.yml';
if (file_exists($file))
{
$files[$app]=$file;
}
}
if (! empty($files)) return $files;
else return NULL;
}
/**
* Return all changelog.yml files
*/
public function getAllFiles()
{
return $this->files;
}
/**
* Read sync list
* @return arra return
*/
protected function readPearUpgrades() {
$result = array();
$newPackages = $this->getSyncUpgrades();
foreach (stPear::getInstalledPackages() as $package => $version)
if (in_array($package, $newPackages))
$result[$package] = $version;
return $result;
}
/**
* Get pear list
* @return array
*/
public function getPearUpgrades()
{
return $this->apps_pear;
}
/**
* Get PEAR version for the app
*
* @param string $app Application
* @return string Version
*/
protected function getPearVersion($app)
{
if (! empty($this->apps_pear[$app])) return $this->apps_pear[$app];
else return NULL;
}
/**
* Read sync list
* @return arra return
*/
protected function readSyncUpgrades()
{
$regsync = new stRegisterSync();
$apps_sync=$regsync->getAppsToSync();
if (! empty($apps_sync['all']))
{
return $apps_sync['all'];
} else return NULL;
}
/**
* Get sync list
* @return array
*/
public function getSyncUpgrades()
{
return $this->apps_new;
}
/**
* Check if there ary any changelog information in install/src, active
* @return bool
*/
public function isAnyActive()
{
if (! empty($this->active_contents)) return true;
else return false;
}
/**
* Return information if smarty templates were changed
* @return bool true - changed, false - not
*/
public function isSmartyChanged()
{
if ($this->smarty_changed) return true;
else return false;
}
/**
* Get smarty theme
* @return string Theme name
*/
public function getSmartyTheme()
{
if (! empty($this->smarty_theme)) return $this->smarty_theme;
else return NULL;
}
/**
* Check if there is any active change log for sync apps and current PEAR apps versions
* @return array() list of active files
*/
protected function readActiveContents()
{
$contents = $this->getContents();
$contents_active=array();
$this->smarty_changed=false;
// echo "<pre>app_content:";print_r($contents);echo "</pre>";
if (! empty($contents))
{
foreach ($contents as $app=>$contents_app)
{
foreach ($contents_app['changelog'] as $keyname=>$content)
{
$add_version=0; $add_method=0;
if (! empty($content['version']))
{
// echo "<pre>version: ";print_r($content['changelog']['version']);echo "</pre>";
if ($this->checkVersion($app,$content['version']))
{
$add_version=1;
} else
{
return $contents_active;
}
}
// echo "<pre>";print_r($contents_app);echo "</pre>";
if ((! empty($content['method']['name'])) && ($add_version==1))
{
// echo "<pre>method: ";print_r($content['changelog']['method']['name']);echo "</pre>";
// $myobject = new stChangelogFunctions();
$method=$content['method']['name'];
if (! empty($content['method']['params']))
{
$params=$content['method']['params'];
} else $params=array();
if (! empty($content['priority']))
{
$priority=$content['priority'];
} else $priority=5; // 1 - important , 5 - minor changes
// $result=call_user_func(array($myobject, $method), $params);
$this->call_ret=call_user_func_array (array('stChangelogFunctions', $method), array($app,$params,'condition'));
if (! empty($this->call_ret['result']))
{
$this->result['P'.$priority][$app][$keyname]['data'] = $this->call_ret['result'];
$this->result['P'.$priority][$app][$keyname]['method'] = $method;
// there yopu can add more information from changelog.yml for template
// $this->result['P'.$priority][$app][$keyname]['keyname_params']['yourkey'] = value
$this->result['P'.$priority][$app][$keyname]['keyname_params']['url'] = $content['url'];
}
// echo "<pre>app=$app :";print_r($result);echo "</pre>";
if ($this->call_ret['return'])
{
// addidtional info for smarty method
if ($method=='smartyTemplatesChanged')
{
$this->smarty_changed=true;
$this->smarty_theme=$this->call_ret['theme'];
}
$add_method=1;
}
}
}
if (($add_version==1) && ($add_method==1)) $contents_active[$app]=$content;
}
}
return $contents_active;
}
/**
* Get changelog function result
* @see stChangelogFunctions class
* @return mixed
*/
public function getResult()
{
if (! empty($this->result))
{
ksort($this->result,SORT_STRING);
return $this->result;
}
else return NULL;
}
/**
* Get changelog content
* @param string $app Applikaction
* @param array $content Content data
* @param string $priority (P1|P2|P3|P4|P5)
* @return string HTML
*/
public function getUpdateContent($app,$app_content,$priority)
{
$culture=sfContext::getInstance()->getUser()->getCulture();
$result=array();
foreach ($app_content as $keyname=>$data_array)
{
$params=$data_array['data'];
$method=$data_array['method'];
$keyname_params = $data_array['keyname_params'];
if (! empty($keyname_params['url'])) $url=$keyname_params['url']; else $url=NULL;
$file=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'changelog'.DIRECTORY_SEPARATOR.$culture.DIRECTORY_SEPARATOR.$keyname.'.html';
if (file_exists($file))
{
// execute method for keyname
$file=file_get_contents($file);
} else $file='';
$ret_keyname=call_user_func_array (array('stChangelogFunctions', $method), array($app,$params,'runkeyname',$keyname_params));
$result['keyname'][$keyname]['content']=$file.$ret_keyname;
$result['keyname'][$keyname]['url']=$url;
}
// execute method for app
$ret_app=call_user_func_array (array('stChangelogFunctions', $method), array($app,$params,'runapp'));
$result['resume']=$ret_app;
return $result;
}
/**
* Get active changelog content arrays
* @return array
*/
public function getActiveContents()
{
return $this->active_contents;
}
/**
* Check if version is active. Compare versions.
* @param string $app Application
* @param array $version Version
* @return bool
*/
protected function checkVersion($app,$version)
{
$min = NULL;
$max = NULL;
if (! empty($version['min'])) $min=$version['min'];
if (! empty($version['max'])) $max=$version['max'];
/**
* Fixed: Package version is from package.yml not from pear.
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
// $pearv = $this->getPearVersion($app);// app PEAR version
$packageFile = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'packages'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'package.yml';
if (file_exists($packageFile)) {
$package = sfYaml::load($packageFile);
$pearv = $package['package']['version'];
} else {
$pearv = 0;
}
// echo "pearv=$pearv min=$min max=$max <br>";
if (! empty($pearv))
{
if ((version_compare($pearv,$min,'>=')) && (version_compare($pearv,$max,'<=')))
{
return true;
}
}
return false;
}
protected function getContents()
{
$content=array();
$files=$this->getAllFiles();
if (! empty($files))
{
foreach ($files as $app=>$file)
{
$content[$app]=sfYaml::load($file);
}
}
return $content;
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* Base class for Changelog update classes
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Changelog base class
*/
class stChangelogBase
{
}

View File

@@ -0,0 +1,70 @@
<?php
/**
* Changelog Description class
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Changelog Description
*/
class stChangelogDescription extends stChangelogBase
{
/**
* Instance
*/
protected static $instance = null;
/**
* Singleton
*
* @param stBackendDesktop $base_class
* @return stBackendDesktop
*/
public static function getInstance($base_class = null)
{
if (null === self::$instance)
{
if (null === $base_class)
{
$base_class = __CLASS__;
}
self::$instance = new $base_class();
}
return self::$instance;
}
/**
* Condition
*
* @param string $app Application
* @param mixed $params Parameters
* @return array('return'=>bool,'result'=>mixed)
*/
public function condition($app,$params)
{
return array('return'=>true, 'result'=>array(true));
}
/**
* Additional description for 1 update for 1 app
* @param mixe $params result from stChangelogDescription::execute['result']
* @return string HTML
*/
public function runkeyname($app,$params,$keyname_params)
{
}
/**
* Additional description for all updates for 1 app
* @param mixed $params result from stChangelogDescription::execute['result']
* @return array Unique files for app
*/
public function runapp($app,$params)
{
return NULL;
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* Changelog function class
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Changelog
*/
class stChangelogFunctions
{
var $result=false;
/**
* Smarty templatecs changed.
*
* @param array $params
* @param string $mode execute|content
* @return mixed
*/
public function smartyTemplatesChanged($app,$params,$method='condition',$keyname_params=NULL)
{
$smarty_changelog = stChangelogSmarty::getInstance();
switch ($method)
{
case 'condition': return $smarty_changelog->condition($app,$params); break;
case 'runkeyname': return $smarty_changelog->runkeyname($app,$params,$keyname_params); break;
case 'runapp': return $smarty_changelog->runapp($app,$params); break;
}
}
/**
* Description for changes
*
* @param array $params
* @param string $mode execute|content
* @return mixed
*/
public function description($app,$params,$method='condition',$keyname_params)
{
$description = stChangelogDescription::getInstance();
switch ($method)
{
case 'condition': return $description->condition($app,$params); break;
case 'runkeyname': return $description->runkeyname($app,$params,$keyname_params); break;
case 'runapp': return NULL; break;
}
}
}

View File

@@ -0,0 +1,178 @@
<?php
/**
* Changelog Smarty class
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Changelog
*/
class stChangelogSmarty extends stChangelogBase
{
/**
* @var string unique changed smarty files
*/
var $files=array();
/**
* Instance
*/
protected static $instance = null;
/**
* Singleton
*
* @return stChangeLogSmarty
*/
public static function getInstance()
{
$base_class = __CLASS__;
if (null === self::$instance) self::$instance = new $base_class();
return self::$instance;
}
/**
* Smarty templatecs changed, detect and remember data
*
* @param string $app Application
* @param mixed $params Parameters
* @return array('return'=>bool,'result'=>mixed)
*/
public function condition($app,$params)
{
$exists=0;
// get default theme
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
$path = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'soteshop.yml';
$config = sfYaml::load($path);
$developerTheme = $config['all']['.view']['theme'];
if (! $developerTheme)
{
$c = new Criteria();
$c->add(ThemePeer::ACTIVE, 1);
$theme_object = ThemePeer::doSelectOne($c);
$theme = $theme_object->getTheme();
}
else $theme = $developerTheme;
$databaseManager->shutdown();
// end
// ignore default theme names
if (($theme == 'default') || ($theme=='default2') || ($theme == 'homeelectronics'))
{
return true;
}
if (empty($params['files'])) return true;
$files = $params['files'];
$mytheme_files=array();
foreach ($files as $id=>$file)
{
$file=preg_replace("/\[MY_THEME\]/",$theme,$file);
$path=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$file;
if (file_exists($path))
{
$exists=1;
$mytheme_files[]=$file;
}
}
if ($exists==1) return array('return'=>true,'result'=>$mytheme_files,'theme'=>$theme);
else return array('return'=>false);
}
/**
* Remember unique files for each changelog keyname for app
* @param mixed $params result from stChangelogSmarty::execute['result']
* @return string HTML
*/
public function runkeyname($app,$params)
{
foreach ($params as $id=>$filename)
{
$this->files[$app][$filename]=1;
}
return NULL;
}
/**
* Return all changed files for app.
* @param mixed $params result from stChangelogSmarty::execute['result']
* @return array Unique files for app
*/
public function runapp($app,$params)
{
$i18n = sfContext::getInstance()->getI18N();
if (! empty($this->files[$app]))
{
$content='';
$content.="<p />";
$content.="<b>".$i18n->__('Pliki:')."</b>";
$content.="<ul>\n";
foreach ($this->files[$app] as $filename=>$tmp)
{
if (strlen($filename)>96)
{
$max=96;
$f1=substr($filename,0,$max);
$f2=substr($filename,$max,strlen($filename)-$max);
$filename=$f1.' -<br />&nbsp;&nbsp;&nbsp;&nbsp;- '.$f2;
}
$content.="<li>$filename</li>\n";
}
$content.="</ul>\n";
return $content;
} else return NULL;
}
/**
* Backup files
* @return string token for backup
*/
public function doBackup()
{
// backup $this->files
$files_all=array();
foreach ($this->files as $app=>$files)
{
$files_all=array_merge($files,$files_all);
}
$files_list=array();
foreach ($files_all as $file=>$tmp)
{
$files_list[]=$file;
}
$backup = stUpdateBackup::getInstance();
$token=$backup->doBackup($files_list);
return $token;
}
/**
* Return all changed files for all app.
* @return array Unique files for app
*/
public function getAllFiles()
{
$result=array();
if (! empty($this->files))
{
foreach ($this->files as $app=>$files)
{
foreach ($files as $filename=>$tmp)
{
$result[]=$filename;
}
}
} else $result=NULL;
return $result;
}
}

View File

@@ -0,0 +1,11 @@
<?php
class stCheckBrowser {
public static function check() {
$stWebRequest = new stWebRequest();
$httpUserAgent = $stWebRequest->getHttpUserAgent();
if (!preg_match('/MSIE 6\.0/', $httpUserAgent) && !preg_match('/MSIE 7\.0/', $httpUserAgent))
return true;
return false;
}
}

View File

@@ -0,0 +1,25 @@
<?php
class stCheckTheme {
public static function check() {
$config = sfYaml::load(sfConfig::get('sf_root_dir').'/config/databases.yml');
$c = $config['all']['propel']['param'];
try {
$pdo = new PDO('mysql:dbname='.$c['database'].';host='.$c['host'], $c['username'], $c['password']);
$sth = $pdo->prepare('SELECT COUNT(`id`) as `count` FROM `st_theme` WHERE `active` = 1 AND (`version` < 2 OR `version` IS NULL);');
$sth->execute();
$result = $sth->fetch(PDO::FETCH_ASSOC);
if(isset($result['count']))
return !(int) $result['count'];
else
return false;
} catch (PDOException $e) {
return -1;
}
return -2;
}
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stInstallerFrontendWeb.class.php 4621 2010-04-19 17:06:15Z marek $
*/
/**
* PEAR base classes
* @todo add PEAR.php verification (eg. for Windows installation), check include_path
*/
error_reporting(($errorsCode = error_reporting()) & ~E_STRICT);
require_once 'PEAR.php';
require_once 'PEAR/Frontend.php';
require_once 'PEAR/Command.php';
require_once 'PEAR/Config.php';
require_once 'PEAR/Registry.php';
require_once 'PEAR/Frontend/CLI.php';
error_reporting($errorsCode);
/**
* PEAR Frontend Web class
*/
require_once (__DIR__.'/stPearFrontendWeb.class.php');
/**
* Installer Frontend Web
*
* @package stUpdate
* @subpackage libs
*/
class stInstallerFrontendWeb
{
/**
* @var string Error messages.
*/
var $error='';
/**
* @var stPearFrontendWeb PEAR Frontend.
*/
var $ui;
/**
* Construct.
*
* @param string $pear_user_config path to .pearrc file (install/src/.pearrc)
* @return bool
*/
function __construct($pear_user_config='')
{
// PEAR Config file
if (empty($pear_user_config)) $pear_user_config=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'.pearrc';
// Init PEAR configuration
// @see PEAR_Frontend_Web PEAR/Frontend/Web.php
$GLOBALS['_PEAR_Frontend_Web_config'] = PEAR_Config::singleton($pear_user_config, $pear_user_config);
$this->config = $GLOBALS['_PEAR_Frontend_Web_config'];
if (PEAR::isError($this->config)) {
throw new Exception('<b>Error:</b> '.$this->config->getMessage());
}
// end
// Init PEAR Frontend class
// PEAR_Frontend::setFrontendClass('PEAR_Frontend_CLI');
$this->ui = PEAR_Frontend::setFrontendClass('stPearFrontendWeb');
PEAR_Frontend::setFrontendObject($this->ui);
return true;
}
/**
* Execute PEAR command.
*
* @param string $command PEAR command eg. 'install'
* @param array $params parameters np. array('pear.dev.quad.sote.pl/stApplicationTest')
* @param array $opts options np. array('force'=>false,...)
* @return bool
*/
public function command($command,$params=array(),$opts=array())
{
if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) $timer = sfTimerManager::getTimer('__SOTE executeUpgradeList stInstallerFrontendWeb::command('.$command.')');
if (($command=='install') && (! sizeof($opts)))
{
$opts['onlyreqdeps'] = true;
$opts['force'] = false;
}
// install force (eg. upload action)
if ($command=='force-install')
{
$command='install';
$opts['force'] = true;
}
$cmd = PEAR_Command::factory($command, $this->config);
if (PEAR::isError($cmd))
{
$this->error=$cmd->getMessage();
} else
{
// execute PEAR command
$ok = $cmd->run($command, $opts, $params);
if (PEAR::isError($ok)) {
$this->error=$ok->getMessage();
}
}
if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) $timer->addTime();
return true;
}
/**
* Get Errors.
*
* @return string
*/
public function getErrors()
{
return $this->error;
}
}

View File

@@ -0,0 +1,187 @@
<?php
/**
* SOTESHOP/stUpdate
*
* This file is the part of stUpdate application. License: (Open License SOTE) Open License SOTE.
* Do not modify this file, system will overwrite it during upgrade.
*
* @package stUpdate
* @subpackage libs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Open License SOTE
* @version $Id: stPearFrontendWeb.class.php 11065 2011-02-16 10:38:27Z marek $
*/
/**
* PEAR Frontend Web.
*
* @author Marek jakubowicz <marek.jakubowicz@sote.pl>
*
* @package stUpdate
* @subpackage libs
*/
class stPearFrontendWeb extends PEAR_Frontend_CLI
{
public function PEAR_Frontend_Web()
{
parent::PEAR();
$this->config = &$GLOBALS['_PEAR_Frontend_Web_config'];
}
function setConfig(&$config)
{
$this->config = &$config;
}
/**
* Display human-friendly output formatted depending on the
* $command parameter.
* This should be able to handle basic output data with no command
* @abstract
*
* @param mixed $data data structure containing the information to display
* @param string $command command from which this method was called
*/
public function outputData($data, $command = '_default')
{
switch ($command)
{
case "list":
$this->_list($data);
break;
case "list-upgrades":
$this->_listUpgrades($data);
break;
case "install":
$this->_install($data);
stPearCache::removeCache();
break;
case "upgrade":
$this->_upgrade($data);
stPearCache::removeCache();
break;
case "clear-cache":
stPearCache::removeCache();
break;
default:
$this->_default($data);
break;
}
}
/**
* Show application list.
*
* @param array
* @return STDOUT
*/
private function _list($data)
{
if (! empty($data['data'])) {
$list=array();
foreach ($data['data'] as $key=>$app)
{
$name=$app[0];
$version=$app[1];
$list[$name]=$version;
}
// show template
// include_once (ST_TMPL_PEAR.'pear_list.php');
$this->printResult(serialize($list));
}
}
/**
* Show messages after installation.
*
* @param array
* @return STDOUT
*/
private function _install($data)
{
$this->printResult(serialize(array($data)));
}
/**
* Show list upgrades.
*
* @param array
*/
private function _listUpgrades($data)
{
if (! empty($data['data'])) {
$list=array();
foreach ($data['data'] as $key=>$app)
{
$channel=$app[0];
$name=$app[1];
$version=$app[3];
$size=$app[4];
$list[]=array('channel'=>$channel,'name'=>$name,'version'=>$version,'size'=>$size);
}
// wyswietl szablon
$this->printResult(serialize($list));
}
}
/**
* Show upgrade result.
*
* @param mixed
* @return STDOUT string
*/
private function _upgrade($data)
{
$this->printResult($data['data']);
}
/**
* Show PEAR messages.
*
* @param string $data
* @return STDOUT
*/
private function _default($data)
{
$this->printResult(serialize($data));
}
/**
* Return printed data.
*
* @param string $data
* @return STDOUT
*/
private function printResult($data)
{
print "<PEAR_RESULT>".$data."</PEAR_RESULT>";
}
/**
* Get data from $this->print()
*
* @param string $data PEAR_RESULT
* @param string $mode unserialize|raw
* @return string | serialized string | NULL
*/
static public function getPearResult($data, $mode = 'unserialize') {
$data = preg_replace('/<\/*PEAR_RESULT>/', '', $data);
if (!empty($data)) {
if ($mode == 'unserialize') {
$arrayData = @unserialize($data);
if (is_array($arrayData))
return $arrayData;
else
return $data;
}
return $data;
}
return null;
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* Class with methods executed before install
*
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* Pre install class
*/
class stPreInstall
{
/**
* @var string install dir
*/
var $install_dir;
public function __construct()
{
$this->install_dir = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'src';
return true;
}
/**
* Return all packages with package/stAppName/preinstall.yml files
*
* @return array array(stAppName1, stAppName2, ...)
*/
public function getApps()
{
$dirs=sfFinder::type('dir')->maxdepth(0)->relative()->in($this->install_dir);
$apps=array();
foreach ($dirs as $dir)
{
$preinstall_yml = $this->getPreinstallConfigPath($dir);
if(file_exists($preinstall_yml))
{
$apps[]=$dir;
}
}
return $apps;
}
/**
* Returnt path to config file for app
*
* @param string $app
* @return string
*/
private function getPreinstallConfigPath($app)
{
return $this->install_dir.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'packages'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'preinstall.yml';
}
/**
* Get config for app
*
* @param string
*/
public function getConfig($app)
{
$data = sfYaml::load($this->getPreinstallConfigPath($app));
return $data;
}
}

View File

@@ -0,0 +1,211 @@
<?php
/**
* Update backup
* @author Marek Jakubowicz <marek.jakubowicz@sote.pl>
*/
/**
* PEAR Tar library
*/
require_once('Archive/Tar.php');
/**
* Update backup
*/
class stUpdateBackup
{
/**
* Instance
*/
protected static $instance = null;
/**
* Singleton
*
* @param string $base_class
* @return stUpdateBackup
*/
public static function getInstance()
{
$base_class = __CLASS__;
if (null === self::$instance) self::$instance = new $base_class();
return self::$instance;
}
/**
* Get backup Token ID
*/
protected function getToken($files)
{
$md5_sign=NULL;
if (! empty($this->token)) return $this->token;
foreach ($files as $file)
{
$file_path=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$file;
if (file_exists($file_path))
{
$data=file_get_contents($file_path);
$md5_data=md5($data);
$md5sign=md5($md5sign.$md5_data);
unset($data);
}
}
$this->token=$md5sign;
if (empty($this->token)) throw new Exception("Empty backup token");
return $this->token;
}
/**
* Create report file
* @param array $files
*/
protected function createReport($files)
{
$report='';
$report.="Date: ".date('Y/m/d H:i:s')."\n";
$report.="IP: ".$_SERVER['REMOTE_ADDR']."\n";
$report.="\n";
$report.="Files:\n";
foreach ($files as $file)
{
$file_path=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$file;
if (file_exists($file_path))
{
$data=file_get_contents($file_path);
$md5=md5($data);
unset($data);
} else $md5='not found';
$report.= " - $file \tmd5: $md5\n";
}
file_put_contents($this->getDir().DIRECTORY_SEPARATOR.'report.txt',$report);
}
/**
* Get backup dir
* @param string $token
* @return string backup dir
*/
protected function getDir($token=NULL)
{
if (! empty($this->backup_dir)) return $this->backup_dir;
$dir=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'backups'.DIRECTORY_SEPARATOR.$token;
if (! is_dir($dir))
{
if (! mkdir($dir)) throw new Exception("Unable mkdir $dir");
}
$this->backup_dir=$dir;
return $this->backup_dir;
}
/**
* Get backup file
* @param string $token
* @return string
*/
public function getBackupFile($token)
{
$file='backups'.DIRECTORY_SEPARATOR.$token.DIRECTORY_SEPARATOR.'backup-'.$token.'.tgz';
return $file;
}
/**
* Backup files
* @param array $files
* @return string token
*/
public function doBackup($files)
{
$token=$this->getToken($files);
$backup_dir=$this->getDir($token);
$backup_files_arch=array();
foreach ($files as $file)
{
$from=sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.$file;
$tdir=$backup_dir;
$to=$tdir.DIRECTORY_SEPARATOR.$file;
$dirs=preg_split('/\//',dirname($file));
foreach ($dirs as $d)
{
$tdir.=DIRECTORY_SEPARATOR.$d;
// echo "tdir=$tdir $d <br>";
if (! is_dir($tdir))
{
if (! mkdir($tdir)) throw new Exception("Unable mkdir $tdir");
}
}
if (! copy($from,$to)) throw new Exception("Unable copy $from $to");
$backup_files_arch[]=$from;
}
// create report file in backup dir
$this->createReport($files);
$dest_package = $backup_dir.DIRECTORY_SEPARATOR.basename($this->getBackupFile($token));
$compress = true;
$arch_files = sfFinder::type('file')->name('*')->relative()->discard(basename($dest_package))->in($backup_dir);
$cwd=getcwd();chdir($backup_dir);
$tar = new Archive_Tar($dest_package, $compress);
$tar->create($arch_files);
chdir($cwd);
$this->saveLastBackupInformation($backup_files_arch,$token);
return $this->getToken();
}
/**
* Save last backup information
* @param array $files
* @param strtong $token
* @return true;
*/
protected function saveLastBackupInformation($files,$token)
{
$path = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.last_backup.reg';
$data=array("data"=>$files,"token"=>$token);
if (! file_put_contents($path, serialize($data))) throw new Exception("Unable save backup information in ".$path);
return true;
}
/**
* Remove archived files
*/
static public function cleanBackup()
{
$path = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'.last_backup.reg';
if (file_exists($path))
{
$data_raw=file_get_contents($path);
$data=unserialize($data_raw);
if (is_array($data))
{
if ((isset($data['data'])) && (isset($data['token'])))
{
if (! empty($data['token'])) $token=$data['token']; else $token=NULL;
if (is_array($data['data']))
{
foreach ($data['data'] as $file)
{
if (file_exists($file))
{
if (! unlink($file)) throw new Exception ("Unable delete file $file. Backup token: $token");
}
}
}
} else
{
throw new Exception("Wrong serialized data in $path. Undefined array keys 'data' or 'token'. Check backup. Token: $token");
}
} else throw new Exception("Wrong serialized data in $path. Check backup. Token: $token");
}
if (file_exists($path)) unlink ($path);
}
}

View File

@@ -0,0 +1 @@
<?php echo $url ?>

View File

@@ -0,0 +1,14 @@
<header>
<div class="header left">
<h1>
<a href="<?php echo url_for('@homepage') ?>" target="_blank"><?php echo $sf_request->getHost();?></a>
</h1>
<span><?php echo __('Panel aktualizacji', null, 'stInstallerWeb');?></span>
</div>
<div class="auth_links">
<span class="backend"><?php echo link_to(__('Panel sklepu', null, 'stInstallerWeb'),"../backend.php", array('popup'=>'backend'));?></span>
<span class="frontend"><?php echo link_to(__('Strona sklepu', null, 'stInstallerWeb'),"../index.php", array('popup'=>'frontend'));?></span>
<?php echo link_to(__('Wyloguj', null, 'stInstallerWeb'),"stAuth/logout", 'class="logout"');?>
</div>
<div class="clear"></div>
</header>

View File

@@ -0,0 +1,4 @@
<?php
/**
* @deprecated: use _menu_home.php || _menu_tools.php
*/

View File

@@ -0,0 +1,55 @@
<?php use_helper('Javascript');?>
<div id="st_update_main_menu">
<?php if (stLockUpdate::isLocked()):?>
<a class="item<?php if ($selected=='rescue'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/rescue') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/rescue.svg?v1') ?></span>
<span class="label"><?php echo __('Naprawa aktualizacji', null, 'stInstallerWeb') ?></span>
</a>
<?php endif ?>
<a id="item_download" class="item<?php if ($selected=='upgradeList'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/upgradeList') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/download.svg?v1') ?></span>
<span class="label preloader">
<?php echo __('Pobierz', null, 'stInstallerWeb') ?>
</span>
</a>
<a id="item_install" class="item<?php if ($selected=='syncList'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/syncList') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/install.svg?v1') ?></span>
<span class="label preloader"><?php echo __('Instaluj', null, 'stInstallerWeb') ?></span>
</a>
<?php if (!stConfig::getInstance('stRegister')->get('demo')): ?>
<a class="item<?php if ($selected=='upload'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/upload') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/upload.svg?v1') ?></span>
<span class="label"><?php echo __('Dodaj', null, 'stInstallerWeb') ?></span>
</a>
<?php endif ?>
<a class="item" href="https://www.sote.pl/category/webstore" target="_blank">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/webstore.svg?v1') ?></span>
<span class="label"><?php echo __('Webstore', null, 'stInstallerWeb') ?></span>
</a>
</div>
<script>
jQuery(function($) {
$.get('<?php echo url_for('stInstallerWeb/AjaxCheckPackageStatus') ?>', function(response) {
let itemInstall = $('#item_install .label');
let itemDownload = $('#item_download .label');
itemInstall.removeClass('preloader');
itemDownload.removeClass('preloader');
console.log(response);
if (response.packagesToInstall > 0)
{
itemInstall.attr('data-count', response.packagesToInstall);
console.log(response.packagesToInstall);
}
if (response.packagesToUpgrade > 0)
{
itemDownload.attr('data-count', response.packagesToUpgrade);
}
});
})
</script>

View File

@@ -0,0 +1,40 @@
<?php use_helper('Javascript');?>
<div id="menu_left">
<?php if (stLockUpdate::isLocked()):?>
<?php if($selected=='rescue') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Naprawa aktualizacji', null, 'stInstallerWeb'),'stInstallerWeb/rescue');?>
</div>
<?php endif;?>
<?php if($selected=='upgradeList') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php if(($selected=='upgradeList') || ($selected=='syncList')):?>
<?php echo link_to(__('Pobierz', null, 'stInstallerWeb'),'stInstallerWeb/upgradeList');?>
<?php else:?>
<nobr><?php echo link_to(__('Pobierz', null, 'stInstallerWeb')."&nbsp;<span class=\"font_normal\" id=\"upgradeList_ajax\" style=\"font-weight:bold\">".image_tag('update/icons/indicator.gif')."</span>",'stInstallerWeb/upgradeList');?></nobr>
<?php echo javascript_tag(
remote_function(array(
'update' => 'upgradeList_ajax',
'url' => 'stInstallerWeb/upgradeList?ajax=1',
))
);?>
<?php endif;?>
</div>
<?php if($selected=='syncList') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php if($selected=='syncList'):?>
<?php echo link_to(__('Instaluj', null, 'stInstallerWeb'),'stInstallerWeb/syncList');?>
<?php else:?>
<nobr><?php echo link_to(__('Instaluj',null, 'stInstallerWeb')."&nbsp;<span class=\"font_normal\" id=\"syncList_ajax\" style=\"font-weight:bold\">".image_tag('update/icons/indicator.gif')."</span>",'stInstallerWeb/syncList');?></nobr>
<?php echo javascript_tag(
remote_function(array(
'update' => 'syncList_ajax',
'url' => 'stInstallerWeb/syncList?ajax=1',
))
);?>
<?php endif;?>
</div>
<?php if($selected=='upload') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Dodaj', null, 'stInstallerWeb'),'stInstallerWeb/upload');?>
</div>
<?php if($selected=='webstore') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('WebStore', null, 'stWebStore'), 'stWebStore/index');?>
</div>
</div>

View File

@@ -0,0 +1,24 @@
<?php if (!isset($selected)) $selected = '';?>
<div id="st_update_main_menu">
<a class="item<?php if ($selected=='verifyall'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/verifyall') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/verify.svg?v1') ?></span>
<span class="label"><?php echo __('Weryfikacja systemu', null, 'stInstallerWeb') ?></span>
</a>
<?php if (!stConfig::getInstance('stRegister')->get('demo')): ?>
<a class="item<?php if ($selected=='devel'): ?> selected<?php endif ?>" href="<?php echo url_for('stDevel/devel') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/devel.svg?v1') ?></span>
<span class="label"><?php echo __('Tryb developerski', null, 'stInstallerWeb') ?></span>
</a>
<?php endif ?>
<a class="item<?php if ($selected=='history'): ?> selected<?php endif ?>" href="<?php echo url_for('stInstallerWeb/history') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/history.svg?v1') ?></span>
<span class="label"><?php echo __('Historia aktualizacji', null, 'stInstallerWeb') ?></span>
</a>
<?php if (!stConfig::getInstance('stRegister')->get('demo')): ?>
<a class="item<?php if ($selected=='reconfigure'): ?> selected<?php endif ?>" href="<?php echo url_for('stSetup/reconfigure') ?>">
<span class="image"><?php echo image_tag('/images/update/red/modules/svg/reconfigure.svg?v1') ?></span>
<span class="label"><?php echo __('Konfiguracja MySQL', null, 'stInstallerWeb') ?></span>
</a>
<?php endif ?>
</div>

View File

@@ -0,0 +1,17 @@
<?php if (!isset($selected)) $selected = '';?>
<ul id="menu_left">
<?php if($selected=='verifyall') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Weryfikacja systemu', null, 'stInstallerWeb'),'stInstallerWeb/verifyall');?>
</div>
<?php if($selected=='devel') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Tryb developerski', null, 'stInstallerWeb'),'devel');?>
</div>
<?php if($selected=='history') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Historia aktualizacji', null, 'stInstallerWeb'),'stInstallerWeb/history');?>
</div>
<?php if($selected=='reconfigure') echo "<div class=\"selected\">"; else echo "<div>";?>
<?php echo link_to(__('Konfiguracja MySQL', null, 'stInstallerWeb'),'stSetup/reconfigure');?>
</div>
<div style="clear:both"></div>
</ul>

View File

@@ -0,0 +1,10 @@
<div class="horizontal_list">
<a id="home" href="<?php echo url_for('@homepage') ?>"><img src="/images/update/logo.png" alt=""></a>
<?php echo link_to(__('Narzędzia eksperta', null, 'stInstallerWeb'),'stInstallerWeb/tools');?>
<div class="auth_links">
<span class="backend"><?php echo link_to(__('Panel sklepu', null, 'stInstallerWeb'),"../backend.php", array('popup'=>'backend'));?></span>
<span class="frontend"><?php echo link_to(__('Strona sklepu', null, 'stInstallerWeb'),"../index.php", array('popup'=>'frontend'));?></span>
<?php echo link_to(__('Wyloguj', null, 'stInstallerWeb'),"stAuth/logout", 'class="logout"');?>
</div>
<div class="clear"></div>
</div>

View File

@@ -0,0 +1,32 @@
<div class="error_message" style="margin-top:5px">
<?php echo __('Nie można zainstalować aktualizacji. System wykrył modyfikację kodu. Twoj system może nie działać poprawnie.', null, 'stInstallerWeb');?>
</div>
<br />
<h2 class="subhead_txt_module">
<?php echo __('Zmodyfikowane pliki:', null, 'stInstallerWeb');?>
</h2>
<table border="0" width="100%">
<?php foreach ($data as $app => $files):?>
<tr>
<th colspan="2" align="left">
<?php echo $app;?>
</th>
<th>
<?php echo __('Data modyfikacji', null, 'stInstallerWeb');?>
</th>
</tr>
<?php foreach ($files as $file => $dat):?>
<tr>
<td align="right">
-
</td>
<td align="left" style="padding-right:20px">
<?php echo str_replace(' / ', '/', $file);?>
</td>
<td align="center" width="150">
<?php echo $dat['modified'];?>
</td>
</tr>
<?php endforeach;?>
<?php endforeach;?>
</table>

View File

@@ -0,0 +1,44 @@
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<?php $i=1;?>
<tr bgcolor="#f1f1f1">
<th align="left"><?php echo __('Nr');?></th>
<th align="left"><?php echo __('Ikonka');?></th>
<th align="left"><?php echo __('Nazwa');?></th>
<th align="left"><?php echo __('Opis');?></th>
<th align="left"><?php echo __('Status');?></th>
</tr>
<?php foreach ($apps as $mode => $val):?>
<?php if ($mode != 'all'):?>
<?php foreach ($val as $id => $app): $title = stApplication::getAppName($app) ?>
<tr>
<td width="50px">
<?php echo $i;?>.
</td>
<td width="50px">
<img width="30" height="30" src="<?php echo st_update_get_app_icon($app) ?>" alt="<?php echo $title ?>">
</td>
<td width="30%">
<?php echo $app;?>
</td>
<td>
<?php echo $title ?>
</td>
<td align="right">
<?php
switch ($mode)
{
case 'added': echo '<span style="color:#3380cc">'.__('Dodaj')."</span>";
break;
case 'changed': echo '<span style="color:#009933">'.__('Aktualizuj')."</span>";
break;
case 'deleted': echo '<span style="color:red">'.__('Usuń').'</span>';
break;
}
?>
</td>
</tr>
<?php $i++;?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</table>

View File

@@ -0,0 +1,35 @@
<?php use_helper('stUpdate') ?>
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1'); ?>
<?php echo get_partial('menu_top');?>
<div id="frame_update">
<div class="box_content">
<h2 class="title"><?php echo __('Dodatkowe aplikacje') ?></h2>
<div class="content_update_box">
<form action="<?php echo url_for('stInstallerWeb/additionalApplications') ?>" method="post">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="table_download">
<thead>
<tr>
<th style="width: 1%"></th>
<th style="text-align: left"><?php echo __('Nazwa') ?></th>
<th style="text-align: center; width: 1%"><?php echo __('Aktywna') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($applications as $name => $label): ?>
<tr>
<td><img width="30" height="30" src="<?php echo st_update_get_app_icon($name) ?>" alt="<?php echo $label ?>"></td>
<td><?php echo $label ?></td>
<td style="text-align: center"><input type="checkbox" name="application[<?php echo strtolower($name) ?>][active]" value="1" <?php echo in_array($name, $active) ? 'checked' : '' ?>></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php echo st_get_update_actions_head('style="float:right"');?>
<?php echo st_get_update_action(null, __('Włacz wszyskie'), null, array('style' => 'margin-right: 5px', 'name' => 'enable_all'));?>
<?php echo st_get_update_action(null, __('Wyłącz wszyskie'), null, array('style' => 'margin-right: 5px', 'name' => 'disable_all'));?>
<?php echo st_get_update_action('save', __('Zapisz'));?>
<?php echo st_get_update_actions_foot();?>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,71 @@
<?php $license_info = stCommunication::getLicenseInfo(30); ?>
<?php if (! empty($license_info['type'])):?>
<?php if(stLicense::isOpen()):?>
<div class="status_alert">
<h4>
<?php echo __('Wersja OPEN nie posiada dostępu do aktualizacji.', null, 'stInstallerWeb');?>
</h4>
<a href="<?php echo __('http://www.sote.pl/licencja-soteshop.html', null, 'stInstallerWeb');?>" target="_blank">
<?php echo __('Zamów wersję komercyjną.', null, 'stInstallerWeb');?>
</a>
<div class="clear"></div>
</div>
<?php elseif($status === 'SOTE_CONNECTION_ERROR'):?>
<div class="status_alert">
<h4>
<?php echo __('Błąd połączenia z serwerem aktualizacji.', null, 'stInstallerWeb');?>
</h4>
<div class="clear"></div>
</div>
<?php elseif ($status === 'UPGRADE_SERVICE_NOT_ACTIVE'):?>
<div class="status_alert">
<h4>
<?php echo __('Sklep nieaktualny', null, 'stInstallerWeb'); ?>
</h4>
<?php // if ($license_info['type'] == 'ROK' || $license_info['type'] == 'MIESIĄC'): $message = stCommunication::blockSite(30) ? __('Przedłuż usługę korzystania z SOTESHOP') : __('Przedłuż usługę korzystania z SOTESHOP.', array('%days%' => $days)); ?>
<?php echo __('Dostęp do aktualizacji wygasł dnia', null, 'stInstallerWeb');?>: <?php echo $upgradeServiceTime;?>
<?php if ($license_info['type'] == 'BEZTERMINOWO' || $license_info['type'] == 'BEZTERMINOWO+HOSTING'): ?>
<div style="color: #C62929">
<?php if ($sf_user->getCulture() == 'pl_PL'): ?>
Zamów dostęp do <a style="color: #C62929" href="http://www.sote.pl/dostep-do-aktualizacji.html" target="sote">aktualizacji sklepu</a>
<?php else: ?>
Order access to <a style="color: #C62929" href="http://www.soteshop.com/access-to-update.html" target="sote">shop updates</a>
<?php endif ?>
</div>
<?php endif; ?>
<div class="clear"></div>
</div>
<?php elseif($status === 'PACKAGES_FOUND'):?>
<div class="status_alert">
<h4><?php echo __('Sklep nieaktualny', null, 'stInstallerWeb');?></h4> <?php echo __('Zaktualizuj swój sklep do najnowszej wersji.', null, 'stInstallerWeb');?>
<div class="clear"></div>
<div class="st_admin-actions">
<span class="download"><?php echo link_to(__('Pobierz aktualizacje', null, 'stInstallerWeb'),'stInstallerWeb/upgradeList');?></span>
<span class="install"><?php echo link_to(__('Instaluj aktualizacje', null, 'stInstallerWeb'),'stInstallerWeb/syncList');?></span>
</div>
<div class="clear"></div>
</div>
<?php elseif($status === 'NOTHING_TO_UPGRADE'):?>
<?php if($isSeven):?>
<div class="status_current">
<h4><?php echo __('Sklep aktualny', null, 'stInstallerWeb');?></h4>
<?php echo __('Twój sklep jest zaktualizowany do najnowszej wersji.', null, 'stInstallerWeb');?>
</div>
<?php else:?>
<div class="status_alert">
<h4><?php echo __('Dostępna jest nowa wersja sklepu.', null, 'stInstallerWeb');?></h4>
<a href="<?php echo __('http://www.sote.pl/aktualizacja-soteshop-z-wersji-6-do-7.html');?>" target="_blank">
<?php echo __('Zamów aktualizację do wersji 7.', null, 'stInstallerWeb');?>
</a>
</div>
<?php endif;?>
</div>
<?php endif; ?>
<?php else: ?>
<?php echo __('Tu pojawią się dostępne aktualizacje.', null, 'stInstallerWeb'); // Wersja demo ?>
<?php endif; ?>

View File

@@ -0,0 +1,8 @@
<?php echo get_partial('stInstallerWeb/menu_top');?>
<div id="frame_update">
<ul id="st_list_installer" style="min-height: 130px;">
<?php echo __('Nie znaleziono archiwum.');?>
</ul>
</div>

View File

@@ -0,0 +1,24 @@
<?php use_helper('I18N', 'Date', 'Text', 'stAdminGenerator', 'Object', 'Validation', 'ObjectAdmin') ?>
<?php use_helper('stProgressBar'); ?>
<?php use_stylesheet('/css/backend/stInstallerWebPlugin.css?version=1'); ?>
<?php echo st_get_admin_head('stInstallerWebPlugin', __('Uaktualnienia',
array()), __('Uaktualnij aplikacje w sklepie',
array()),NULL) ?>
<div style="margin:0px 30px;">
<?php echo get_partial('menu');?>
<div class="st_head_txt_installer">
<?php echo __('Wyczyszczenie cache'); ?>
</div>
<pre><?php
print_r($content);
print_r($error);
?></pre>
</div>
<?php echo st_get_admin_foot() ?>

View File

@@ -0,0 +1,96 @@
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1'); ?>
<?php use_javascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); ?>
<?php use_helper('stUpdate') ?>
<?php echo get_partial('stInstallerWeb/menu_top');?>
<div id="frame_update">
<?php echo get_partial('menu_home',array('selected'=>'syncList'));?>
<div class="box_content">
<div class="content_update_box">
<div style="float:right; margin-right:10px"><?php echo image_tag('/images/update/installerweb/arrow_down.png')?></div>
<h2 class="subhead_txt_module">
<?php echo __('Opis zmian aktualizacji');?> <?php // echo $active ?>
</h2>
<?php if ($smarty_changed):?>
<?php echo __('W Twoim sklepie wykryto indywidualny temat graficzny:').' <b>'.$smarty_theme.'</b>.<br />'.__('Poniżej przedstawione pliki zostaną zarchiwizowane i napisane. Przeczytaj opis zmian.') ?>
<p />
<?php endif ?>
<?php foreach ($output as $priority=>$content):?>
<?php if ($priority=='P1') $bgcolor='#FAAAAA'; else $bgcolor='#FFF';?>
<?php foreach ($content as $app=>$content2):?>
<div class="content_update_box" style="width:845px; margin-bottom: 10px; background-color: <?php echo $bgcolor ?>">
<div style="float:right">
<span style="font-size:9px"><?php echo __('Aplikacja')?>:</span> <span style="font-size:12px"><?php echo $app;?></span>
<?php if ($priority=='P1'):?>
<br />
<div style="float:right; margin-right:5px"><?php echo image_tag('/images/update/installerweb/icon_warning.png')?></div>
<?php endif ?>
</div>
<div class="content_update_box" style="width:650px; margin-bottom: 0px; background-color: #fff">
<?php foreach ($content2['keyname'] as $keyname=>$content3): ?>
<?php echo $content3['content'] ?>
<?php if (! empty($content3['url'])):?>
<div style="float:right">
<p />
<a href="<?php echo url_for($content3['url']) ?>" target="update_info"><?php echo __('Więcej informacji') ?></a>
</div>
<?php endif ?>
<p />
<?php endforeach ?>
<p />
<?php echo $content2['resume'] ?>
</div>
</div>
<?php endforeach ?>
<?php endforeach ?>
<?php if ($smarty_changed):?>
<div class="content_update_box" style="width:845px; margin-bottom: 0px; background-color: #fff">
<?php echo "<b>".__('Lista zmienionych plików')."</b>"?>
<div style="float:right; margin-right:10px;"><?php echo link_to(__('Pobierz pliki'),'stInstallerWeb/backup?token='.$backup_token);?>
<?php echo link_to(image_tag('/images/update/icon_download.svg'),'stInstallerWeb/backup?token='.$backup_token)?></div>
<ul>
<?php foreach ($smarty_files as $file): ?>
<li><?php echo $file ?></li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>
<div class="clear"></div>
<?php if ($confirmation) :?>
<div style="float:right; width=200px">
<div style="float:right;">
<div class="form-error-msg" id="noconfirm-error" style="display:none; color: #FF3333">↓&nbsp;<?php echo __("Proszę zaakceptować zmiany")?>&nbsp;↓</div>
<?php echo __('Akceptuję opisane zmiany') ?> <?php echo checkbox_tag('confirm', 1, 0, array('onChange'=>'if ($("confirm").checked == false) {$("changelog_confirm_actions").style.display = "none";$("changelog_noconfirm_actions").style.display = "block";} else {$("changelog_confirm_actions").style.display = "block";$("noconfirm-error").style.display = "none"; $("changelog_noconfirm_actions").style.display = "none";}')); ?>
</div>
<div id="changelog_confirm_actions" style="float:right;display:none; clear: both">
<?php echo st_get_update_actions_head('style="float:right";') ?>
<?php echo st_get_update_action('install', __('Aktualizuj wszystkie'), 'stInstallerWeb/verify', 'post=true') ?>
<?php echo st_get_update_actions_foot() ?>
</div>
<div id="changelog_noconfirm_actions" style="float:right; clear: both">
<?php echo st_get_update_actions_head('style="float:right";') ?>
<?php echo st_get_update_action('install', __('Aktualizuj wszystkie'), null, array('type'=>'button', 'onClick'=>'$("noconfirm-error").style.display = "block";')) ?>
<?php echo st_get_update_actions_foot() ?>
</div>
</div>
<?php else: ?>
<div style="float:right; width=200px">
<?php echo st_get_update_actions_head('style="float:right"') ?>
<div style="float:right"><?php echo st_get_update_action('install', __('Aktualizuj wszystkie'), 'stInstallerWeb/verify', 'post=true') ?></div>
<div style="float:right; margin-right:30px"><?php echo input_hidden_tag('confirm', 1, 1); ?></div>
<?php echo st_get_update_actions_foot() ?>
</div>
<?php endif ?>
<div class="clear"></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,45 @@
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1'); ?>
<?php use_stylesheet('/css/update/setup.css?v2'); ?>
<?php echo get_partial('menu_top');?>
<div id="frame_update">
<div id="sf_admin_container" style="width: auto;">
<div style="padding-bottom: 40px;">
<?php echo __('Korzystasz z przeglądarki Internet Explorer 7 lub niższej.');?>
<?php echo __('Do poprawnego działania panelu aktualizacji oraz sklepu zalecamy skorzystanie z nowszej wersji przeglądarki lub innej zgodnej ze standardem W3C.');?>
</div>
<div style="padding-bottom: 20px; text-align: center;">
<?php echo __('Poniżej lista przeglądarek zalecanych do obsługi panelu administracyjnego:') ?>
</div>
<div style="overflow: hidden; padding-bottom: 40px; width: 480px; margin: 0px auto;">
<div style="float: left; width: 120px; text-align: center;">
<a href="http://windows.microsoft.com/pl-PL/internet-explorer/products/ie/home" target="_blank">
<img src="/images/update/browser/ie.png" alt=""/><br />
Internet Explorer 8
</a>
</div>
<div style="float: left; width: 120px; text-align: center;">
<a href="http://www.mozilla-europe.org/pl/firefox/" target="_blank">
<img src="/images/update/browser/firefox.png" alt=""/><br />
Firefox
</a>
</div>
<div style="float: left; width: 120px; text-align: center;">
<a href="http://www.opera.com/" target="_blank">
<img src="/images/update/browser/opera.png" alt="" /><br />
Opera
</a>
</div>
<div style="float: left; width: 120px; text-align: center;">
<img src="/images/update/browser/chrome.png" alt=""/><br />
<?php echo link_to("Chrome","http://www.google.com/chrome/index.html?hl=pl&brand=CHMG&utm_source=pl", "target=>_blank") ?>
</div>
</div>
<div>
<?php if($sf_user->getCulture() == 'pl_PL'):?>
<?php echo __('Więcej informacji na temat instalacji przeglądarek znajdziecie Państwo');?> <a href="http://www.sote.pl/trac/wiki/doc/webbrowsers" target="_blank"><?php echo __('tutaj');?></a>.
<?php endif;?>
</div>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<?php use_stylesheet('/css/update/stInstallerWebPlugin.css?version=1'); ?>
<?php use_stylesheet('/css/update/setup.css?v2'); ?>
<?php echo get_partial('menu_top');?>
<div id="frame_update">
<div id="sf_admin_container" style="width: auto;">
<?php echo get_partial('menu');?>
<div class="content">
<div class="st_head_txt_installer_sync">
<?php echo __('Weryfikacja tematu graficznego sklepu');?>
</div>
<div class="content" style="padding-left: 0px;">
<?php if ($check === true):?>
<?php echo __('Weryfikacja została zakończona pomyślnie.');?>
<?php elseif ($check === false):?>
<?php echo __('Dostępna jest nowa wersja SOTESHOP 6:');?>
<a href="<?php echo __('http://www.sote.pl/soteshop6');?>" target="_blank"><?php echo __('więcej');?></a><br />
<?php echo __('Jeśli chcesz pobrać aktualizacje do wersji 6, musisz zaktualizować grafikę do nowszej wersji:');?>
<a href="<?php echo __('http://www.sote.pl/soteshop6/update');?>" target="_blank"><?php echo __('więcej');?></a>
<?php elseif ($check == -1):?>
<?php echo __('Nie można połączyć sie z bazą danych w celu wykonania weryfikacji.');?><br />
<?php echo __('Prosze o kontakt z serwisem oprogramowania www.serwis.sote.pl.');?>
<?php elseif ($check == -2):?>
<?php echo __('Wystąpił błąd podczas weryfikacja tematu graficznego.');?><br />
<?php echo __('Prosze o kontakt z serwisem oprogramowania www.serwis.sote.pl.');?>
<?php endif;?>
</div>
</div>
<div class="clear"></div>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More