Jump to content

Search the Community

Showing results for tags 'registry'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. So I have a registry class that holds sub class instances. When the application loads a module, the registry class needs to make sub class functionality available to the module. There's an autoloader in place, I just need the class instances. A service manager should load the registry class with sub classes. Service manager RegistryClass has this prototype at the end of the process: // hash table of registry properties and classes // SiteNavigation example is one sub class RegistryClass Object( [data:RegistryClass:private] => [regList:RegistryClass:private] => Array ( [SiteNavigation] => SiteNavigation Object ( [siteConfig:protected] => [route:protected] => 
 ) ) ) There are several MVC scripts in the module that require different things. However, when the script (ie module controller) picks up the Registry object, it's hash table (regList) is empty. // empty table, empty belly RegistryClass Object ( [data:RegistryClass:private] => [regList:RegistryClass:private] => Array ( ) ) I've tried using the built in PHP interface Serializable however, it's producing incomplete PHP objects when I call unserialize() method. Called from a module script - that looks like: $newObj = unserialize($serialized); // Registry appears fine, however, SiteNavigation is incomplete RegistryClass Object ( [data:RegistryClass:private] => [regList:RegistryClass:private] => Array ( [SiteNavigation] => __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => SiteNavigation [siteConfig:protected] => [route:protected] => ) ) ) Here is a snip from the service manager which 1. instantiates a singleton registry class 2. instantiates the sub classes. $regObj = RegistryClass::getInstance(); // Singleton class holds instances of sub classes in hash table /* * set() method simply assigns sub class names as key and object instance as value to regList */ if(class_exists($className)) { $regObj->set($className, new $className); } /* * now serialize and assign to session, RegistryClass implements Serializable */ $_SESSION['RegistryClass'] = $regObj->serialize($regObj); It seems like the sub classes (ie SiteNavigation) doesn't serialize. Error log output only C:13:"RegistryClass":2:{N;}). Any thoughts are appreciated.
×
×
  • 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.