コード例 #1
0
ファイル: order-preferences.php プロジェクト: rodrisan/ps-cli
 public static function print_order_preferences()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     $line = array('PS_ORDER_PROCESS_TYPE', 'Checkout process');
     $orderType = Configuration::get('PS_ORDER_PROCESS_TYPE');
     if ($orderType == PS_ORDER_PROCESS_STANDARD) {
         array_push($line, 'Standard');
     } else {
         array_push($line, 'One page checkout');
     }
     $table->addRow($line);
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_GUEST_CHECKOUT_ENABLED', 'Allow guest visitors to place orders');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISALLOW_HISTORY_REORDERING', 'Disable one click reorder');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ALLOW_MULTISHIPPING', 'Allow shipping to multiple addresses');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_SHIP_WHEN_AVAILABLE', 'Allow shipping delay');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_CONDITIONS', 'Require customers to accept terms of service');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PURCHASE_MINIMUM', 'Minimum purchase total required (0=disabled)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_CONDITIONS_CMS_ID', 'Store\'s condition of use page ID');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_GIFT_WRAPPING', 'Offer gift wrapping');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_GIFT_WRAPPING_PRICE', 'Gift wrapping price');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_GIFT_WRAPPING_TAX_RULES_GROUP', 'tax group for gift wrapping');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_RECYCLE_PACK', 'Suggest recycled packaging');
     $table->display();
 }
コード例 #2
0
 public static function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_CATALOG_MODE', 'Enable PS catalog mode');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_COMPARATOR_MAX_ITEM', 'Max selection for products comparison');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_NB_DAYS_NEW_PRODUCT', 'Number of days for which a product is considered new');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_CART_REDIRECT', 'Redirect after adding product to cart');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCT_SHORT_DESC_LIMIT', 'Maximum product short description size');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_QTY_DISCOUNT_ON_COMBINATION', 'How to calculate quantity discounts (0=products, 1=combination)');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_FORCE_FRIENDLY_PRODUCT', 'update friendly url on every save');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCTS_PER_PAGE', 'Number of products per page');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCTS_ORDER_BY', 'Products sorted by (0=name, 1=price, 2=add date, 3=modification date, 4=position category, 5=manufacturer, 6=Qtty, 7=reference)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCTS_ORDER_WAY', 'Default order method (0=asc, 1=desc)');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISPLAY_QTIES', 'Display available quantities');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_LAST_QTIES', 'Display remaining when lower than:');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISPLAY_JQZOOM', 'Enable Jqzoom on product page');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISP_UNAVAILABLE_ATTR', 'Display unavailable products');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ATTRIBUTE_CATEGORY_DISPLAY', 'Display add to cart button when product has attributes');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_ATTRIBUTE_ANCHOR_SEPARATOR', 'Separator of attribute anchor on product links');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISPLAY_DISCOUNT_PRICE', 'Display the new price with applied discount');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ORDER_OUT_OF_STOCK', 'Display add to cart on unavailable products');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_STOCK_MANAGEMENT', 'Enable stock management');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ADVANCED_STOCK_MANAGEMENT', 'Enabled advanced stock management');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_FORCE_ASM_NEW_PRODUCT', 'New products use advanced stock management');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_DEFAULT_WAREHOUSE_NEW_PRODUCT', 'Default warehouse of new products');
     $table->display();
     return;
 }
コード例 #3
0
ファイル: 1clickupgrade.php プロジェクト: rodrisan/ps-cli
 public function run()
 {
     $arguments = PS_CLI_ARGUMENTS::getArgumentsInstance();
     $interface = PS_CLI_INTERFACE::getInterface();
     if ($arguments->getOpt('show-status')) {
         $table = new Cli\Table();
         $table->setHeaders(array('Key', 'Configuration', 'Value'));
         PS_CLI_UTILS::add_configuration_value($table, 'PS_UPGRADE_CHANNEL', 'PrestaShop upgrade Channel');
         $interface->add_table($table);
     } else {
         $interface->add_content("Not implemented");
         $interface->set_ret_value(1);
     }
 }
コード例 #4
0
ファイル: test-table.php プロジェクト: kehet/php-cli-utils
 public function testDatabaseDumpMysqli()
 {
     $table = new \Cli\Table();
     $db = new \mysqli('localhost', 'H675X16em4', 'XOc1pu3AcAnINA2eKEY4ruRO8i8iXI', 'test');
     if ($db->connect_errno) {
         throw new \Exception("Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error);
     }
     if (!($stmt = $db->prepare("SELECT * FROM `table`"))) {
         throw new \Exception("Prepare failed: (" . $db->errno . ") " . $db->error);
     }
     if (!$stmt->execute()) {
         throw new \Exception("Execute failed: (" . $stmt->errno . ") " . $stmt->error);
     }
     $table->importFromMysqli($stmt);
     $this->expectOutputString('+-------------+-------------+-------------+' . "\n" . '| Col 1       | Col 2       | Col 3       |' . "\n" . '+-------------+-------------+-------------+' . "\n" . '| Col 1 Row 1 | Col 2 Row 1 | Col 3 Row 1 |' . "\n" . '| Col 1 Row 2 | Col 2 Row 2 | Col 3 Row 2 |' . "\n" . '| Col 1 Row 3 | Col 2 Row 3 | Col 3 Row 3 |' . "\n" . '+-------------+-------------+-------------+' . "\n");
     $table->show();
     $stmt->close();
 }
コード例 #5
0
ファイル: seo.php プロジェクト: rodrisan/ps-cli
 public static function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_REWRITING_SETTINGS', 'Support Url rewriting');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ALLOW_ACCENTED_CHARS_URL', 'Allow accented in characters in URL');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_CANONICAL_REDIRECT', 'Redirect to canonical URL (0= no redirection, 1= 302, 2 = 301)');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_HTACCESS_DISABLE_MULTIVIEWS', 'Disable Apache mutliview');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_HTACCESS_DISABLE_MODSEC', 'Disable Apache mod security');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_SHOP_DOMAIN', 'Shop domain');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_SHOP_DOMAIN_SSL', 'Shop domain SSL');
     $context = Context::getContext();
     $line = array('-', 'Default URI');
     $url = ShopUrl::getShopUrls($context->shop->id)->where('main', '=', 1)->getFirst();
     array_push($line, $url->physical_uri);
     $table->addRow($line);
     $table->display();
     return;
 }
コード例 #6
0
ファイル: db.php プロジェクト: rodrisan/ps-cli
 public static function list_database_backups()
 {
     $dh = @opendir(PrestaShopBackup::getBackupPath());
     if ($dh === false) {
         echo "Error, cannot read database backup directory {$dh}\n";
         return false;
     }
     $table = new Cli\Table();
     $table->setHeaders(array('Filename', 'Size', 'Date'));
     while ($file = readdir($dh)) {
         if (preg_match('/^([_a-zA-Z0-9\\-]*[\\d]+-[a-z\\d]+)\\.sql(\\.gz|\\.bz2)?$/', $file, $matches) == 0) {
             continue;
         }
         $filename = $file;
         $size = number_format(filesize(PrestaShopBackup::getBackupPath($file)) / 1000, 2) . ' Kb';
         $date = date('Y-m-d H:i:s', (int) $matches[1]);
         $table->addRow(array($filename, $size, $date));
     }
     $table->display();
     return true;
 }
コード例 #7
0
ファイル: themes.php プロジェクト: rodrisan/ps-cli
 public static function print_available_themes()
 {
     $installedThemesDirs = array();
     $themes = Theme::getAvailable(false);
     $installedThemes = Theme::getThemes();
     foreach ($installedThemes as $installedTheme) {
         $installedThemesDirs[] = $installedTheme->directory;
     }
     $table = new Cli\Table();
     $table->setHeaders(array('Directory', 'Installed'));
     foreach ($themes as $theme) {
         //check if theme is installed
         if (array_search($theme, $installedThemesDirs) === false) {
             $isInstalled = 'No';
         } else {
             $isInstalled = 'Yes';
         }
         $table->addRow(array($theme, $isInstalled));
     }
     $table->display();
 }
コード例 #8
0
ファイル: preferences.php プロジェクト: rodrisan/ps-cli
 public static function show_preferences_status()
 {
     $table = new Cli\Table();
     $activities = array(2 => 'Animals and Pets', 3 => 'Art and Culture', 4 => 'Babies', 5 => 'Beauty and Personal Care', 6 => 'Cars', 7 => 'Computer Hardware and Software', 8 => 'Download', 9 => 'Fashion and accessories', 10 => 'Flowers, Gifts and Crafts', 11 => 'Food and beverage', 12 => 'HiFi, Photo and Video', 13 => 'Home and Garden', 14 => 'Home Appliances', 15 => 'Jewelry', 1 => 'Lingerie and Adult', 16 => 'Mobile and Telecom', 17 => 'Services', 18 => 'Shoes and accessories', 19 => 'Sport and Entertainment', 20 => 'Travel');
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_TOKEN_ENABLE', 'Front office tokens');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ALLOW_HTML_IFRAME', 'Allow HTML iframes');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_USE_HTMLPURIFIER', 'Use HTML purifier library');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISPLAY_SUPPLIERS', 'Enable FO suppliers and manufacturers page');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_DISPLAY_BEST_SELLERS', 'Enable FO Best Sellers page');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_COOKIE_CHECKIP', 'Check cookie IP address');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_COOKIE_LIFETIME_FO', 'Front office cookie lifetime');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_COOKIE_LIFETIME_BO', 'Back office cookie lifetime');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_LIMIT_UPLOAD_FILE_VALUE', 'Maximum upload size (MB)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_LIMIT_UPLOAD_IMAGE_VALUE', 'Maximum image upload size (MB)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_ATTACHMENT_MAXIMUM_SIZE', 'Maximum attachment size (MB)');
     $line = array('PS_PRICE_ROUND_MODE', 'Round mode (0=superior, 1=inferior, 2=classic)');
     $roundMode = Configuration::get('PS_PRICE_ROUND_MODE');
     switch ($roundMode) {
         case 0:
             array_push($line, 'Superior');
             break;
         case 1:
             array_push($line, 'Inferior');
             break;
         case 2:
             array_push($line, 'Classic');
             break;
     }
     $table->addRow($line);
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_SSL_ENABLED', 'Force SSL on all pages');
     $shopActivity = Configuration::get('PS_SHOP_ACTIVITY');
     $line = array('PS_SHOP_ACTIVITY', 'Shop activity', $activities[$shopActivity] . " [{$shopActivity}]");
     $table->addRow($line);
     $table->display();
 }
コード例 #9
0
ファイル: ps-cli_utils.php プロジェクト: xego/ps-cli
 public static function add_configuration_value(Cli\Table &$table, $key, $friendlyName, $since = NULL)
 {
     $configuration = PS_CLI_Configure::getConfigurationInstance();
     //if since is given and we know we're bellow, skip the value
     if ($since !== NULL) {
         if (version_compare($since, $configuration->psVersion, '>')) {
             return;
         }
     }
     $line = array($key, $friendlyName);
     $value = Configuration::get($key);
     array_push($line, $value);
     $table->addRow($line);
 }
コード例 #10
0
ファイル: localization.php プロジェクト: xego/ps-cli
 public function list_languages()
 {
     $languages = Language::getLanguages(false, false);
     $defaultLang = Configuration::get('PS_LANG_DEFAULT');
     $table = new Cli\Table();
     $table->setHeaders(array('id', 'name', 'active', 'iso_code', 'language_code', 'date_format_lite', 'date_format_full', 'is_rtl', 'Default'));
     foreach ($languages as $lang) {
         $table->addRow(array($lang['id_lang'], $lang['name'], $lang['active'], $lang['iso_code'], $lang['language_code'], $lang['date_format_lite'], $lang['date_format_full'], $lang['is_rtl'], $lang['id_lang'] == $defaultLang ? 'X' : ''));
     }
     $table->display();
 }
コード例 #11
0
ファイル: ps-cli_interface.php プロジェクト: xego/ps-cli
 public static function display_table(Cli\Table $table)
 {
     $table->display();
 }
コード例 #12
0
ファイル: stores.php プロジェクト: rodrisan/ps-cli
 public function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_STORE_DISPLAY_FOOTER', 'Display link to store locator in the footer');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_STORE_DISPLAY_SITEMAP', 'Display link to store locator in the sitemap');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_STORE_SIMPLIFIED', 'Show a simplified store locator');
     PS_CLI_Utils::add_configuration_value($table, 'PS_STORES_CENTER_LAT', 'Default latitude');
     PS_CLI_Utils::add_configuration_value($table, 'PS_STORES_CENTER_LONG', 'Default longitude');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_NAME', 'Shop name');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_EMAIL', 'Shop email');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_DETAILS', 'Shop details');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_ADDR1', 'Shop address line 1');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_ADDR2', 'Shop address line 2');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_CODE', 'Zip/postal code');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_CITY', 'City');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_COUNTRY_ID', 'Country ID');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_STATE_ID', 'State ID');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_PHONE', 'Phone number');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SHOP_FAX', 'Fax number');
     $table->display();
     return;
 }
コード例 #13
0
ファイル: 1clickupgrade.php プロジェクト: xego/ps-cli
 protected function _listModifiedFiles()
 {
     $upgrader = new Upgrader();
     if (!is_object($upgrader)) {
         PS_CLI_Interface::error('Could not load upgrader module');
     }
     $modifiedFiles = $upgrader->getChangedFilesList(NULL, true);
     $table = new Cli\Table();
     $table->setHeaders(array('Category', 'File'));
     foreach ($modifiedFiles as $category => $filesArray) {
         foreach ($filesArray as $id => $file) {
             $table->addRow(array($category, $file));
         }
     }
     $table->display();
 }
コード例 #14
0
ファイル: modules.php プロジェクト: xego/ps-cli
 public function print_module_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_DISABLE_NON_NATIVE', 'Disable non native modules');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_DISABLE_OVERRIDES', 'Disable all overrides');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PRESTASTORE_LIVE', 'Automatically check modules updates');
     $table->display();
 }
コード例 #15
0
ファイル: profile.php プロジェクト: rodrisan/ps-cli
 public static function list_permissions($profileId)
 {
     $configuration = PS_CLI_CONFIGURE::getConfigurationInstance();
     if (!Validate::isUnsignedInt($profileId)) {
         echo "Error, {$profileId} is not a valid profile ID\n";
         return false;
     }
     $profile = new Profile($profileId);
     if (!Validate::IsLoadedObject($profile)) {
         echo "Error, could not find a profile with ID: {$profileId}\n";
         return false;
     }
     $accesses = Profile::getProfileAccesses($profileId, 'id_tab');
     echo "Access rights for profile " . array_pop($profile->name) . " ({$profileId})\n";
     $table = new Cli\Table();
     $table->setHeaders(array('Tab', 'View', 'Add', 'Edit', 'Delete'));
     $allowedStr = 'X';
     $deniedStr = '';
     foreach ($accesses as $access) {
         $tab = new Tab($access['id_tab'], $configuration->lang);
         $table->addRow(array($tab->name, $access['view'] == 1 ? $allowedStr : $deniedStr, $access['add'] == 1 ? $allowedStr : $deniedStr, $access['edit'] == 1 ? $allowedStr : $deniedStr, $access['delete'] == 1 ? $allowedStr : $deniedStr));
     }
     $table->display();
 }
コード例 #16
0
 public static function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_REGISTRATION_PROCESS_TYPE', 'Registration type (0=only account; 1=account and address)');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_ONE_PHONE_AT_LEAST', 'Customer have to provide at least one phone number');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_CART_FOLLOWING', 'Recall last shopping cart');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_CUSTOMER_CREATION_EMAIL', 'Send an email with account information');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PASSWD_TIME_FRONT', 'Minimum time between two passwords resets');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_B2B_ENABLE', 'B2B mode');
     $table->display();
 }
コード例 #17
0
ファイル: images.php プロジェクト: rodrisan/ps-cli
 public static function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_IMAGE_QUALITY', 'Image format (jpg, png, png_all)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_JPEG_QUALITY', 'Jpeg compression (0-100)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PNG_QUALITY', 'Jpeg compression (0-9)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_IMAGE_GENERATION_METHOD', '(0=auto, 1=width, 2=height)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCT_PICTURE_MAX_SIZE', 'Maximum file size of customer pictures (in bytes)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCT_PICTURE_WIDTH', 'Width of product pictures custumers can upload (in px)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PRODUCT_PICTURE_HEIGHT', 'Height of product pictures custumers can upload (in px)');
     $table->display();
     return;
 }
コード例 #18
0
ファイル: core.php プロジェクト: rodrisan/ps-cli
 public static function print_server_info()
 {
     $context = Context::getContext();
     $params_optional_results = ConfigurationTest::check(ConfigurationTest::getDefaultTestsOp());
     $table = new Cli\Table();
     $table->addRow(array('MySQL version', Db::getInstance()->getVersion()));
     $table->addRow(array('MySQL server', _DB_SERVER_));
     $table->addRow(array('Database name', _DB_NAME_));
     $table->addRow(array('User', _DB_USER_));
     $table->addRow(array('Prefix', _DB_PREFIX_));
     $table->addRow(array('Engine', _MYSQL_ENGINE_));
     $table->addRow(array('PrestaShop version', _PS_VERSION_));
     $table->addRow(array('Shop base URL', $context->shop->getBaseURL()));
     foreach ($params_optional_results as $key => $value) {
         $table->addRow(array($key, $value));
     }
     $table->display();
 }
コード例 #19
0
ファイル: email.php プロジェクト: rodrisan/ps-cli
 public function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_EMAIL_MESSAGE', 'Email method');
     $type = Configuration::get('PS_MAIL_TYPE');
     switch ($type) {
         case Mail::TYPE_HTML:
             $typeName = 'HTML';
             break;
         case Mail::TYPE_TEXT:
             $typeName = 'Text';
             break;
         case Mail::TYPE_BOTH:
             $typeName = 'Both';
             break;
         default:
             $typeName = '';
             break;
     }
     $table->addRow(array('PS_MAIL_TYPE', "Email Type (" . Mail::TYPE_HTML . " for HTML, " . Mail::TYPE_TEXT . " for text, " . Mail::TYPE_BOTH . " for both)", $type . ' (' . $typeName . ')'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_DOMAIN', 'Mail domain name');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_SHOP_EMAIL', 'Shop email');
     //todo
     $mailMethod = Configuration::get('PS_MAIL_METHOD');
     switch ($mailMethod) {
         case self::MAIL_PHP:
             $methodName = 'PHP mail()';
             break;
         case self::MAIL_SMTP:
             $methodName = 'SMTP';
             break;
         case self::MAIL_DISABLED:
             $methodName = 'Disabled';
             break;
         default:
             $methodName = '';
             break;
     }
     $table->addRow(array('PS_MAIL_METHOD', 'Email method (' . self::MAIL_PHP . ' for php mail(), ' . self::MAIL_SMTP . ' for smtp, ' . self::MAIL_DISABLED . ' for disabled)', $mailMethod . ' (' . $methodName . ')'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_SERVER', 'Email server');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_USER', 'Email user');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_PASSWD', 'Email password');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_SMTP_ENCRYPTION', 'SMTP encryption (off, tls or ssl)');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_MAIL_SMTP_PORT', 'SMTP port');
     PS_CLI_UTILS::add_boolean_configuration_status($table, 'PS_LOG_EMAILS', 'Logs emails');
     $table->display();
 }
コード例 #20
0
ファイル: multistore.php プロジェクト: rodrisan/ps-cli
 public static function list_groups()
 {
     $groups = ShopGroup::getShopGroups(false);
     $table = new Cli\Table();
     $table->setHeaders(array('id', 'name', 'share customers', 'share orders', 'share stock', 'active', 'deleted'));
     foreach ($groups as $group) {
         $fields = $group->getFields();
         $table->addRow(array($fields['id_shop_group'], $fields['name'], $fields['share_customer'], $fields['share_order'], $fields['share_stock'], $fields['active'], $fields['deleted']));
     }
     $table->display();
 }
コード例 #21
0
ファイル: search.php プロジェクト: rodrisan/ps-cli
    public static function list_aliases()
    {
        $table = new Cli\Table();
        $table->setHeaders(array('id_alias', 'alias', 'search', 'active'));
        $aliases = Db::getInstance()->executeS('
		SELECT a.*
		FROM `' . _DB_PREFIX_ . 'alias` a');
        foreach ($aliases as $alias) {
            $table->addRow(array($alias['id_alias'], $alias['alias'], $alias['search'], $alias['active'] ? 'yes' : 'no'));
        }
        $table->display();
    }
コード例 #22
0
ファイル: ccc.php プロジェクト: rodrisan/ps-cli
 public function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_SMARTY_CACHE', 'Smarty Template Cache');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CACHING_TYPE', 'Smarty Caching type', '1.6.0.11');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CONSOLE', 'Display smarty console (0 for never, 1 for URL, 2 for always)', '1.6.0.11');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CONSOLE_KEY', 'Smarty console key', '1.6.0.11');
     $currentConfig = Configuration::getGlobalValue('PS_SMARTY_FORCE_COMPILE');
     $line = array('PS_SMARTY_FORCE_COMPILE', 'Smarty Template Compilation (' . _PS_SMARTY_NO_COMPILE_ . ' for never, ' . _PS_SMARTY_CHECK_COMPILE_ . ' for updated, ' . _PS_SMARTY_FORCE_COMPILE_ . ' for always)');
     switch ($currentConfig) {
         case _PS_SMARTY_NO_COMPILE_:
             array_push($line, $currentConfig . ' (never)');
             break;
         case _PS_SMARTY_CHECK_COMPILE_:
             array_push($line, $currentConfig . ' (if updated)');
             break;
         case _PS_SMARTY_FORCE_COMPILE_:
             array_push($line, $currentConfig . ' (Always)');
             break;
     }
     $table->addRow($line);
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_CSS_THEME_CACHE', 'Css cache');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_JS_THEME_CACHE', 'JS cache');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_HTACCESS_CACHE_CONTROL', 'Htaccess cache control');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_MEDIA_SERVERS', 'Use Media Servers');
     $line = array('PS_CIPHER_ALGORITHM', 'Cipher (0=blowfish, 1=rijndael)');
     if (Configuration::getGlobalValue('PS_CIPHER_ALGORITHM')) {
         array_push($line, 'RIJNDAEL/Mcrypt');
     } else {
         array_push($line, 'Local Blowfish');
     }
     $table->addRow($line);
     $line = array('Const: _PS_CACHE_ENABLED_', 'Cache');
     if (_PS_CACHE_ENABLED_) {
         array_push($line, 'enabled');
     } else {
         array_push($line, 'disabled');
     }
     $table->addRow($line);
     $table->addRow(array('Const: _PS_CACHING_SYSTEM_', 'Active Caching system', _PS_CACHING_SYSTEM_));
     $table->display();
     return;
 }
コード例 #23
0
ファイル: cms.php プロジェクト: rodrisan/ps-cli
 public static function list_pages()
 {
     $context = Context::getContext();
     $table = new Cli\Table();
     $table->setHeaders(array('id', 'category', 'position', 'active', 'indexation', 'lang', 'title', 'rewrite', 'keywords'));
     //$pages = CMS::listCms($context->language->id);
     $pages = CMS::getCMSPages($context->language->id, null, false);
     foreach ($pages as $page) {
         $table->addRow(array($page['id_cms'], $page['id_cms_category'], $page['position'], $page['active'], $page['indexation'], Language::getIsoById($page['id_lang']), $page['meta_title'], $page['link_rewrite'], $page['meta_keywords']));
     }
     $table->display();
     return true;
 }
コード例 #24
0
 public static function print_employee_options()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_UTILS::add_configuration_value($table, 'PS_PASSWD_TIME_BACK', 'Minimum delay for password regeneration');
     PS_CLI_UTILS::add_configuration_value($table, 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 'Memorize last used language in forms');
     $table->display();
 }