{"id":16233485,"url":"https://github.com/karser/mainsmsbundle","last_synced_at":"2025-04-08T07:36:39.518Z","repository":{"id":6178168,"uuid":"7408318","full_name":"karser/MainSMSBundle","owner":"karser","description":"Bundle http://mainsms.ru/","archived":false,"fork":false,"pushed_at":"2014-02-08T11:54:47.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T04:47:57.955Z","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/karser.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-01-02T15:01:36.000Z","updated_at":"2014-02-08T11:54:48.000Z","dependencies_parsed_at":"2022-09-08T23:51:08.260Z","dependency_job_id":null,"html_url":"https://github.com/karser/MainSMSBundle","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/karser%2FMainSMSBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karser%2FMainSMSBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karser%2FMainSMSBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karser%2FMainSMSBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karser","download_url":"https://codeload.github.com/karser/MainSMSBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247797353,"owners_count":20997725,"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-10-10T13:12:49.593Z","updated_at":"2025-04-08T07:36:39.495Z","avatar_url":"https://github.com/karser.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Getting started with MainSMSBundle\n=============\n\n[MainSMS](http://mainsms.ru/)\n\n## Prerequisites\n\nThis version of the bundle requires Symfony 2.1+ and Doctrine ORM 2.2+\n\n## Installation\n\nInstallation is a quick 3 step process:\n\n1. Download KarserMainSMSBundle using composer\n2. Enable the Bundle\n3. Configure the KarserMainSMSBundle\n\n### Step 1: Download KarserMainSMSBundle using composer\n\nAdd KarserMainSMSBundle in your composer.json:\n\n```js\n{\n    \"require\": {\n        \"karser/mainsms-bundle\": \"dev-master\"\n    }\n}\n```\n\nNow tell composer to download the bundle by running the command:\n\n``` bash\n$ php ./composer.phar update\n```\n\nComposer will install the bundle to your project's `vendor/karser` directory.\n\n### Step 2: Enable the bundle\n\nEnable the bundle in the kernel:\n\n``` php\n\u003c?php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new Karser\\MainSMSBundle\\KarserMainSMSBundle(),\n    );\n}\n```\n\n### Step 3: Configure the KarserMainSMSBundle\n\nAdd the following configuration to your `config.yml` file according to which type\nof datastore you are using.\n\n``` yaml\n# app/config/config.yml\nkarser_main_sms:\n    project: \"%main_sms_project%\"\n    key: \"%main_sms_key%\"\n    use_ssl: \"%main_sms_use_ssl%\"\n    test_mode: \"%main_sms_test_mode%\"\n```\n\n``` yaml\n# app/config/parameters.yml\nparameters:\n    main_sms_project:   ~ # project name\n    main_sms_key:       ~ # sms key\n    main_sms_use_ssl:   ~ # true or false\n    main_sms_test_mode: ~ # true or false\n```\nIf you going to store messages in the database, don't forget to update your schema:\n```\napp/console doctrine:schema:update\n```\n\n### Usage Steps\n#### Basic usage\nYou can send message directly:\n``` php\n$MainSMSModel = $this-\u003eget('karser.main_sms.model');\n//or use getter trait\nuse \\Karser\\MainSMSBundle\\Model\\Getter;\n$MainSMSModel = $this-\u003egetMainSmsModel($this-\u003econtainer);\n//send message\n$MainSMSModel-\u003emessageSend($number, $message, $sender);\n```\n\nYou can check the balance by cli command:\n```\n$ app/console mainsms:balance\n\u003e Balance is 6.45\n```\n\n#### Schedule the message\nEnsure that doctrine automapping is enabled:\n``` yaml\ndoctrine:\n    orm:\n        auto_mapping: true\n```\nIt maps the message to SMSTask entity and stores to the database.\n``` php\n$MainSMSManager = $this-\u003eget('karser.main_sms.manager');\n//or use getter trait\nuse \\Karser\\MainSMSBundle\\Manager\\Getter;\n$MainSMSManager = $this-\u003egetMainSmsManager($this-\u003econtainer);\n//schedule message\n$MainSMSManager-\u003eschedule($number, $message, $sender);\n```\nYou can send it later by cli command:\n```\n$ app/console mainsms:send\n\u003e Balance is 6.45\n\u003e Messages to send 1\n.\nDone.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarser%2Fmainsmsbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarser%2Fmainsmsbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarser%2Fmainsmsbundle/lists"}