Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Simple Encode Rate Topic   - - - - -

 
  • sok777
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 392 posts

Posted 01 September 2019 - 06:54 PM #1

Hello,

 

I am trying to use:

 

include_once(Registry::get('config.dir.schemas') . 'literal_converter/utf8.functions.php');

 

with function fn_simple_encode_str($str)

 

But it always throws error, Class 'Tygh\Registry' not found

 

What is wrong?

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 02 September 2019 - 06:08 AM #2

Add

use Tygh\Registry;

under the first line in your php file:

<?php

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sok777
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 392 posts

Posted 02 September 2019 - 06:18 AM #3

Yes I have it but still comes error
Fatal error: Uncaught Error: Class 'Tygh\Registry'

<?php
use Tygh\Registry;

include_once(Registry::get('config.dir.schemas') . 'literal_converter/utf8.functions.php');

fn_simple_encode_str('test');


 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 801 posts

Posted 02 September 2019 - 08:26 AM #4

Hello

 

Is this script called from the controller or do you have it in the root of the store ?

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 02 September 2019 - 01:50 PM #5

Please provide us with the full path to the file


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sok777
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 392 posts

Posted 02 September 2019 - 05:07 PM #6

the file encode.php is in the root of the store



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 801 posts

Posted 02 September 2019 - 05:53 PM #7

Hello

 

You should add on the start script, before use Tygh\Registry;

 

define('AREA', 'C');

@ini_set('memory_limit', '1024M');
 
require dirname(__FILE__) . '/init.php';
 
Best regards
Robert

Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 03 September 2019 - 07:01 AM #8

Please try

 

<?php


use Tygh\Registry;


define('AREA', 'C');


require dirname(__FILE__) . '/init.php';


include_once(Registry::get('config.dir.schemas') . 'literal_converter/utf8.functions.php');


fn_simple_encode_str('test');

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sok777
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 392 posts

Posted 03 September 2019 - 06:04 PM #9

thank you guys, works perfect.



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 801 posts

Posted 03 September 2019 - 06:09 PM #10

Hello

 

You are welcome :)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl