{"id":13520112,"url":"https://github.com/swiftforum/SwiftForum","last_synced_at":"2025-03-31T16:30:34.680Z","repository":{"id":10186337,"uuid":"12274660","full_name":"swiftforum/SwiftForum","owner":"swiftforum","description":"A blazing fast, light weight forum using PHP and Symfony 2","archived":false,"fork":false,"pushed_at":"2014-01-23T02:51:36.000Z","size":1656,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T05:22:48.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftforum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-21T16:09:02.000Z","updated_at":"2019-04-29T13:31:41.000Z","dependencies_parsed_at":"2022-08-31T01:22:38.990Z","dependency_job_id":null,"html_url":"https://github.com/swiftforum/SwiftForum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftforum%2FSwiftForum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftforum%2FSwiftForum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftforum%2FSwiftForum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftforum%2FSwiftForum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftforum","download_url":"https://codeload.github.com/swiftforum/SwiftForum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222670691,"owners_count":17020513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:02:11.698Z","updated_at":"2024-11-02T03:30:18.577Z","avatar_url":"https://github.com/swiftforum.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"SwiftForum\n========================\n\nSwiftForum is still in early development. Detailed instructions on how to get it running will be added soon.\n\nFor now, this readme will be used for developer information.\n\nLicense\n-----------------------\nThis project uses the MIT license, which can be found under Resources/meta/LICENSE\n\nTo-Do\n------------------------\n\n* Create the actual forum components in this order:\n* Forum Categories ( in progress )\n* Forum Boards\n* Forum Topics\n* Forum Posts\n\nAfter that:\n\n* Create user profile pages\n* Create support for signatures and Gravatars\n* Add Admin Features\n* Boost the performance using ESI, Query Caches etc\n* Add Unit testing support\n* Make the bundle more portable and easier to include in projects\n\nI know Unit Testing is supposed to be set up at the start of the project, but unfortunately time limitations prevented this.\nI would really like to add it as soon as time allows.\n\nDeveloper Reference:\n-------------------------\nHere I will outline some guides on how to achieve things, both for my own reference as well as for contributers.\n\n### Controller Structure:\n**AdminController**:\nLets users with authority perform administrative tasks on both forums as well as users. ( Route prefix: \"/admin\", route example: \"/admin/forum/categories\", \"/admin/members\" etc )\n\n**AuthController**:\nHandles account tasks. Logging in, out, verifying your email, registering a new account and editing your account. ( Route prefix: \"/\", route example: \"/editprofile\", \"/register\" etc )\n\n**BaseController**:\nExtends the base symfony controller to make some methods available to all other controllers.\n\n**BasicController**:\nHandles basic tasks, such as displaying the list of icons. ( Route prefix: \"/\", route example: \"/icons\" )\n\n**ForumController**:\nDisplay board structure, display posts etc. ( Route prefix: \"/forum\", route example: \"/forum/\" )\n\n**HomeController**:\nDisplays the homepage. ( Route prefix: \"/\", route example: \"/\" )\n\n### Caching with Symfony:\n\n**Caching Doctrine result sets**:\nExample:\n\nCreate Entity/Icons:\n\n    /**\n    * @ORM\\Table(name=\"icons\")\n    * @ORM\\Entity(repositoryClass=\"Acme\\CachingBundle\\Entity\\IconsRepository\")\n    */\n    class Icons\n    {\n        // Stuff\n    }\n\n\nCreate Entity/IconsRepository:\n\n    use Doctrine\\ORM\\EntityRepository;\n\n    class IconsRepository extends EntityRepository\n    {\n        return $this-\u003ecreateQueryBuilder('i')\n            -\u003eorderBy('i.id', 'asc')\n            -\u003egetQuery()\n            -\u003euseQueryCache(true)\n            -\u003esetResultCacheId('icons')\n            -\u003egetResult();\n    }\n\nNote the useQueryCache and setResultCacheId('cachename').\n\nTo invalidate the result cache ( call everytime the data is modified ):\n\n    $this-\u003egetDoctrine()-\u003egetManager()-\u003egetConfiguration()-\u003egetResultCacheImpl()-\u003edelete('icons');\n\nTo load from cache:\n\n    if($this-\u003egetDoctrine()-\u003egetManager()-\u003egetConfiguration()-\u003egetResultCacheImpl()-\u003econtains('icons')) {\n        $icons = $this-\u003egetDoctrine()-\u003egetManager()-\u003egetConfiguration()-\u003egetResultCacheImpl()-\u003efetch('icons');\n        $logger-\u003einfo('Cache hit');\n    } else {\n        $icons = $em-\u003egetRepository('AcmeCachingBundle:Icons')\n            -\u003egetIcons();\n        $logger-\u003einfo('Cache was not hit');\n    }\n\nTo delete all cache entries:\n\n    $cacheDriver = $entityManager-\u003egetConfiguration()-\u003egetResultCacheImpl();\n    $cacheDriver-\u003edeleteAll();\n\nCaching of a site:\nSet cache settings in one call\n\n    $response-\u003esetCache(array(\n        'etag'          =\u003e $etag,\n        'last_modified' =\u003e $date,\n        'max_age'       =\u003e 10,\n        's_maxage'      =\u003e 10,\n        'public'        =\u003e true,\n        'private'    =\u003e true,\n    ));\n\n    if($response-\u003eisNotModified($this-\u003egetRequest())) {\n        $logger-\u003eerr('Not modified!');\n    }\n\n\nMarks the Response stale\n\n    $response-\u003eexpire();\n\nForce the response to return a proper 304 response with no content\n\n    $response-\u003esetNotModified();\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftforum%2FSwiftForum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftforum%2FSwiftForum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftforum%2FSwiftForum/lists"}