{"id":28754215,"url":"https://github.com/zeroasterisk/rsc-cakephp-plugin","last_synced_at":"2025-08-24T12:45:40.228Z","repository":{"id":10939457,"uuid":"13246297","full_name":"zeroasterisk/RSC-CakePHP-Plugin","owner":"zeroasterisk","description":"Rackspace Cloud Plugin (Cloud Files, Cloud DNS, etc...)","archived":false,"fork":false,"pushed_at":"2016-06-30T13:08:07.000Z","size":643,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-17T01:07:58.334Z","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/zeroasterisk.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-10-01T14:35:04.000Z","updated_at":"2015-04-07T17:55:26.000Z","dependencies_parsed_at":"2022-08-30T23:21:00.111Z","dependency_job_id":null,"html_url":"https://github.com/zeroasterisk/RSC-CakePHP-Plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeroasterisk/RSC-CakePHP-Plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2FRSC-CakePHP-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2FRSC-CakePHP-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2FRSC-CakePHP-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2FRSC-CakePHP-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroasterisk","download_url":"https://codeload.github.com/zeroasterisk/RSC-CakePHP-Plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroasterisk%2FRSC-CakePHP-Plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262697249,"owners_count":23349890,"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":"2025-06-17T01:07:57.190Z","updated_at":"2025-06-30T02:04:08.812Z","avatar_url":"https://github.com/zeroasterisk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"RSC Plugin for CakePHP\n========================\n\nRackspace Cloud API - Implemented in a simple CakePHP manner.\n\nInstall\n-----------------------\n\nInstall as a submodule (if your project is a git repo)\n\n```\ncd project\ngit submodule add https://github.com/zeroasterisk/RSC-CakePHP-Plugin.git app/Plugin/RSC\ngit submodule update --init --recursive\n```\n\nInstall as a clone/copy of this project\n\n```\ncd project\ngit clone https://github.com/zeroasterisk/RSC-CakePHP-Plugin.git app/Plugin/RSC\ncd app/Plugin/RSC\ngit submodule update --init --recursive\n```\n\nManual Installation\n\n* Download this plugin into `app/Plugin/RSC`\n* Download [php-opencloud](https://github.com/rackspace/php-opencloud) into `app/Plugin/RSC/Vendor/php-opencloud`\n\n\nConfigure\n----------------------\n\n**Load Plugin**\n\nEnsure the plugin is loaded in `app/Config/bootstrap.php` by calling `CakePlugin::load('RSC');`\n\n```\necho \"CakePlugin::load('RSC');\" \u003e\u003e 'app/Config/bootstrap.php'\n```\n\n**Make Database Config**\n\nAdd an entry to `app/Config/database.php` for `rcs` calling the datasource = 'RSC.RSCSource'\n\n```\n\tpublic $rsc = array(\n\t\t'datasource' =\u003e 'RSC.RSCSource',\n\t\t/* the rest of the config is in app/Config/rsc.php */\n\t);\n```\n\n```\necho \"public $rsc = array( 'datasource' =\u003e 'RSC.RSCSource' );\" \u003e\u003e 'app/Config/database.php'\n```\n\n**Setup Config File**\n\nCopy the example config file over, and edit\n\n```\ncp app/Plugin/RSC/Config/rsc.example.php app/Config/rsc.php\n```\n\nUsage RSC Files\n-----------------------\n\nSetup\n\n```\n// gets the Model for use, or you can include in $this-\u003euses()\n$this-\u003eRSCFile = ClassRegistry::init('RSC.RSCFile');\n```\n\nUploading a file\n\n```\n// uploads a file\n//   auto-creates the container if it doesn't exist\n//   automatically uses the basename($filepath) as the filename (no dirs)\n$fileObject = $this-\u003eRSCFile-\u003eupload($filepath, 'my-cool-container');\n$url = $fileObject-\u003ePublicURL();\n\n// uploads the same file to a custom filename with paths/dirs\n$fileObject = $this-\u003eRSCFile-\u003eupload($filepath, 'my-cool-container', 'funky/path/here/filename.png');\n\n// you can force whatever params/headers you want, including 'name'\n$fileObject = $this-\u003eRSCFile-\u003eupload($filepath, 'my-cool-container', array(\n\t'name' =\u003e 'funky/path/here/filename.png',\n\t'Access-Control-Allow-Origin' =\u003e '*',\n));\n```\n\nBasic \"find\" functionality\n\n```\n// CakePHP API'ish [read]\n$this-\u003eRSCFile-\u003eid = 'filename.png';\n$fileObject = $this-\u003eRSCFile-\u003eread();\n$fileObject = $this-\u003eRSCFile-\u003eread(null, 'filename.png');\n$fileObject = $this-\u003eRSCFile-\u003eread(null, 'funky/path/here/filename.png');\n\n// CakePHP API'ish [exists]\n$this-\u003eRSCFile-\u003eid = 'filename.png';\n$existsBool = $this-\u003eRSCFile-\u003eexists();\n$existsBool = $this-\u003eRSCFile-\u003eexists('filename.png');\n$existsBool = $this-\u003eRSCFile-\u003eexists('funky/path/here/filename.png');\n\n\n// returns a simple list of filenames\n$filenames = $this-\u003eRSCFile-\u003efindFiles('filena');\n\n// returns a 1-dimensional array of details, including: name, size, type\n$files = $this-\u003eRSCFile-\u003efindFilesWithDetails('filena');\n```\n\nDownload a file\n\n```\n$successBool = $this-\u003eRSCFile-\u003edownload('filename.png', 'my-cool-container', APP . 'tmp' . DS . 'myfile.png');\n```\n\nDelete files\n\n```\n// CakePHP API'ish [delete]\n$this-\u003eRSCFile-\u003eid = 'filename.png';\ndeletedBool = $this-\u003eRSCFile-\u003edelete();\ndeletedBool = $this-\u003eRSCFile-\u003edelete('filename.png');\ndeletedBool = $this-\u003eRSCFile-\u003edelete('funky/path/here/filename.png');\n```\n\nDo your own API work\n--------------------------\n\nOnce you get connected up to a container, the rest of the API setup is very\nsimple... so you can easily use this model to get you to the `$container`\nobject and then you can do your own API implementation/work from there.\n\n```\n$Container = $this-\u003eRSCFile-\u003econtainer('my-cool-container');\n$newDataObject = $Container-\u003eDataObject();\n$newDataObject-\u003eCreate($params, $sourcefile);\n```\n\nRackSpace Cloud DNS Domain and Records\n-------------------------\n\nFind Domain\n\n```\n$this-\u003eRSCDomain-\u003efind('first', array('conditions' =\u003e array('name' =\u003e 'example.com'));\n//Find with records\n$this-\u003eRSCDomain-\u003efind('first', array(\n  'conditions' =\u003e array('name' =\u003e 'example.com'), \n  'records' =\u003e true\n));\n```\n\nCreate and/or Update Domain\n\n```\n$this-\u003eRSCDomain-\u003esave(array(\n  'name' =\u003e 'nick-is-awesome.com', \n  'emailAddress' =\u003e 'nick@example.com', \n  'ttl' =\u003e 3600\n));\n```\n\nDelete Domain\n\n```\n$this-\u003eRSCDomain-\u003edelete('nick-is-awesome.com');\n```\n\nRecords CRUD: require a 'zone' (aka domain name) when interacting with them. You pass this into the conditions\n\nFind Record\n\n```\n$this-\u003eRSCRecord-\u003efind('all', array(\n  'conditions' =\u003e array(\n    'zone' =\u003e 'example.com'\n  )\n));\n```\n\nCreate and/or Update Record\n\n```\n$this-\u003eRSCRecord-\u003esave(array(\n  'zone' =\u003e 'nick-is-awesome.com',\n  'name' =\u003e 'pop.nick-is-awesome.com',\n  'type' =\u003e 'CNAME',\n  'data' =\u003e 'pop.gmail.com',\n  'ttl' =\u003e '3600',\n));\n```\n\nDelete Record\n\n```\n$this-\u003eRSCRecord-\u003edelete('pop.nick-is-awesome.com', 'nick-is-awesome.com');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Frsc-cakephp-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroasterisk%2Frsc-cakephp-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroasterisk%2Frsc-cakephp-plugin/lists"}