Jump to content

simplyi

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

simplyi's Achievements

Member

Member (2/5)

0

Reputation

  1. thorpe, thank you for moving back my question! The intl package is working for me 50%. I have uncommented php_intl.dll in php.ini extension=php_intl.dll and I can work with Locale class no problem. But when I execute $r = ResourceBundle::create( 'en', $filename); then I get an error message: Fatal error: Class 'ResourceBundle' not found. Both classes Locale and ResourceBundle are in one package "intl". Why is it that Locale class is found and ResourceBundle class cannot be found??? Can someone advise me? Thank you!
  2. thorpe, thank you very much for your reply. I am using PHP5.3.1 intl package. I learned that this package was moved to php.net from PEAR. Here is a link to ResourceBundle class: http://ca2.php.net/manual/en/class.resourcebundle.php And here is a link to example of usage: http://ca2.php.net/manual/en/resourcebundle.get.php thorpe, do you have experience using this class? can you advise how to create a Resouce file and the access it using ResourceBundle class? Thank you!
  3. Hi! I need help understanding how to access resource files using ResourceBundle Class and what should be ResourceBundle file format. I have an example of usage in the form of: $r = ResourceBundle::create( 'en', $fileName); but what is the correct format of Resource file? Can it be a format of property file in the form of key=value key=value? or can it be a .txt file of format?: root:table { myName:string { "Here goes my name" } } Can someone share a very simple example of ready to use Resource file with a plain text in it? Thank you!
  4. PFMaBiSmAd, thank you very much for your reply. No, an Array of two Maps that I am trying to store in Session does not Contain a resource like ResultSet after running SQL query. The class used to return BookOffers IS called DAO but it does not work with a Database but works as kind of Data Access Object to query different Web Services to get XML responses, parse them, build BookVO objects(get() and set() methods) and return an Array of these BookVOs stored in a Map(Key, Value). Then the two Maps are added to one $returnValue array and this $returnValue array is returned back as a result of function call. Because there is a long business logic behind the scenes and many lines of code I do not post the entire method here but only a sample structure of an Array I am trying to put into $_SESSION. ...
  5. The structure is as mentioned above: require_once `BookVO.php`; session_start(); // function findBook returns an Array of two Maps. //$searchResults[0] -- Holds a Map of: RecordId(as key) => BookValueObject(as Value) //$searchResults[1] -- Holds a Map of: BookPrice(as key) => BookValueObject(Value) the BookVO is a Class with setters and getters functions. For example. function setTitle($title) { $this->title = $title } function getTitle () { return $this->title; }
  6. Yes, when I store an Object of Class Foo in $_SESSION then it works... but not my Array What is the correct way to serialize an Array and store it in $_SESSION? The example bellow I have also tried and it also generates Warning message. $_SESSION['bookOffers'] = serialize($bookOffers); //and then get it back $bookOffers = unserialize($_SESSION['bookOffers']); Warning: unserialize() [function.unserialize]: Node no longer exists
  7. Yes, I does make big sense! and I did try that It generates the Warning message. Warning: session_start() [function.session-start]: Node no longer exists The only way when Warning message is not generated is when I cast to String. But then I cannot get it back to Array. Fooooh...
  8. yes, when I cast it to String it gets stored in $_SESSION and no Warning message... But then I cannot cast it back from String to Array.
  9. $_SESSION['bookOffers'] = (object)$bookOffers; Generates Warning message ;( ( ! ) Warning: session_start() [function.session-start]: Node no longer exists
  10. :) I am very sorry for this confusion but of course I do it the other way around . Here is my example: // First I do The Cast and store in $_SESSION $_SESSION['bookOffers'] = (String)$bookOffers; // Second I read from $_SESSION $bookOffers = $_SESSION['bookOffers']; // Then I try to debug // print_r returns a string: Array print_r($bookOffers); // returns: 1 echo count($bookOffers); // Generated Warning message: Warning: Invalid argument supplied for foreach() foreach($bookOffers as $key=>$value) { echo "<br/>" . $key . "=" . $value; } does not help... What is the way around?
  11. $bookOffers = $_SESSION['bookOffers'] // print_r returns a string: Array print_r($bookOffers); // returns: 1 echo count($bookOffers); // Generated Warning message: Warning: Invalid argument supplied for foreach() foreach($bookOffers as $key=>$value) { echo "<br/>" . $key . "=" . $value; }
  12. Thank you! This solves the problem with WARNING message: $_SESSION['bookOffers'] = (string)$bookOffers; but now I cannot get my Array back to normal. $bookOffers = $_SESSION['bookOffers'] or $bookOffers = (Array)$_SESSION['bookOffers'] Does not help ;( How to cast back?
  13. Thank you very much for your replies! The only class in my Array is BookVO.php and I tried declaring it before session_start(). Does not help. The code is large but here its short structure. require_once `BookVO.php`; session_start(); // function findBook returns an Array of two Maps. //$searchResults[0] -- Holds a Map of: RecordId(as key) => BookValueObject(as Value) //$searchResults[1] -- Holds a Map of: BookPrice(as key) => BookValueObject(Value) $bookOffers = $storesDAO->findBookOffers($isbn); // if I add $bookOffers into $_SESSION I will get WARNING message mentioned earlier $_SESSION['bookOffers'] = $bookOffers; Thank you!
  14. Hello. I have an array of 60+ objects which I try to put into user session to have it available while user is browsing web site. Each object in an array contains some data. Can it be that the array of objects I am trying to keep in session is too large? because I am getting this working message as soon as I put my array into session: Warning: session_start() [function.session-start]: Node no longer exists I put other data like Strings into $_SESSION and it works well. Is it possible to solve the problem with an array of objects and Warning message? What other ways are there in PHP to persist large objects? I do not want to store the data I keep in array into a database temp table... Thank you!
  15. Hello! I am looking for an architecture for price comparison web site that queries API of different vendors like Amazon and displays sorted results. I am sure there should be some Tutorials or blue prints available on Best Practices building such architecture. For example when the number of vendors to query grows it is better to cache search results in local database. I am looking for any advises or links to documents that discuss this topic. If you have one, please share. Thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.